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";
126 const std::string kernel_name =
"PorousFlowUnsaturated_AdvectiveFlux" +
Moose::stringify(i);
127 params.
set<
unsigned int>(
"fluid_component") = i;
129 _problem->addKernel(kernel_type, kernel_name, params);
131 const std::string kernel_name =
134 params.
set<NonlinearVariableName>(
"variable") =
_pp_var;
135 _problem->addKernel(kernel_type, kernel_name, params);
139 const std::string kernel_type =
"PorousFlowFluxLimitedTVDAdvection";
147 const std::string kernel_name =
"PorousFlowFluxLimited_DarcyFlow" +
Moose::stringify(i);
148 params.
set<UserObjectName>(
"advective_flux_calculator") =
151 _problem->addKernel(kernel_type, kernel_name, params);
153 const std::string kernel_name =
155 params.
set<NonlinearVariableName>(
"variable") =
_pp_var;
156 params.
set<UserObjectName>(
"advective_flux_calculator") =
158 _problem->addKernel(kernel_type, kernel_name, params);
163 std::string kernel_name =
"PorousFlowUnsaturated_MassTimeDerivative";
164 std::string kernel_type =
"PorousFlowMassTimeDerivative";
175 kernel_name =
"PorousFlowUnsaturated_MassTimeDerivative" +
Moose::stringify(i);
176 params.
set<
unsigned int>(
"fluid_component") = i;
180 _problem->addKernel(kernel_type, kernel_name, params);
185 params.
set<NonlinearVariableName>(
"variable") =
_pp_var;
187 params.
set<std::vector<AuxVariableName>>(
"save_in") = {
189 _problem->addKernel(kernel_type, kernel_name, params);
194 std::string kernel_name =
"PorousFlowUnsaturated_MassVolumetricExpansion";
195 std::string kernel_type =
"PorousFlowMassVolumetricExpansion";
204 kernel_name =
"PorousFlowUnsaturated_MassVolumetricExpansion" +
Moose::stringify(i);
205 params.
set<
unsigned>(
"fluid_component") = i;
207 _problem->addKernel(kernel_type, kernel_name, params);
212 params.
set<NonlinearVariableName>(
"variable") =
_pp_var;
213 _problem->addKernel(kernel_type, kernel_name, params);
220 const std::string kernel_name =
"PorousFlowUnsaturated_HeatAdvection";
221 const std::string kernel_type =
"PorousFlowHeatAdvection";
228 _problem->addKernel(kernel_type, kernel_name, params);
232 const std::string kernel_name =
"PorousFlowUnsaturated_HeatAdvection";
233 const std::string kernel_type =
"PorousFlowFluxLimitedTVDAdvection";
239 params.
set<UserObjectName>(
"advective_flux_calculator") =
"PorousFlowUnsaturatedHeat_AC";
240 _problem->addKernel(kernel_type, kernel_name, params);
258 const std::string userobject_name =
"PorousFlowUnsaturated_AC_" +
Moose::stringify(i);
261 const std::string userobject_name =
271 const std::string userobject_name =
"PorousFlowUnsaturatedHeat_AC";
284 const std::string material_type =
"PorousFlow1PhaseP";
285 const std::string material_name =
"PorousFlowUnsaturated_1PhaseP_VG_qp";
290 params.
set<std::vector<VariableName>>(
"porepressure") = {
_pp_var};
292 params.
set<
bool>(
"at_nodes") =
false;
293 _problem->addMaterial(material_type, material_name, params);
297 const std::string material_type =
"PorousFlow1PhaseP";
298 const std::string material_name =
"PorousFlowUnsaturated_1PhaseP_VG_nodal";
303 params.
set<std::vector<VariableName>>(
"porepressure") = {
_pp_var};
305 params.
set<
bool>(
"at_nodes") =
true;
306 _problem->addMaterial(material_type, material_name, params);
registerMooseAction("PorousFlowApp", PorousFlowUnsaturated, "add_user_object")
std::shared_ptr< FEProblemBase > & _problem
bool dependsOn(const T &key, const T &value)
InputParameters getValidParams(const std::string &name) const
void paramError(const std::string ¶m, Args... args) const
enum PorousFlowActionBase::StabilizationEnum _stabilization
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.
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.
void addSaturationAux(unsigned phase)
Add an AuxVariable and AuxKernel to calculate saturation.
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains
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 std::vector< VariableName > _temperature_var
Name of the temperature variable (if any)
void addAdvectiveFluxCalculatorUnsaturated(unsigned phase, bool multiply_by_density, std::string userobject_name)
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 addAdvectiveFluxCalculatorUnsaturatedMultiComponent(unsigned phase, unsigned fluid_component, bool multiply_by_density, std::string userobject_name)
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.
void addVolumetricStrainMaterial(const std::vector< VariableName > &displacements, const std::string &base_name)
Adds a quadpoint volumetric strain material.
const RealVectorValue _gravity
Gravity.
virtual void addUserObjects()
Add all other UserObjects.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
void addCapillaryPressureVG(Real m, Real alpha, std::string userobject_name, Real sat_lr=0.0)
Adds a van Genuchten capillary pressure UserObject.
void addAdvectiveFluxCalculatorUnsaturatedHeat(unsigned phase, bool multiply_by_density, std::string userobject_name)
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.
Base class for actions involving a single fluid phase.
const std::vector< AuxVariableName > _save_component_rate_in
Name of the variables (if any) that will record the fluid-components' rate of change.
virtual void addAuxObjects() override
Add all AuxVariables and AuxKernels.
static InputParameters validParams()
const VariableName _pp_var
Porepressure NonlinearVariable name.
virtual void addKernels() override
Add all Kernels.
const std::string _base_name
base_name used in the TensorMechanics strain calculator
virtual void addMaterials() override
Add all Materials.
virtual void addMaterialDependencies() override
Add all material dependencies so that the correct version of each material can be added.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
Action for simulation involving a single phase, partially or fully saturated fluid.
const Real _s_res
Residual saturation to use in the relative permeability expressions.
static InputParameters validParams()
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
virtual void addUserObjects() override
Add all other UserObjects.
PorousFlowUnsaturated(const InputParameters ¶ms)
virtual void addKernels() override
Add all Kernels.
RelpermTypeChoiceEnum
Fluid relative permeability type (FLAC or Corey)
const Real _van_genuchten_m
Van Genuchten m parameter.
virtual void addAuxObjects() override
Add all AuxVariables and AuxKernels.
const std::string _capillary_pressure_name
Name of the capillary pressure UserObject.
virtual void addMaterials() override
Add all Materials.
virtual void addMaterialDependencies() override
Add all material dependencies so that the correct version of each material can be added.
const bool _add_saturation_aux
Add an Aux Variable to record saturation.
const Real _van_genuchten_alpha
Van Genuchten alpha parameter.
const Real _relative_permeability_exponent
Relative permeability exponent.
std::string stringify(const T &t)