Skip to content

Commit

Permalink
eos davis
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Dec 2, 2024
1 parent ade7cc3 commit 5edeed4
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions singularity-eos/eos/eos_davis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ class DavisReactants : public EosBase<DavisReactants> {
PORTABLE_INLINE_FUNCTION
DavisReactants(const Real rho0, const Real e0, const Real P0, const Real T0,
const Real A, const Real B, const Real C, const Real G0, const Real Z,
const Real alpha, const Real Cv0)
const Real alpha, const Real Cv0,
const MeanAtomicProperties &AZbar = MeanAtomicProperties())
: _rho0(rho0), _e0(e0), _P0(P0), _T0(T0), _A(A), _B(B), _C(C), _G0(G0), _Z(Z),
_alpha(alpha), _Cv0(Cv0) {
_alpha(alpha), _Cv0(Cv0), _AZbar(AZbar) {
CheckParams();
}
DavisReactants GetOnDevice() { return *this; }
Expand Down Expand Up @@ -146,6 +147,10 @@ class DavisReactants : public EosBase<DavisReactants> {
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
return Gamma(rho);
}
PORTABLE_INLINE_FUNCTION
Real MeanAtomicMass() const { return _AZbar.Abar; }
PORTABLE_INLINE_FUNCTION
Real MeanAtomicNumber() const { return _AZbar.Zbar; }
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void
FillEos(Real &rho, Real &temp, Real &energy, Real &press, Real &cv, Real &bmod,
Expand Down Expand Up @@ -183,6 +188,7 @@ class DavisReactants : public EosBase<DavisReactants> {
private:
static constexpr Real onethird = 1.0 / 3.0;
Real _rho0, _e0, _P0, _T0, _A, _B, _C, _G0, _Z, _alpha, _Cv0;
MeanAtomicProperties _AZbar;
// static constexpr const char _eos_type[] = "DavisReactants";
static constexpr unsigned long _preferred_input =
thermalqs::density | thermalqs::specific_internal_energy;
Expand All @@ -198,8 +204,9 @@ class DavisProducts : public EosBase<DavisProducts> {
DavisProducts() = default;
PORTABLE_INLINE_FUNCTION
DavisProducts(const Real a, const Real b, const Real k, const Real n, const Real vc,
const Real pc, const Real Cv)
: _a(a), _b(b), _k(k), _n(n), _vc(vc), _pc(pc), _Cv(Cv) {}
const Real pc, const Real Cv,
const MeanAtomicProperties &AZbar = MeanAtomicProperties())
: _a(a), _b(b), _k(k), _n(n), _vc(vc), _pc(pc), _Cv(Cv), _AZbar(AZbar) {}
PORTABLE_INLINE_FUNCTION
void CheckParams() const {
// TODO(JMM): Stub.
Expand Down Expand Up @@ -285,6 +292,10 @@ class DavisProducts : public EosBase<DavisProducts> {
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
return Gamma(rho);
}
PORTABLE_INLINE_FUNCTION
Real MeanAtomicMass() const { return _AZbar.Abar; }
PORTABLE_INLINE_FUNCTION
Real MeanAtomicNumber() const { return _AZbar.Zbar; }
template <typename Indexer_t = Real *>
PORTABLE_INLINE_FUNCTION void
DensityEnergyFromPressureTemperature(const Real press, const Real temp,
Expand Down Expand Up @@ -321,6 +332,7 @@ class DavisProducts : public EosBase<DavisProducts> {
private:
static constexpr Real onethird = 1.0 / 3.0;
Real _a, _b, _k, _n, _vc, _pc, _Cv;
MeanAtomicProperties _AZbar;
// static constexpr const char _eos_type[] = "DavisProducts";
static constexpr const unsigned long _preferred_input =
thermalqs::density | thermalqs::specific_internal_energy;
Expand Down

0 comments on commit 5edeed4

Please sign in to comment.