Branch data Line data Source code
1 : : // *****************************************************************************
2 : : /*!
3 : : \file src/PDE/EoS/WilkinsAluminum.hpp
4 : : \copyright 2012-2015 J. Bakosi,
5 : : 2016-2018 Los Alamos National Security, LLC.,
6 : : 2019-2021 Triad National Security, LLC.
7 : : All rights reserved. See the LICENSE file for details.
8 : : \brief Wilkins equation of state for aluminum
9 : : \details This file declares functions for the Wilkins equation of
10 : : state for solids and a hydro EoS for aluminum. These functions were
11 : : taken from Example 4 of Barton, Philip T. "An interface-capturing
12 : : Godunov method for the simulation of compressible solid-fluid
13 : : problems." Journal of Computational Physics 390 (2019): 25-50.
14 : : */
15 : : // *****************************************************************************
16 : : #ifndef WilkinsAluminum_h
17 : : #define WilkinsAluminum_h
18 : :
19 : : #include "Data.hpp"
20 : :
21 : : namespace inciter {
22 : :
23 : : class WilkinsAluminum {
24 : :
25 : : private:
26 : : tk::real m_gamma, m_cv, m_mu, m_rho0;
27 : :
28 : : //! \brief Calculate elastic contribution to material energy from the
29 : : //! material density, and deformation gradient tensor
30 : : tk::real elasticEnergy(
31 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad,
32 : : std::array< std::array< tk::real, 3 >, 3 >& devH ) const;
33 : :
34 : : public:
35 : : //! Default constructor
36 : : WilkinsAluminum() = default;
37 : :
38 : : //! Constructor
39 : : WilkinsAluminum(tk::real gamma, tk::real cv, tk::real mu );
40 : :
41 : : //! Set rho0 EOS parameter; i.e. the initial density
42 : : void setRho0(tk::real rho0);
43 : :
44 : : //! Calculate density from the material pressure and temperature
45 : : tk::real density( tk::real pr,
46 : : tk::real temp ) const;
47 : :
48 : : //! Calculate pressure from the material density, momentum and total energy
49 : : tk::real pressure(
50 : : tk::real arho,
51 : : tk::real u,
52 : : tk::real v,
53 : : tk::real w,
54 : : tk::real arhoE,
55 : : tk::real alpha=1.0,
56 : : std::size_t imat=0,
57 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
58 : :
59 : : //! Calculate cold-compression component of pressure (no-op)
60 : : tk::real pressure_coldcompr(
61 : : tk::real,
62 : : tk::real ) const
63 : : { return 0.0; }
64 : :
65 : : //! \brief Calculate the elastic Cauchy stress tensor from the material
66 : : //! density, momentum, total energy, and inverse deformation gradient
67 : : //! tensor using the WilkinsAluminum equation of state
68 : : std::array< std::array< tk::real, 3 >, 3 >
69 : : CauchyStress(
70 : : tk::real,
71 : : tk::real,
72 : : tk::real,
73 : : tk::real,
74 : : tk::real,
75 : : tk::real alpha,
76 : : std::size_t /*imat*/,
77 : : const std::array< std::array< tk::real, 3 >, 3 >& adefgrad ) const;
78 : :
79 : : //! Calculate speed of sound from the material density and material pressure
80 : : tk::real soundspeed(
81 : : tk::real arho,
82 : : tk::real apr,
83 : : tk::real alpha=1.0,
84 : : std::size_t imat=0,
85 : : const std::array< std::array< tk::real, 3 >, 3 >& adefgrad={{}} ) const;
86 : :
87 : : //! Calculate speed of shear waves
88 : : tk::real shearspeed(
89 : : tk::real arho,
90 : : tk::real alpha=1.0,
91 : : std::size_t imat=0 ) const;
92 : :
93 : : //! \brief Calculate material specific total energy from the material
94 : : //! density, momentum and material pressure
95 : : tk::real totalenergy(
96 : : tk::real arho,
97 : : tk::real u,
98 : : tk::real v,
99 : : tk::real w,
100 : : tk::real apr,
101 : : tk::real alpha=1.0,
102 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
103 : :
104 : : //! \brief Calculate material temperature from the material density, and
105 : : //! material specific total energy
106 : : tk::real temperature(
107 : : tk::real arho,
108 : : tk::real u,
109 : : tk::real v,
110 : : tk::real w,
111 : : tk::real arhoE,
112 : : tk::real alpha=1.0,
113 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
114 : :
115 : : //! Compute the minimum allowed pressure
116 : : tk::real min_eff_pressure(
117 : : tk::real min,
118 : : tk::real,
119 : : tk::real ) const;
120 : :
121 : : //! Compute the reference density
122 : : tk::real refDensity() const { return density(refPressure(), 300.0); }
123 : :
124 : : //! Compute the reference pressure
125 : : tk::real refPressure() const { return 1.0e5; }
126 : :
127 : : //! Return initial density
128 : 0 : tk::real rho0() const { return m_rho0; }
129 : :
130 : : //! Return gas constant (no-op)
131 : 0 : tk::real gas_constant() const { return 0.0; }
132 : :
133 : : //! Return internal energy (no-op)
134 : 0 : tk::real internalenergy(tk::real temp) const { return m_cv * temp; }
135 : :
136 : : //! Return specific heat (no-op)
137 : 0 : tk::real cv( [[maybe_unused]] tk::real temp) const { return m_cv; }
138 : :
139 : : /** @name Charm++ pack/unpack serializer member functions */
140 : : ///@{
141 : : //! \brief Pack/Unpack serialize member function
142 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
143 : : void pup( PUP::er &p ) /*override*/ {
144 : : p | m_gamma;
145 : : p | m_cv;
146 : : p | m_mu;
147 : : p | m_rho0;
148 : : }
149 : : //! \brief Pack/Unpack serialize operator|
150 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
151 : : //! \param[in,out] i WilkinsAluminum object reference
152 : : friend void operator|( PUP::er& p, WilkinsAluminum& i ) { i.pup(p); }
153 : : //@}
154 : : };
155 : :
156 : : } //inciter::
157 : :
158 : : #endif // WilkinsAluminum_h
|