https://mooseframework.inl.gov
FluidPropertiesGasMixMaterial.C
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 
12 #include "THMNames.h"
13 
14 registerMooseObject("ThermalHydraulicsApp", FluidPropertiesGasMixMaterial);
15 
18 {
20 
21  params.addRequiredCoupledVar("xirhoA", "xi*rho*A variable");
22  params.addRequiredCoupledVar("rhoA", "rho*A variable");
23  params.addRequiredCoupledVar("rhouA", "rho*u*A variable");
24  params.addRequiredCoupledVar("rhoEA", "rho*E*A variable");
25  params.addRequiredCoupledVar("area", "Cross-sectional area variable");
26 
27  params.addRequiredParam<UserObjectName>("fluid_properties",
28  "The VaporMixtureFluidProperties object");
29 
30  params.addClassDescription("Computes various fluid properties for FlowModelGasMix.");
31 
32  return params;
33 }
34 
36  : Material(parameters),
37 
38  _A(adCoupledValue("area")),
39  _xirhoA(adCoupledValue("xirhoA")),
40  _rhoA(adCoupledValue("rhoA")),
41  _rhouA(adCoupledValue("rhouA")),
42  _rhoEA(adCoupledValue("rhoEA")),
43 
44  _xi(declareADProperty<Real>(THM::MASS_FRACTION)),
45  _rho(declareADProperty<Real>(THM::DENSITY)),
46  _v(declareADProperty<Real>(THM::SPECIFIC_VOLUME)),
47  _vel(declareADProperty<Real>(THM::VELOCITY)),
48  _e(declareADProperty<Real>(THM::SPECIFIC_INTERNAL_ENERGY)),
49  _p(declareADProperty<Real>(THM::PRESSURE)),
50  _T(declareADProperty<Real>(THM::TEMPERATURE)),
51  _h(declareADProperty<Real>(THM::SPECIFIC_ENTHALPY)),
52  _H(declareADProperty<Real>(THM::SPECIFIC_TOTAL_ENTHALPY)),
53  _c(declareADProperty<Real>(THM::SOUND_SPEED)),
54  _cp(declareADProperty<Real>(THM::SPECIFIC_HEAT_CONSTANT_PRESSURE)),
55  _cv(declareADProperty<Real>(THM::SPECIFIC_HEAT_CONSTANT_VOLUME)),
56  _k(declareADProperty<Real>(THM::THERMAL_CONDUCTIVITY)),
57  _mu(declareADProperty<Real>(THM::DYNAMIC_VISCOSITY)),
58 
59  _fp(getUserObject<VaporMixtureFluidProperties>("fluid_properties"))
60 {
61 }
62 
63 void
65 {
66  _xi[_qp] = _xirhoA[_qp] / _rhoA[_qp];
67  _rho[_qp] = _rhoA[_qp] / _A[_qp];
68  _v[_qp] = 1.0 / _rho[_qp];
69  _vel[_qp] = _rhouA[_qp] / _rhoA[_qp];
70  _e[_qp] = (_rhoEA[_qp] - 0.5 * _rhouA[_qp] * _rhouA[_qp] / _rhoA[_qp]) / _rhoA[_qp];
71  _p[_qp] = _fp.p_from_v_e(_v[_qp], _e[_qp], {_xi[_qp]});
72  _T[_qp] = _fp.T_from_v_e(_v[_qp], _e[_qp], {_xi[_qp]});
73  _h[_qp] = _e[_qp] + _p[_qp] / _rho[_qp];
74  _H[_qp] = _h[_qp] + 0.5 * _vel[_qp] * _vel[_qp];
75  _c[_qp] = _fp.c_from_p_T(_p[_qp], _T[_qp], {_xi[_qp]});
76  _cp[_qp] = _fp.cp_from_p_T(_p[_qp], _T[_qp], {_xi[_qp]});
77  _cv[_qp] = _fp.cv_from_p_T(_p[_qp], _T[_qp], {_xi[_qp]});
78  _k[_qp] = _fp.k_from_p_T(_p[_qp], _T[_qp], {_xi[_qp]});
79  _mu[_qp] = _fp.mu_from_p_T(_p[_qp], _T[_qp], {_xi[_qp]});
80 }
Base class for fluid properties of vapor mixtures.
static const std::string SPECIFIC_HEAT_CONSTANT_PRESSURE
Definition: THMNames.h:34
static const std::string SPECIFIC_ENTHALPY
Definition: THMNames.h:33
static const std::string SPECIFIC_INTERNAL_ENERGY
Definition: THMNames.h:36
static const std::string THERMAL_CONDUCTIVITY
Definition: THMNames.h:41
registerMooseObject("ThermalHydraulicsApp", FluidPropertiesGasMixMaterial)
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
const VaporMixtureFluidProperties & _fp
static const std::string SPECIFIC_VOLUME
Definition: THMNames.h:38
static const std::string SOUND_SPEED
Definition: THMNames.h:32
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
FluidPropertiesGasMixMaterial(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Computes various fluid properties for FlowModelGasMix.
void addClassDescription(const std::string &doc_string)
static const std::string SPECIFIC_HEAT_CONSTANT_VOLUME
Definition: THMNames.h:35
static const std::string SPECIFIC_TOTAL_ENTHALPY
Definition: THMNames.h:37
static const std::string DYNAMIC_VISCOSITY
Definition: THMNames.h:18
static const std::string DENSITY
Definition: THMNames.h:16