Skip to content
Snippets Groups Projects
Commit 85460c78 authored by Jacob Kegerreis's avatar Jacob Kegerreis Committed by Matthieu Schaller
Browse files

Eos selection

parent 2f8eca80
No related branches found
No related tags found
No related merge requests found
...@@ -909,15 +909,10 @@ The ``EoS`` section contains options for the equations of state. ...@@ -909,15 +909,10 @@ The ``EoS`` section contains options for the equations of state.
Multiple EoS can be used for :ref:`planetary`, Multiple EoS can be used for :ref:`planetary`,
see :ref:`planetary_eos` for more information. see :ref:`planetary_eos` for more information.
To enable one or multiple of these EoS, the corresponding ``planetary_use_*:`` To enable one or multiple EoS, the corresponding ``planetary_use_*:``
flag(s) must be set to ``1`` in the parameter file for a simulation, flag(s) must be set to ``1`` in the parameter file for a simulation,
along with the path to any table files, which are provided with the along with the path to any table files, which are set by the
``planetary_*_table_file:`` parameters. ``planetary_*_table_file:`` parameters.
This currently means that all EoS within each base type are prepared at once,
which we intend to simplify in the future.
The data files for the tabulated EoS can be downloaded using
the ``examples/EoSTables/get_eos_tables.sh`` script.
For the (non-planetary) isothermal EoS, the ``isothermal_internal_energy:`` For the (non-planetary) isothermal EoS, the ``isothermal_internal_energy:``
parameter sets the thermal energy per unit mass. parameter sets the thermal energy per unit mass.
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
Planetary Equations of State Planetary Equations of State
============================ ============================
Configuring SWIFT with the ``--with-equation-of-state=planetary`` and Configuring SWIFT with the ``--with-equation-of-state=planetary`` and
``--with-hydro=planetary`` options enables the use of multiple ``--with-hydro=planetary`` options enables the use of multiple
equations of state (EoS). equations of state (EoS).
...@@ -29,6 +29,7 @@ The material's ID is set by a somewhat arbitrary base type ID ...@@ -29,6 +29,7 @@ The material's ID is set by a somewhat arbitrary base type ID
+ Iron: ``100`` + Iron: ``100``
+ Granite: ``101`` + Granite: ``101``
+ Water: ``102`` + Water: ``102``
+ Basalt: ``103``
+ Hubbard \& MacFarlane (1980): ``2`` + Hubbard \& MacFarlane (1980): ``2``
+ Hydrogen-helium atmosphere: ``200`` + Hydrogen-helium atmosphere: ``200``
+ Ice H20-CH4-NH3 mix: ``201`` + Ice H20-CH4-NH3 mix: ``201``
...@@ -48,18 +49,19 @@ the ``examples/Planetary/EoSTables/get_eos_tables.sh`` script. ...@@ -48,18 +49,19 @@ the ``examples/Planetary/EoSTables/get_eos_tables.sh`` script.
To enable one or multiple EoS, the corresponding ``planetary_use_*:`` To enable one or multiple EoS, the corresponding ``planetary_use_*:``
flag(s) must be set to ``1`` in the parameter file for a simulation, flag(s) must be set to ``1`` in the parameter file for a simulation,
along with the path to any table files, which are provided with the along with the path to any table files, which are set by the
``planetary_*_table_file:`` parameters, ``planetary_*_table_file:`` parameters,
as detailed in :ref:`Parameters_eos` and ``examples/parameter_example.yml``. as detailed in :ref:`Parameters_eos` and ``examples/parameter_example.yml``.
This currently means that all EoS within each base type are prepared at once,
which we intend to simplify in the future. The data files for the tabulated EoS can be downloaded using
the ``examples/EoSTables/get_eos_tables.sh`` script.
Unlike the EoS for an ideal or isothermal gas, these more complicated materials Unlike the EoS for an ideal or isothermal gas, these more complicated materials
do not always include transformations between the internal energy, do not always include transformations between the internal energy,
temperature, and entropy. At the moment, we have implemented temperature, and entropy. At the moment, we have implemented
\\(P(\\rho, u)\\) and \\(c_s(\\rho, u)\\), \\(P(\\rho, u)\\) and \\(c_s(\\rho, u)\\),
which is sufficient for the :ref:`planetary_sph` hydro scheme, which is sufficient for the :ref:`planetary_sph` hydro scheme,
but makes most materials currently incompatible with entropy-based schemes. but makes most materials currently incompatible with e.g. entropy-based schemes.
The Tillotson sound speed was derived using The Tillotson sound speed was derived using
\\(c_s^2 = \\left. ( \\partial P / \\partial \\rho ) \\right|_S \\) \\(c_s^2 = \\left. ( \\partial P / \\partial \\rho ) \\right|_S \\)
......
# Define the system of units to use internally. # Define the system of units to use internally.
InternalUnitSystem: InternalUnitSystem:
UnitMass_in_cgs: 5.9724e27 # Grams UnitMass_in_cgs: 1e27 # Sets Earth mass = 5.972
UnitLength_in_cgs: 6.371e8 # Centimeters UnitLength_in_cgs: 1e8 # Sets Earth radius = 6.371
UnitVelocity_in_cgs: 6.371e8 # Centimeters per second UnitVelocity_in_cgs: 1e8 # Sets time in seconds
UnitCurrent_in_cgs: 1 # Amperes UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin UnitTemp_in_cgs: 1 # Kelvin
...@@ -38,17 +38,16 @@ SPH: ...@@ -38,17 +38,16 @@ SPH:
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel). resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel).
delta_neighbours: 0.1 # The tolerance for the targetted number of neighbours. delta_neighbours: 0.1 # The tolerance for the targetted number of neighbours.
CFL_condition: 0.2 # Courant-Friedrich-Levy condition for time integration. CFL_condition: 0.2 # Courant-Friedrich-Levy condition for time integration.
h_max: 0.2 # Maximal allowed smoothing length (in internal units). h_max: 1.2 # Maximal allowed smoothing length (in internal units).
viscosity_alpha: 1.5 # Override for the initial value of the artificial viscosity. viscosity_alpha: 1.5 # Override for the initial value of the artificial viscosity.
# Parameters for the self-gravity scheme # Parameters for the self-gravity scheme
Gravity: Gravity:
eta: 0.025 # Constant dimensionless multiplier for time integration. eta: 0.025 # Constant dimensionless multiplier for time integration.
MAC: adaptive MAC: adaptive # Choice of mulitpole acceptance criterion: 'adaptive' OR 'geometric'.
theta_cr: 0.7 epsilon_fmm: 0.001 # Tolerance parameter for the adaptive multipole acceptance criterion.
epsilon_fmm: 0.001 theta_cr: 0.7 # Opening angle for the purely gemoetric criterion.
use_tree_below_softening: 1 max_physical_baryon_softening: 0.02 # Physical softening length (in internal units).
max_physical_baryon_softening: 0.003 # Physical softening length (in internal units).
# Parameters for the task scheduling # Parameters for the task scheduling
Scheduler: Scheduler:
...@@ -56,11 +55,6 @@ Scheduler: ...@@ -56,11 +55,6 @@ Scheduler:
# Parameters related to the equation of state # Parameters related to the equation of state
EoS: EoS:
planetary_use_Til: 1 # Whether to initialise the Tillotson EOS # Select which planetary EoS material(s) to enable for use.
planetary_use_Til_iron: 1 # Tillotson iron, material ID 100
# Parameters governing the logger snapshot system planetary_use_Til_granite: 1 # Tillotson granite, material ID 101
Logger:
delta_step: 10 # Update the particle log every this many updates
basename: index # Common part of the filenames
initial_buffer_size: 0.01 # (Optional) Buffer size in GB
buffer_scale: 10 # (Optional) When buffer size is too small, update it with required memory times buffer_scale
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
# Make a simple animation of the snapshots # Make a simple animation of the snapshots
out="earth_impact.mp4" out="earth_impact.mp4"
ffmpeg -framerate 5 -i earth_impact_%?%?%?%?%?%?.png $out -y ffmpeg -framerate 5 -i earth_impact_%?%?%?%?.png $out -y
echo Saved $out echo Saved $out
\ No newline at end of file
...@@ -57,10 +57,10 @@ Di_mat_colour = { ...@@ -57,10 +57,10 @@ Di_mat_colour = {
Di_id_colour = {Di_mat_id[mat]: colour for mat, colour in Di_mat_colour.items()} Di_id_colour = {Di_mat_id[mat]: colour for mat, colour in Di_mat_colour.items()}
def load_snapshot(snapshot_time, ax_lim): def load_snapshot(snapshot_id, ax_lim):
""" Select and load the particles to plot. """ """ Select and load the particles to plot. """
# Snapshot to load # Snapshot to load
snapshot = "earth_impact_%06d.hdf5" % snapshot_time snapshot = "earth_impact_%04d.hdf5" % snapshot_id
# Only load data with the axis limits and below z=0 # Only load data with the axis limits and below z=0
ax_lim = 0.1 ax_lim = 0.1
...@@ -131,15 +131,15 @@ if __name__ == "__main__": ...@@ -131,15 +131,15 @@ if __name__ == "__main__":
ax_lim = 3.4 ax_lim = 3.4
# Plot each snapshot # Plot each snapshot
for snapshot_time in range(0, 36000 + 1, 1000): for snapshot_id in range(37):
# Load the data # Load the data
pos, mat_id = load_snapshot(snapshot_time, ax_lim) pos, mat_id = load_snapshot(snapshot_id, ax_lim)
# Plot the data # Plot the data
plot_snapshot(pos, mat_id, ax_lim) plot_snapshot(pos, mat_id, ax_lim)
# Save the figure # Save the figure
save = "earth_impact_%06d.png" % snapshot_time save = "earth_impact_%04d.png" % snapshot_id
plt.savefig(save, dpi=100) plt.savefig(save, dpi=100)
print("\rSaved %s" % save) print("\rSaved %s" % save)
......
...@@ -266,20 +266,31 @@ LineOfSight: ...@@ -266,20 +266,31 @@ LineOfSight:
# Parameters related to the equation of state ------------------------------------------ # Parameters related to the equation of state ------------------------------------------
EoS: EoS:
isothermal_internal_energy: 20.26784 # Thermal energy per unit mass for the case of isothermal equation of state (in internal units). isothermal_internal_energy: 20.26784 # Thermal energy per unit mass for the case of isothermal equation of state (in internal units).
# Select which planetary EoS material(s) to enable for use.
planetary_use_Til: 1 # (Optional) Whether to prepare the Tillotson EoS planetary_use_idg_def: 0 # Default ideal gas, material ID 0
planetary_use_HM80: 0 # (Optional) Whether to prepare the Hubbard & MacFarlane (1980) EoS planetary_use_Til_iron: 1 # Tillotson iron, material ID 100
planetary_use_SESAME: 0 # (Optional) Whether to prepare the SESAME EoS planetary_use_Til_granite: 1 # Tillotson granite, material ID 101
planetary_use_ANEOS: 0 # (Optional) Whether to prepare the ANEOS EoS planetary_use_Til_water: 0 # Tillotson water, material ID 102
# (Optional) Table file paths planetary_use_Til_basalt: 0 # Tillotson basalt, material ID 103
planetary_HM80_HHe_table_file: ./EoSTables/HM80_HHe.txt planetary_use_HM80_HHe: 0 # Hubbard & MacFarlane (1980) hydrogen-helium atmosphere, material ID 200
planetary_HM80_ice_table_file: ./EoSTables/HM80_ice.txt planetary_use_HM80_ice: 0 # Hubbard & MacFarlane (1980) H20-CH4-NH3 ice mix, material ID 201
planetary_HM80_rock_table_file: ./EoSTables/HM80_rock.txt planetary_use_HM80_rock: 0 # Hubbard & MacFarlane (1980) SiO2-MgO-FeS-FeO rock mix, material ID 202
planetary_SESAME_iron_table_file: ./EoSTables/SESAME_iron_2140.txt planetary_use_SESAME_iron: 0 # SESAME iron 2140, material ID 300
planetary_SESAME_basalt_table_file: ./EoSTables/SESAME_basalt_7530.txt planetary_use_SESAME_basalt: 0 # SESAME basalt 7530, material ID 301
planetary_SESAME_water_table_file: ./EoSTables/SESAME_water_7154.txt planetary_use_SESAME_water: 0 # SESAME water 7154, material ID 302
planetary_SS08_water_table_file: ./EoSTables/SS08_water.txt planetary_use_SS08_water: 0 # Senft & Stewart (2008) SESAME-like water, material ID 303
planetary_use_ANEOS_forsterite: 0 # ANEOS forsterite (Stewart et al. 2019), material ID 400
planetary_use_ANEOS_iron: 0 # ANEOS iron (Stewart 2020), material ID 401
planetary_use_ANEOS_Fe85Si15: 0 # ANEOS Fe85Si15 (Stewart 2020), material ID 402
# Tablulated EoS file paths.
planetary_HM80_HHe_table_file: ./EoSTables/HM80_HHe.txt
planetary_HM80_ice_table_file: ./EoSTables/HM80_ice.txt
planetary_HM80_rock_table_file: ./EoSTables/HM80_rock.txt
planetary_SESAME_iron_table_file: ./EoSTables/SESAME_iron_2140.txt
planetary_SESAME_basalt_table_file: ./EoSTables/SESAME_basalt_7530.txt
planetary_SESAME_water_table_file: ./EoSTables/SESAME_water_7154.txt
planetary_SS08_water_table_file: ./EoSTables/SS08_water.txt
planetary_ANEOS_forsterite_table_file: ./EoSTables/ANEOS_forsterite_S19.txt planetary_ANEOS_forsterite_table_file: ./EoSTables/ANEOS_forsterite_S19.txt
planetary_ANEOS_iron_table_file: ./EoSTables/ANEOS_iron_S20.txt planetary_ANEOS_iron_table_file: ./EoSTables/ANEOS_iron_S20.txt
planetary_ANEOS_Fe85Si15_table_file: ./EoSTables/ANEOS_Fe85Si15_S20.txt planetary_ANEOS_Fe85Si15_table_file: ./EoSTables/ANEOS_Fe85Si15_S20.txt
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment