Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ANEOS conversion.py and EoS.h so that they become compatible #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions eos/ANEOS_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ def reformat(number):
fig.savefig("Density" + str(m) + ".png")

h = open(outputfilename,'w')
h.write("%i %i %s \n" % (nr, nu , ':Grid numbers for density and internal energy'))
h.write('Density (km/m3), Internal energy (kJ/kg), Temperature (K), Sound speed (m/s), Entropy (J/K/kg) \n')
h.write("%s %i %i %s \n" % ('#', nr, nu , ':Grid numbers for density and internal energy'))
h.write('# Density (km/m3), Internal energy (kJ/kg), Temperature (K), Sound speed (m/s), Entropy (J/K/kg) \n')


for m in range(0,nr):
for n in range(0,nu):
h.write("%15.8E %15.8E %15.8E %15.8E %15.8E \n" % (density[m], new_energy[n], new_temperature[m][n], new_soundspeed[m][n], new_entropy[m][n]))
h.write("%15.8E %15.8E %15.8E %15.8E %15.8E %15.8E \n" % (density[m], new_energy[n], new_temperature[m][n], new_pressure[m][n], new_soundspeed[m][n], new_entropy[m][n]))
Binary file modified eos/Density0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified eos/Density100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified eos/Density20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified eos/Density40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified eos/Density60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified eos/Density80.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43,204 changes: 14,402 additions & 28,802 deletions eos/granite.rho_u.txt

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions examples/input.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# input parameters
mode = 2
output_interval = 10
damping = 1
end_time = 1e5
output_directory = results/
impVel = 1000
UnitMass = 5.97e+24 # target mass
UnitRadi = 6100e+3 # target radius
coreFracRadi = 0.54 # core fraction in radius
Expand Down
21 changes: 0 additions & 21 deletions input/imp.txt

This file was deleted.

23 changes: 0 additions & 23 deletions input/tar.txt

This file was deleted.

4 changes: 2 additions & 2 deletions src/EoS.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace EoS{
* A member variable that contains all the EoS data from ANEOS. The lines
* represent density, the columns energy. The data values for each entry
* are
* Density (kg/m3) Temperature (K) Energy (J/kg) Pressure (Pa) Sound speed (m/s) Entropy (J/kg/K).
* Density (kg/m3) Internal energy (J/kg) Temperature (K) Pressure (Pa) Sound speed (m/s) Entropy (J/kg/K).
*/
std::vector<std::vector<std::array<type, 6> > > eos_data;

Expand Down Expand Up @@ -232,7 +232,7 @@ namespace EoS{
}

inline type Pressure(const type dens, const type eng) const{
return get_interpolated_value(dens,eng,3);
return std::max(get_interpolated_value(dens,eng,3), 0.0);
}

inline type SoundSpeed(const type dens, const type eng) const{
Expand Down