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

Add lambda thermalq #362

Merged
merged 8 commits into from
Apr 18, 2024
Merged
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
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/...)
- [[PR#362]](https://github.com/lanl/singularity-eos/pull/362) Add lambda to thermalqs
- [[PR#339]](https://github.com/lanl/singularity-eos/pull/339) Added COMPONENTS to singularity-eos CMake install, allowing to select a minimal subset needed e.g. for Fortran bindings only
- [[PR#336]](https://github.com/lanl/singularity-eos/pull/336) Included code and documentation for a full, temperature consistent, Mie-Gruneisen EOS based on a pressure power law expansion in eta = 1-V/V0. PowerMG.
- [[PR#357]](https://github.com/lanl/singularity-eos/pull/357) Added support for C++17 (e.g., needed when using newer Kokkos).
Expand Down
7 changes: 7 additions & 0 deletions doc/sphinx/src/using-eos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,18 @@ currently:
* ``thermalqs::temperature``
* ``thermalqs::specific_heat``
* ``thermalqs::bulk_modulus``
* ``thermalqs::do_lambda``
* ``thermalqs::all_values``

however, most EOS models only specify that they prefer density and
temperature or density and specific internal energy.

.. note::

The ``thermalqs::do_lambda`` flag is a bit special. It specifies that
eos-specific operations are to be performed on the additional
quantities passed in through the ``lambda`` variable.

.. _eos builder section:

EOS Builder
Expand Down
3 changes: 2 additions & 1 deletion python/module.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------
// © 2021-2023. Triad National Security, LLC. All rights reserved. This
// © 2021-2024. Triad National Security, LLC. All rights reserved. This
// program was produced under U.S. Government contract 89233218CNA000001
// for Los Alamos National Laboratory (LANL), which is operated by Triad
// National Security, LLC for the U.S. Department of Energy/National
Expand Down Expand Up @@ -141,6 +141,7 @@ PYBIND11_MODULE(singularity_eos, m) {
thermalqs.attr("temperature") = pybind11::int_(thermalqs::temperature);
thermalqs.attr("specific_heat") = pybind11::int_(thermalqs::specific_heat);
thermalqs.attr("bulk_modulus") = pybind11::int_(thermalqs::bulk_modulus);
thermalqs.attr("do_lambda") = pybind11::int_(thermalqs::do_lambda);
thermalqs.attr("all_values") = pybind11::int_(thermalqs::all_values);

py::module eos_units = m.def_submodule("eos_units");
Expand Down
5 changes: 3 additions & 2 deletions singularity-eos/base/constants.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------
// © 2021-2023. Triad National Security, LLC. All rights reserved. This
// © 2021-2024. Triad National Security, LLC. All rights reserved. This
// program was produced under U.S. Government contract 89233218CNA000001
// for Los Alamos National Laboratory (LANL), which is operated by Triad
// National Security, LLC for the U.S. Department of Energy/National
Expand Down Expand Up @@ -27,7 +27,8 @@ constexpr unsigned long pressure = (1 << 2);
constexpr unsigned long temperature = (1 << 3);
constexpr unsigned long specific_heat = (1 << 4);
constexpr unsigned long bulk_modulus = (1 << 5);
constexpr unsigned long all_values = (1 << 6) - 1;
constexpr unsigned long do_lambda = (1 << 6);
constexpr unsigned long all_values = (1 << 7) - 1;
} // namespace thermalqs

constexpr size_t MAX_NUM_LAMBDAS = 3;
Expand Down
3 changes: 2 additions & 1 deletion test/python_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def testConstants(self):
thermalqs.pressure |
thermalqs.temperature |
thermalqs.specific_heat |
thermalqs.bulk_modulus)
thermalqs.bulk_modulus |
thermalqs.do_lambda)

def testIdealGas(self):
eos = singularity_eos.IdealGas(1,1)
Expand Down
Loading