https://mooseframework.inl.gov
IdealGasMixtureFluidProperties.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
13 #include "NaNInterface.h"
14 
17 
21 #define override_property(want, prop1, prop2) \
22  template <typename CppType> \
23  CppType want##_from_##prop1##_##prop2##_templ( \
24  const CppType & prop1, const CppType & prop2, const std::vector<CppType> & x) const; \
25  virtual Real want##_from_##prop1##_##prop2(Real prop1, Real prop2, const std::vector<Real> & x) \
26  const override; \
27  virtual ADReal want##_from_##prop1##_##prop2( \
28  const ADReal & prop1, const ADReal & prop2, const std::vector<ADReal> & x) const override
29 
34 {
35 public:
37 
39 
41 
42  virtual unsigned int numberOfComponents() const override { return _n_components; }
43 
44  virtual const SinglePhaseFluidProperties & getPrimaryFluidProperties() const override;
45  virtual const SinglePhaseFluidProperties &
46  getSecondaryFluidProperties(unsigned int i = 0) const override;
47 
53  template <typename CppType>
54  std::vector<CppType>
55  secondaryToAllMassFractions_templ(const std::vector<CppType> & x_secondary) const;
56  std::vector<ADReal> secondaryToAllMassFractions(const std::vector<ADReal> & x_secondary) const;
57  std::vector<Real> secondaryToAllMassFractions(const std::vector<Real> & x_secondary) const;
58 
64  template <typename CppType>
65  CppType mixtureSpecificHeatRatio_templ(const std::vector<CppType> & x) const;
66  ADReal mixtureSpecificHeatRatio(const std::vector<ADReal> & x) const;
67  Real mixtureSpecificHeatRatio(const std::vector<Real> & x) const;
68 
74  template <typename CppType>
75  CppType mixtureMolarMass_templ(const std::vector<CppType> & x) const;
76  ADReal mixtureMolarMass(const std::vector<ADReal> & x) const;
77  Real mixtureMolarMass(const std::vector<Real> & x) const;
78 
84  template <typename CppType>
85  std::vector<CppType> molarFractionsFromMassFractions_templ(const std::vector<CppType> & x) const;
86  std::vector<ADReal> molarFractionsFromMassFractions(const std::vector<ADReal> & x) const;
87  std::vector<Real> molarFractionsFromMassFractions(const std::vector<Real> & x) const;
88 
89  override_property(p, v, e);
90  override_property(T, v, e);
91  override_property(v, p, T);
92  override_property(rho, p, T);
93  override_property(e, p, T);
94  override_property(s, p, T);
95  override_property(c, p, T);
96  override_property(cp, p, T);
97  override_property(cv, p, T);
98  override_property(mu, p, T);
99  override_property(k, p, T);
100  override_property(e, p, rho);
101 
102 #undef override_property
103 
104 protected:
106  const std::vector<UserObjectName> _component_fp_names;
108  const unsigned int _n_components;
110  const unsigned int _n_secondary_components;
111 
113  std::vector<const IdealGasFluidProperties *> _component_fps;
114 };
Base class for fluid properties of vapor mixtures.
std::vector< ADReal > secondaryToAllMassFractions(const std::vector< ADReal > &x_secondary) const
static const std::string cv
Definition: NS.h:122
virtual unsigned int numberOfComponents() const override
Returns the number of components in the mixture.
const unsigned int _n_secondary_components
Number of secondary components.
virtual const SinglePhaseFluidProperties & getSecondaryFluidProperties(unsigned int i=0) const override
Gets a secondary component single-phase fluid properties.
DualNumber< Real, DNDerivativeType, true > ADReal
IdealGasMixtureFluidProperties(const InputParameters &parameters)
static const std::string cp
Definition: NS.h:121
const std::vector< double > x
std::vector< ADReal > molarFractionsFromMassFractions(const std::vector< ADReal > &x) const
virtual const SinglePhaseFluidProperties & getPrimaryFluidProperties() const override
Gets the primary component single-phase fluid properties.
static const std::string mu
Definition: NS.h:123
std::vector< CppType > secondaryToAllMassFractions_templ(const std::vector< CppType > &x_secondary) const
Computes all mass fractions.
Common class for single phase fluid properties.
std::vector< const IdealGasFluidProperties * > _component_fps
Component fluid properties objects.
static InputParameters validParams()
const std::vector< UserObjectName > _component_fp_names
Names of component fluid properties.
ADReal mixtureSpecificHeatRatio(const std::vector< ADReal > &x) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CppType mixtureSpecificHeatRatio_templ(const std::vector< CppType > &x) const
Computes the mixture specific heat ratio.
const InputParameters & parameters() const
Class for fluid properties of an ideal gas mixture.
ADReal mixtureMolarMass(const std::vector< ADReal > &x) const
Ideal gas fluid properties Default parameters are for air at atmospheric pressure and temperature...
const unsigned int _n_components
Number of components.
Interface class for producing errors, warnings, or just quiet NaNs.
Definition: NaNInterface.h:22
CppType mixtureMolarMass_templ(const std::vector< CppType > &x) const
Computes the mixture molar mass.
std::vector< CppType > molarFractionsFromMassFractions_templ(const std::vector< CppType > &x) const
Computes molar fractions.
static const std::string k
Definition: NS.h:130