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

Fluid properties of Brine. More...

#include <PorousFlowBrine.h>

Inheritance diagram for PorousFlowBrine:
[legend]

Public Member Functions

 PorousFlowBrine (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 or qps. More...
 
MaterialProperty< Real > *const _dviscosity_dp
 Derivative of fluid phase viscosity wrt pressure at the nodes or qps. More...
 
MaterialProperty< Real > *const _dviscosity_dT
 Derivative of fluid phase viscosity wrt temperature at the nodes or qps. 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 BrineFluidProperties_brine_fp
 Brine Fluid properties UserObject. More...
 
const SinglePhaseFluidProperties_water_fp
 Water Fluid properties UserObject. More...
 
const VariableValue & _xnacl
 NaCl mass fraction at the qps or nodes. 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

Fluid properties of Brine.

Provides density, viscosity, derivatives wrt pressure and temperature at the quadpoints or nodes

Definition at line 25 of file PorousFlowBrine.h.

Constructor & Destructor Documentation

◆ PorousFlowBrine()

PorousFlowBrine::PorousFlowBrine ( const InputParameters &  parameters)

Definition at line 29 of file PorousFlowBrine.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  _xnacl(_nodal_material ? coupledNodalValue("xnacl") : coupledValue("xnacl"))
125 {
126  // BrineFluidProperties UserObject
127  std::string brine_name = name() + ":brine";
128  {
129  std::string class_name = "BrineFluidProperties";
130  InputParameters params = _app.getFactory().getValidParams(class_name);
131  _fe_problem.addUserObject(class_name, brine_name, params);
132  }
133  _brine_fp = &_fe_problem.getUserObject<BrineFluidProperties>(brine_name);
134 
135  // Water properties UserObject
137 }
MaterialProperty< Real > *const _dviscosity_dp
Derivative of fluid phase viscosity wrt pressure at the nodes or qps.
MaterialProperty< Real > *const _denthalpy_dp
Derivative of fluid enthalpy wrt phase pore pressure at the qps or nodes.
MaterialProperty< Real > *const _dviscosity_dT
Derivative of fluid phase viscosity wrt temperature at the nodes or qps.
const BrineFluidProperties * _brine_fp
Brine Fluid properties UserObject.
MaterialProperty< Real > *const _ddensity_dp
Derivative of fluid density wrt phase pore pressure at the qps or nodes.
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fr...
MaterialProperty< Real > *const _denthalpy_dT
Derivative of fluid enthalpy wrt temperature at the qps or nodes.
MaterialProperty< Real > *const _viscosity
Fluid phase viscosity at the nodes or qps.
MaterialProperty< Real > *const _dinternal_energy_dT
Derivative of fluid internal_energy wrt temperature at the qps or nodes.
const SinglePhaseFluidProperties * _water_fp
Water Fluid properties UserObject.
virtual const SinglePhaseFluidProperties & getComponent(unsigned int component) const override
Get UserObject for specified component.
const std::string name
Definition: Setup.h:22
const std::string _phase
Stringified fluid phase number.
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.
MaterialProperty< Real > *const _internal_energy
Fluid phase internal_energy at the qps or nodes.
MaterialProperty< Real > *const _ddensity_dT
Derivative of fluid density wrt temperature at the qps or nodes.
PorousFlowFluidPropertiesBase(const InputParameters &parameters)
MaterialProperty< Real > *const _density
Fluid phase density at the qps or nodes.
MaterialProperty< Real > *const _dinternal_energy_dp
Derivative of fluid internal_energy wrt phase pore pressure at the qps or nodes.
const VariableValue & _xnacl
NaCl mass fraction at the qps or nodes.
MaterialProperty< Real > *const _enthalpy
Fluid phase enthalpy at the qps or nodes.
static const unsigned int WATER
Fluid component numbers for water and NaCl.

Member Function Documentation

◆ computeQpProperties()

void PorousFlowBrine::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowFluidPropertiesBase.

Definition at line 154 of file PorousFlowBrine.C.

155 {
156  const Real Tk = _temperature[_qp] + _t_c2k;
157 
158  if (_compute_rho_mu)
159  {
160  // Density and derivatives wrt pressure and temperature
161  Real rho, drho_dp, drho_dT, drho_dx;
163  _porepressure[_qp][_phase_num], Tk, _xnacl[_qp], rho, drho_dp, drho_dT, drho_dx);
164  (*_density)[_qp] = rho;
165  (*_ddensity_dp)[_qp] = drho_dp;
166  (*_ddensity_dT)[_qp] = drho_dT;
167 
168  // Viscosity and derivatives wrt pressure and temperature
169  Real mu, dmu_dp, dmu_dT, dmu_dx;
170  _brine_fp->mu_dpTx(_porepressure[_qp][_phase_num], Tk, _xnacl[_qp], mu, dmu_dp, dmu_dT, dmu_dx);
171  (*_viscosity)[_qp] = mu;
172  (*_dviscosity_dp)[_qp] = dmu_dp;
173  (*_dviscosity_dT)[_qp] = dmu_dT;
174  }
175 
176  // Internal energy and derivatives wrt pressure and temperature
178  {
179  Real e, de_dp, de_dT, de_dx;
180  _brine_fp->e_dpTx(_porepressure[_qp][_phase_num], Tk, _xnacl[_qp], e, de_dp, de_dT, de_dx);
181  (*_internal_energy)[_qp] = e;
182  (*_dinternal_energy_dp)[_qp] = de_dp;
183  (*_dinternal_energy_dT)[_qp] = de_dT;
184  }
185 
186  // Enthalpy and derivatives wrt pressure and temperature
187  if (_compute_enthalpy)
188  {
189  Real h, dh_dp, dh_dT, dh_dx;
190  _brine_fp->h_dpTx(_porepressure[_qp][_phase_num], Tk, _xnacl[_qp], h, dh_dp, dh_dT, dh_dx);
191  (*_enthalpy)[_qp] = h;
192  (*_denthalpy_dp)[_qp] = dh_dp;
193  (*_denthalpy_dT)[_qp] = dh_dT;
194  }
195 }
const BrineFluidProperties * _brine_fp
Brine Fluid properties UserObject.
virtual void rho_dpTx(Real pressure, Real temperature, Real xnacl, Real &rho, Real &drho_dp, Real &drho_dT, Real &drho_dx) const override
Density and its derivatives wrt pressure, temperature and mass fraction.
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
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 h_dpTx(Real pressure, Real temperature, Real xnacl, Real &h, Real &dh_dp, Real &dh_dT, Real &dh_dx) const override
Enthalpy and derivatives wrt pressure, temperature and mass fraction.
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
virtual void e_dpTx(Real pressure, Real temperature, Real xnacl, Real &e, Real &de_dp, Real &de_dT, Real &de_dx) const override
Internal energy and its derivatives wrt pressure, temperature and mass fraction.
virtual void mu_dpTx(Real pressure, Real temperature, Real xnacl, Real &mu, Real &dmu_dp, Real &dmu_dT, Real &dmu_dx) const override
const VariableValue & _xnacl
NaCl mass fraction at the qps or nodes.
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.

◆ initQpStatefulProperties()

void PorousFlowBrine::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 140 of file PorousFlowBrine.C.

141 {
142  if (_compute_rho_mu)
143  (*_density)[_qp] =
146  (*_internal_energy)[_qp] =
148  if (_compute_enthalpy)
149  (*_enthalpy)[_qp] =
151 }
virtual Real h(Real pressure, Real temperature, Real xnacl) const override
Enthalpy.
const BrineFluidProperties * _brine_fp
Brine Fluid properties UserObject.
virtual Real e(Real pressure, Real temperature, Real xnacl) const override
Internal energy.
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
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 VariableValue & _xnacl
NaCl mass fraction at the qps or nodes.
virtual Real rho(Real pressure, Real temperature, Real xnacl) const override
Density.
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

◆ _brine_fp

const BrineFluidProperties* PorousFlowBrine::_brine_fp
protected

Brine Fluid properties UserObject.

Definition at line 80 of file PorousFlowBrine.h.

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

◆ _compute_enthalpy

const bool PorousFlowBrine::_compute_enthalpy
protected

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

Definition at line 41 of file PorousFlowBrine.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _compute_internal_energy

const bool PorousFlowBrine::_compute_internal_energy
protected

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

Definition at line 38 of file PorousFlowBrine.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _compute_rho_mu

const bool PorousFlowBrine::_compute_rho_mu
protected

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

Definition at line 35 of file PorousFlowBrine.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _ddensity_dp

MaterialProperty<Real>* const PorousFlowBrine::_ddensity_dp
protected

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

Definition at line 47 of file PorousFlowBrine.h.

◆ _ddensity_dT

MaterialProperty<Real>* const PorousFlowBrine::_ddensity_dT
protected

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

Definition at line 50 of file PorousFlowBrine.h.

◆ _density

MaterialProperty<Real>* const PorousFlowBrine::_density
protected

Fluid phase density at the qps or nodes.

Definition at line 44 of file PorousFlowBrine.h.

◆ _denthalpy_dp

MaterialProperty<Real>* const PorousFlowBrine::_denthalpy_dp
protected

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

Definition at line 74 of file PorousFlowBrine.h.

◆ _denthalpy_dT

MaterialProperty<Real>* const PorousFlowBrine::_denthalpy_dT
protected

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

Definition at line 77 of file PorousFlowBrine.h.

◆ _dinternal_energy_dp

MaterialProperty<Real>* const PorousFlowBrine::_dinternal_energy_dp
protected

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

Definition at line 65 of file PorousFlowBrine.h.

◆ _dinternal_energy_dT

MaterialProperty<Real>* const PorousFlowBrine::_dinternal_energy_dT
protected

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

Definition at line 68 of file PorousFlowBrine.h.

◆ _dviscosity_dp

MaterialProperty<Real>* const PorousFlowBrine::_dviscosity_dp
protected

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

Definition at line 56 of file PorousFlowBrine.h.

◆ _dviscosity_dT

MaterialProperty<Real>* const PorousFlowBrine::_dviscosity_dT
protected

Derivative of fluid phase viscosity wrt temperature at the nodes or qps.

Definition at line 59 of file PorousFlowBrine.h.

◆ _enthalpy

MaterialProperty<Real>* const PorousFlowBrine::_enthalpy
protected

Fluid phase enthalpy at the qps or nodes.

Definition at line 71 of file PorousFlowBrine.h.

◆ _internal_energy

MaterialProperty<Real>* const PorousFlowBrine::_internal_energy
protected

Fluid phase internal_energy at the qps or nodes.

Definition at line 62 of file PorousFlowBrine.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

◆ _temperature

const MaterialProperty<Real>& PorousFlowFluidPropertiesBase::_temperature
protectedinherited

◆ _viscosity

MaterialProperty<Real>* const PorousFlowBrine::_viscosity
protected

Fluid phase viscosity at the nodes or qps.

Definition at line 53 of file PorousFlowBrine.h.

◆ _water_fp

const SinglePhaseFluidProperties* PorousFlowBrine::_water_fp
protected

Water Fluid properties UserObject.

Definition at line 83 of file PorousFlowBrine.h.

Referenced by PorousFlowBrine().

◆ _xnacl

const VariableValue& PorousFlowBrine::_xnacl
protected

NaCl mass fraction at the qps or nodes.

Definition at line 86 of file PorousFlowBrine.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().


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