Skip to content
Snippets Groups Projects
Commit 1a46a2f8 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'eos_selection' into 'master'

Eos selection

Closes #743

See merge request !1290
parents 2f8eca80 85460c78
No related branches found
No related tags found
1 merge request!1290Eos selection
......@@ -909,15 +909,10 @@ The ``EoS`` section contains options for the equations of state.
Multiple EoS can be used for :ref:`planetary`,
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,
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.
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:``
parameter sets the thermal energy per unit mass.
......
......@@ -5,7 +5,7 @@
Planetary Equations of State
============================
Configuring SWIFT with the ``--with-equation-of-state=planetary`` and
``--with-hydro=planetary`` options enables the use of multiple
equations of state (EoS).
......@@ -29,6 +29,7 @@ The material's ID is set by a somewhat arbitrary base type ID
+ Iron: ``100``
+ Granite: ``101``
+ Water: ``102``
+ Basalt: ``103``
+ Hubbard \& MacFarlane (1980): ``2``
+ Hydrogen-helium atmosphere: ``200``
+ Ice H20-CH4-NH3 mix: ``201``
......@@ -48,18 +49,19 @@ the ``examples/Planetary/EoSTables/get_eos_tables.sh`` script.
To enable one or multiple EoS, the corresponding ``planetary_use_*:``
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,
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
do not always include transformations between the internal energy,
temperature, and entropy. At the moment, we have implemented
\\(P(\\rho, u)\\) and \\(c_s(\\rho, u)\\),
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
\\(c_s^2 = \\left. ( \\partial P / \\partial \\rho ) \\right|_S \\)
......
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 5.9724e27 # Grams
UnitLength_in_cgs: 6.371e8 # Centimeters
UnitVelocity_in_cgs: 6.371e8 # Centimeters per second
UnitMass_in_cgs: 1e27 # Sets Earth mass = 5.972
UnitLength_in_cgs: 1e8 # Sets Earth radius = 6.371
UnitVelocity_in_cgs: 1e8 # Sets time in seconds
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
......@@ -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).
delta_neighbours: 0.1 # The tolerance for the targetted number of neighbours.
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.
# Parameters for the self-gravity scheme
Gravity:
eta: 0.025 # Constant dimensionless multiplier for time integration.
MAC: adaptive
theta_cr: 0.7
epsilon_fmm: 0.001
use_tree_below_softening: 1
max_physical_baryon_softening: 0.003 # Physical softening length (in internal units).
eta: 0.025 # Constant dimensionless multiplier for time integration.
MAC: adaptive # Choice of mulitpole acceptance criterion: 'adaptive' OR 'geometric'.
epsilon_fmm: 0.001 # Tolerance parameter for the adaptive multipole acceptance criterion.
theta_cr: 0.7 # Opening angle for the purely gemoetric criterion.
max_physical_baryon_softening: 0.02 # Physical softening length (in internal units).
# Parameters for the task scheduling
Scheduler:
......@@ -56,11 +55,6 @@ Scheduler:
# Parameters related to the equation of state
EoS:
planetary_use_Til: 1 # Whether to initialise the Tillotson EOS
# Parameters governing the logger snapshot system
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
# Select which planetary EoS material(s) to enable for use.
planetary_use_Til_iron: 1 # Tillotson iron, material ID 100
planetary_use_Til_granite: 1 # Tillotson granite, material ID 101
......@@ -2,6 +2,6 @@
# Make a simple animation of the snapshots
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
\ No newline at end of file
echo Saved $out
......@@ -57,10 +57,10 @@ Di_mat_colour = {
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. """
# 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
ax_lim = 0.1
......@@ -131,15 +131,15 @@ if __name__ == "__main__":
ax_lim = 3.4
# Plot each snapshot
for snapshot_time in range(0, 36000 + 1, 1000):
for snapshot_id in range(37):
# 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_snapshot(pos, mat_id, ax_lim)
# Save the figure
save = "earth_impact_%06d.png" % snapshot_time
save = "earth_impact_%04d.png" % snapshot_id
plt.savefig(save, dpi=100)
print("\rSaved %s" % save)
......
......@@ -266,20 +266,31 @@ LineOfSight:
# Parameters related to the equation of state ------------------------------------------
EoS:
isothermal_internal_energy: 20.26784 # Thermal energy per unit mass for the case of isothermal equation of state (in internal units).
planetary_use_Til: 1 # (Optional) Whether to prepare the Tillotson EoS
planetary_use_HM80: 0 # (Optional) Whether to prepare the Hubbard & MacFarlane (1980) EoS
planetary_use_SESAME: 0 # (Optional) Whether to prepare the SESAME EoS
planetary_use_ANEOS: 0 # (Optional) Whether to prepare the ANEOS EoS
# (Optional) Table 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
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_idg_def: 0 # Default ideal gas, material ID 0
planetary_use_Til_iron: 1 # Tillotson iron, material ID 100
planetary_use_Til_granite: 1 # Tillotson granite, material ID 101
planetary_use_Til_water: 0 # Tillotson water, material ID 102
planetary_use_Til_basalt: 0 # Tillotson basalt, material ID 103
planetary_use_HM80_HHe: 0 # Hubbard & MacFarlane (1980) hydrogen-helium atmosphere, material ID 200
planetary_use_HM80_ice: 0 # Hubbard & MacFarlane (1980) H20-CH4-NH3 ice mix, material ID 201
planetary_use_HM80_rock: 0 # Hubbard & MacFarlane (1980) SiO2-MgO-FeS-FeO rock mix, material ID 202
planetary_use_SESAME_iron: 0 # SESAME iron 2140, material ID 300
planetary_use_SESAME_basalt: 0 # SESAME basalt 7530, material ID 301
planetary_use_SESAME_water: 0 # SESAME water 7154, material ID 302
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_iron_table_file: ./EoSTables/ANEOS_iron_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