Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lanl/singularity-eos into jhp/DavisEOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jhp-lanl committed May 14, 2024
2 parents a0b5a9f + 994da55 commit 797c13e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [[PR335]](https://github.com/lanl/singularity-eos/pull/335) Fix missing hermite.hpp in CMake install required for Helmholtz EOS
- [[PR356]](https://github.com/lanl/singularity-eos/pull/356) Guard against FPEs in the PTE solver
- [[PR356]](https://github.com/lanl/singularity-eos/pull/356) Update CMake for proper Kokkos linking in Fortran interface
- [[PR373]](https://github.com/lanl/singularity-eos/pull/373) Initialize cache in `get_sg_eos*` functions

### Changed (changing behavior/API/variables/...)
- [[PR363]](https://github.com/lanl/singularity-eos/pull/363) Template lambda values for scalar calls
Expand Down
11 changes: 4 additions & 7 deletions doc/sphinx/src/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

.. _DavisReactants: https://doi.org/10.1016/S0010-2180(99)00112-1

.. _DavisProducts: https://doi.org/10.1063/1.2035310

.. _ProbingOffHugoniotStates: https://doi.org/10.1063/1.4939675

.. _WillsThermo: https://www.osti.gov/biblio/1561015
Expand Down Expand Up @@ -1196,11 +1194,10 @@ Davis Products EOS
.. warning::
Entropy is not yet available for this EOS

The `Davis products EOS <DavisProducts_>`_ is created from the reference
isentrope passing through the CJ state of the high explosive along with a
constant heat capacity. The constant heat capacity leads to the energy being a
simple funciton of the temperature deviation from the reference isentrope such
that
The Davis products EOS is created from the reference isentrope passing through
the CJ state of the high explosive along with a constant heat capacity. The
constant heat capacity leads to the energy being a simple funciton of the
temperature deviation from the reference isentrope such that

.. math::
Expand Down
1 change: 1 addition & 0 deletions singularity-eos/closure/mixed_cell_models.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class PTESolverBase {
void Finalize() {
for (int m = 0; m < nmat; m++) {
temp[m] *= Tnorm;
PORTABLE_REQUIRE(temp[m] >= 0., "Non-positive temperature returned");
u[m] *= uscale;
press[m] *= uscale;
}
Expand Down
1 change: 0 additions & 1 deletion singularity-eos/eos/eos_davis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ class DavisProducts : public EosBase<DavisProducts> {
inline void Finalize() {}
static std::string EosType() { return std::string("DavisProducts"); }
static std::string EosPyType() { return EosType(); }
// TODO (JHP): Create helper function to find the CJ state given the reference state

private:
static constexpr Real onethird = 1.0 / 3.0;
Expand Down
4 changes: 4 additions & 0 deletions singularity-eos/eos/get_sg_eos_p_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ void get_sg_eos_p_t(const char *name, int ncell, int nmat, indirection_v &offset
// for small loops
const int32_t token{tokens.acquire()};
const int32_t tid{small_loop ? iloop : token};
// need to initialize the scratch before it's used to avoid undefined behavior
for (int idx = 0; idx < solver_scratch.extent(1); ++idx) {
solver_scratch(tid, idx) = 0.0;
}
// caching mechanism
singularity::mix_impl::CacheAccessor cache(&solver_scratch(tid, 0));
double mass_sum{0.0};
Expand Down
4 changes: 4 additions & 0 deletions singularity-eos/eos/get_sg_eos_rho_e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ void get_sg_eos_rho_e(const char *name, int ncell, indirection_v &offsets_v,
int npte{0};
// initialize values for solver / lookup
i_func(i, tid, mass_sum, npte, 0.0, 1.0, 0.0);
// need to initialize the scratch before it's used to avoid undefined behavior
for (int idx = 0; idx < solver_scratch.extent(1); ++idx) {
solver_scratch(tid, idx) = 0.0;
}
// get cache from offsets into scratch
const int neq = npte + 1;
singularity::mix_impl::CacheAccessor cache(&solver_scratch(tid, 0) +
Expand Down
4 changes: 4 additions & 0 deletions singularity-eos/eos/get_sg_eos_rho_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ void get_sg_eos_rho_p(const char *name, int ncell, indirection_v &offsets_v,
// initialize values for solver / lookup
i_func(i, tid, mass_sum, npte, 0.0, 0.0, 1.0);
Real sie_tot_true{0.0};
// need to initialize the scratch before it's used to avoid undefined behavior
for (int idx = 0; idx < solver_scratch.extent(1); ++idx) {
solver_scratch(tid, idx) = 0.0;
}
const int neq = npte + 1;
singularity::mix_impl::CacheAccessor cache(&solver_scratch(tid, 0) +
neq * (neq + 4) + 2 * npte);
Expand Down
4 changes: 4 additions & 0 deletions singularity-eos/eos/get_sg_eos_rho_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ void get_sg_eos_rho_t(const char *name, int ncell, indirection_v &offsets_v,
i_func(i, tid, mass_sum, npte, 1.0, 0.0, 0.0);
// calculate pte condition (lookup for 1 mat cell)
Real sie_tot_true{0.0};
// need to initialize the scratch before it's used to avoid undefined behavior
for (int idx = 0; idx < solver_scratch.extent(1); ++idx) {
solver_scratch(tid, idx) = 0.0;
}
const int neq = npte;
singularity::mix_impl::CacheAccessor cache(&solver_scratch(tid, 0) +
neq * (neq + 4) + 2 * npte);
Expand Down

0 comments on commit 797c13e

Please sign in to comment.