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 : 7850190 : 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_temp, 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_temp, 57 : : const std::vector< EOS >& mat_blk) const; 58 : : 59 : : //! Compute mixture pressure 60 : : tk::real pressure(tk::real mix_density, 61 : : tk::real mix_temp) const; 62 : : 63 : : //! Compute mixture temperature 64 : : tk::real temperature(tk::real mix_density, 65 : : tk::real u, 66 : : tk::real v, 67 : : tk::real w, 68 : : tk::real rhoE, 69 : : const std::vector< EOS >& mat_blk) const; 70 : : 71 : : /** @name Charm++ pack/unpack serializer member functions */ 72 : : ///@{ 73 : : //! \brief Pack/Unpack serialize member function 74 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference 75 : : void pup( PUP::er &p ) /*override*/ { 76 : : p | m_nspec; 77 : : p | m_mix_density; 78 : : p | m_mix_R; 79 : : p | m_Ys; 80 : : } 81 : : //! \brief Pack/Unpack serialize operator| 82 : : //! \param[in,out] p Charm++'s PUP::er serializer object reference 83 : : //! \param[in,out] i Mixture object reference 84 : : friend void operator|( PUP::er& p, Mixture& i ) { i.pup(p); } 85 : : //@} 86 : : 87 : : }; 88 : : 89 : : } //inciter:: 90 : : 91 : : #endif // Mixture_h