Branch data Line data Source code
1 : : // *****************************************************************************
2 : : /*!
3 : : \file src/PDE/EoS/SmallShearSolid.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 Small shear strain equation of state for solids
9 : : \details This file declares functions for the SmallShearSolid equation of
10 : : state for the compressible flow equations. These functions are
11 : : taken from Plohr, J. N., & Plohr, B. J. (2005). Linearized analysis
12 : : of Richtmyer–Meshkov flow for elastic materials. Journal of Fluid
13 : : Mechanics, 537, 55-89. The SmallShearSolid EOS uses a small-shear
14 : : approximation for the elastic contribution, and a stiffened gas EOS
15 : : for the hydrodynamic contribution of the internal energy.
16 : : */
17 : : // *****************************************************************************
18 : : #ifndef SmallShearSolid_h
19 : : #define SmallShearSolid_h
20 : :
21 : : #include "Data.hpp"
22 : :
23 : : namespace inciter {
24 : :
25 : : class SmallShearSolid {
26 : :
27 : : private:
28 : : tk::real m_gamma, m_pstiff, m_cv, m_mu, m_rho0;
29 : :
30 : : //! \brief Calculate elastic contribution to material energy from the
31 : : //! material density, and deformation gradient tensor
32 : : tk::real elasticEnergy(
33 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad,
34 : : tk::real& eps2 ) const;
35 : :
36 : : public:
37 : : //! Default constructor
38 : : SmallShearSolid() = default;
39 : :
40 : : //! Constructor
41 : : SmallShearSolid(tk::real gamma, tk::real pstiff, tk::real cv, tk::real mu );
42 : :
43 : : //! Set rho0 EOS parameter; i.e. the initial density
44 : : void setRho0(tk::real rho0);
45 : :
46 : : //! Calculate density from the material pressure and temperature
47 : : tk::real density( tk::real pr,
48 : : tk::real temp ) const;
49 : :
50 : : //! Calculate pressure from the material density, momentum and total energy
51 : : tk::real pressure(
52 : : tk::real arho,
53 : : tk::real u,
54 : : tk::real v,
55 : : tk::real w,
56 : : tk::real arhoE,
57 : : tk::real alpha=1.0,
58 : : std::size_t imat=0,
59 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
60 : :
61 : : //! Calculate cold-compression component of pressure (no-op)
62 : : tk::real pressure_coldcompr(
63 : : tk::real,
64 : : tk::real ) const
65 : : { return 0.0; }
66 : :
67 : : //! \brief Calculate the elastic Cauchy stress tensor from the material
68 : : //! density, momentum, total energy, and inverse deformation gradient
69 : : //! tensor using the SmallShearSolid equation of state
70 : : std::array< std::array< tk::real, 3 >, 3 >
71 : : CauchyStress(
72 : : tk::real,
73 : : tk::real,
74 : : tk::real,
75 : : tk::real,
76 : : tk::real,
77 : : tk::real alpha,
78 : : std::size_t /*imat*/,
79 : : const std::array< std::array< tk::real, 3 >, 3 >& adefgrad ) const;
80 : :
81 : : //! Calculate speed of sound from the material density and material pressure
82 : : tk::real soundspeed(
83 : : tk::real arho,
84 : : tk::real apr,
85 : : tk::real alpha=1.0,
86 : : std::size_t imat=0,
87 : : const std::array< std::array< tk::real, 3 >, 3 >& adefgrad={{}} ) const;
88 : :
89 : : //! Calculate speed of shear waves
90 : : tk::real shearspeed(
91 : : tk::real arho,
92 : : tk::real alpha=1.0,
93 : : std::size_t imat=0 ) const;
94 : :
95 : : //! \brief Calculate material specific total energy from the material
96 : : //! density, momentum and material pressure
97 : : tk::real totalenergy(
98 : : tk::real rho,
99 : : tk::real u,
100 : : tk::real v,
101 : : tk::real w,
102 : : tk::real pr,
103 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
104 : :
105 : : //! \brief Calculate material temperature from the material density, and
106 : : //! material specific total energy
107 : : tk::real temperature(
108 : : tk::real arho,
109 : : tk::real u,
110 : : tk::real v,
111 : : tk::real w,
112 : : tk::real arhoE,
113 : : tk::real alpha=1.0,
114 : : const std::array< std::array< tk::real, 3 >, 3 >& defgrad={{}} ) const;
115 : :
116 : : //! Compute the minimum allowed pressure
117 : : tk::real min_eff_pressure(
118 : : tk::real min,
119 : : tk::real,
120 : : tk::real ) const;
121 : :
122 : : //! Compute the reference density
123 : : tk::real refDensity() const { return density(refPressure(), 300.0); }
124 : :
125 : : //! Compute the reference pressure
126 : : tk::real refPressure() const { return 1.0e5; }
127 : :
128 : : //! Return initial density
129 : 0 : tk::real rho0() const { return m_rho0; }
130 : :
131 : : /** @name Charm++ pack/unpack serializer member functions */
132 : : ///@{
133 : : //! \brief Pack/Unpack serialize member function
134 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
135 : : void pup( PUP::er &p ) /*override*/ {
136 : : p | m_gamma;
137 : : p | m_pstiff;
138 : : p | m_cv;
139 : : p | m_mu;
140 : : p | m_rho0;
141 : : }
142 : : //! \brief Pack/Unpack serialize operator|
143 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
144 : : //! \param[in,out] i SmallShearSolid object reference
145 : : friend void operator|( PUP::er& p, SmallShearSolid& i ) { i.pup(p); }
146 : : //@}
147 : : };
148 : :
149 : : } //inciter::
150 : :
151 : : #endif // SmallShearSolid_h
|