www.mooseframework.org
MultiComponentFluidPropertiesMaterialPT.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
11 
13 
16 {
18  params.addRequiredCoupledVar("pressure", "pressure (Pa)");
19  params.addRequiredCoupledVar("temperature", "temperature (K)");
20  params.addRequiredCoupledVar("xmass", "Solute mass fraction (-)");
21  params.addRequiredParam<UserObjectName>("fp", "The name of the user object for fluid properties");
22  params.addClassDescription(
23  "Fluid properties of a multicomponent fluid using the (pressure, temperature) formulation");
24  return params;
25 }
26 
28  const InputParameters & parameters)
29  : Material(parameters),
30  _pressure(coupledValue("pressure")),
31  _temperature(coupledValue("temperature")),
32  _xmass(coupledValue("xmass")),
33 
34  _rho(declareProperty<Real>("density")),
35  _h(declareProperty<Real>("enthalpy")),
36  _cp(declareProperty<Real>("cp")),
37  _e(declareProperty<Real>("e")),
38 
39  _fp(getUserObject<MultiComponentFluidProperties>("fp"))
40 {
41 }
42 
44 
45 void
47 {
48  _rho[_qp] = _fp.rho_from_p_T_X(_pressure[_qp], _temperature[_qp], _xmass[_qp]);
49  _h[_qp] = _fp.h_from_p_T_X(_pressure[_qp], _temperature[_qp], _xmass[_qp]);
50  _cp[_qp] = _fp.cp_from_p_T_X(_pressure[_qp], _temperature[_qp], _xmass[_qp]);
51  _e[_qp] = _fp.e_from_p_T_X(_pressure[_qp], _temperature[_qp], _xmass[_qp]);
52 }
registerMooseObject("FluidPropertiesTestApp", MultiComponentFluidPropertiesMaterialPT)
const VariableValue & _xmass
Mass fraction of solute (-)
MultiComponentFluidPropertiesMaterialPT(const InputParameters &parameters)
MaterialProperty< Real > & _rho
Density (kg/m^3)
MaterialProperty< Real > & _h
Enthalpy (kJ/kg)
Material for calculating fluid properties for a fluid comprised of two components: the solute (eg...
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
Common class for multiple component fluid properties using a pressure and temperature formulation...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
MaterialProperty< Real > & _e
Internal energy (kJ/kg)
MaterialProperty< Real > & _cp
Isobaric heat capacity (kJ/kg/K)