www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowSingleComponentFluid Class Reference

General single component fluid material. More...

#include <PorousFlowSingleComponentFluid.h>

Inheritance diagram for PorousFlowSingleComponentFluid:
[legend]

Public Member Functions

 PorousFlowSingleComponentFluid (const InputParameters &parameters)
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 

Protected Attributes

const bool _compute_rho_mu
 If true, this Material will compute density and viscosity, and their derivatives. More...
 
const bool _compute_internal_energy
 If true, this Material will compute internal energy and its derivatives. More...
 
const bool _compute_enthalpy
 If true, this Material will compute enthalpy and its derivatives. More...
 
MaterialProperty< Real > *const _density
 Fluid phase density at the qps or nodes. More...
 
MaterialProperty< Real > *const _ddensity_dp
 Derivative of fluid density wrt phase pore pressure at the qps or nodes. More...
 
MaterialProperty< Real > *const _ddensity_dT
 Derivative of fluid density wrt temperature at the qps or nodes. More...
 
MaterialProperty< Real > *const _viscosity
 Fluid phase viscosity at the nodes. More...
 
MaterialProperty< Real > *const _dviscosity_dp
 Derivative of fluid phase viscosity wrt pressure at the nodes. More...
 
MaterialProperty< Real > *const _dviscosity_dT
 Derivative of fluid phase viscosity wrt temperature at the nodes. More...
 
MaterialProperty< Real > *const _internal_energy
 Fluid phase internal_energy at the qps or nodes. More...
 
MaterialProperty< Real > *const _dinternal_energy_dp
 Derivative of fluid internal_energy wrt phase pore pressure at the qps or nodes. More...
 
MaterialProperty< Real > *const _dinternal_energy_dT
 Derivative of fluid internal_energy wrt temperature at the qps or nodes. More...
 
MaterialProperty< Real > *const _enthalpy
 Fluid phase enthalpy at the qps or nodes. More...
 
MaterialProperty< Real > *const _denthalpy_dp
 Derivative of fluid enthalpy wrt phase pore pressure at the qps or nodes. More...
 
MaterialProperty< Real > *const _denthalpy_dT
 Derivative of fluid enthalpy wrt temperature at the qps or nodes. More...
 
const SinglePhaseFluidProperties_fp
 Fluid properties UserObject. More...
 
const MaterialProperty< std::vector< Real > > & _porepressure
 Pore pressure at the nodes or quadpoints. More...
 
const MaterialProperty< Real > & _temperature
 Fluid temperature at the nodes or quadpoints. More...
 
const Real _t_c2k
 Conversion from degrees Celsius to degrees Kelvin. More...
 
const Real _R
 Universal gas constant. More...
 
const unsigned int _phase_num
 Phase number of fluid. More...
 
const std::string _phase
 Stringified fluid phase number. More...
 

Detailed Description

General single component fluid material.

Provides quadpoint density, viscosity, internal energy, enthalpy and derivatives wrt pressure and temperature for a fluid defined in the FluidProperties module

Definition at line 26 of file PorousFlowSingleComponentFluid.h.

Constructor & Destructor Documentation

◆ PorousFlowSingleComponentFluid()

PorousFlowSingleComponentFluid::PorousFlowSingleComponentFluid ( const InputParameters &  parameters)

Definition at line 29 of file PorousFlowSingleComponentFluid.C.

30  : PorousFlowFluidPropertiesBase(parameters),
31  _compute_rho_mu(getParam<bool>("compute_density_and_viscosity")),
32  _compute_internal_energy(getParam<bool>("compute_internal_energy")),
33  _compute_enthalpy(getParam<bool>("compute_enthalpy")),
35  ? (_nodal_material
36  ? &declareProperty<Real>("PorousFlow_fluid_phase_density_nodal" + _phase)
37  : &declareProperty<Real>("PorousFlow_fluid_phase_density_qp" + _phase))
38  : nullptr),
41  ? (_nodal_material
42  ? &declarePropertyDerivative<Real>(
43  "PorousFlow_fluid_phase_density_nodal" + _phase, _pressure_variable_name)
44  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_density_qp" + _phase,
45  _pressure_variable_name))
46  : nullptr),
48  ? (_nodal_material ? &declarePropertyDerivative<Real>(
49  "PorousFlow_fluid_phase_density_nodal" + _phase,
50  _temperature_variable_name)
51  : &declarePropertyDerivative<Real>(
52  "PorousFlow_fluid_phase_density_qp" + _phase,
53  _temperature_variable_name))
54  : nullptr),
55 
57  ? (_nodal_material
58  ? &declareProperty<Real>("PorousFlow_viscosity_nodal" + _phase)
59  : &declareProperty<Real>("PorousFlow_viscosity_qp" + _phase))
60  : nullptr),
62  ? (_nodal_material
63  ? &declarePropertyDerivative<Real>(
64  "PorousFlow_viscosity_nodal" + _phase, _pressure_variable_name)
65  : &declarePropertyDerivative<Real>("PorousFlow_viscosity_qp" + _phase,
66  _pressure_variable_name))
67  : nullptr),
70  ? (_nodal_material
71  ? &declarePropertyDerivative<Real>("PorousFlow_viscosity_nodal" + _phase,
72  _temperature_variable_name)
73  : &declarePropertyDerivative<Real>("PorousFlow_viscosity_qp" + _phase,
74  _temperature_variable_name))
75  : nullptr),
76 
79  ? (_nodal_material
80  ? &declareProperty<Real>("PorousFlow_fluid_phase_internal_energy_nodal" + _phase)
81  : &declareProperty<Real>("PorousFlow_fluid_phase_internal_energy_qp" + _phase))
82  : nullptr),
84  ? (_nodal_material
85  ? &declarePropertyDerivative<Real>(
86  "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
87  _pressure_variable_name)
88  : &declarePropertyDerivative<Real>(
89  "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
90  _pressure_variable_name))
91  : nullptr),
93  ? (_nodal_material
94  ? &declarePropertyDerivative<Real>(
95  "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
96  _temperature_variable_name)
97  : &declarePropertyDerivative<Real>(
98  "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
99  _temperature_variable_name))
100  : nullptr),
101 
103  ? (_nodal_material
104  ? &declareProperty<Real>("PorousFlow_fluid_phase_enthalpy_nodal" + _phase)
105  : &declareProperty<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase))
106  : nullptr),
109  ? (_nodal_material
110  ? &declarePropertyDerivative<Real>(
111  "PorousFlow_fluid_phase_enthalpy_nodal" + _phase, _pressure_variable_name)
112  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase,
113  _pressure_variable_name))
114  : nullptr),
116  ? (_nodal_material ? &declarePropertyDerivative<Real>(
117  "PorousFlow_fluid_phase_enthalpy_nodal" + _phase,
118  _temperature_variable_name)
119  : &declarePropertyDerivative<Real>(
120  "PorousFlow_fluid_phase_enthalpy_qp" + _phase,
121  _temperature_variable_name))
122  : nullptr),
123 
124  _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
125 {
126 }
MaterialProperty< Real > *const _dinternal_energy_dT
Derivative of fluid internal_energy wrt temperature at the qps or nodes.
MaterialProperty< Real > *const _viscosity
Fluid phase viscosity at the nodes.
MaterialProperty< Real > *const _dinternal_energy_dp
Derivative of fluid internal_energy wrt phase pore pressure at the qps or nodes.
MaterialProperty< Real > *const _dviscosity_dp
Derivative of fluid phase viscosity wrt pressure at the nodes.
MaterialProperty< Real > *const _dviscosity_dT
Derivative of fluid phase viscosity wrt temperature at the nodes.
const bool _compute_rho_mu
If true, this Material will compute density and viscosity, and their derivatives. ...
const std::string _phase
Stringified fluid phase number.
MaterialProperty< Real > *const _ddensity_dp
Derivative of fluid density wrt phase pore pressure at the qps or nodes.
MaterialProperty< Real > *const _denthalpy_dT
Derivative of fluid enthalpy wrt temperature at the qps or nodes.
MaterialProperty< Real > *const _internal_energy
Fluid phase internal_energy at the qps or nodes.
MaterialProperty< Real > *const _denthalpy_dp
Derivative of fluid enthalpy wrt phase pore pressure at the qps or nodes.
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
PorousFlowFluidPropertiesBase(const InputParameters &parameters)
MaterialProperty< Real > *const _density
Fluid phase density at the qps or nodes.
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
MaterialProperty< Real > *const _ddensity_dT
Derivative of fluid density wrt temperature at the qps or nodes.
MaterialProperty< Real > *const _enthalpy
Fluid phase enthalpy at the qps or nodes.
const SinglePhaseFluidProperties & _fp
Fluid properties UserObject.

Member Function Documentation

◆ computeQpProperties()

void PorousFlowSingleComponentFluid::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowFluidPropertiesBase.

Definition at line 141 of file PorousFlowSingleComponentFluid.C.

142 {
143  const Real Tk = _temperature[_qp] + _t_c2k;
144 
145  if (_compute_rho_mu)
146  {
147  // Density and viscosity, and derivatives wrt pressure and temperature
148  Real rho, drho_dp, drho_dT, mu, dmu_dp, dmu_dT;
149  _fp.rho_mu_dpT(_porepressure[_qp][_phase_num], Tk, rho, drho_dp, drho_dT, mu, dmu_dp, dmu_dT);
150  (*_density)[_qp] = rho;
151  (*_ddensity_dp)[_qp] = drho_dp;
152  (*_ddensity_dT)[_qp] = drho_dT;
153  (*_viscosity)[_qp] = mu;
154  (*_dviscosity_dp)[_qp] = dmu_dp;
155  (*_dviscosity_dT)[_qp] = dmu_dT;
156  }
157 
158  // Internal energy and derivatives wrt pressure and temperature at the qps
160  {
161  Real e, de_dp, de_dT;
162  _fp.e_from_p_T(_porepressure[_qp][_phase_num], Tk, e, de_dp, de_dT);
163  (*_internal_energy)[_qp] = e;
164  (*_dinternal_energy_dp)[_qp] = de_dp;
165  (*_dinternal_energy_dT)[_qp] = de_dT;
166  }
167 
168  // Enthalpy and derivatives wrt pressure and temperature at the qps
169  if (_compute_enthalpy)
170  {
171  Real h, dh_dp, dh_dT;
172  _fp.h_from_p_T(_porepressure[_qp][_phase_num], Tk, h, dh_dp, dh_dT);
173  (*_enthalpy)[_qp] = h;
174  (*_denthalpy_dp)[_qp] = dh_dp;
175  (*_denthalpy_dT)[_qp] = dh_dT;
176  }
177 }
virtual void rho_mu_dpT(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &mu, Real &dmu_dp, Real &dmu_dT) const
Density and viscosity and their derivatives wrt pressure and temperature.
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
const unsigned int _phase_num
Phase number of fluid.
const bool _compute_rho_mu
If true, this Material will compute density and viscosity, and their derivatives. ...
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
virtual Real h_from_p_T(Real p, Real T) const
Specific enthalpy from pressure and temperature.
const MaterialProperty< Real > & _temperature
Fluid temperature at the nodes or quadpoints.
const Real _t_c2k
Conversion from degrees Celsius to degrees Kelvin.
const MaterialProperty< std::vector< Real > > & _porepressure
Pore pressure at the nodes or quadpoints.
const SinglePhaseFluidProperties & _fp
Fluid properties UserObject.

◆ initQpStatefulProperties()

void PorousFlowSingleComponentFluid::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 129 of file PorousFlowSingleComponentFluid.C.

130 {
131  if (_compute_rho_mu)
132  (*_density)[_qp] = _fp.rho_from_p_T(_porepressure[_qp][_phase_num], _temperature[_qp] + _t_c2k);
134  (*_internal_energy)[_qp] =
136  if (_compute_enthalpy)
137  (*_enthalpy)[_qp] = _fp.h_from_p_T(_porepressure[_qp][_phase_num], _temperature[_qp] + _t_c2k);
138 }
virtual Real e_from_p_T(Real p, Real T) const
Internal energy from pressure and temperature.
virtual Real rho_from_p_T(Real p, Real T) const
Density from pressure and temperature.
const unsigned int _phase_num
Phase number of fluid.
const bool _compute_rho_mu
If true, this Material will compute density and viscosity, and their derivatives. ...
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
virtual Real h_from_p_T(Real p, Real T) const
Specific enthalpy from pressure and temperature.
const MaterialProperty< Real > & _temperature
Fluid temperature at the nodes or quadpoints.
const Real _t_c2k
Conversion from degrees Celsius to degrees Kelvin.
const MaterialProperty< std::vector< Real > > & _porepressure
Pore pressure at the nodes or quadpoints.
const SinglePhaseFluidProperties & _fp
Fluid properties UserObject.

Member Data Documentation

◆ _compute_enthalpy

const bool PorousFlowSingleComponentFluid::_compute_enthalpy
protected

If true, this Material will compute enthalpy and its derivatives.

Definition at line 42 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _compute_internal_energy

const bool PorousFlowSingleComponentFluid::_compute_internal_energy
protected

If true, this Material will compute internal energy and its derivatives.

Definition at line 39 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _compute_rho_mu

const bool PorousFlowSingleComponentFluid::_compute_rho_mu
protected

If true, this Material will compute density and viscosity, and their derivatives.

Definition at line 36 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _ddensity_dp

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_ddensity_dp
protected

Derivative of fluid density wrt phase pore pressure at the qps or nodes.

Definition at line 48 of file PorousFlowSingleComponentFluid.h.

◆ _ddensity_dT

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_ddensity_dT
protected

Derivative of fluid density wrt temperature at the qps or nodes.

Definition at line 51 of file PorousFlowSingleComponentFluid.h.

◆ _density

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_density
protected

Fluid phase density at the qps or nodes.

Definition at line 45 of file PorousFlowSingleComponentFluid.h.

◆ _denthalpy_dp

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_denthalpy_dp
protected

Derivative of fluid enthalpy wrt phase pore pressure at the qps or nodes.

Definition at line 75 of file PorousFlowSingleComponentFluid.h.

◆ _denthalpy_dT

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_denthalpy_dT
protected

Derivative of fluid enthalpy wrt temperature at the qps or nodes.

Definition at line 78 of file PorousFlowSingleComponentFluid.h.

◆ _dinternal_energy_dp

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_dinternal_energy_dp
protected

Derivative of fluid internal_energy wrt phase pore pressure at the qps or nodes.

Definition at line 66 of file PorousFlowSingleComponentFluid.h.

◆ _dinternal_energy_dT

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_dinternal_energy_dT
protected

Derivative of fluid internal_energy wrt temperature at the qps or nodes.

Definition at line 69 of file PorousFlowSingleComponentFluid.h.

◆ _dviscosity_dp

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_dviscosity_dp
protected

Derivative of fluid phase viscosity wrt pressure at the nodes.

Definition at line 57 of file PorousFlowSingleComponentFluid.h.

◆ _dviscosity_dT

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_dviscosity_dT
protected

Derivative of fluid phase viscosity wrt temperature at the nodes.

Definition at line 60 of file PorousFlowSingleComponentFluid.h.

◆ _enthalpy

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_enthalpy
protected

Fluid phase enthalpy at the qps or nodes.

Definition at line 72 of file PorousFlowSingleComponentFluid.h.

◆ _fp

const SinglePhaseFluidProperties& PorousFlowSingleComponentFluid::_fp
protected

Fluid properties UserObject.

Definition at line 81 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _internal_energy

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_internal_energy
protected

Fluid phase internal_energy at the qps or nodes.

Definition at line 63 of file PorousFlowSingleComponentFluid.h.

◆ _phase

const std::string PorousFlowMaterialBase::_phase
protectedinherited

Stringified fluid phase number.

Definition at line 38 of file PorousFlowMaterialBase.h.

◆ _phase_num

const unsigned int PorousFlowMaterialBase::_phase_num
protectedinherited

◆ _porepressure

const MaterialProperty<std::vector<Real> >& PorousFlowFluidPropertiesBase::_porepressure
protectedinherited

◆ _R

const Real PorousFlowFluidPropertiesBase::_R
protectedinherited

Universal gas constant.

Definition at line 43 of file PorousFlowFluidPropertiesBase.h.

◆ _t_c2k

const Real PorousFlowFluidPropertiesBase::_t_c2k
protectedinherited

Conversion from degrees Celsius to degrees Kelvin.

Definition at line 40 of file PorousFlowFluidPropertiesBase.h.

Referenced by PorousFlowBrine::computeQpProperties(), computeQpProperties(), PorousFlowBrine::initQpStatefulProperties(), and initQpStatefulProperties().

◆ _temperature

const MaterialProperty<Real>& PorousFlowFluidPropertiesBase::_temperature
protectedinherited

◆ _viscosity

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_viscosity
protected

Fluid phase viscosity at the nodes.

Definition at line 54 of file PorousFlowSingleComponentFluid.h.


The documentation for this class was generated from the following files: