19 params.addParam<
bool>(
20 "compute_density_and_viscosity",
true,
"Compute the fluid density and viscosity");
21 params.addParam<
bool>(
"compute_internal_energy",
true,
"Compute the fluid internal energy");
22 params.addParam<
bool>(
"compute_enthalpy",
true,
"Compute the fluid enthalpy");
23 params.addParam<UserObjectName>(
"water_fp",
24 "The name of the FluidProperties UserObject for water");
25 params.addCoupledVar(
"xnacl", 0,
"The salt mass fraction in the brine (kg/kg)");
26 params.addClassDescription(
27 "This Material calculates fluid properties for brine at the quadpoints or nodes");
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")),
36 _density(_compute_rho_mu
38 ? &declareProperty<Real>(
"PorousFlow_fluid_phase_density_nodal" + _phase)
39 : &declareProperty<Real>(
"PorousFlow_fluid_phase_density_qp" + _phase))
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))
49 _ddensity_dT(_compute_rho_mu
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))
58 _viscosity(_compute_rho_mu
60 ? &declareProperty<Real>(
"PorousFlow_viscosity_nodal" + _phase)
61 : &declareProperty<Real>(
"PorousFlow_viscosity_qp" + _phase))
63 _dviscosity_dp(_compute_rho_mu
65 ? &declarePropertyDerivative<Real>(
66 "PorousFlow_viscosity_nodal" + _phase, _pressure_variable_name)
67 : &declarePropertyDerivative<Real>(
"PorousFlow_viscosity_qp" + _phase,
68 _pressure_variable_name))
73 ? &declarePropertyDerivative<Real>(
"PorousFlow_viscosity_nodal" + _phase,
74 _temperature_variable_name)
75 : &declarePropertyDerivative<Real>(
"PorousFlow_viscosity_qp" + _phase,
76 _temperature_variable_name))
80 _compute_internal_energy
82 ? &declareProperty<Real>(
"PorousFlow_fluid_phase_internal_energy_nodal" + _phase)
83 : &declareProperty<Real>(
"PorousFlow_fluid_phase_internal_energy_qp" + _phase))
85 _dinternal_energy_dp(_compute_internal_energy
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))
94 _dinternal_energy_dT(_compute_internal_energy
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))
104 _enthalpy(_compute_enthalpy
106 ? &declareProperty<Real>(
"PorousFlow_fluid_phase_enthalpy_nodal" + _phase)
107 : &declareProperty<Real>(
"PorousFlow_fluid_phase_enthalpy_qp" + _phase))
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))
117 _denthalpy_dT(_compute_enthalpy
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))
126 _xnacl(_nodal_material ? coupledDofValues(
"xnacl") : coupledValue(
"xnacl"))
128 if (parameters.isParamSetByUser(
"water_fp"))
130 _water_fp = &getUserObject<SinglePhaseFluidProperties>(
"water_fp");
134 paramError(
"water_fp",
"A water FluidProperties UserObject must be supplied");
138 const std::string brine_name =
name() +
":brine";
140 const std::string class_name =
"BrineFluidProperties";
141 InputParameters params = _app.getFactory().getValidParams(class_name);
143 if (parameters.isParamSetByUser(
"water_fp"))
144 params.set<UserObjectName>(
"water_fp") =
_water_fp->name();
147 _fe_problem.addUserObject(class_name, brine_name, params);
174 Real rho, drho_dp, drho_dT, drho_dx;
177 (*_density)[_qp] = rho;
178 (*_ddensity_dp)[_qp] = drho_dp;
179 (*_ddensity_dT)[_qp] = drho_dT;
182 Real mu, dmu_dp, dmu_dT, dmu_dx;
185 (*_viscosity)[_qp] = mu;
186 (*_dviscosity_dp)[_qp] = dmu_dp;
187 (*_dviscosity_dT)[_qp] = dmu_dT;
193 Real 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;
204 Real h, dh_dp, dh_dT, dh_dx;
207 (*_enthalpy)[_qp] = h;
208 (*_denthalpy_dp)[_qp] = dh_dp;
209 (*_denthalpy_dT)[_qp] = dh_dT;