Skip to content

Commit 8f77c6d

Browse files
Added documentation for the simple MACAW some more comments.
1 parent d9b861c commit 8f77c6d

File tree

2 files changed

+72
-6
lines changed

2 files changed

+72
-6
lines changed

doc/sphinx/src/models.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
.. _PowerMG: https://www.osti.gov/biblio/1762624
2323

24+
.. _SimpleMACAW: https://www.osti.gov/biblio/2479474
25+
2426

2527
EOS Models
2628
===========
@@ -1320,6 +1322,58 @@ This constructor also optionally accepts `MeanAtomicProperties` for
13201322
the atomic mass and number as a final optional parameter.
13211323

13221324

1325+
.. _MACAW EOS: https://pubs.aip.org/aip/jap/article/134/12/125102/2912256
1326+
1327+
Simple MACAW
1328+
````````````
1329+
The `Simple MACAW EOS <_SimpleMACAW>`_ is a simplified version of the `MACAW EOS <MACAW EOS>`_
1330+
and is thermodynamically consistent. It is constructed from a the Helmholtz
1331+
free energy using a Murnaghan cold curve and a simplified thermal component
1332+
from the MACAW EOS.
1333+
1334+
Fundamentally, the equation of state can be written in Mie-Gruneisen form (with constant Gruneisen parameter) as:
1335+
1336+
.. math::
1337+
1338+
P(v, e) = P_{\text{cold}}(v) + \Gamma_c \rho (e - e_{\text{cold}}(v))
1339+
1340+
where the cold curves are given by:
1341+
1342+
.. math::
1343+
1344+
e_{\text{cold}}(v) = A v_0 \Big[ \Big( \frac{v}{v_0} \Big)^{-B} + \Big( \frac{v}{v_0} \Big) B - (B+1) \Big]
1345+
1346+
and
1347+
1348+
.. math::
1349+
1350+
p_{\text{cold}}(v) := -e'_{\text{cold}}(v) = AB \Big( \Big( \frac{v}{v_0} \Big)^{-(B+1)} - 1 \Big)
1351+
1352+
The specific heat capacity at constant volume for this model is given by,
1353+
1354+
.. math::
1355+
1356+
C_v(v, \tau) = C^\infty_v \frac{\tau^2 + 2\tau}{(\tau + 1)^2} \quad \text{where } \tau = \frac{T}{\theta(v)} \quad \text{ and } \quad \theta(v) := T_0 \Big( \frac{v}{v_c} \Big)^{-\Gamma_c}
1357+
1358+
Note it obeys the expected physical behavior; that, :math:`\lim_{T\to 0^+} C_v(v,\tau(v,T)) = 0` and
1359+
:math:`\lim_{T\to\infty} C_v(v,\tau(v,T) = C^\infty_v < \infty` (Dulong-Petit law).
1360+
1361+
The constructor for the Simple MACAW EOS is
1362+
1363+
.. code-block:: cpp
1364+
1365+
SimpleMACAW(const Real A, const Real B, const Real Cvinf, const Real v0,
1366+
const Real T0, const Real Gc)
1367+
1368+
where ``A`` is :math:`A`, ``B`` is :math:`B`, ``Cvinf`` is :math:`C^\infty_v`,
1369+
``v0`` is :math:`v_0`, ``T0`` is :math:`T_0`, ``Gc`` is :math:`\Gamma_c`.
1370+
1371+
In order to maintain thermodynamic consistency, a sufficient set of constraints
1372+
is given by :math:`A > 0`, :math:`B > 0`, :math:`C^\infty_v > 0`, :math:`v_0 >
1373+
0`, :math:`T_0 > 0`, and :math:`\Gamma_c > 0`. If one wants to maintain
1374+
thermodynamic consistency, we also require :math:`\Gamma_c \in (0,1)`.
1375+
1376+
13231377
JWL EOS
13241378
``````````
13251379

singularity-eos/eos/eos_simple_macaw.hpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ namespace singularity {
3333

3434
using namespace eos_base;
3535

36-
/* The details of this equation of state can be found here:
37-
* https://www.osti.gov/biblio/2479474 */
36+
/* Most information regarding this equation of state can be found here:
37+
* https://www.osti.gov/biblio/2479474
38+
*
39+
* Note that all equations are given as functions of the density ($\rho$) rather than functions
40+
* of the specific volume ($v$). The reason for this is it simplifies the computational complexity.
41+
*/
3842
class SimpleMACAW : public EosBase<SimpleMACAW> {
3943
public:
4044
SimpleMACAW() = default;
@@ -55,10 +59,10 @@ class SimpleMACAW : public EosBase<SimpleMACAW> {
5559
return robust::ratio((Delta_e + std::sqrt(discriminant)), 2.0 * _Cvinf);
5660
}
5761
PORTABLE_INLINE_FUNCTION void CheckParams() const {
58-
PORTABLE_ALWAYS_REQUIRE(_A > 0, "Parameter, 'A', must be positive");
59-
PORTABLE_ALWAYS_REQUIRE(_B > 0, "Parameter, 'B', must be positive");
62+
PORTABLE_ALWAYS_REQUIRE(_A >= 0, "Parameter, 'A', must be non-negative");
63+
PORTABLE_ALWAYS_REQUIRE(_B >= 0, "Parameter, 'B', must be non-negative");
6064
PORTABLE_ALWAYS_REQUIRE(_v0 > 0, "Reference specific volume, 'v0', must be positive");
61-
PORTABLE_ALWAYS_REQUIRE(_T0 > 0, "Reference temperature, 'T0', must be positive");
65+
PORTABLE_ALWAYS_REQUIRE(_T0 >= 0, "Reference temperature, 'T0', must be non-negative");
6266
PORTABLE_ALWAYS_REQUIRE(_Cvinf > 0, "Specific heat capacity (at constant volume), `Cvinf`, must be positive");
6367
PORTABLE_ALWAYS_REQUIRE(_Gc > 0 && _Gc < 1, "Gruneisen parameter, 'Gc', must be in the interval (0,1)");
6468
_AZbar.CheckParams();
@@ -67,18 +71,21 @@ class SimpleMACAW : public EosBase<SimpleMACAW> {
6771
PORTABLE_INLINE_FUNCTION Real InternalEnergyFromDensityTemperature(
6872
const Real rho, const Real temperature,
6973
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
74+
/* Equation (16) */
7075
return rho * (SieColdCurve(rho) + SieThermalPortion(rho, temperature));
7176
}
7277
template <typename Indexer_t = Real *>
7378
PORTABLE_INLINE_FUNCTION Real PressureFromDensityTemperature(
7479
const Real rho, const Real temperature,
7580
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
81+
/* Equation (15) */
7682
return PressureColdCurve(rho) + PressureThermalPortion(rho, temperature);
7783
}
7884
template <typename Indexer_t = Real *>
7985
PORTABLE_INLINE_FUNCTION Real PressureFromDensityInternalEnergy(
8086
const Real rho, const Real sie,
8187
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
88+
/* Equation (19) */
8289
return PressureColdCurve(rho) + _Gc * rho * (sie - SieColdCurve(rho));
8390
}
8491
template <typename Indexer_t = Real *>
@@ -93,6 +100,7 @@ class SimpleMACAW : public EosBase<SimpleMACAW> {
93100
PORTABLE_INLINE_FUNCTION Real
94101
EntropyFromDensityTemperature(const Real rho, const Real temperature,
95102
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
103+
/* Equation (8) */
96104
const Real tau = robust::ratio(temperature, TemperatureScale(rho));
97105
return _Cvinf * (robust::ratio(tau, 1.0 + tau) + std::log(1.0 + tau));
98106
}
@@ -138,6 +146,7 @@ class SimpleMACAW : public EosBase<SimpleMACAW> {
138146
template <typename Indexer_t = Real *>
139147
PORTABLE_INLINE_FUNCTION Real TemperatureScale(
140148
const Real rho, Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
149+
/* Equation (13) */
141150
return _T0 * std::pow(rho * _v0, _Gc);
142151
}
143152

@@ -146,6 +155,7 @@ class SimpleMACAW : public EosBase<SimpleMACAW> {
146155
PORTABLE_INLINE_FUNCTION Real SpecificHeatFromDensityTemperature(
147156
const Real rho, const Real temperature,
148157
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
158+
/* Equation (6) */
149159
const Real tau = robust::ratio(temperature, TemperatureScale(rho));
150160
const Real numerator = math_utils::pow<2>(tau) + 2.0 * tau;
151161
const Real denominator = math_utils::pow<2>(tau + 1.0);
@@ -170,6 +180,7 @@ class SimpleMACAW : public EosBase<SimpleMACAW> {
170180
PORTABLE_INLINE_FUNCTION Real BulkModulusFromDensityInternalEnergy(
171181
const Real rho, const Real sie,
172182
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
183+
/* Equation (21) (multiplied by $\rho$ to get bulk mod) */
173184
const Real term1 = _A * _B * (_B + 1.0) * std::pow(rho * _v0, _B + 1.0);
174185
const Real term2 = _Gc * (_Gc + 1.0) * rho * (sie - SieColdCurve(rho));
175186
return term1 + term2;
@@ -179,7 +190,8 @@ class SimpleMACAW : public EosBase<SimpleMACAW> {
179190
PORTABLE_INLINE_FUNCTION Real IsothermalBulkModulusFromDensityTemperature(
180191
const Real rho, const Real temperature,
181192
Indexer_t &&lambda = static_cast<Real *>(nullptr)) const {
182-
/* As mentioned in the paper, from the constraints on the parameters,
193+
/* Equation (22) (multiplied by $\rho$ to get bulk mod)
194+
* As mentioned in the paper, from the constraints on the parameters,
183195
* the isothermal bulk modulus is guaranteed to be positive. */
184196
const Real term1 = _A * _B * (_B + 1.0) * std::pow(rho * _v0, _B + 1.0);
185197
const Real numerator = rho * _T0 * (1.0 - _Gc) * std::pow(rho * _v0, 2.0 * _Gc) + temperature;

0 commit comments

Comments
 (0)