Branch data Line data Source code
1 : : // *****************************************************************************
2 : : /*!
3 : : \file src/PDE/MultiSpecies/Mixture.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 Multispecies mixture function
9 : : \details This file declares functions for computing mixture flow quantities
10 : : */
11 : : // *****************************************************************************
12 : : #ifndef Mixture_h
13 : : #define Mixture_h
14 : :
15 : : #include <vector>
16 : :
17 : : #include "Types.hpp"
18 : : #include "EoS/EOS.hpp"
19 : :
20 : : namespace inciter {
21 : :
22 : : class Mixture {
23 : :
24 : : private:
25 : : std::size_t m_nspec;
26 : : tk::real m_mix_density;
27 : : tk::real m_mix_R;
28 : : std::vector< tk::real > m_Ys;
29 : :
30 : : public:
31 : : //! Constructor based on state vector
32 : : Mixture(const std::size_t nspec,
33 : : const std::vector< tk::real >& ugp,
34 : : const std::vector< EOS >& mat_blk);
35 : :
36 : : //! Constructor based on mixture thermodynamics, mass fractions
37 : : Mixture(const std::size_t nspec,
38 : : const std::vector< tk::real >& Ys,
39 : : tk::real mix_pressure,
40 : : tk::real temperature,
41 : : const std::vector< EOS >& mat_blk);
42 : :
43 : : //! Return mixture density
44 : 3747894 : tk::real get_mix_density() { return m_mix_density; }
45 : :
46 : : //! Compute mixture frozen speed of sound.
47 : : tk::real frozen_soundspeed(tk::real mix_density,
48 : : tk::real mix_pressure,
49 : : const std::vector< EOS >& mat_blk) const;
50 : :
51 : : //! Compute mixture total energy
52 : : tk::real totalenergy(tk::real mix_density,
53 : : tk::real u,
54 : : tk::real v,
55 : : tk::real w,
56 : : tk::real mix_pressure,
57 : : const std::vector< EOS >& mat_blk) const;
58 : :
59 : : //! Compute mixture pressure
60 : : tk::real pressure(tk::real mix_density,
61 : : tk::real u,
62 : : tk::real v,
63 : : tk::real w,
64 : : tk::real rhoE,
65 : : const std::vector< EOS >& mat_blk) const;
66 : :
67 : : //! Compute mixture temperature
68 : : tk::real temperature(tk::real mix_density,
69 : : tk::real u,
70 : : tk::real v,
71 : : tk::real w,
72 : : tk::real rhoE,
73 : : const std::vector< EOS >& mat_blk) const;
74 : :
75 : : /** @name Charm++ pack/unpack serializer member functions */
76 : : ///@{
77 : : //! \brief Pack/Unpack serialize member function
78 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
79 : : void pup( PUP::er &p ) /*override*/ {
80 : : p | m_nspec;
81 : : p | m_mix_density;
82 : : p | m_mix_R;
83 : : p | m_Ys;
84 : : }
85 : : //! \brief Pack/Unpack serialize operator|
86 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference
87 : : //! \param[in,out] i Mixture object reference
88 : : friend void operator|( PUP::er& p, Mixture& i ) { i.pup(p); }
89 : : //@}
90 : :
91 : : };
92 : :
93 : : } //inciter::
94 : :
95 : : #endif // Mixture_h
|