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 24 of file PorousFlowBrine.h.

Constructor & Destructor Documentation

◆ PorousFlowBrine()

PorousFlowBrine::PorousFlowBrine ( const InputParameters &  parameters)

Definition at line 31 of file PorousFlowBrine.C.

32  : PorousFlowFluidPropertiesBase(parameters),
33  _compute_rho_mu(getParam<bool>("compute_density_and_viscosity")),
34  _compute_internal_energy(getParam<bool>("compute_internal_energy")),
35  _compute_enthalpy(getParam<bool>("compute_enthalpy")),
37  ? (_nodal_material
38  ? &declareProperty<Real>("PorousFlow_fluid_phase_density_nodal" + _phase)
39  : &declareProperty<Real>("PorousFlow_fluid_phase_density_qp" + _phase))
40  : nullptr),
43  ? (_nodal_material
44  ? &declarePropertyDerivative<Real>(
45  "PorousFlow_fluid_phase_density_nodal" + _phase, _pressure_variable_name)
46  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_density_qp" + _phase,
47  _pressure_variable_name))
48  : nullptr),
50  ? (_nodal_material ? &declarePropertyDerivative<Real>(
51  "PorousFlow_fluid_phase_density_nodal" + _phase,
52  _temperature_variable_name)
53  : &declarePropertyDerivative<Real>(
54  "PorousFlow_fluid_phase_density_qp" + _phase,
55  _temperature_variable_name))
56  : nullptr),
57 
59  ? (_nodal_material
60  ? &declareProperty<Real>("PorousFlow_viscosity_nodal" + _phase)
61  : &declareProperty<Real>("PorousFlow_viscosity_qp" + _phase))
62  : nullptr),
64  ? (_nodal_material
65  ? &declarePropertyDerivative<Real>(
66  "PorousFlow_viscosity_nodal" + _phase, _pressure_variable_name)
67  : &declarePropertyDerivative<Real>("PorousFlow_viscosity_qp" + _phase,
68  _pressure_variable_name))
69  : nullptr),
72  ? (_nodal_material
73  ? &declarePropertyDerivative<Real>("PorousFlow_viscosity_nodal" + _phase,
74  _temperature_variable_name)
75  : &declarePropertyDerivative<Real>("PorousFlow_viscosity_qp" + _phase,
76  _temperature_variable_name))
77  : nullptr),
78 
81  ? (_nodal_material
82  ? &declareProperty<Real>("PorousFlow_fluid_phase_internal_energy_nodal" + _phase)
83  : &declareProperty<Real>("PorousFlow_fluid_phase_internal_energy_qp" + _phase))
84  : nullptr),
86  ? (_nodal_material
87  ? &declarePropertyDerivative<Real>(
88  "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
89  _pressure_variable_name)
90  : &declarePropertyDerivative<Real>(
91  "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
92  _pressure_variable_name))
93  : nullptr),
95  ? (_nodal_material
96  ? &declarePropertyDerivative<Real>(
97  "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
98  _temperature_variable_name)
99  : &declarePropertyDerivative<Real>(
100  "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
101  _temperature_variable_name))
102  : nullptr),
103 
105  ? (_nodal_material
106  ? &declareProperty<Real>("PorousFlow_fluid_phase_enthalpy_nodal" + _phase)
107  : &declareProperty<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase))
108  : nullptr),
111  ? (_nodal_material
112  ? &declarePropertyDerivative<Real>(
113  "PorousFlow_fluid_phase_enthalpy_nodal" + _phase, _pressure_variable_name)
114  : &declarePropertyDerivative<Real>("PorousFlow_fluid_phase_enthalpy_qp" + _phase,
115  _pressure_variable_name))
116  : nullptr),
118  ? (_nodal_material ? &declarePropertyDerivative<Real>(
119  "PorousFlow_fluid_phase_enthalpy_nodal" + _phase,
120  _temperature_variable_name)
121  : &declarePropertyDerivative<Real>(
122  "PorousFlow_fluid_phase_enthalpy_qp" + _phase,
123  _temperature_variable_name))
124  : nullptr),
125 
126  _xnacl(_nodal_material ? coupledDofValues("xnacl") : coupledValue("xnacl"))
127 {
128  if (parameters.isParamSetByUser("water_fp"))
129  {
130  _water_fp = &getUserObject<SinglePhaseFluidProperties>("water_fp");
131 
132  // Check that a water userobject has actually been supplied
133  if (_water_fp->fluidName() != "water")
134  paramError("water_fp", "A water FluidProperties UserObject must be supplied");
135  }
136 
137  // BrineFluidProperties UserObject
138  const std::string brine_name = name() + ":brine";
139  {
140  const std::string class_name = "BrineFluidProperties";
141  InputParameters params = _app.getFactory().getValidParams(class_name);
142 
143  if (parameters.isParamSetByUser("water_fp"))
144  params.set<UserObjectName>("water_fp") = _water_fp->name();
145 
146  if (_tid == 0)
147  _fe_problem.addUserObject(class_name, brine_name, params);
148  }
149  _brine_fp = &_fe_problem.getUserObjectTempl<BrineFluidProperties>(brine_name);
150 }

Member Function Documentation

◆ computeQpProperties()

void PorousFlowBrine::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowFluidPropertiesBase.

Definition at line 167 of file PorousFlowBrine.C.

168 {
169  const Real Tk = _temperature[_qp] + _t_c2k;
170 
171  if (_compute_rho_mu)
172  {
173  // Density and derivatives wrt pressure and temperature
174  Real rho, drho_dp, drho_dT, drho_dx;
176  _porepressure[_qp][_phase_num], Tk, _xnacl[_qp], rho, drho_dp, drho_dT, drho_dx);
177  (*_density)[_qp] = rho;
178  (*_ddensity_dp)[_qp] = drho_dp;
179  (*_ddensity_dT)[_qp] = drho_dT;
180 
181  // Viscosity and derivatives wrt pressure and temperature
182  Real mu, dmu_dp, dmu_dT, dmu_dx;
184  _porepressure[_qp][_phase_num], Tk, _xnacl[_qp], mu, dmu_dp, dmu_dT, dmu_dx);
185  (*_viscosity)[_qp] = mu;
186  (*_dviscosity_dp)[_qp] = dmu_dp;
187  (*_dviscosity_dT)[_qp] = dmu_dT;
188  }
189 
190  // Internal energy and derivatives wrt pressure and temperature
192  {
193  Real e, de_dp, de_dT, de_dx;
195  _porepressure[_qp][_phase_num], Tk, _xnacl[_qp], e, de_dp, de_dT, de_dx);
196  (*_internal_energy)[_qp] = e;
197  (*_dinternal_energy_dp)[_qp] = de_dp;
198  (*_dinternal_energy_dT)[_qp] = de_dT;
199  }
200 
201  // Enthalpy and derivatives wrt pressure and temperature
202  if (_compute_enthalpy)
203  {
204  Real h, dh_dp, dh_dT, dh_dx;
206  _porepressure[_qp][_phase_num], Tk, _xnacl[_qp], h, dh_dp, dh_dT, dh_dx);
207  (*_enthalpy)[_qp] = h;
208  (*_denthalpy_dp)[_qp] = dh_dp;
209  (*_denthalpy_dT)[_qp] = dh_dT;
210  }
211 }

◆ initQpStatefulProperties()

void PorousFlowBrine::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 153 of file PorousFlowBrine.C.

154 {
155  if (_compute_rho_mu)
156  (*_density)[_qp] = _brine_fp->rho_from_p_T_X(
157  _porepressure[_qp][_phase_num], _temperature[_qp] + _t_c2k, _xnacl[_qp]);
159  (*_internal_energy)[_qp] = _brine_fp->e_from_p_T_X(
160  _porepressure[_qp][_phase_num], _temperature[_qp] + _t_c2k, _xnacl[_qp]);
161  if (_compute_enthalpy)
162  (*_enthalpy)[_qp] = _brine_fp->h_from_p_T_X(
163  _porepressure[_qp][_phase_num], _temperature[_qp] + _t_c2k, _xnacl[_qp]);
164 }

Member Data Documentation

◆ _brine_fp

const BrineFluidProperties* PorousFlowBrine::_brine_fp
protected

Brine fluid properties UserObject.

Definition at line 79 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 40 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 37 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 34 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 46 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 49 of file PorousFlowBrine.h.

◆ _density

MaterialProperty<Real>* const PorousFlowBrine::_density
protected

Fluid phase density at the qps or nodes.

Definition at line 43 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 73 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 76 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 64 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 67 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 55 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 58 of file PorousFlowBrine.h.

◆ _enthalpy

MaterialProperty<Real>* const PorousFlowBrine::_enthalpy
protected

Fluid phase enthalpy at the qps or nodes.

Definition at line 70 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 61 of file PorousFlowBrine.h.

◆ _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

◆ _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

◆ _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 52 of file PorousFlowBrine.h.

◆ _water_fp

const SinglePhaseFluidProperties* PorousFlowBrine::_water_fp
protected

Water fluid properties UserObject.

Definition at line 82 of file PorousFlowBrine.h.

Referenced by PorousFlowBrine().

◆ _xnacl

const VariableValue& PorousFlowBrine::_xnacl
protected

NaCl mass fraction at the qps or nodes.

Definition at line 85 of file PorousFlowBrine.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().


The documentation for this class was generated from the following files:
PorousFlowBrine::_ddensity_dT
MaterialProperty< Real > *const _ddensity_dT
Derivative of fluid density wrt temperature at the qps or nodes.
Definition: PorousFlowBrine.h:49
PorousFlowFluidPropertiesBase::_t_c2k
const Real _t_c2k
Conversion from degrees Celsius to degrees Kelvin.
Definition: PorousFlowFluidPropertiesBase.h:39
PorousFlowBrine::_dinternal_energy_dp
MaterialProperty< Real > *const _dinternal_energy_dp
Derivative of fluid internal_energy wrt phase pore pressure at the qps or nodes.
Definition: PorousFlowBrine.h:64
PorousFlowFluidPropertiesBase::_porepressure
const MaterialProperty< std::vector< Real > > & _porepressure
Pore pressure at the nodes or quadpoints.
Definition: PorousFlowFluidPropertiesBase.h:33
PorousFlowBrine::_dviscosity_dp
MaterialProperty< Real > *const _dviscosity_dp
Derivative of fluid phase viscosity wrt pressure at the nodes or qps.
Definition: PorousFlowBrine.h:55
PorousFlowBrine::_compute_enthalpy
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
Definition: PorousFlowBrine.h:40
PorousFlowBrine::_viscosity
MaterialProperty< Real > *const _viscosity
Fluid phase viscosity at the nodes or qps.
Definition: PorousFlowBrine.h:52
PorousFlowBrine::_dinternal_energy_dT
MaterialProperty< Real > *const _dinternal_energy_dT
Derivative of fluid internal_energy wrt temperature at the qps or nodes.
Definition: PorousFlowBrine.h:67
PorousFlowBrine::_dviscosity_dT
MaterialProperty< Real > *const _dviscosity_dT
Derivative of fluid phase viscosity wrt temperature at the nodes or qps.
Definition: PorousFlowBrine.h:58
BrineFluidProperties::e_from_p_T_X
FPDualReal e_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const
Definition: BrineFluidProperties.C:389
PorousFlowBrine::_compute_rho_mu
const bool _compute_rho_mu
If true, this Material will compute density and viscosity, and their derivatives.
Definition: PorousFlowBrine.h:34
PorousFlowBrine::_density
MaterialProperty< Real > *const _density
Fluid phase density at the qps or nodes.
Definition: PorousFlowBrine.h:43
BrineFluidProperties::mu_from_p_T_X
virtual Real mu_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
Definition: BrineFluidProperties.C:211
PorousFlowBrine::_ddensity_dp
MaterialProperty< Real > *const _ddensity_dp
Derivative of fluid density wrt phase pore pressure at the qps or nodes.
Definition: PorousFlowBrine.h:46
PorousFlowBrine::_compute_internal_energy
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
Definition: PorousFlowBrine.h:37
PorousFlowBrine::_water_fp
const SinglePhaseFluidProperties * _water_fp
Water fluid properties UserObject.
Definition: PorousFlowBrine.h:82
name
const std::string name
Definition: Setup.h:21
PorousFlowBrine::_internal_energy
MaterialProperty< Real > *const _internal_energy
Fluid phase internal_energy at the qps or nodes.
Definition: PorousFlowBrine.h:61
PorousFlowBrine::_denthalpy_dT
MaterialProperty< Real > *const _denthalpy_dT
Derivative of fluid enthalpy wrt temperature at the qps or nodes.
Definition: PorousFlowBrine.h:76
BrineFluidProperties::rho_from_p_T_X
virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
Definition: BrineFluidProperties.C:171
PorousFlowBrine::_denthalpy_dp
MaterialProperty< Real > *const _denthalpy_dp
Derivative of fluid enthalpy wrt phase pore pressure at the qps or nodes.
Definition: PorousFlowBrine.h:73
BrineFluidProperties::h_from_p_T_X
FPDualReal h_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const
Definition: BrineFluidProperties.C:264
PorousFlowBrine::_xnacl
const VariableValue & _xnacl
NaCl mass fraction at the qps or nodes.
Definition: PorousFlowBrine.h:85
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
PorousFlowMaterialBase::_phase_num
const unsigned int _phase_num
Phase number of fluid.
Definition: PorousFlowMaterialBase.h:34
PorousFlowBrine::_enthalpy
MaterialProperty< Real > *const _enthalpy
Fluid phase enthalpy at the qps or nodes.
Definition: PorousFlowBrine.h:70
PorousFlowFluidPropertiesBase::PorousFlowFluidPropertiesBase
PorousFlowFluidPropertiesBase(const InputParameters &parameters)
Definition: PorousFlowFluidPropertiesBase.C:25
PorousFlowBrine::_brine_fp
const BrineFluidProperties * _brine_fp
Brine fluid properties UserObject.
Definition: PorousFlowBrine.h:79
BrineFluidProperties
Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fr...
Definition: BrineFluidProperties.h:38