20 params.addRequiredCoupledVar(
"porepressure",
21 "Variable that is the porepressure of the liquid phase");
22 params.addRequiredCoupledVar(
"enthalpy",
"Enthalpy of the fluid");
23 MooseEnum unit_choice(
"Kelvin=0 Celsius=1",
"Kelvin");
24 params.addParam<MooseEnum>(
25 "temperature_unit", unit_choice,
"The unit of the temperature variable");
26 params.addRequiredParam<UserObjectName>(
"capillary_pressure",
27 "Name of the UserObject defining the capillary pressure");
28 params.addRequiredParam<UserObjectName>(
"fluid_state",
"Name of the FluidState UserObject");
29 params.addPrivateParam<std::string>(
"pf_material_type",
"fluid_state");
30 params.addClassDescription(
31 "Class for single component multiphase fluid state calculations using pressure and enthalpy");
36 const InputParameters & parameters)
39 _liquid_porepressure(_nodal_material ? coupledDofValues(
"porepressure")
40 : coupledValue(
"porepressure")),
41 _liquid_gradp_qp(coupledGradient(
"porepressure")),
42 _liquid_porepressure_varnum(coupled(
"porepressure")),
43 _pvar(_dictator.isPorousFlowVariable(_liquid_porepressure_varnum)
44 ? _dictator.porousFlowVariableNum(_liquid_porepressure_varnum)
47 _enthalpy(_nodal_material ? coupledDofValues(
"enthalpy") : coupledValue(
"enthalpy")),
48 _gradh_qp(coupledGradient(
"enthalpy")),
49 _enthalpy_varnum(coupled(
"enthalpy")),
50 _hvar(_dictator.isPorousFlowVariable(_enthalpy_varnum)
51 ? _dictator.porousFlowVariableNum(_enthalpy_varnum)
55 _aqueous_phase_number(_fs.aqueousPhaseIndex()),
56 _gas_phase_number(_fs.gasPhaseIndex()),
58 _temperature(_nodal_material ? declareProperty<Real>(
"PorousFlow_temperature_nodal")
59 : declareProperty<Real>(
"PorousFlow_temperature_qp")),
60 _grad_temperature_qp(_nodal_material
62 : &declareProperty<
RealGradient>(
"PorousFlow_grad_temperature_qp")),
64 _nodal_material ? declareProperty<std::vector<Real>>(
"dPorousFlow_temperature_nodal_dvar")
65 : declareProperty<std::vector<Real>>(
"dPorousFlow_temperature_qp_dvar")),
66 _dgrad_temperature_dgradv(_nodal_material ? nullptr
67 : &declareProperty<std::vector<Real>>(
68 "dPorousFlow_grad_temperature_qp_dgradvar")),
69 _dgrad_temperature_dv(_nodal_material ? nullptr
71 "dPorousFlow_grad_temperature_qp_dvar")),
72 _mass_frac(_nodal_material
73 ? declareProperty<std::vector<std::vector<Real>>>(
"PorousFlow_mass_frac_nodal")
74 : declareProperty<std::vector<std::vector<Real>>>(
"PorousFlow_mass_frac_qp")),
75 _grad_mass_frac_qp(_nodal_material ? nullptr
76 : &declareProperty<std::vector<std::vector<
RealGradient>>>(
77 "PorousFlow_grad_mass_frac_qp")),
78 _dmass_frac_dvar(_nodal_material ? declareProperty<std::vector<std::vector<std::vector<Real>>>>(
79 "dPorousFlow_mass_frac_nodal_dvar")
80 : declareProperty<std::vector<std::vector<std::vector<Real>>>>(
81 "dPorousFlow_mass_frac_qp_dvar")),
83 _fluid_density(_nodal_material
84 ? declareProperty<std::vector<Real>>(
"PorousFlow_fluid_phase_density_nodal")
85 : declareProperty<std::vector<Real>>(
"PorousFlow_fluid_phase_density_qp")),
86 _dfluid_density_dvar(_nodal_material ? declareProperty<std::vector<std::vector<Real>>>(
87 "dPorousFlow_fluid_phase_density_nodal_dvar")
88 : declareProperty<std::vector<std::vector<Real>>>(
89 "dPorousFlow_fluid_phase_density_qp_dvar")),
90 _fluid_viscosity(_nodal_material
91 ? declareProperty<std::vector<Real>>(
"PorousFlow_viscosity_nodal")
92 : declareProperty<std::vector<Real>>(
"PorousFlow_viscosity_qp")),
93 _dfluid_viscosity_dvar(
95 ? declareProperty<std::vector<std::vector<Real>>>(
"dPorousFlow_viscosity_nodal_dvar")
96 : declareProperty<std::vector<std::vector<Real>>>(
"dPorousFlow_viscosity_qp_dvar")),
100 ? declareProperty<std::vector<Real>>(
"PorousFlow_fluid_phase_enthalpy_nodal")
101 : declareProperty<std::vector<Real>>(
"PorousFlow_fluid_phase_enthalpy_qp")),
102 _dfluid_enthalpy_dvar(_nodal_material ? declareProperty<std::vector<std::vector<Real>>>(
103 "dPorousFlow_fluid_phase_enthalpy_nodal_dvar")
104 : declareProperty<std::vector<std::vector<Real>>>(
105 "dPorousFlow_fluid_phase_enthalpy_qp_dvar")),
107 _fluid_internal_energy(
109 ? declareProperty<std::vector<Real>>(
"PorousFlow_fluid_phase_internal_energy_nodal")
110 : declareProperty<std::vector<Real>>(
"PorousFlow_fluid_phase_internal_energy_qp")),
111 _dfluid_internal_energy_dvar(_nodal_material
112 ? declareProperty<std::vector<std::vector<Real>>>(
113 "dPorousFlow_fluid_phase_internal_energy_nodal_dvar")
114 : declareProperty<std::vector<std::vector<Real>>>(
115 "dPorousFlow_fluid_phase_internal_qp_dvar")),
117 _T_c2k(getParam<MooseEnum>(
"temperature_unit") == 0 ? 0.0 : 273.15),
120 _pidx(_fs.getPressureIndex()),
121 _hidx(_fs.getEnthalpyIndex())
128 " phases are allowed. Please check the number of phases entered in the dictator is "
229 if (!_nodal_material)
233 const Real dp = 1.0e-2;
234 const Real dh = 1.0e-2;
265 (*_dgrad_temperature_dv)[_qp][
_pvar] =
267 (*_dgrad_temperature_dv)[_qp][
_hvar] =
364 if (!_nodal_material)
368 (*_dgrad_temperature_dgradv)[_qp].assign(
_num_pf_vars, 0.0);
383 if (!_nodal_material)