14 #include "libmesh/string_to_enum.h" 30 params.
addParam<
bool>(
"add_saturation_aux",
true,
"Add an AuxVariable that records saturation");
32 "van_genuchten_alpha",
34 "van_genuchten_alpha > 0.0",
35 "Van Genuchten alpha parameter used to determine saturation from porepressure");
39 "van_genuchten_m > 0 & van_genuchten_m < 1",
40 "Van Genuchten m parameter used to determine saturation from porepressure");
41 MooseEnum relperm_type_choice(
"FLAC Corey",
"FLAC");
44 "Type of relative-permeability function. FLAC relperm = (1+m)S^m - " 45 "mS^(1+m). Corey relperm = S^m. m is the exponent. Here S = " 46 "(saturation - residual)/(1 - residual)");
49 "relative_permeability_exponent>=0",
50 "Relative permeability exponent");
52 "residual_saturation",
54 "residual_saturation>=0.0 & residual_saturation<1.0",
55 "Residual saturation to use in the relative permeability expression");
56 params.
addClassDescription(
"Adds Kernels and fluid-property Materials necessary to simulate a " 57 "single-phase saturated-unsaturated flow problem. The saturation is " 58 "computed using van Genuchten's expression. No Kernels for diffusion " 59 "and dispersion of fluid components are added. To run a simulation " 60 "you will also need to provide various other Materials for each mesh " 61 "block, depending on your simulation type, viz: permeability, " 62 "porosity, elasticity tensor, strain calculator, stress calculator, " 63 "matrix internal energy, thermal conductivity, diffusivity");
69 _add_saturation_aux(getParam<bool>(
"add_saturation_aux")),
70 _van_genuchten_alpha(getParam<
Real>(
"van_genuchten_alpha")),
71 _van_genuchten_m(getParam<
Real>(
"van_genuchten_m")),
74 _relative_permeability_exponent(getParam<
Real>(
"relative_permeability_exponent")),
75 _s_res(getParam<
Real>(
"residual_saturation")),
76 _capillary_pressure_name(
"PorousFlowUnsaturated_CapillaryPressureVG")
79 paramError(
"stabilization",
"Some stabilization must be used in PorousFlowUnsaturated");
103 _included_objects.push_back(
"PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent");
117 const std::string kernel_type =
"PorousFlowAdvectiveFlux";
124 const std::string kernel_name =
"PorousFlowUnsaturated_AdvectiveFlux" +
Moose::stringify(i);
125 params.
set<
unsigned int>(
"fluid_component") = i;
127 _problem->addKernel(kernel_type, kernel_name, params);
129 const std::string kernel_name =
132 params.
set<NonlinearVariableName>(
"variable") =
_pp_var;
133 _problem->addKernel(kernel_type, kernel_name, params);
137 const std::string kernel_type =
"PorousFlowFluxLimitedTVDAdvection";
143 const std::string kernel_name =
"PorousFlowFluxLimited_DarcyFlow" +
Moose::stringify(i);
144 params.
set<UserObjectName>(
"advective_flux_calculator") =
147 _problem->addKernel(kernel_type, kernel_name, params);
149 const std::string kernel_name =
151 params.
set<NonlinearVariableName>(
"variable") =
_pp_var;
152 params.
set<UserObjectName>(
"advective_flux_calculator") =
154 _problem->addKernel(kernel_type, kernel_name, params);
159 std::string kernel_name =
"PorousFlowUnsaturated_MassTimeDerivative";
160 std::string kernel_type =
"PorousFlowMassTimeDerivative";
169 kernel_name =
"PorousFlowUnsaturated_MassTimeDerivative" +
Moose::stringify(i);
170 params.
set<
unsigned int>(
"fluid_component") = i;
174 _problem->addKernel(kernel_type, kernel_name, params);
179 params.
set<NonlinearVariableName>(
"variable") =
_pp_var;
181 params.
set<std::vector<AuxVariableName>>(
"save_in") = {
183 _problem->addKernel(kernel_type, kernel_name, params);
188 std::string kernel_name =
"PorousFlowUnsaturated_MassVolumetricExpansion";
189 std::string kernel_type =
"PorousFlowMassVolumetricExpansion";
196 kernel_name =
"PorousFlowUnsaturated_MassVolumetricExpansion" +
Moose::stringify(i);
197 params.
set<
unsigned>(
"fluid_component") = i;
199 _problem->addKernel(kernel_type, kernel_name, params);
204 params.
set<NonlinearVariableName>(
"variable") =
_pp_var;
205 _problem->addKernel(kernel_type, kernel_name, params);
212 const std::string kernel_name =
"PorousFlowUnsaturated_HeatAdvection";
213 const std::string kernel_type =
"PorousFlowHeatAdvection";
218 _problem->addKernel(kernel_type, kernel_name, params);
222 const std::string kernel_name =
"PorousFlowUnsaturated_HeatAdvection";
223 const std::string kernel_type =
"PorousFlowFluxLimitedTVDAdvection";
227 params.
set<UserObjectName>(
"advective_flux_calculator") =
"PorousFlowUnsaturatedHeat_AC";
228 _problem->addKernel(kernel_type, kernel_name, params);
246 const std::string userobject_name =
"PorousFlowUnsaturated_AC_" +
Moose::stringify(i);
249 const std::string userobject_name =
259 const std::string userobject_name =
"PorousFlowUnsaturatedHeat_AC";
272 const std::string material_type =
"PorousFlow1PhaseP";
274 const std::string material_name =
"PorousFlowUnsaturated_1PhaseP_VG_qp";
276 params.
set<std::vector<VariableName>>(
"porepressure") = {
_pp_var};
278 params.
set<
bool>(
"at_nodes") =
false;
279 _problem->addMaterial(material_type, material_name, params);
283 const std::string material_type =
"PorousFlow1PhaseP";
285 const std::string material_name =
"PorousFlowUnsaturated_1PhaseP_VG_nodal";
287 params.
set<std::vector<VariableName>>(
"porepressure") = {
_pp_var};
289 params.
set<
bool>(
"at_nodes") =
true;
290 _problem->addMaterial(material_type, material_name, params);
virtual void addMaterials() override
Add all Materials.
void addSaturationAux(unsigned phase)
Add an AuxVariable and AuxKernel to calculate saturation.
Action for simulation involving a single phase, partially or fully saturated fluid.
void addRelativePermeabilityCorey(bool at_nodes, unsigned phase, Real n, Real s_res, Real sum_s_res)
Adds a relative-permeability Material of the Corey variety.
const Real _van_genuchten_m
Van Genuchten m parameter.
InputParameters getValidParams(const std::string &name) const
bool dependsOn(const std::string &key, const std::string &value)
const VariableName _pp_var
Porepressure NonlinearVariable name.
const bool _add_saturation_aux
Add an Aux Variable to record saturation.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
RelpermTypeChoiceEnum
Fluid relative permeability type (FLAC or Corey)
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
const Real _van_genuchten_alpha
Van Genuchten alpha parameter.
virtual void addKernels() override
Add all Kernels.
const std::vector< AuxVariableName > _save_component_rate_in
Name of the variables (if any) that will record the fluid-components' rate of change.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
static InputParameters validParams()
const Real _s_res
Residual saturation to use in the relative permeability expressions.
void addCapillaryPressureVG(Real m, Real alpha, std::string userobject_name)
Adds a van Genuchten capillary pressure UserObject.
registerMooseAction("PorousFlowApp", PorousFlowUnsaturated, "add_user_object")
virtual void addAuxObjects() override
Add all AuxVariables and AuxKernels.
Base class for actions involving a single fluid phase.
virtual void addMaterials() override
Add all Materials.
void addAdvectiveFluxCalculatorUnsaturated(unsigned phase, bool multiply_by_density, std::string userobject_name)
virtual void addKernels() override
Add all Kernels.
void paramError(const std::string ¶m, Args... args) const
static InputParameters validParams()
std::string stringify(const T &t)
const RealVectorValue _gravity
Gravity.
const std::vector< VariableName > _temperature_var
Name of the temperature variable (if any)
bool _transient
Flag to denote if the simulation is transient.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _relative_permeability_exponent
Relative permeability exponent.
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
PorousFlowUnsaturated(const InputParameters ¶ms)
virtual void addMaterialDependencies() override
Add all material dependencies so that the correct version of each material can be added...
const std::string _capillary_pressure_name
Name of the capillary pressure UserObject.
virtual void addAuxObjects() override
Add all AuxVariables and AuxKernels.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const bool _strain_at_nearest_qp
Evaluate strain at the nearest quadpoint for porosity that depends on strain.
void addVolumetricStrainMaterial(const std::vector< VariableName > &displacements, const std::string &base_name)
Adds a quadpoint volumetric strain material.
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
void addRelativePermeabilityFLAC(bool at_nodes, unsigned phase, Real m, Real s_res, Real sum_s_res)
Adds a relative-permeability Material of the FLAC variety.
std::shared_ptr< FEProblemBase > & _problem
virtual void addUserObjects()
Add all other UserObjects.
void addAdvectiveFluxCalculatorUnsaturatedMultiComponent(unsigned phase, unsigned fluid_component, bool multiply_by_density, std::string userobject_name)
virtual void addMaterialDependencies() override
Add all material dependencies so that the correct version of each material can be added...
const std::string _base_name
base_name used in the TensorMechanics strain calculator
enum PorousFlowActionBase::StabilizationEnum _stabilization
const std::vector< VariableName > _mass_fraction_vars
Name of the mass-fraction variables (if any)
virtual void addUserObjects() override
Add all other UserObjects.
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.
void addAdvectiveFluxCalculatorUnsaturatedHeat(unsigned phase, bool multiply_by_density, std::string userobject_name)