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 SinglePhaseFluidPropertiesPT_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 VariableName _pressure_variable_name
 Name of (dummy) pressure primary variable. More...
 
const VariableName _temperature_variable_name
 Name of (dummy) temperature primary variable. 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 24 of file PorousFlowSingleComponentFluid.h.

Constructor & Destructor Documentation

PorousFlowSingleComponentFluid::PorousFlowSingleComponentFluid ( const InputParameters &  parameters)

Definition at line 25 of file PorousFlowSingleComponentFluid.C.

26  : PorousFlowFluidPropertiesBase(parameters),
27  _compute_rho_mu(getParam<bool>("compute_density_and_viscosity")),
28  _compute_internal_energy(getParam<bool>("compute_internal_energy")),
29  _compute_enthalpy(getParam<bool>("compute_enthalpy")),
31  ? (_nodal_material
32  ? &declareProperty<Real>("PorousFlow_fluid_phase_density_nodal" + _phase)
33  : &declareProperty<Real>("PorousFlow_fluid_phase_density_qp" + _phase))
34  : nullptr),
37  ? (_nodal_material
38  ? &declarePropertyDerivative<Real>(
39  "PorousFlow_fluid_phase_density_nodal" + _phase, _pressure_variable_name)
40  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_density_qp" + _phase,
42  : nullptr),
45  ? (_nodal_material
46  ? &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_density_nodal" +
47  _phase,
49  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_density_qp" + _phase,
51  : nullptr),
52 
54  ? (_nodal_material
55  ? &declareProperty<Real>("PorousFlow_viscosity_nodal" + _phase)
56  : &declareProperty<Real>("PorousFlow_viscosity_qp" + _phase))
57  : nullptr),
59  ? (_nodal_material
60  ? &declarePropertyDerivative<Real>(
61  "PorousFlow_viscosity_nodal" + _phase, _pressure_variable_name)
62  : &declarePropertyDerivative<Real>("PorousFlow_viscosity_qp" + _phase,
64  : nullptr),
67  ? (_nodal_material
68  ? &declarePropertyDerivative<Real>("PorousFlow_viscosity_nodal" + _phase,
70  : &declarePropertyDerivative<Real>("PorousFlow_viscosity_qp" + _phase,
72  : nullptr),
73 
76  ? (_nodal_material
77  ? &declareProperty<Real>("PorousFlow_fluid_phase_internal_energy_nodal" + _phase)
78  : &declareProperty<Real>("PorousFlow_fluid_phase_internal_energy_qp" + _phase))
79  : nullptr),
81  ? (_nodal_material
82  ? &declarePropertyDerivative<Real>(
83  "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
85  : &declarePropertyDerivative<Real>(
86  "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
88  : nullptr),
90  ? (_nodal_material
91  ? &declarePropertyDerivative<Real>(
92  "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
94  : &declarePropertyDerivative<Real>(
95  "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
97  : nullptr),
98 
100  ? (_nodal_material
101  ? &declareProperty<Real>("PorousFlow_fluid_phase_enthalpy_nodal" + _phase)
102  : &declareProperty<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase))
103  : nullptr),
106  ? (_nodal_material
107  ? &declarePropertyDerivative<Real>(
108  "PorousFlow_fluid_phase_enthalpy_nodal" + _phase, _pressure_variable_name)
109  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase,
111  : nullptr),
114  ? (_nodal_material
115  ? &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_enthalpy_nodal" +
116  _phase,
118  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase,
120  : nullptr),
121 
122  _fp(getUserObject<SinglePhaseFluidPropertiesPT>("fp"))
123 {
124 }
const VariableName _temperature_variable_name
Name of (dummy) temperature primary variable.
const VariableName _pressure_variable_name
Name of (dummy) pressure primary variable.
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.
const SinglePhaseFluidPropertiesPT & _fp
Fluid properties UserObject.
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.

Member Function Documentation

void PorousFlowSingleComponentFluid::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowFluidPropertiesBase.

Definition at line 138 of file PorousFlowSingleComponentFluid.C.

139 {
140  const Real Tk = _temperature[_qp] + _t_c2k;
141 
142  if (_compute_rho_mu)
143  {
144  // Density and derivatives wrt pressure and temperature at the qps
145  Real rho, drho_dp, drho_dT;
146  _fp.rho_dpT(_porepressure[_qp][_phase_num], Tk, rho, drho_dp, drho_dT);
147  (*_density)[_qp] = rho;
148  (*_ddensity_dp)[_qp] = drho_dp;
149  (*_ddensity_dT)[_qp] = drho_dT;
150 
151  // Viscosity and derivatives wrt pressure and temperature at the nodes.
152  // Note that dmu_dp = dmu_drho * drho_dp
153  Real mu, dmu_drho, dmu_dT;
154  _fp.mu_drhoT_from_rho_T(rho, Tk, drho_dT, mu, dmu_drho, dmu_dT);
155  (*_viscosity)[_qp] = mu;
156  (*_dviscosity_dp)[_qp] = dmu_drho * drho_dp;
157  (*_dviscosity_dT)[_qp] = dmu_dT;
158  }
159 
160  // Internal energy and derivatives wrt pressure and temperature at the qps
162  {
163  Real e, de_dp, de_dT;
164  _fp.e_dpT(_porepressure[_qp][_phase_num], Tk, e, de_dp, de_dT);
165  (*_internal_energy)[_qp] = e;
166  (*_dinternal_energy_dp)[_qp] = de_dp;
167  (*_dinternal_energy_dT)[_qp] = de_dT;
168  }
169 
170  // Enthalpy and derivatives wrt pressure and temperature at the qps
171  if (_compute_enthalpy)
172  {
173  Real h, dh_dp, dh_dT;
174  _fp.h_dpT(_porepressure[_qp][_phase_num], Tk, h, dh_dp, dh_dT);
175  (*_enthalpy)[_qp] = h;
176  (*_denthalpy_dp)[_qp] = dh_dp;
177  (*_denthalpy_dT)[_qp] = dh_dT;
178  }
179 }
virtual void e_dpT(Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const =0
Internal energy and its derivatives wrt pressure and temperature.
virtual void rho_dpT(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const =0
Density and its derivatives wrt pressure and temperature.
virtual void h_dpT(Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const =0
Enthalpy and its derivatives wrt pressure and temperature.
const SinglePhaseFluidPropertiesPT & _fp
Fluid properties UserObject.
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. ...
virtual void mu_drhoT_from_rho_T(Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const =0
Dynamic viscosity and its derivatives wrt density and temperature.
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.
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.
void PorousFlowSingleComponentFluid::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 127 of file PorousFlowSingleComponentFluid.C.

128 {
129  if (_compute_rho_mu)
130  (*_density)[_qp] = _fp.rho(_porepressure[_qp][_phase_num], _temperature[_qp] + _t_c2k);
132  (*_internal_energy)[_qp] = _fp.e(_porepressure[_qp][_phase_num], _temperature[_qp] + _t_c2k);
133  if (_compute_enthalpy)
134  (*_enthalpy)[_qp] = _fp.h(_porepressure[_qp][_phase_num], _temperature[_qp] + _t_c2k);
135 }
const SinglePhaseFluidPropertiesPT & _fp
Fluid properties UserObject.
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. ...
virtual Real e(Real pressure, Real temperature) const =0
Internal energy.
virtual Real h(Real p, Real T) const =0
Specific enthalpy.
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
virtual Real rho(Real pressure, Real temperature) const =0
Density.
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
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.

Member Data Documentation

const bool PorousFlowSingleComponentFluid::_compute_enthalpy
protected

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

Definition at line 40 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

const bool PorousFlowSingleComponentFluid::_compute_internal_energy
protected

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

Definition at line 37 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

const bool PorousFlowSingleComponentFluid::_compute_rho_mu
protected

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

Definition at line 34 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_ddensity_dp
protected

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

Definition at line 46 of file PorousFlowSingleComponentFluid.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_ddensity_dT
protected

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

Definition at line 49 of file PorousFlowSingleComponentFluid.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_density
protected

Fluid phase density at the qps or nodes.

Definition at line 43 of file PorousFlowSingleComponentFluid.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_denthalpy_dp
protected

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

Definition at line 73 of file PorousFlowSingleComponentFluid.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_denthalpy_dT
protected

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

Definition at line 76 of file PorousFlowSingleComponentFluid.h.

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 64 of file PorousFlowSingleComponentFluid.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_dinternal_energy_dT
protected

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

Definition at line 67 of file PorousFlowSingleComponentFluid.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_dviscosity_dp
protected

Derivative of fluid phase viscosity wrt pressure at the nodes.

Definition at line 55 of file PorousFlowSingleComponentFluid.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_dviscosity_dT
protected

Derivative of fluid phase viscosity wrt temperature at the nodes.

Definition at line 58 of file PorousFlowSingleComponentFluid.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_enthalpy
protected

Fluid phase enthalpy at the qps or nodes.

Definition at line 70 of file PorousFlowSingleComponentFluid.h.

const SinglePhaseFluidPropertiesPT& PorousFlowSingleComponentFluid::_fp
protected

Fluid properties UserObject.

Definition at line 79 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_internal_energy
protected

Fluid phase internal_energy at the qps or nodes.

Definition at line 61 of file PorousFlowSingleComponentFluid.h.

const std::string PorousFlowMaterialBase::_phase
protectedinherited

Stringified fluid phase number.

Definition at line 36 of file PorousFlowMaterialBase.h.

const unsigned int PorousFlowMaterialBase::_phase_num
protectedinherited
const MaterialProperty<std::vector<Real> >& PorousFlowFluidPropertiesBase::_porepressure
protectedinherited
const VariableName PorousFlowFluidPropertiesBase::_pressure_variable_name
protectedinherited

Name of (dummy) pressure primary variable.

Definition at line 38 of file PorousFlowFluidPropertiesBase.h.

const Real PorousFlowFluidPropertiesBase::_R
protectedinherited

Universal gas constant.

Definition at line 47 of file PorousFlowFluidPropertiesBase.h.

const Real PorousFlowFluidPropertiesBase::_t_c2k
protectedinherited

Conversion from degrees Celsius to degrees Kelvin.

Definition at line 44 of file PorousFlowFluidPropertiesBase.h.

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

const MaterialProperty<Real>& PorousFlowFluidPropertiesBase::_temperature
protectedinherited
const VariableName PorousFlowFluidPropertiesBase::_temperature_variable_name
protectedinherited

Name of (dummy) temperature primary variable.

Definition at line 41 of file PorousFlowFluidPropertiesBase.h.

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_viscosity
protected

Fluid phase viscosity at the nodes.

Definition at line 52 of file PorousFlowSingleComponentFluid.h.


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