|
|
The work-in-progress implementation (on the `planetary` branch) of allowing different "gas" particles to have different equations of state, as well as the addition of more complex equations of state like iron and rock for planetary simulations such as giant impacts.
|
|
|
|
|
|
New Hydro Scheme
|
|
|
----------------
|
|
|
|
|
|
Create the `Minimal Multi Mat` hydro scheme; a copy of `Minimal` with added bits to allow multiple materials:
|
|
|
* Create `src/hydro/MinimalMultiMat/', starting with a copy of `Minimal`.
|
|
|
* `src/hydro/MinimalMultiMat/*.h': Rename the header include guards appropriately.
|
|
|
* `configure.ac`: Add the new `--with-hydro` option `minimal-multi-mat` like the existing ones.
|
|
|
* Similarly, add like the other shemes to: `src/debug.c`, `src/hydro.h`, `src/hydro_io.h`, and `src/part.h`.
|
|
|
|
|
|
New Equation(s) of State
|
|
|
------------------------
|
|
|
|
|
|
Add the Tillotson analytic equation of state with multiple different material parameters to choose from:
|
|
|
* Create `src/equation_of_state/tillotson/`, starting with a copy of `ideal_gas`.
|
|
|
* `configure.ac`: Add the new `--with-equation-of-state` option `tillotson` like the existing ones.
|
|
|
* Simlarly, add like the other EoS options to `src/equation_of_state.h`.
|
|
|
|
|
|
In `src/equation_of_state/tillotson/equation_of_state.h`:
|
|
|
* Modify the header include guard, `eos_print()`, and `eos_print_snapshot()` appropriately.
|
|
|
* For now, set all functions apart from P(rho, u) and c_s(rho, u) to return 0 since we're using minimal SPH to start with.
|
|
|
* Add the Tillotson equations to `gas_pressure_from_internal_energy()` and (NOT DONE YET) `gas_soundspeed_from_internal_energy()`.
|
|
|
* Create the `Til_params` struct to contain the relevant material parameters.
|
|
|
* For each material (iron, granite, and water so far), add a corresponding `Til_params` struct to the `eos_parameters` struct, and define a function e.g. `set_Til_iron()` to set the values.
|
|
|
* `eos_init()`: Call all the setting functions so all the parameters for each material in `eos_parameters` are set, e.g. `set_Til_iron(e->Til_iron);`.
|
|
|
* Create `enum material_id{}` list of material identifier flags to allow for multiple materials...
|
|
|
|
|
|
Multiple Materials
|
|
|
------------------
|
|
|
|
|
|
Add a new integer flag particle property to identify the material of every particle:
|
|
|
* `src/hydro/MinimalMultiMat/hydro_part.h`: add `material_id mat_id;` to the `part` struct, where `enum material_id` is currently defined in `src/equation_of_state/tillotson/equation_of_state.h`.
|
|
|
* `src/hydro/MinimalMultiMat/hydro_debug.h`: Add the `p->mat_id` integer to `hydro_debug_particle()`.
|
|
|
* `src/hydro/MinimalMultiMat/hydro_io.h`: Add `mat_id` to `hydro_read_particles()` and `hydro_write_particles()`.
|
|
|
|
|
|
Use the material ID flag with the EoS:
|
|
|
* `src/hydro/MinimalMultiMat/hydro.h`: Add `p->mat_id` as a third argument (after e.g. `denisty` and `u`) to all the equation of state functions, and to the functions themselves in `src/equation_of_state/tillotson/equation_of_state.h`. Here set the type `int` rather than `material_id` for generality.
|
|
|
* `src/equation_of_state/tillotson/equation_of_state.h`: In the EoS functions, declare a new `Til_params *mat` struct pointer then use a switch case to select which material's parameters to point it at and use in the equations. |