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 rho,
97 : : tk::real u,
98 : : tk::real v,
99 : : tk::real w,
100 : : tk::real pr,
101 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
102 : :
103 : : //! \brief Calculate material temperature from the material density, and
104 : : //! material specific total energy
105 : : tk::real temperature(
106 : : tk::real arho,
107 : : tk::real u,
108 : : tk::real v,
109 : : tk::real w,
110 : : tk::real arhoE,
111 : : tk::real alpha=1.0,
112 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
113 : :
114 : : //! Compute the minimum allowed pressure
115 : : tk::real min_eff_pressure(
116 : : tk::real min,
117 : : tk::real,
118 : : tk::real ) const;
119 : :
120 : : //! Compute the reference density
121 : : tk::real refDensity() const { return density(refPressure(), 300.0); }
122 : :
123 : : //! Compute the reference pressure
124 : : tk::real refPressure() const { return 1.0e5; }
125 : :
126 : : //! Return initial density
127 : 0 : tk::real rho0() const { return m_rho0; }
128 : :
129 : : /** @name Charm++ pack/unpack serializer member functions */
130 : : ///@{
131 : : //! \brief Pack/Unpack serialize member function
132 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
133 : : void pup( PUP::er &p ) /*override*/ {
134 : : p | m_gamma;
135 : : p | m_cv;
136 : : p | m_mu;
137 : : p | m_rho0;
138 : : }
139 : : //! \brief Pack/Unpack serialize operator|
140 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
141 : : //! \param[in,out] i WilkinsAluminum object reference
142 : : friend void operator|( PUP::er& p, WilkinsAluminum& i ) { i.pup(p); }
143 : : //@}
144 : : };
145 : :
146 : : } //inciter::
147 : :
148 : : #endif // WilkinsAluminum_h
|