www.mooseframework.org
Public Member Functions | Protected Types | 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 Types

enum  PressureUnitEnum { PressureUnitEnum::Pa, PressureUnitEnum::MPa }
 Unit used for porepressure. More...
 
enum  TimeUnitEnum { TimeUnitEnum::seconds, TimeUnitEnum::hours, TimeUnitEnum::days, TimeUnitEnum::years }
 Unit used for time. More...
 

Protected Member Functions

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

Protected Attributes

enum PorousFlowSingleComponentFluid::PressureUnitEnum _p_unit
 
const Real _pressure_to_Pascals
 convert porepressure to Pascals by multiplying by this quantity More...
 
enum PorousFlowSingleComponentFluid::TimeUnitEnum _time_unit
 
const Real _time_to_seconds
 convert time to seconds by multiplying by this quantity More...
 
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 25 of file PorousFlowSingleComponentFluid.h.

Member Enumeration Documentation

◆ PressureUnitEnum

Unit used for porepressure.

Enumerator
Pa 
MPa 

Definition at line 35 of file PorousFlowSingleComponentFluid.h.

35 { Pa, MPa } _p_unit;

◆ TimeUnitEnum

Unit used for time.

Enumerator
seconds 
hours 
days 
years 

Definition at line 41 of file PorousFlowSingleComponentFluid.h.

41 { seconds, hours, days, years } _time_unit;

Constructor & Destructor Documentation

◆ PorousFlowSingleComponentFluid()

PorousFlowSingleComponentFluid::PorousFlowSingleComponentFluid ( const InputParameters &  parameters)

Definition at line 39 of file PorousFlowSingleComponentFluid.C.

40  : PorousFlowFluidPropertiesBase(parameters),
41  _p_unit(getParam<MooseEnum>("pressure_unit").getEnum<PressureUnitEnum>()),
43  _time_unit(getParam<MooseEnum>("time_unit").getEnum<TimeUnitEnum>()),
45  ? 1.0
47  ? 3600.0
48  : _time_unit == TimeUnitEnum::days ? 3600.0 * 24
49  : 3600 * 24 * 365.25),
50  _compute_rho_mu(getParam<bool>("compute_density_and_viscosity")),
51  _compute_internal_energy(getParam<bool>("compute_internal_energy")),
52  _compute_enthalpy(getParam<bool>("compute_enthalpy")),
54  ? (_nodal_material
55  ? &declareProperty<Real>("PorousFlow_fluid_phase_density_nodal" + _phase)
56  : &declareProperty<Real>("PorousFlow_fluid_phase_density_qp" + _phase))
57  : nullptr),
60  ? (_nodal_material
61  ? &declarePropertyDerivative<Real>(
62  "PorousFlow_fluid_phase_density_nodal" + _phase, _pressure_variable_name)
63  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_density_qp" + _phase,
64  _pressure_variable_name))
65  : nullptr),
67  ? (_nodal_material ? &declarePropertyDerivative<Real>(
68  "PorousFlow_fluid_phase_density_nodal" + _phase,
69  _temperature_variable_name)
70  : &declarePropertyDerivative<Real>(
71  "PorousFlow_fluid_phase_density_qp" + _phase,
72  _temperature_variable_name))
73  : nullptr),
74 
76  ? (_nodal_material
77  ? &declareProperty<Real>("PorousFlow_viscosity_nodal" + _phase)
78  : &declareProperty<Real>("PorousFlow_viscosity_qp" + _phase))
79  : nullptr),
81  ? (_nodal_material
82  ? &declarePropertyDerivative<Real>(
83  "PorousFlow_viscosity_nodal" + _phase, _pressure_variable_name)
84  : &declarePropertyDerivative<Real>("PorousFlow_viscosity_qp" + _phase,
85  _pressure_variable_name))
86  : nullptr),
89  ? (_nodal_material
90  ? &declarePropertyDerivative<Real>("PorousFlow_viscosity_nodal" + _phase,
91  _temperature_variable_name)
92  : &declarePropertyDerivative<Real>("PorousFlow_viscosity_qp" + _phase,
93  _temperature_variable_name))
94  : nullptr),
95 
98  ? (_nodal_material
99  ? &declareProperty<Real>("PorousFlow_fluid_phase_internal_energy_nodal" + _phase)
100  : &declareProperty<Real>("PorousFlow_fluid_phase_internal_energy_qp" + _phase))
101  : nullptr),
103  ? (_nodal_material
104  ? &declarePropertyDerivative<Real>(
105  "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
106  _pressure_variable_name)
107  : &declarePropertyDerivative<Real>(
108  "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
109  _pressure_variable_name))
110  : nullptr),
112  ? (_nodal_material
113  ? &declarePropertyDerivative<Real>(
114  "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
115  _temperature_variable_name)
116  : &declarePropertyDerivative<Real>(
117  "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
118  _temperature_variable_name))
119  : nullptr),
120 
122  ? (_nodal_material
123  ? &declareProperty<Real>("PorousFlow_fluid_phase_enthalpy_nodal" + _phase)
124  : &declareProperty<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase))
125  : nullptr),
128  ? (_nodal_material
129  ? &declarePropertyDerivative<Real>(
130  "PorousFlow_fluid_phase_enthalpy_nodal" + _phase, _pressure_variable_name)
131  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase,
132  _pressure_variable_name))
133  : nullptr),
135  ? (_nodal_material ? &declarePropertyDerivative<Real>(
136  "PorousFlow_fluid_phase_enthalpy_nodal" + _phase,
137  _temperature_variable_name)
138  : &declarePropertyDerivative<Real>(
139  "PorousFlow_fluid_phase_enthalpy_qp" + _phase,
140  _temperature_variable_name))
141  : nullptr),
142 
143  _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
144 {
145 }

Member Function Documentation

◆ computeQpProperties()

void PorousFlowSingleComponentFluid::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowFluidPropertiesBase.

Definition at line 162 of file PorousFlowSingleComponentFluid.C.

163 {
164  const Real Tk = _temperature[_qp] + _t_c2k;
165 
166  if (_compute_rho_mu)
167  {
168  // Density and viscosity, and derivatives wrt pressure and temperature
169  Real rho, drho_dp, drho_dT, mu, dmu_dp, dmu_dT;
171  Tk,
172  rho,
173  drho_dp,
174  drho_dT,
175  mu,
176  dmu_dp,
177  dmu_dT);
178  (*_density)[_qp] = rho;
179  (*_ddensity_dp)[_qp] = drho_dp * _pressure_to_Pascals;
180  (*_ddensity_dT)[_qp] = drho_dT;
181  (*_viscosity)[_qp] = mu / _pressure_to_Pascals / _time_to_seconds;
182  (*_dviscosity_dp)[_qp] = dmu_dp / _time_to_seconds;
183  (*_dviscosity_dT)[_qp] = dmu_dT / _pressure_to_Pascals / _time_to_seconds;
184  }
185 
186  // Internal energy and derivatives wrt pressure and temperature at the qps
188  {
189  Real e, de_dp, de_dT;
190  _fp.e_from_p_T(_porepressure[_qp][_phase_num] * _pressure_to_Pascals, Tk, e, de_dp, de_dT);
191  (*_internal_energy)[_qp] = e;
192  (*_dinternal_energy_dp)[_qp] = de_dp * _pressure_to_Pascals;
193  (*_dinternal_energy_dT)[_qp] = de_dT;
194  }
195 
196  // Enthalpy and derivatives wrt pressure and temperature at the qps
197  if (_compute_enthalpy)
198  {
199  Real h, dh_dp, dh_dT;
200  _fp.h_from_p_T(_porepressure[_qp][_phase_num] * _pressure_to_Pascals, Tk, h, dh_dp, dh_dT);
201  (*_enthalpy)[_qp] = h;
202  (*_denthalpy_dp)[_qp] = dh_dp * _pressure_to_Pascals;
203  (*_denthalpy_dT)[_qp] = dh_dT;
204  }
205 }

◆ initQpStatefulProperties()

void PorousFlowSingleComponentFluid::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 148 of file PorousFlowSingleComponentFluid.C.

149 {
150  if (_compute_rho_mu)
151  (*_density)[_qp] = _fp.rho_from_p_T(_porepressure[_qp][_phase_num] * _pressure_to_Pascals,
152  _temperature[_qp] + _t_c2k);
154  (*_internal_energy)[_qp] = _fp.e_from_p_T(_porepressure[_qp][_phase_num] * _pressure_to_Pascals,
155  _temperature[_qp] + _t_c2k);
156  if (_compute_enthalpy)
157  (*_enthalpy)[_qp] = _fp.h_from_p_T(_porepressure[_qp][_phase_num] * _pressure_to_Pascals,
158  _temperature[_qp] + _t_c2k);
159 }

Member Data Documentation

◆ _compute_enthalpy

const bool PorousFlowSingleComponentFluid::_compute_enthalpy
protected

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

Definition at line 53 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 50 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 47 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 59 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 62 of file PorousFlowSingleComponentFluid.h.

◆ _density

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_density
protected

Fluid phase density at the qps or nodes.

Definition at line 56 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 86 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 89 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 77 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 80 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 68 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 71 of file PorousFlowSingleComponentFluid.h.

◆ _enthalpy

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_enthalpy
protected

Fluid phase enthalpy at the qps or nodes.

Definition at line 83 of file PorousFlowSingleComponentFluid.h.

◆ _fp

const SinglePhaseFluidProperties& PorousFlowSingleComponentFluid::_fp
protected

Fluid properties UserObject.

Definition at line 92 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 74 of file PorousFlowSingleComponentFluid.h.

◆ _p_unit

enum PorousFlowSingleComponentFluid::PressureUnitEnum PorousFlowSingleComponentFluid::_p_unit
protected

◆ _phase

const std::string PorousFlowMaterialBase::_phase
protectedinherited

Stringified fluid phase number.

Definition at line 37 of file PorousFlowMaterialBase.h.

◆ _phase_num

const unsigned int PorousFlowMaterialBase::_phase_num
protectedinherited

◆ _porepressure

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

◆ _pressure_to_Pascals

const Real PorousFlowSingleComponentFluid::_pressure_to_Pascals
protected

convert porepressure to Pascals by multiplying by this quantity

Definition at line 38 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _R

const Real PorousFlowFluidPropertiesBase::_R
protectedinherited

Universal gas constant.

Definition at line 42 of file PorousFlowFluidPropertiesBase.h.

◆ _t_c2k

const Real PorousFlowFluidPropertiesBase::_t_c2k
protectedinherited

Conversion from degrees Celsius to degrees Kelvin.

Definition at line 39 of file PorousFlowFluidPropertiesBase.h.

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

◆ _temperature

const MaterialProperty<Real>& PorousFlowFluidPropertiesBase::_temperature
protectedinherited

◆ _time_to_seconds

const Real PorousFlowSingleComponentFluid::_time_to_seconds
protected

convert time to seconds by multiplying by this quantity

Definition at line 44 of file PorousFlowSingleComponentFluid.h.

Referenced by computeQpProperties().

◆ _time_unit

enum PorousFlowSingleComponentFluid::TimeUnitEnum PorousFlowSingleComponentFluid::_time_unit
protected

◆ _viscosity

MaterialProperty<Real>* const PorousFlowSingleComponentFluid::_viscosity
protected

Fluid phase viscosity at the nodes.

Definition at line 65 of file PorousFlowSingleComponentFluid.h.


The documentation for this class was generated from the following files:
PorousFlowSingleComponentFluid::_internal_energy
MaterialProperty< Real > *const _internal_energy
Fluid phase internal_energy at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:74
SinglePhaseFluidProperties::rho_mu_from_p_T
virtual void rho_mu_from_p_T(Real p, Real T, Real &rho, Real &mu) const
Combined methods.
Definition: SinglePhaseFluidProperties.C:256
PorousFlowSingleComponentFluid::TimeUnitEnum::days
PorousFlowFluidPropertiesBase::_t_c2k
const Real _t_c2k
Conversion from degrees Celsius to degrees Kelvin.
Definition: PorousFlowFluidPropertiesBase.h:39
PorousFlowFluidPropertiesBase::_porepressure
const MaterialProperty< std::vector< Real > > & _porepressure
Pore pressure at the nodes or quadpoints.
Definition: PorousFlowFluidPropertiesBase.h:33
PorousFlowSingleComponentFluid::_time_to_seconds
const Real _time_to_seconds
convert time to seconds by multiplying by this quantity
Definition: PorousFlowSingleComponentFluid.h:44
PorousFlowSingleComponentFluid::_dviscosity_dT
MaterialProperty< Real > *const _dviscosity_dT
Derivative of fluid phase viscosity wrt temperature at the nodes.
Definition: PorousFlowSingleComponentFluid.h:71
PorousFlowSingleComponentFluid::_compute_internal_energy
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
Definition: PorousFlowSingleComponentFluid.h:50
PorousFlowSingleComponentFluid::_p_unit
enum PorousFlowSingleComponentFluid::PressureUnitEnum _p_unit
PorousFlowSingleComponentFluid::_enthalpy
MaterialProperty< Real > *const _enthalpy
Fluid phase enthalpy at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:83
PorousFlowSingleComponentFluid::_ddensity_dp
MaterialProperty< Real > *const _ddensity_dp
Derivative of fluid density wrt phase pore pressure at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:59
PorousFlowSingleComponentFluid::TimeUnitEnum::seconds
PorousFlowSingleComponentFluid::_dinternal_energy_dT
MaterialProperty< Real > *const _dinternal_energy_dT
Derivative of fluid internal_energy wrt temperature at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:80
PorousFlowSingleComponentFluid::_ddensity_dT
MaterialProperty< Real > *const _ddensity_dT
Derivative of fluid density wrt temperature at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:62
PorousFlowSingleComponentFluid::_denthalpy_dp
MaterialProperty< Real > *const _denthalpy_dp
Derivative of fluid enthalpy wrt phase pore pressure at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:86
PorousFlowSingleComponentFluid::_dinternal_energy_dp
MaterialProperty< Real > *const _dinternal_energy_dp
Derivative of fluid internal_energy wrt phase pore pressure at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:77
PorousFlowSingleComponentFluid::_compute_enthalpy
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
Definition: PorousFlowSingleComponentFluid.h:53
PorousFlowSingleComponentFluid::_pressure_to_Pascals
const Real _pressure_to_Pascals
convert porepressure to Pascals by multiplying by this quantity
Definition: PorousFlowSingleComponentFluid.h:38
PorousFlowSingleComponentFluid::TimeUnitEnum::hours
PorousFlowSingleComponentFluid::_fp
const SinglePhaseFluidProperties & _fp
Fluid properties UserObject.
Definition: PorousFlowSingleComponentFluid.h:92
PorousFlowFluidPropertiesBase::_temperature
const MaterialProperty< Real > & _temperature
Fluid temperature at the nodes or quadpoints.
Definition: PorousFlowFluidPropertiesBase.h:36
PorousFlowMaterialBase::_phase
const std::string _phase
Stringified fluid phase number.
Definition: PorousFlowMaterialBase.h:37
PorousFlowSingleComponentFluid::_viscosity
MaterialProperty< Real > *const _viscosity
Fluid phase viscosity at the nodes.
Definition: PorousFlowSingleComponentFluid.h:65
PorousFlowMaterialBase::_phase_num
const unsigned int _phase_num
Phase number of fluid.
Definition: PorousFlowMaterialBase.h:34
PorousFlowSingleComponentFluid::_time_unit
enum PorousFlowSingleComponentFluid::TimeUnitEnum _time_unit
PorousFlowSingleComponentFluid::_dviscosity_dp
MaterialProperty< Real > *const _dviscosity_dp
Derivative of fluid phase viscosity wrt pressure at the nodes.
Definition: PorousFlowSingleComponentFluid.h:68
PorousFlowFluidPropertiesBase::PorousFlowFluidPropertiesBase
PorousFlowFluidPropertiesBase(const InputParameters &parameters)
Definition: PorousFlowFluidPropertiesBase.C:25
PorousFlowSingleComponentFluid::_density
MaterialProperty< Real > *const _density
Fluid phase density at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:56
PorousFlowSingleComponentFluid::_compute_rho_mu
const bool _compute_rho_mu
If true, this Material will compute density and viscosity, and their derivatives.
Definition: PorousFlowSingleComponentFluid.h:47
PorousFlowSingleComponentFluid::_denthalpy_dT
MaterialProperty< Real > *const _denthalpy_dT
Derivative of fluid enthalpy wrt temperature at the qps or nodes.
Definition: PorousFlowSingleComponentFluid.h:89
PorousFlowSingleComponentFluid::PressureUnitEnum::Pa