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")),
63 _is_xnacl_pfvar(_dictator.isPorousFlowVariable(coupled(
"xnacl")))
67 _water_fp = &getUserObject<SinglePhaseFluidProperties>(
"water_fp");
71 paramError(
"water_fp",
"A water FluidProperties UserObject must be supplied");
75 const std::string brine_name =
name() +
":brine";
77 const std::string class_name =
"BrineFluidProperties";
84 _fe_problem.addUserObject(class_name, brine_name, params);
111 Real rho, drho_dp, drho_dT, drho_dx;
114 (*_density)[_qp] = rho;
115 (*_ddensity_dp)[_qp] = drho_dp;
116 (*_ddensity_dT)[_qp] = drho_dT;
118 (*_ddensity_dX)[_qp] = drho_dx;
121 Real mu, dmu_dp, dmu_dT, dmu_dx;
124 (*_viscosity)[_qp] =
mu;
125 (*_dviscosity_dp)[_qp] = dmu_dp;
126 (*_dviscosity_dT)[_qp] = dmu_dT;
128 (*_dviscosity_dX)[_qp] = dmu_dx;
134 Real e, de_dp, de_dT, de_dx;
137 (*_internal_energy)[_qp] = e;
138 (*_dinternal_energy_dp)[_qp] = de_dp;
139 (*_dinternal_energy_dT)[_qp] = de_dT;
141 (*_dinternal_energy_dX)[_qp] = de_dx;
147 Real h, dh_dp, dh_dT, dh_dx;
150 (*_enthalpy)[_qp] = h;
151 (*_denthalpy_dp)[_qp] = dh_dp;
152 (*_denthalpy_dT)[_qp] = dh_dT;
154 (*_denthalpy_dX)[_qp] = dh_dx;
const bool _compute_internal_energy
If true, this Material will compute internal energy and its derivatives.
FPADReal h_from_p_T_X(const FPADReal &pressure, const FPADReal &temperature, const FPADReal &xnacl) const
const bool _is_xnacl_pfvar
Flag to denote whether NaCl mass fraction is a nonlinear variable.
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.
FPADReal e_from_p_T_X(const FPADReal &pressure, const FPADReal &temperature, const FPADReal &xnacl) const
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
e e e e s T T T T T rho v v T e p T T virtual T std::string fluidName() const
Fluid name.
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. ...