14#include "libmesh/string_to_enum.h"
20 params.
addParam<
bool>(
"add_darcy_aux",
true,
"Add AuxVariables that record Darcy velocity");
21 params.
addParam<
bool>(
"add_stress_aux",
true,
"Add AuxVariables that record effective stress");
24 "Whether to use a PorousFlowBrine Material",
25 "This parameter should no longer be used. Instead use "
26 "fluid_properties_type = PorousFlowBrine");
27 params.
addRequiredParam<VariableName>(
"porepressure",
"The name of the porepressure variable");
28 MooseEnum coupling_type(
"Hydro ThermoHydro HydroMechanical ThermoHydroMechanical",
"Hydro");
31 "The type of simulation. For simulations involving Mechanical "
32 "deformations, you will need to supply the correct Biot coefficient. "
33 "For simulations involving Thermal flows, you will need an associated "
34 "ConstantThermalExpansionCoefficient Material");
35 MooseEnum fluid_properties_type(
"PorousFlowSingleComponentFluid PorousFlowBrine Custom",
36 "PorousFlowSingleComponentFluid");
38 "fluid_properties_type",
39 fluid_properties_type,
40 "Type of fluid properties to use. For 'PorousFlowSingleComponentFluid' you must provide a "
41 "fp UserObject. For 'PorousFlowBrine' you must supply a nacl_name. For "
42 "'Custom' your input file must include a Material that provides fluid properties such as "
43 "density, viscosity, enthalpy and internal energy");
44 MooseEnum simulation_type_choice(
"steady transient",
"transient");
47 simulation_type_choice,
48 "Whether a transient or steady-state simulation is being performed",
49 "The execution type is now determined automatically. This parameter should no longer be "
53 "The name of the user object for fluid "
54 "properties. Only needed if fluid_properties_type = PorousFlowSingleComponentFluid");
57 "List of variables that represent the mass fractions. With only one fluid "
58 "component, this may be left empty. With N fluid components, the format is "
59 "'f_0 f_1 f_2 ... f_(N-1)'. That is, the N^th component need not be "
60 "specified because f_N = 1 - (f_0 + f_1 + ... + f_(N-1)). It is best "
61 "numerically to choose the N-1 mass fraction variables so that they "
62 "represent the fluid components with small concentrations. This Action "
63 "will associated the i^th mass fraction variable to the equation for the "
64 "i^th fluid component, and the pressure variable to the N^th fluid "
69 "Index of NaCl variable in mass_fraction_vars, for "
70 "calculating brine properties. Only required if use_brine is true.",
71 "This parameter should no longer be used. Instead use nacl_name = the_nacl_variable_name");
74 "Name of the NaCl variable. Only required if fluid_properties_type = PorousFlowBrine");
78 "The Biot coefficient (relevant only for mechanically-coupled simulations)");
79 params.
addParam<std::vector<AuxVariableName>>(
80 "save_component_rate_in",
82 "List of AuxVariables into which the rate-of-change of each fluid component at each node "
83 "will be saved. There must be exactly N of these to match the N fluid components. The "
84 "result will be measured in kg/s, where the kg is the mass of the fluid component at the "
85 "node (or m^3/s if multiply_by_density=false). Note that this saves the result from the "
86 "MassTimeDerivative Kernels, but NOT from the MassVolumetricExpansion Kernels.");
87 MooseEnum temp_unit_choice(
"Kelvin Celsius",
"Kelvin");
89 "temperature_unit", temp_unit_choice,
"The unit of the temperature variable");
94 "The unit of the pressure variable used everywhere in the input file "
95 "except for in the FluidProperties-module objects. This can be set to the non-default value "
96 "only for fluid_properties_type = PorousFlowSingleComponentFluid");
97 MooseEnum time_unit_choice(
"seconds hours days years",
"seconds");
101 "The unit of time used everywhere in the input file except for in the "
102 "FluidProperties-module objects. This can be set to the non-default value only for "
103 "fluid_properties_type = PorousFlowSingleComponentFluid");
104 params.
addParam<std::string>(
"base_name",
105 "The base_name used in the TensorMechanics strain calculator. This "
106 "is only relevant for mechanically-coupled models.");
113 _pp_var(getParam<VariableName>(
"porepressure")),
119 _fluid_properties_type(
121 _biot_coefficient(getParam<Real>(
"biot_coefficient")),
122 _add_darcy_aux(getParam<bool>(
"add_darcy_aux")),
123 _add_stress_aux(getParam<bool>(
"add_stress_aux")),
124 _save_component_rate_in(getParam<
std::vector<AuxVariableName>>(
"save_component_rate_in")),
125 _temperature_unit(getParam<
MooseEnum>(
"temperature_unit")),
126 _pressure_unit(getParam<
MooseEnum>(
"pressure_unit")),
127 _time_unit(getParam<
MooseEnum>(
"time_unit")),
128 _base_name(isParamValid(
"base_name") ? getParam<
std::string>(
"base_name") +
"_" :
"")
131 mooseError(
"PorousFlowSinglePhaseBase: You need to specify a temperature variable to perform "
132 "non-isothermal simulations");
138 "PorousFlowSinglePhaseBase: You should not specify a nacl_name when "
139 "fluid_properties_type = PorousFlowSingleComponentFluid");
142 "PorousFlowSinglePhaseBase: You must specify fp when fluid_properties_type = "
143 "PorousFlowSingleComponentFluid");
144 _fp = getParam<UserObjectName>(
"fp");
151 "PorousFlowSinglePhaseBase: You must specify nacl_name when "
152 "fluid_properties_type = PorousFlowBrine");
155 "PorousFlowSinglePhaseBase: You should not specify fp when "
156 "fluid_properties_type = PorousFlowBrine");
159 "Must use pressure_unit = Pa for fluid_properties_type = PorousFlowBrine");
162 "Must use time_unit = seconds for fluid_properties_type = PorousFlowBrine");
163 _nacl_name = getParam<VariableName>(
"nacl_name");
169 "The number of save_component_rate_in variables must be the number of fluid "
210 for (
unsigned i = 0; i <
_ndisp; ++i)
212 std::string kernel_name =
"PorousFlowUnsaturated_grad_stress" +
Moose::stringify(i);
213 std::string kernel_type =
"StressDivergenceTensors";
215 kernel_type =
"StressDivergenceRZTensors";
226 params.
set<std::vector<MaterialPropertyName>>(
"eigenstrain_names") =
227 getParam<std::vector<MaterialPropertyName>>(
"eigenstrain_names");
230 params.
set<
unsigned>(
"component") = i;
231 params.
set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
232 _problem->addKernel(kernel_type, kernel_name, params);
237 kernel_type =
"Gravity";
243 params.
set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
244 _problem->addKernel(kernel_type, kernel_name, params);
247 kernel_name =
"PorousFlowUnsaturated_EffStressCoupling" +
Moose::stringify(i);
248 kernel_type =
"PorousFlowEffectiveStressCoupling";
255 params.
set<
unsigned>(
"component") = i;
256 params.
set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
257 _problem->addKernel(kernel_type, kernel_name, params);
263 std::string kernel_name =
"PorousFlowUnsaturated_HeatConduction";
264 std::string kernel_type =
"PorousFlowHeatConduction";
268 _problem->addKernel(kernel_type, kernel_name, params);
272 kernel_name =
"PorousFlowUnsaturated_EnergyTimeDerivative";
273 kernel_type =
"PorousFlowEnergyTimeDerivative";
280 _problem->addKernel(kernel_type, kernel_name, params);
286 std::string kernel_name =
"PorousFlowUnsaturated_HeatVolumetricExpansion";
287 std::string kernel_type =
"PorousFlowHeatVolumetricExpansion";
292 _problem->addKernel(kernel_type, kernel_name, params);
331 if (compute_rho_mu_qp || compute_e_qp || compute_h_qp)
353 if (compute_rho_mu_nodal || compute_e_nodal || compute_h_nodal)
359 compute_rho_mu_nodal,
366 compute_rho_mu_nodal,
386 const std::string uo_type =
"PorousFlowDictator";
391 params.
set<SolverSystemName>(
"solver_sys") =
400 params.
set<std::vector<VariableName>>(
"porous_flow_vars") = pf_vars;
401 params.
set<
unsigned int>(
"number_fluid_phases") = 1;
405 _problem->addUserObject(uo_type, uo_name, params);
std::shared_ptr< FEProblemBase > & _problem
bool dependsOn(const T &key, const T &value)
InputParameters getValidParams(const std::string &name) const
const InputParameters & parameters() const
const std::string & name() const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
Base class for PorousFlow actions.
virtual void addKernels()
Add all Kernels.
Moose::CoordinateSystemType _coord_system
Coordinate system of the simulation (eg RZ, XYZ, etc)
void addSingleComponentFluidMaterial(bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy, const UserObjectName &fp, const MooseEnum &temperature_unit, const MooseEnum &pressure_unit, const MooseEnum &time_unit)
Adds a single-component fluid Material.
const std::vector< VariableName > & _displacements
Displacement NonlinearVariable names (if any)
const unsigned _ndisp
Number of displacement variables supplied.
void addTemperatureMaterial(bool at_nodes)
Adds a nodal and a quadpoint Temperature material.
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains
static InputParameters validParams()
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not)
const std::vector< VariableName > _mass_fraction_vars
Name of the mass-fraction variables (if any)
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.
const std::vector< VariableName > _temperature_var
Name of the temperature variable (if any)
bool _transient
Flag to denote if the simulation is transient.
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
void addMassFractionMaterial(bool at_nodes)
Adds a nodal and a quadpoint MassFraction material.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
const bool _strain_at_nearest_qp
Evaluate strain at the nearest quadpoint for porosity that depends on strain.
const unsigned int _num_aqueous_kinetic
Number of aqeuous-kinetic secondary species that are involved in mineralisation.
void addEffectiveFluidPressureMaterial(bool at_nodes)
Adds a nodal and a quadpoint effective fluid pressure material.
void addStressAux()
Add AuxVariables and AuxKernels to compute effective stress.
void addDarcyAux(const RealVectorValue &gravity)
Add AuxVariables and AuxKernels to calculate Darcy velocity.
const RealVectorValue _gravity
Gravity.
virtual void addMaterials()
Add all Materials.
virtual void addMaterialDependencies()
Add all material dependencies so that the correct version of each material can be added.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
virtual void addAuxObjects()
Add all AuxVariables and AuxKernels.
void addBrineMaterial(const VariableName xnacl, bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy, const MooseEnum &temperature_unit)
Adds a brine fluid Material.
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.
const std::vector< AuxVariableName > _save_component_rate_in
Name of the variables (if any) that will record the fluid-components' rate of change.
CouplingTypeEnum
Determines the coupling type.
const MooseEnum _time_unit
Unit used for time.
const bool _add_darcy_aux
Add a AuxVariables to record Darcy velocity.
virtual void addAuxObjects() override
Add all AuxVariables and AuxKernels.
virtual void addDictator() override
Add the PorousFlowDictator object.
const MooseEnum _temperature_unit
Unit used for temperature.
enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum _fluid_properties_type
VariableName _nacl_name
Name of the NaCl variable.
static InputParameters validParams()
const VariableName _pp_var
Porepressure NonlinearVariable name.
virtual void addKernels() override
Add all Kernels.
UserObjectName _fp
Name of the fluid-properties UserObject.
PorousFlowSinglePhaseBase(const InputParameters ¶ms)
const std::string _base_name
base_name used in the TensorMechanics strain calculator
FluidPropertiesTypeEnum
Determines the fluid-properties type.
@ PorousFlowSingleComponentFluid
const Real _biot_coefficient
Fluid specific heat capacity at constant volume.
virtual void addMaterials() override
Add all Materials.
const MooseEnum _pressure_unit
Unit used for porepressure.
virtual void addMaterialDependencies() override
Add all material dependencies so that the correct version of each material can be added.
const bool _add_stress_aux
Add AuxVariables for stress.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
std::string stringify(const T &t)