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

Analytic electron EOS and zsplit modifier #444

Merged
merged 41 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2b258e4
ideal gas electron EOS implemented. Still need to add zsplit and docu…
jonahm-LANL Dec 11, 2024
6167b75
zsplit mostly implemented
jonahm-LANL Dec 16, 2024
4b4a2fa
zsplit compiles
jonahm-LANL Dec 16, 2024
3d18cae
tests work
jonahm-LANL Dec 16, 2024
7fba185
add test for zsplits
jonahm-LANL Dec 16, 2024
2512249
messages
jonahm-LANL Dec 16, 2024
8085e61
Add discussion of lambdas, add discussion of 3T, add discussion of ZS…
jonahm-LANL Dec 17, 2024
7e9a7ec
changelog
jonahm-LANL Dec 17, 2024
54c8a25
Merge branch 'main' into jmm/zsplit
Yurlungur Dec 17, 2024
aaa57cc
clang format 12 stay around please
jonahm-LANL Dec 17, 2024
0dfef59
latest for docs, noble for formatting
jonahm-LANL Dec 17, 2024
a0a8069
try updating to latest catch2 release
jonahm-LANL Dec 17, 2024
c692221
unused variable
jonahm-LANL Dec 17, 2024
98fb444
typo and also try to make wno-psabi only for C++
jonahm-LANL Dec 17, 2024
08172b2
try to fix cuda errors for static members
jonahm-LANL Dec 17, 2024
95c60cd
No GCC. You are wrong and I am right.
jonahm-LANL Dec 17, 2024
3b030b1
disable some EOSs from default variant
jonahm-LANL Dec 17, 2024
7886d11
shrink the default variant
jonahm-LANL Dec 17, 2024
dc803ed
Disable python build in github tests as it now takes an incredibly lo…
jonahm-LANL Dec 17, 2024
a0f00c4
update build to be parallel
jonahm-LANL Dec 17, 2024
c43afcc
try enabling python build now again with parallel builds
jonahm-LANL Dec 17, 2024
d282d09
undo removal of relativistic EOS
jonahm-LANL Dec 17, 2024
090559e
fix type list comma
jonahm-LANL Dec 17, 2024
d80e40c
add parallel builds for the docs build
jonahm-LANL Dec 17, 2024
780fbd4
WHY IS IT DYING WITHOUT AN ERROR MESSAGE
jonahm-LANL Dec 17, 2024
af1e70a
turn off IPO to see if this fixes the memory problems with the linker
jonahm-LANL Dec 17, 2024
ed6622f
no need for verbose output
jonahm-LANL Dec 17, 2024
39990f8
switch to ld.gold linker
jonahm-LANL Dec 17, 2024
6f6b6f8
huh...
jonahm-LANL Dec 17, 2024
830bb5e
disabling intraprocedural optimization seems to way slow down the build
jonahm-LANL Dec 17, 2024
d0dcacd
extend memory limits on system, use release build to remove debug sym…
jonahm-LANL Dec 17, 2024
bc721f8
runner not available for ubuntu-noble now. Try older version string?
jonahm-LANL Dec 17, 2024
fc3ee77
add doc info
jonahm-LANL Dec 18, 2024
0e9f910
add v&v EOS option to spackage
jonahm-LANL Dec 18, 2024
2c013c3
spackage should have vandv set to true
jonahm-LANL Dec 18, 2024
7368490
document spackage change
jonahm-LANL Dec 18, 2024
4e93e12
Sam jones comments
jonahm-LANL Dec 18, 2024
551fc3e
Update doc/sphinx/src/modifiers.rst
Yurlungur Dec 18, 2024
6e255b9
Update doc/sphinx/src/modifiers.rst
Yurlungur Dec 18, 2024
5042643
hjhp and pdmullen comments
jonahm-LANL Dec 18, 2024
03d646d
Merge branch 'jmm/zsplit' of github.com:lanl/singularity-eos into jmm…
jonahm-LANL Dec 18, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
-DSINGULARITY_USE_SPINER_WITH_HDF5=OFF \
-DSINGULARITY_FORCE_SUBMODULE_MODE=ON \
-B build .
cmake --build build
cmake --build build --parallel 4
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

builds the python bits faster. Speeds up doc build time by a factor of 4ish

sudo cmake --install build
- name: build docs
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
formatting:
name: Check Formatting
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed until we update clang-format to clang-17


steps:
- name: Checkout code
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/tests.yml
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this file required to deal with out-of-memory failure when linking the full fortran interface.

Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ jobs:
- name: install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages -qq build-essential gfortran libhdf5-serial-dev
sudo apt-get install -y --allow-downgrades --allow-remove-essential --allow-change-held-packages -qq build-essential gfortran libhdf5-serial-dev binutils-gold
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

binutils-gold gets us use the gold linker developed by google specifically for big C++ projects. It seems to be much faster and more memory efficient. Generically I don't know if we want to rely on it, but honestly I was very impressed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll defer to @rbberger @dholladay00 and @mauneyc-LANL on their opinions here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i think for now we don't need to change it elsewhere. In this particular CI test, this, GNU ld is too memory inefficient and the test doesn't finish without gold.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could totally be wrong, but I have a bit of a hunch that among all the changes made, only the switch to Release is required. Should we be minimalistic here, or you are quite happy with binutils-gold?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually impressed by binutils-gold. The build time is also just faster with it on, so I'd like to leave it as this test takes about 10 minutes. That said, I'm fine removing it if (a) that still works and (b) people feel strongly.

pip install numpy
pip install h5py
- name: build and run tests
run: |
mkdir -p bin
cd bin
ulimit -m unlimited
ulimit -v unlimited
Comment on lines +31 to +32
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this does anything inside a docker container, but it doesn't hurt.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we could also be minimalistic if desirable... see above. No strong feelings here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it. In worst case it does nothing.

mkdir -p ${HOME}/install
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/install \
-DSINGULARITY_USE_SPINER=ON \
Expand All @@ -38,11 +40,14 @@ jobs:
-DSINGULARITY_USE_HELMHOLTZ=ON \
-DSINGULARITY_TEST_HELMHOLTZ=ON \
-DSINGULARITY_FORCE_SUBMODULE_MODE=ON \
-DSINGULARITY_USE_V_AND_V_EOS=OFF \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removes SAP_Polynomial, NobleAbel and CarnahanStarling equations of state from the default variant. Down the line, we may also wish to remove StiffGas and the relativistic modifier.

-DSINGULARITY_PLUGINS=$(pwd)/../example/plugin \
-DCMAKE_LINKER=ld.gold \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gold linker in question

-DCMAKE_BUILD_TYPE=Release \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to the default build type, which is RelWithDebInfo, this drops debug symbols, shrinking the memory footprint during link stage.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that's such a huge memory hit to be honest. Honestly though, I find that if I really need debug symbols, I'm compiling with full Debug anyway so I'm okay with this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I agree. Is also only for this test. The default build is still "RelWithDebInfo."

..
#-DSINGULARITY_TEST_PYTHON=ON \
#-DSINGULARITY_TEST_STELLAR_COLLAPSE=ON \
#..
make
make -j4
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parallel build.

make install
ctest --output-on-failure
2 changes: 1 addition & 1 deletion .github/workflows/tests_minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
-DSINGULARITY_FORCE_SUBMODULE_MODE=ON \
-DSINGULARITY_USE_KOKKOS=OFF \
..
make
make -j4
make install
make test
2 changes: 1 addition & 1 deletion .github/workflows/tests_minimal_kokkos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
-DSINGULARITY_FORCE_SUBMODULE_MODE=ON \
-DSINGULARITY_USE_KOKKOS=ON \
..
make
make -j4
make install
make test
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Current develop

### Added (new features/APIs/variables/...)
- [[PR444]](https://github.com/lanl/singularity-eos/pull/444) Add Z split modifier and electron ideal gas EOS

### Fixed (Repair bugs, etc)
- [[PR439]](https://github.com/lanl/singularity-eos/pull/439) Add mean atomic mass and number to EOS API
Expand Down
21 changes: 19 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ cmake_dependent_option(
SINGULARITY_USE_HELMHOLTZ "Include Helmholtz equation of state" OFF
"SINGULARITY_USE_SPINER;SINGULARITY_USE_SPINER_WITH_HDF5" OFF)

# Enables polynomial, carnahan starling, and NobleAbel in variant.
# Off by default, as they are not in the default python bindings or used
# by default in downstream codes.
option(SINGULARITY_USE_V_AND_V_EOS
"Add analytic EOSs for V&V to the variant"
OFF)

# testing options
option(SINGULARITY_BUILD_TESTS "Compile tests" OFF)

Expand Down Expand Up @@ -332,6 +339,9 @@ endif()
if(SINGULARITY_USE_HELMHOLTZ)
target_compile_definitions(singularity-eos_Interface INTERFACE SINGULARITY_USE_HELMHOLTZ)
endif()
if (SINGULARITY_USE_V_AND_V_EOS)
target_compile_definitions(singularity-eos_Interface INTERFACE SINGULARITY_USE_V_AND_V_EOS)
endif()
if(SINGULARITY_USE_SPINER_WITH_HDF5)
target_compile_definitions(singularity-eos_Interface INTERFACE SINGULARITY_USE_SPINER_WITH_HDF5)
endif()
Expand Down Expand Up @@ -440,8 +450,8 @@ if(SINGULARITY_BUILD_TESTS)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
# or later is fine too
GIT_TAG v3.0.1)
# jmm: updated Dec 17, 2024 to avoid build errors on modern gcc
GIT_TAG v3.7.1)
Comment on lines +453 to +454
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catch2 v3.0.1 does not compile on ubuntu 24.04. Update to 3.7.1 to rescue it.

FetchContent_MakeAvailable(Catch2)
list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/contrib)
endif()
Expand Down Expand Up @@ -560,6 +570,13 @@ target_compile_options(
-use_fast_math
> # release
> # cuda

# Suppresses annoying ABI notes. See:
# https://stackoverflow.com/questions/52020305/what-exactly-does-gccs-wpsabi-option-do-what-are-the-implications-of-supressi
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<COMPILE_LANGUAGE:CXX>>:-Wno-psabi>
# `-Wclass-memaccess now default with -Wall but we explicitly
# manage this ourselves in our serialization routines.
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<COMPILE_LANGUAGE:CXX>>:-Wno-class-memaccess>
Comment on lines +577 to +579
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is apparently a new warning. Since we sometimes build with -Werr its also an error. I am silencing it as memcpy is an intrinsic part of the serialization infrastructure and the heuristic that normally justifies warning doesn't apply in our case. We have introspection about the trivial and non-trivial copy properties of our data and we manage it.

)
if (SINGULARITY_STRICT_WARNINGS)
target_compile_options(singularity-eos_Interface INTERFACE
Expand Down
1 change: 1 addition & 0 deletions doc/sphinx/src/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ The main CMake options to configure building are in the following table:
``SINGULARITY_NQT_ORDER_1`` OFF For fast logs, use the less accurate but faster 1st-order version.
``SINGULARITY_NQT_PORTABLE`` OFF For fast logs, use the slower but endianness-independent implementation.
``SINGULARITY_STRICT_WARNINGS`` OFF For testing. Adds -Wall and -Werror to builds.
``SINGULARITY_USE_V_AND_V_EOS`` OFF Enables several additional EOS models and adds them to the default variant
====================================== ======= ===========================================

More options are available to modify only if certain other options or
Expand Down
120 changes: 120 additions & 0 deletions doc/sphinx/src/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,61 @@ functional forms for :math:`\Gamma` and the reference curves, the task of
calculating a **thermodynamically consistent** temperature becomes more
complicated.

The 3T Model
``````````````
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved

In high-energy density physics, the so-called three-temperature (or
3T) model is often employed. In this model, a material is fully or
partially ionized. Due to the separation in masses between electrons
and atomic nuclei, electrons come into thermal equilibrium and ions
come into thermal equilibrium, but the two populations are not in
thermal equilibrium with each other. This introduces separate electron
and ion temperatures. The third temperature is potentially a radiation
temperature.

By convention in 3T physics, density :math:`\rho` is always the mass
density of the ions. The electron number density may then be computed
as

.. math::

n = \left\langle Z \right\rangle \frac{\rho}{\left\langle A\right\rangle m_p}

where here :math:`\left\langle Z\right\rangle` is the average number
of electrons contributed per atom, also called mean ionization state,
:math:`\rho` is the ion mass density, :math:`\bar{A}` is the mean
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved
atomic mass (in grams per mole) of a given material and :math:`m_p` is
the proton mass.

.. note::

Note that there is notational ambiguity between the average
ionization state and the average atomic number, as the symbol for
both is :math:`Z`. To disambiguate in ``singularity-eos``, we use
overbars to reference mean atomic properties such as mean atomic
mass :math:`\bar{A}` and mean atomic number :math:`\bar{Z}` while we
use :math:`\left\langle Z\right\rangle` to denote mean ionizaiton
state.

Also by convention, the specific internal energy carried by electrons
:math:`\varepsilon_e` is specific with respect to the *ion* mass. In
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved
particular:

.. math::

u_e = \varepsilon_e \rho

where here :math:`u_e` is the internal energy per unit volume carried
by electrons and, as discussed above, :math:`\rho` is ion mass
density.

``singularity-eos`` assumes that, when 3T physics is active, electrons
and ions are each described by a separate equation of state
object. Several models are specifically designed to represent, e.g.,
the electron equation of state or ion equation of state. The tabulated
models may also support loading tables specifically for electron or
ion equations of state.

Available EOS Information and Nomenclature
------------------------------------------

Expand Down Expand Up @@ -469,6 +524,71 @@ the atomic mass and number as a final optional parameter, e.g.,
IdealGas(Real gm1, Real Cv, MeanAtomicProperties(Abar, Zbar));
IdealGas(Real gm1, Real Cv, Real EntropyT0, Real EntropyRho0, MeanAtomicProperties(Abar, Zbar));

Ideal Electron Gas
```````````````````

The ideal electron gas equation of state is designed for use with 3T
physics. It is an ideal Boltzmann gas of electrons. As such, each
electron is assumed to have three translational degrees of freedom
:math:`f`, such that

.. math::

\Gamma = \frac{2}{f} = \frac{2}{3}

and

.. math::

\gamma = \Gamma + 1 = \frac{5}{3}.

The pressure is given by the number density of electrons times
:math:`k_b T` for Boltzmann constant :math:`k_b` and temperature
:math:`T`:

.. math::

P = \frac{\rho}{m_p \bar{A}}\left\langle Z \right\rangle k_b T
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved

The specific heat is then

.. math::

C_V = \frac{\left\langle Z \right\rangle k_b}{\Gamma m_p \bar{A}}
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved

so that

.. math::

P = \Gamma \rho C_V T

as expected.

The constructor takes only the ``MeanAtomicProperties`` struct, which
is a required input:

.. code-block:: cpp

IdealElectrons(const MeanAtomicProperties &AZbar);

Optionally reference values may be provided for the entropy
calculation, which is computed in the same way as the standard ideal
gas.
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved

Calls to compute state variables require the mean ionization state,
which must be passed in the ``lambda`` parameter, e.g.,

.. code-block:: cpp

Real lambda[1] = {Z};
Real P = eos.PressureFromDensityTemperature(rho, T, lambda);

.. note::

For now, the ideal electron gas is not in the default variant
provided by singularity-eos. If you would like to use it, you must
implement your own custom variant.

Stiffened Gas
`````````````

Expand Down
111 changes: 103 additions & 8 deletions doc/sphinx/src/modifiers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ Equation of State Modifiers
provides some internal transformation on inputs and outputs. For
example the ``ShiftedEOS`` modifier changes the zero point energy of a
given EOS model by shifting all energies up or down. Modifiers can be
used to, for example, production-harden a model. Only certain
combinations of ``EOS`` and ``modifier`` are permitted by the defualt
``Variant``. For example, only ``IdealGas``, ``SpinerEOS``, and
``StellarCollapse`` support the ``RelativisticEOS`` and ``UnitSystem``
modifiers. All models support the ``ShiftedEOS`` and ``ScaledEOS``
modifiers. However, note that modifiers do not commute, and only one
order is supported. The ordering, inside-out, is ``UnitSystem`` or
``RelativisticEOS``, then ``ScaledEOS``, then ``ShiftedEOS``.
used to, for example, production-harden a model.

Only certain combinations of ``EOS`` and ``modifier`` are permitted by
the defualt ``Variant``. For example, only ``IdealGas``,
``SpinerEOS``, and ``StellarCollapse`` support the ``RelativisticEOS``
and ``UnitSystem`` modifiers. All models support the ``ShiftedEOS``
and ``ScaledEOS`` modifiers. However, note that modifiers do not
commute, and only one order is supported. The ordering, inside-out, is
``UnitSystem`` or ``RelativisticEOS``, then ``ScaledEOS``, then
``ShiftedEOS``.

We list below the available modifiers and their constructors.

Expand Down Expand Up @@ -187,6 +189,99 @@ internal energy, and temperature. On the other hand,
specifies the unit system by specifying units for time, mass, length,
and temperature.

Z-Split EOS
-------------

For 3T physics (as described in the models section) it is often
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved
desirable to have a separate equation of state for electrons and a
separate equation of state for ions. The Z-split model takes a total
equation of state and splits it into electron and ion components. The
"Z" here signifies mean ionization state, or the average number of
free electrons contributed per atomic nucleus, which is the mean
atomic number in the case of full ionization, but could be smaller in
the case of partial ionization. (It is zero for an unionized gas.) The
physical model of Z-split can be derived from an ideal gas equation of
state. For an ideal gas made up of electrons and ions, where all
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved
molecular bonds have been broken, the total pressure is given by

.. math::

P_t = (\left\langle Z\right\rangle + 1) \frac{\rho}{m_p \bar{A}} k_b T

where :math:`\left\langle Z\right\rangle` is the mean ionization
state, :math:`rho` is the ion mass density (the electron ion mass
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved
density is negligible), :math:`m_p` is the proton mass,
:math:`\bar{A}` is the mean atomic mass, :math:`k_b` is Boltzmann's
constant, and :math:`T` is temperature. The contribution from
electrons is proportional to :math:`\left\langle Z\right\rangle`.

The split simply splits the total pressure into normalized
contributions for the electrons:

.. math::

P_e = \frac{\left\langle Z\right\rangle}{1 + \left\langle Z\right\rangle} P_t(\rho, T_e)

and ions:

.. math::

P_i = \frac{1}{1 + \left\langle Z\right\rangle} P_t(\rho, T_i)

where here :math:`T_e` is the electron temperature and :math:`T_i` the
ion temperature such that, when the temperatures are equal,

.. math::

P_e + P_i = P_t

The same split is applied to the specific internal energy:

.. math::

\varepsilon_e = \frac{\left\langle Z\right\rangle}{1 + \left\langle Z\right\rangle} \varepsilon_t(\rho, T_e)\\
\varepsilon_i = \frac{1}{1 + \left\langle Z\right\rangle} \varepsilon_t(\rho, T_i)

and the remaining state variables and thermodynamic derivatives can be
derived from these relations.

In ``singularity-eos``, the z-split is implemented as the templated class

.. code-block:: cpp

template<ZSplitComponent ztype, typename T>
class ZSplit

where ``ZSPlitComponent`` may either be ``ZSplitComponent::Electrons``
or ``ZSplitComponent::Ions``. As syntactic sugar, ``ZSplitE<T>`` and
``ZSplitI<T>`` are available. The Z-split constructor does not require
any additional parameters, so you may construct one as, e.g.,
Yurlungur marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: cpp

using namespace singularity
auto ion_eos = ZSPlitI<IdealGas>(IdealGas(gm1, Cv);

and similarly for electrons,

.. code-block:: cpp

auto electron_eos = ZSPlitE<IdealGas>(IdealGas(gm1, Cv);

The Z-split modifier takes the ionization state as an additional
parameter via the lambda. For example:

.. code-block:: cpp

Real lambda[1] = {Z};
Real Pe = electron_eos.PressureFromDensityTemperature(rho, temperature, lambda);

.. note::

For now, the Z-split EOS is not in the default variant provided by
singularity-eos. If you would like to use it, you must implement
your own custom variant.

Composing Modifiers
--------------------

Expand Down
Loading
Loading