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 : : //! inverse deformation gradient tensor using the WilkinsAluminum EOS
67 : : std::array< std::array< tk::real, 3 >, 3 >
68 : : CauchyStress(
69 : : tk::real alpha,
70 : : std::size_t /*imat*/,
71 : : const std::array< std::array< tk::real, 3 >, 3 >& adefgrad ) const;
72 : :
73 : : //! Calculate speed of sound from the material density and material pressure
74 : : tk::real soundspeed(
75 : : tk::real arho,
76 : : tk::real apr,
77 : : tk::real alpha=1.0,
78 : : std::size_t imat=0,
79 : : const std::array< std::array< tk::real, 3 >, 3 >& adefgrad={{}} ) const;
80 : :
81 : : //! Calculate speed of shear waves
82 : : tk::real shearspeed(
83 : : tk::real arho,
84 : : tk::real alpha=1.0,
85 : : std::size_t imat=0 ) const;
86 : :
87 : : //! \brief Calculate material specific total energy from the material
88 : : //! density, momentum and material pressure
89 : : tk::real totalenergy(
90 : : tk::real arho,
91 : : tk::real u,
92 : : tk::real v,
93 : : tk::real w,
94 : : tk::real apr,
95 : : tk::real alpha=1.0,
96 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
97 : :
98 : : //! \brief Calculate material temperature from the material density, and
99 : : //! material specific total energy
100 : : tk::real temperature(
101 : : tk::real arho,
102 : : tk::real u,
103 : : tk::real v,
104 : : tk::real w,
105 : : tk::real arhoE,
106 : : tk::real alpha=1.0,
107 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
108 : :
109 : : //! Compute the minimum allowed pressure
110 : : tk::real min_eff_pressure(
111 : : tk::real min,
112 : : tk::real,
113 : : tk::real ) const;
114 : :
115 : : //! Compute the reference density
116 : : tk::real refDensity() const { return density(refPressure(), 300.0); }
117 : :
118 : : //! Compute the reference pressure
119 : : tk::real refPressure() const { return 1.0e5; }
120 : :
121 : : //! Return initial density
122 : : tk::real rho0() const { return m_rho0; }
123 : :
124 : : //! Return gas constant (no-op)
125 : : tk::real gas_constant() const { return 0.0; }
126 : :
127 : : //! Return internal energy (no-op)
128 : 0 : tk::real internalenergy(tk::real temp) const { return m_cv * temp; }
129 : :
130 : : //! Return specific heat (no-op)
131 : : tk::real cv( [[maybe_unused]] tk::real temp) const { return m_cv; }
132 : :
133 : : /** @name Charm++ pack/unpack serializer member functions */
134 : : ///@{
135 : : //! \brief Pack/Unpack serialize member function
136 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
137 : : void pup( PUP::er &p ) /*override*/ {
138 : : p | m_gamma;
139 : : p | m_cv;
140 : : p | m_mu;
141 : : p | m_rho0;
142 : : }
143 : : //! \brief Pack/Unpack serialize operator|
144 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
145 : : //! \param[in,out] i WilkinsAluminum object reference
146 : : friend void operator|( PUP::er& p, WilkinsAluminum& i ) { i.pup(p); }
147 : : //@}
148 : : };
149 : :
150 : : } //inciter::
151 : :
152 : : #endif // WilkinsAluminum_h
|