www.mooseframework.org
FluidPropertiesMaterialPT.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Material>();
15  params.addRequiredCoupledVar("pressure", "Fluid pressure (Pa)");
16  params.addRequiredCoupledVar("temperature", "Fluid temperature (K)");
17  params.addRequiredParam<UserObjectName>("fp", "The name of the user object for fluid properties");
18  params.addClassDescription("Fluid properties using the (pressure, temperature) formulation");
19  return params;
20 }
21 
22 FluidPropertiesMaterialPT::FluidPropertiesMaterialPT(const InputParameters & parameters)
23  : Material(parameters),
24  _pressure(coupledValue("pressure")),
25  _temperature(coupledValue("temperature")),
26 
27  _rho(declareProperty<Real>("density")),
28  _mu(declareProperty<Real>("viscosity")),
29  _cp(declareProperty<Real>("cp")),
30  _cv(declareProperty<Real>("cv")),
31  _k(declareProperty<Real>("k")),
32  _h(declareProperty<Real>("h")),
33  _e(declareProperty<Real>("e")),
34  _s(declareProperty<Real>("s")),
35  _c(declareProperty<Real>("c")),
36 
37  _fp(getUserObject<SinglePhaseFluidPropertiesPT>("fp"))
38 {
39 }
40 
42 
43 void
45 {
46  _rho[_qp] = _fp.rho(_pressure[_qp], _temperature[_qp]);
47  _mu[_qp] = _fp.mu_from_rho_T(_rho[_qp], _temperature[_qp]);
48  _cp[_qp] = _fp.cp(_pressure[_qp], _temperature[_qp]);
49  _cv[_qp] = _fp.cv(_pressure[_qp], _temperature[_qp]);
50  _k[_qp] = _fp.k_from_rho_T(_rho[_qp], _temperature[_qp]);
51  _h[_qp] = _fp.h(_pressure[_qp], _temperature[_qp]);
52  _e[_qp] = _fp.e(_pressure[_qp], _temperature[_qp]);
53  _s[_qp] = _fp.s(_pressure[_qp], _temperature[_qp]);
54  _c[_qp] = _fp.c(_pressure[_qp], _temperature[_qp]);
55 }
MaterialProperty< Real > & _cp
Isobaric specific heat capacity (kJ/kg/K)
MaterialProperty< Real > & _c
Speed of sound (m/s)
virtual Real cp(Real pressure, Real temperature) const =0
Isobaric specific heat capacity.
const VariableValue & _pressure
Pressure (Pa)
virtual Real c(Real pressure, Real temperature) const =0
Speed of sound.
virtual Real mu_from_rho_T(Real density, Real temperature) const =0
MaterialProperty< Real > & _h
Specific enthalpy (kJ/kg)
const VariableValue & _temperature
Temperature (K)
InputParameters validParams< FluidPropertiesMaterialPT >()
Common class for single phase fluid properties using a pressure and temperature formulation.
const SinglePhaseFluidPropertiesPT & _fp
Fluid properties UserObject.
MaterialProperty< Real > & _e
Internal energy (kJ/kg)
virtual Real e(Real pressure, Real temperature) const =0
Internal energy.
MaterialProperty< Real > & _k
Thermal conductivity (W/m/K)
FluidPropertiesMaterialPT(const InputParameters &parameters)
MaterialProperty< Real > & _s
Specific entropy (kJ/kg/K)
virtual Real h(Real p, Real T) const =0
Specific enthalpy.
virtual Real cv(Real pressure, Real temperature) const =0
Isochoric specific heat.
virtual Real rho(Real pressure, Real temperature) const =0
Density.
virtual Real k_from_rho_T(Real density, Real temperature) const =0
Thermal conductivity as a function of density and temperature.
MaterialProperty< Real > & _mu
Viscosity (Pa.s)
MaterialProperty< Real > & _rho
Density (kg/m^3)
virtual Real s(Real pressure, Real temperature) const =0
Specific entropy.
MaterialProperty< Real > & _cv
Isochoric specific heat capacity (kJ/kg/K)