18 params.
addParam<UserObjectName>(
"water_fp",
19 "The name of the FluidProperties UserObject for water");
20 params.
addCoupledVar(
"xnacl", 0,
"The salt mass fraction in the brine (kg/kg)");
22 "This Material calculates fluid properties for brine at the quadpoints or nodes");
28 _ddensity_dX(_compute_rho_mu
29 ? (_nodal_material ? &declarePropertyDerivative<
Real>(
30 "PorousFlow_fluid_phase_density_nodal" + _phase,
31 _mass_fraction_variable_name)
32 : &declarePropertyDerivative<
Real>(
33 "PorousFlow_fluid_phase_density_qp" + _phase,
34 _mass_fraction_variable_name))
39 ? &declarePropertyDerivative<
Real>(
"PorousFlow_viscosity_nodal" + _phase,
40 _mass_fraction_variable_name)
41 : &declarePropertyDerivative<
Real>(
"PorousFlow_viscosity_qp" + _phase,
42 _mass_fraction_variable_name))
44 _dinternal_energy_dX(_compute_internal_energy
46 ? &declarePropertyDerivative<
Real>(
47 "PorousFlow_fluid_phase_internal_energy_nodal" + _phase,
48 _mass_fraction_variable_name)
49 : &declarePropertyDerivative<
Real>(
50 "PorousFlow_fluid_phase_internal_energy_qp" + _phase,
51 _mass_fraction_variable_name))
53 _denthalpy_dX(_compute_enthalpy
54 ? (_nodal_material ? &declarePropertyDerivative<
Real>(
55 "PorousFlow_fluid_phase_enthalpy_nodal" + _phase,
56 _mass_fraction_variable_name)
57 : &declarePropertyDerivative<
Real>(
58 "PorousFlow_fluid_phase_enthalpy_qp" + _phase,
59 _mass_fraction_variable_name))
61 _is_xnacl_nodal(isCoupled(
"xnacl") ? getFieldVar(
"xnacl", 0)->isNodal() : false),
62 _xnacl(_nodal_material && _is_xnacl_nodal ? coupledDofValues(
"xnacl") : coupledValue(
"xnacl"))
66 _water_fp = &getUserObject<SinglePhaseFluidProperties>(
"water_fp");
70 paramError(
"water_fp",
"A water FluidProperties UserObject must be supplied");
74 const std::string brine_name =
name() +
":brine";
76 const std::string class_name =
"BrineFluidProperties";
83 _fe_problem.addUserObject(class_name, brine_name, params);
110 Real rho, drho_dp, drho_dT, drho_dx;
113 (*_density)[_qp] = rho;
114 (*_ddensity_dp)[_qp] = drho_dp;
115 (*_ddensity_dT)[_qp] = drho_dT;
116 (*_ddensity_dX)[_qp] = drho_dx;
119 Real mu, dmu_dp, dmu_dT, dmu_dx;
122 (*_viscosity)[_qp] =
mu;
123 (*_dviscosity_dp)[_qp] = dmu_dp;
124 (*_dviscosity_dT)[_qp] = dmu_dT;
125 (*_dviscosity_dX)[_qp] = dmu_dx;
131 Real e, de_dp, de_dT, de_dx;
134 (*_internal_energy)[_qp] = e;
135 (*_dinternal_energy_dp)[_qp] = de_dp;
136 (*_dinternal_energy_dT)[_qp] = de_dT;
137 (*_dinternal_energy_dX)[_qp] = de_dx;
143 Real h, dh_dp, dh_dT, dh_dx;
146 (*_enthalpy)[_qp] = h;
147 (*_denthalpy_dp)[_qp] = dh_dp;
148 (*_denthalpy_dT)[_qp] = dh_dT;
149 (*_denthalpy_dX)[_qp] = dh_dx;
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
virtual Real rho_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
static InputParameters validParams()
const BrineFluidProperties * _brine_fp
Brine fluid properties UserObject.
virtual void initQpStatefulProperties() override
Base class for fluid properties materials.
virtual Real mu_from_p_T_X(Real pressure, Real temperature, Real xnacl) const override
Brine (NaCl in H2O) fluid properties as a function of pressure (Pa), temperature (K) and NaCl mass fr...
static InputParameters validParams()
virtual const std::string & name() const
const unsigned int _phase_num
Phase number of fluid.
const Real _t_c2k
Conversion from degrees Celsius to degrees Kelvin.
const SinglePhaseFluidProperties * _water_fp
Water fluid properties UserObject.
static const std::string mu
PorousFlowBrine(const InputParameters ¶meters)
const GenericMaterialProperty< Real, is_ad > & _temperature
Fluid temperature at the nodes or quadpoints.
registerMooseObject("PorousFlowApp", PorousFlowBrine)
const bool _compute_enthalpy
If true, this Material will compute enthalpy and its derivatives.
const T & getUserObject(const std::string ¶m_name, bool is_dependency=true) const
Fluid properties of Brine.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void computeQpProperties() override
FPDualReal e_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const
FPDualReal h_from_p_T_X(const FPDualReal &pressure, const FPDualReal &temperature, const FPDualReal &xnacl) const
const VariableValue & _xnacl
NaCl mass fraction at the qps or nodes.
const GenericMaterialProperty< std::vector< Real >, is_ad > & _porepressure
Pore pressure at the nodes or quadpoints.
const bool _compute_rho_mu
If true, this Material will compute density and viscosity, and their derivatives. ...