www.mooseframework.org
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
PorousFlowUnsaturated Class Reference

Action for simulation involving a single phase, partially or fully saturated fluid. More...

#include <PorousFlowUnsaturated.h>

Inheritance diagram for PorousFlowUnsaturated:
[legend]

Public Member Functions

 PorousFlowUnsaturated (const InputParameters &params)
 
virtual void act () override
 

Protected Types

enum  RelpermTypeChoiceEnum { RelpermTypeChoiceEnum::FLAC, RelpermTypeChoiceEnum::COREY }
 Fluid relative permeability type (FLAC or Corey) More...
 
enum  CouplingTypeEnum { CouplingTypeEnum::Hydro, CouplingTypeEnum::ThermoHydro, CouplingTypeEnum::HydroMechanical, CouplingTypeEnum::ThermoHydroMechanical }
 Determines the coupling type. More...
 
enum  SimulationTypeChoiceEnum { SimulationTypeChoiceEnum::STEADY, SimulationTypeChoiceEnum::TRANSIENT }
 Whether steady or transient simulation. More...
 

Protected Member Functions

virtual void addDictator () override
 Add the PorousFlowDictator object. More...
 
void addSaturationAux (unsigned phase)
 Add an AuxVariable and AuxKernel to calculate saturation. More...
 
void addDarcyAux (const RealVectorValue &gravity)
 Add AuxVariables and AuxKernels to calculate Darcy velocity. More...
 
void addStressAux ()
 Add AuxVariables and AuxKernels to compute effective stress. More...
 
void addTemperatureMaterial (bool at_nodes)
 Adds a nodal and a quadpoint Temperature material. More...
 
void addMassFractionMaterial (bool at_nodes)
 Adds a nodal and a quadpoint MassFraction material. More...
 
void addEffectiveFluidPressureMaterial (bool at_nodes)
 Adds a nodal and a quadpoint effective fluid pressure material. More...
 
void addVolumetricStrainMaterial (const std::vector< VariableName > &displacements, bool consistent_with_displaced_mesh)
 Adds a quadpoint volumetric strain material. More...
 
void addSingleComponentFluidMaterial (bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy, const UserObjectName &fp)
 Adds a single-component fluid Material. More...
 
void addBrineMaterial (const VariableName xnacl, bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy)
 Adds a brine fluid Material. More...
 
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. More...
 
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. More...
 
void addCapillaryPressureVG (Real m, Real alpha, std::string userobject_name)
 Adds a van Genuchten capillary pressure UserObject. More...
 

Protected Attributes

const bool _add_saturation_aux
 Add an Aux Variable to record saturation. More...
 
const Real _van_genuchten_alpha
 Van Genuchten alpha parameter. More...
 
const Real _van_genuchten_m
 Van Genuchten m parameter. More...
 
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
 
const Real _relative_permeability_exponent
 Relative permeability exponent. More...
 
const Real _s_res
 Residual saturation to use in the relative permeability expressions. More...
 
const NonlinearVariableName _pp_var
 Porepressure NonlinearVariable name. More...
 
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
 
enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum _simulation_type
 
const UserObjectName & _fp
 Name of the fluid-properties UserObject. More...
 
const Real _biot_coefficient
 Fluid specific heat capacity at constant volume. More...
 
const bool _add_darcy_aux
 Add a AuxVariables to record Darcy velocity. More...
 
const bool _add_stress_aux
 Add AuxVariables for stress. More...
 
const bool _use_brine
 Use PorousFlowBrine material. More...
 
const unsigned _nacl_index
 Index of NaCl in list of fluid components. More...
 
std::vector< std::string > _objects_to_add
 List of Kernels, AuxKernels, Materials, etc, to be added. More...
 
const std::string _dictator_name
 The name of the PorousFlowDictator object to be added. More...
 
const unsigned int _num_aqueous_equilibrium
 Number of aqueous-equilibrium secondary species. More...
 
const unsigned int _num_aqueous_kinetic
 Number of aqeuous-kinetic secondary species that are involved in mineralisation. More...
 
const RealVectorValue _gravity
 Gravity. More...
 
const std::vector< VariableName > & _mass_fraction_vars
 Name of the mass-fraction variables (if any) More...
 
const unsigned _num_mass_fraction_vars
 Number of mass-fraction variables. More...
 
const std::vector< VariableName > & _temperature_var
 Name of the temperature variable (if any) More...
 
const std::vector< NonlinearVariableName > & _displacements
 Displacement NonlinearVariable names (if any) More...
 
const unsigned _ndisp
 Number of displacement variables supplied. More...
 
std::vector< VariableName > _coupled_displacements
 Displacement Variable names. More...
 
Moose::CoordinateSystemType _coord_system
 Coordinate system of the simulation (eg RZ, XYZ, etc) More...
 
DependencyResolver< std::string > _deps
 All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies. More...
 

Detailed Description

Action for simulation involving a single phase, partially or fully saturated fluid.

The fluid's saturation is found using the van-Genuchten expression, and the relative permeability is found using the FLAC or Corey expression.

Definition at line 25 of file PorousFlowUnsaturated.h.

Member Enumeration Documentation

◆ CouplingTypeEnum

enum PorousFlowSinglePhaseBase::CouplingTypeEnum
strongprotectedinherited

Determines the coupling type.

Enumerator
Hydro 
ThermoHydro 
HydroMechanical 
ThermoHydroMechanical 

Definition at line 37 of file PorousFlowSinglePhaseBase.h.

37  {
38  Hydro,
39  ThermoHydro,
40  HydroMechanical,
41  ThermoHydroMechanical
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type

◆ RelpermTypeChoiceEnum

Fluid relative permeability type (FLAC or Corey)

Enumerator
FLAC 
COREY 

Definition at line 43 of file PorousFlowUnsaturated.h.

43 { FLAC, COREY } _relperm_type;
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type

◆ SimulationTypeChoiceEnum

Whether steady or transient simulation.

Enumerator
STEADY 
TRANSIENT 

Definition at line 45 of file PorousFlowSinglePhaseBase.h.

45 { STEADY, TRANSIENT } _simulation_type;
enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum _simulation_type

Constructor & Destructor Documentation

◆ PorousFlowUnsaturated()

PorousFlowUnsaturated::PorousFlowUnsaturated ( const InputParameters &  params)

Definition at line 68 of file PorousFlowUnsaturated.C.

69  : PorousFlowSinglePhaseBase(params),
70  _add_saturation_aux(getParam<bool>("add_saturation_aux")),
71  _van_genuchten_alpha(getParam<Real>("van_genuchten_alpha")),
72  _van_genuchten_m(getParam<Real>("van_genuchten_m")),
74  getParam<MooseEnum>("relative_permeability_type").getEnum<RelpermTypeChoiceEnum>()),
75  _relative_permeability_exponent(getParam<Real>("relative_permeability_exponent")),
76  _s_res(getParam<Real>("residual_saturation"))
77 {
78  _objects_to_add.push_back("PorousFlowAdvectiveFlux");
80  _objects_to_add.push_back("PorousFlowMassTimeDerivative");
84  _objects_to_add.push_back("PorousFlowMassVolumetricExpansion");
87  _objects_to_add.push_back("PorousFlowHeatAdvection");
89  _objects_to_add.push_back("SaturationAux");
90 }
const Real _van_genuchten_m
Van Genuchten m parameter.
const bool _add_saturation_aux
Add an Aux Variable to record saturation.
const Real _van_genuchten_alpha
Van Genuchten alpha parameter.
const Real _s_res
Residual saturation to use in the relative permeability expressions.
std::vector< std::string > _objects_to_add
List of Kernels, AuxKernels, Materials, etc, to be added.
const Real _relative_permeability_exponent
Relative permeability exponent.
PorousFlowSinglePhaseBase(const InputParameters &params)
enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum _simulation_type
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type

Member Function Documentation

◆ act()

void PorousFlowUnsaturated::act ( )
overridevirtual

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 93 of file PorousFlowUnsaturated.C.

94 {
96 
97  // add the kernels
98  if (_current_task == "add_kernel")
99  {
100  std::string kernel_name = "PorousFlowUnsaturated_AdvectiveFlux";
101  std::string kernel_type = "PorousFlowAdvectiveFlux";
102  InputParameters params = _factory.getValidParams(kernel_type);
103  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
104  params.set<RealVectorValue>("gravity") = _gravity;
105 
106  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
107  {
108  kernel_name = "PorousFlowUnsaturated_AdvectiveFlux" + Moose::stringify(i);
109  params.set<unsigned int>("fluid_component") = i;
110  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
111  _problem->addKernel(kernel_type, kernel_name, params);
112  }
113  kernel_name = "PorousFlowUnsaturated_AdvectiveFlux" + Moose::stringify(_num_mass_fraction_vars);
114  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
115  params.set<NonlinearVariableName>("variable") = _pp_var;
116  _problem->addKernel(kernel_type, kernel_name, params);
117  }
118  if (_current_task == "add_kernel" && _simulation_type == SimulationTypeChoiceEnum::TRANSIENT)
119  {
120  std::string kernel_name = "PorousFlowUnsaturated_MassTimeDerivative";
121  std::string kernel_type = "PorousFlowMassTimeDerivative";
122  InputParameters params = _factory.getValidParams(kernel_type);
123  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
124 
125  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
126  {
127  kernel_name = "PorousFlowUnsaturated_MassTimeDerivative" + Moose::stringify(i);
128  params.set<unsigned int>("fluid_component") = i;
129  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
130  _problem->addKernel(kernel_type, kernel_name, params);
131  }
132  kernel_name =
133  "PorousFlowUnsaturated_MassTimeDerivative" + Moose::stringify(_num_mass_fraction_vars);
134  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
135  params.set<NonlinearVariableName>("variable") = _pp_var;
136  _problem->addKernel(kernel_type, kernel_name, params);
137  }
138 
141  _current_task == "add_kernel" && _simulation_type == SimulationTypeChoiceEnum::TRANSIENT)
142  {
143  std::string kernel_name = "PorousFlowUnsaturated_MassVolumetricExpansion";
144  std::string kernel_type = "PorousFlowMassVolumetricExpansion";
145  InputParameters params = _factory.getValidParams(kernel_type);
146  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
147  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
148  {
149  kernel_name = "PorousFlowUnsaturated_MassVolumetricExpansion" + Moose::stringify(i);
150  params.set<unsigned>("fluid_component") = i;
151  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
152  _problem->addKernel(kernel_type, kernel_name, params);
153  }
154  kernel_name =
155  "PorousFlowUnsaturated_MassVolumetricExpansion" + Moose::stringify(_num_mass_fraction_vars);
156  params.set<unsigned>("fluid_component") = _num_mass_fraction_vars;
157  params.set<NonlinearVariableName>("variable") = _pp_var;
158  _problem->addKernel(kernel_type, kernel_name, params);
159  }
160 
163  _current_task == "add_kernel")
164  {
165  std::string kernel_name = "PorousFlowUnsaturated_HeatAdvection";
166  std::string kernel_type = "PorousFlowHeatAdvection";
167  InputParameters params = _factory.getValidParams(kernel_type);
168  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
169  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
170  params.set<RealVectorValue>("gravity") = _gravity;
171  _problem->addKernel(kernel_type, kernel_name, params);
172  }
173 
174  // Add the capillary pressure UserObject
175  std::string capillary_pressure_name = "PorousFlowUnsaturated_CapillaryPressureVG";
177 
178  if (_deps.dependsOn(_objects_to_add, "pressure_saturation_qp") && _current_task == "add_material")
179  {
180  std::string material_type = "PorousFlow1PhaseP";
181  InputParameters params = _factory.getValidParams(material_type);
182 
183  std::string material_name = "PorousFlowUnsaturated_1PhaseP_VG_qp";
184  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
185  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
186  params.set<UserObjectName>("capillary_pressure") = capillary_pressure_name;
187  params.set<bool>("at_nodes") = false;
188  _problem->addMaterial(material_type, material_name, params);
189  }
190  if (_deps.dependsOn(_objects_to_add, "pressure_saturation_nodal") &&
191  _current_task == "add_material")
192  {
193  std::string material_type = "PorousFlow1PhaseP";
194  InputParameters params = _factory.getValidParams(material_type);
195 
196  std::string material_name = "PorousFlowUnsaturated_1PhaseP_VG_nodal";
197  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
198  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
199  params.set<UserObjectName>("capillary_pressure") = capillary_pressure_name;
200  params.set<bool>("at_nodes") = true;
201  _problem->addMaterial(material_type, material_name, params);
202  }
203 
204  if (_deps.dependsOn(_objects_to_add, "relative_permeability_qp"))
205  {
208  else
210  }
211  if (_deps.dependsOn(_objects_to_add, "relative_permeability_nodal"))
212  {
215  else
217  }
218 
219  if (_deps.dependsOn(_objects_to_add, "volumetric_strain_qp") ||
220  _deps.dependsOn(_objects_to_add, "volumetric_strain_nodal"))
222 
223  // add relevant AuxVariables and AuxKernels
225  addSaturationAux(0);
226 }
const std::vector< VariableName > & _mass_fraction_vars
Name of the mass-fraction variables (if any)
void addSaturationAux(unsigned phase)
Add an AuxVariable and AuxKernel to calculate saturation.
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.
const bool _add_saturation_aux
Add an Aux Variable to record saturation.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
const Real _van_genuchten_alpha
Van Genuchten alpha parameter.
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.
std::vector< std::string > _objects_to_add
List of Kernels, AuxKernels, Materials, etc, to be added.
const NonlinearVariableName _pp_var
Porepressure NonlinearVariable name.
const RealVectorValue _gravity
Gravity.
const std::vector< VariableName > & _temperature_var
Name of the temperature variable (if any)
const Real _relative_permeability_exponent
Relative permeability exponent.
enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum _simulation_type
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
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.
void addVolumetricStrainMaterial(const std::vector< VariableName > &displacements, bool consistent_with_displaced_mesh)
Adds a quadpoint volumetric strain material.
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.

◆ addBrineMaterial()

void PorousFlowActionBase::addBrineMaterial ( const VariableName  xnacl,
bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy 
)
protectedinherited

Adds a brine fluid Material.

Parameters
xnaclthe variable containing the mass fraction of NaCl in the fluid
phasethe phase number of the fluid
compute_density_and_viscositycompute the density and viscosity of the fluid
compute_internal_energycompute the fluid internal energy
compute_enthalpycompute the fluid enthalpy
at_nodesadd a nodal material

Definition at line 384 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

390 {
391  if (_current_task == "add_material")
392  {
393  std::string material_type = "PorousFlowBrine";
394  InputParameters params = _factory.getValidParams(material_type);
395 
396  params.set<std::vector<VariableName>>("xnacl") = {nacl_brine};
397  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
398  params.set<unsigned int>("phase") = phase;
399  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
400  params.set<bool>("compute_internal_energy") = compute_internal_energy;
401  params.set<bool>("compute_enthalpy") = compute_enthalpy;
402 
403  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
404  if (at_nodes)
405  material_name = "PorousFlowActionBase_FluidProperties";
406 
407  params.set<bool>("at_nodes") = at_nodes;
408  _problem->addMaterial(material_type, material_name, params);
409  }
410 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addCapillaryPressureVG()

void PorousFlowActionBase::addCapillaryPressureVG ( Real  m,
Real  alpha,
std::string  userobject_name 
)
protectedinherited

Adds a van Genuchten capillary pressure UserObject.

Parameters
mvan Genuchten exponent
alphavan Genuchten alpha
userobject_namename of the user object

Definition at line 462 of file PorousFlowActionBase.C.

Referenced by act().

463 {
464  if (_current_task == "add_user_object")
465  {
466  std::string userobject_type = "PorousFlowCapillaryPressureVG";
467  InputParameters params = _factory.getValidParams(userobject_type);
468  params.set<Real>("m") = m;
469  params.set<Real>("alpha") = alpha;
470  _problem->addUserObject(userobject_type, userobject_name, params);
471  }
472 }

◆ addDarcyAux()

void PorousFlowActionBase::addDarcyAux ( const RealVectorValue &  gravity)
protectedinherited

Add AuxVariables and AuxKernels to calculate Darcy velocity.

Parameters
gravitygravitational acceleration pointing downwards (eg (0, 0, -9.8))

Definition at line 130 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

131 {
132  if (_current_task == "add_aux_variable")
133  {
134  _problem->addAuxVariable("darcy_vel_x",
135  FEType(Utility::string_to_enum<Order>("CONSTANT"),
136  Utility::string_to_enum<FEFamily>("MONOMIAL")));
137  _problem->addAuxVariable("darcy_vel_y",
138  FEType(Utility::string_to_enum<Order>("CONSTANT"),
139  Utility::string_to_enum<FEFamily>("MONOMIAL")));
140  _problem->addAuxVariable("darcy_vel_z",
141  FEType(Utility::string_to_enum<Order>("CONSTANT"),
142  Utility::string_to_enum<FEFamily>("MONOMIAL")));
143  }
144 
145  if (_current_task == "add_aux_kernel")
146  {
147  std::string aux_kernel_type = "PorousFlowDarcyVelocityComponent";
148  InputParameters params = _factory.getValidParams(aux_kernel_type);
149 
150  params.set<RealVectorValue>("gravity") = gravity;
151  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
152  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
153 
154  std::string aux_kernel_name = "PorousFlowActionBase_Darcy_x_Aux";
155  params.set<MooseEnum>("component") = "x";
156  params.set<AuxVariableName>("variable") = "darcy_vel_x";
157  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
158 
159  aux_kernel_name = "PorousFlowActionBase_Darcy_y_Aux";
160  params.set<MooseEnum>("component") = "y";
161  params.set<AuxVariableName>("variable") = "darcy_vel_y";
162  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
163 
164  aux_kernel_name = "PorousFlowActionBase_Darcy_z_Aux";
165  params.set<MooseEnum>("component") = "z";
166  params.set<AuxVariableName>("variable") = "darcy_vel_z";
167  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
168  }
169 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addDictator()

void PorousFlowSinglePhaseBase::addDictator ( )
overrideprotectedvirtualinherited

Add the PorousFlowDictator object.

Implements PorousFlowActionBase.

Definition at line 255 of file PorousFlowSinglePhaseBase.C.

256 {
257  std::string uo_name = _dictator_name;
258  std::string uo_type = "PorousFlowDictator";
259  InputParameters params = _factory.getValidParams(uo_type);
260  std::vector<VariableName> pf_vars = _mass_fraction_vars;
261  pf_vars.push_back(_pp_var);
264  pf_vars.push_back(_temperature_var[0]);
267  pf_vars.insert(pf_vars.end(), _coupled_displacements.begin(), _coupled_displacements.end());
268  params.set<std::vector<VariableName>>("porous_flow_vars") = pf_vars;
269  params.set<unsigned int>("number_fluid_phases") = 1;
270  params.set<unsigned int>("number_fluid_components") = _num_mass_fraction_vars + 1;
271  params.set<unsigned int>("number_aqueous_equilibrium") = _num_aqueous_equilibrium;
272  params.set<unsigned int>("number_aqueous_kinetic") = _num_aqueous_kinetic;
273  _problem->addUserObject(uo_type, uo_name, params);
274 }
const std::vector< VariableName > & _mass_fraction_vars
Name of the mass-fraction variables (if any)
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
const unsigned int _num_aqueous_kinetic
Number of aqeuous-kinetic secondary species that are involved in mineralisation.
const NonlinearVariableName _pp_var
Porepressure NonlinearVariable name.
const std::vector< VariableName > & _temperature_var
Name of the temperature variable (if any)
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.

◆ addEffectiveFluidPressureMaterial()

void PorousFlowActionBase::addEffectiveFluidPressureMaterial ( bool  at_nodes)
protectedinherited

Adds a nodal and a quadpoint effective fluid pressure material.

Parameters
at_nodesAdd nodal effective fluid pressure material

Definition at line 319 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

320 {
321  if (_current_task == "add_material")
322  {
323  std::string material_type = "PorousFlowEffectiveFluidPressure";
324  InputParameters params = _factory.getValidParams(material_type);
325 
326  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
327 
328  std::string material_name = "PorousFlowUnsaturated_EffectiveFluidPressure_qp";
329  if (at_nodes)
330  material_name = "PorousFlowUnsaturated_EffectiveFluidPressure";
331 
332  params.set<bool>("at_nodes") = at_nodes;
333  _problem->addMaterial(material_type, material_name, params);
334  }
335 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addMassFractionMaterial()

void PorousFlowActionBase::addMassFractionMaterial ( bool  at_nodes)
protectedinherited

Adds a nodal and a quadpoint MassFraction material.

Parameters
at_nodesAdd nodal mass-fraction material

Definition at line 294 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

295 {
296  if (_current_task == "add_material")
297  {
298  if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
299  parameters().hasCoupledValue("mass_fraction_vars")))
300  mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
301  "mass_fraction_vars");
302 
303  std::string material_type = "PorousFlowMassFraction";
304  InputParameters params = _factory.getValidParams(material_type);
305 
306  params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
307  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
308 
309  std::string material_name = "PorousFlowActionBase_MassFraction_qp";
310  if (at_nodes)
311  material_name = "PorousFlowActionBase_MassFraction";
312 
313  params.set<bool>("at_nodes") = at_nodes;
314  _problem->addMaterial(material_type, material_name, params);
315  }
316 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addRelativePermeabilityCorey()

void PorousFlowActionBase::addRelativePermeabilityCorey ( bool  at_nodes,
unsigned  phase,
Real  n,
Real  s_res,
Real  sum_s_res 
)
protectedinherited

Adds a relative-permeability Material of the Corey variety.

Parameters
phasethe phase number of the fluid
nThe Corey exponent
s_resThe residual saturation for this phase
sum_s_resThe sum of residual saturations over all phases

Definition at line 413 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::act(), act(), and PorousFlowBasicTHM::act().

416 {
417  if (_current_task == "add_material")
418  {
419  std::string material_type = "PorousFlowRelativePermeabilityCorey";
420  InputParameters params = _factory.getValidParams(material_type);
421 
422  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
423  params.set<Real>("n") = n;
424  params.set<unsigned int>("phase") = phase;
425  params.set<Real>("s_res") = s_res;
426  params.set<Real>("sum_s_res") = sum_s_res;
427 
428  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
429  if (at_nodes)
430  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
431 
432  params.set<bool>("at_nodes") = at_nodes;
433  _problem->addMaterial(material_type, material_name, params);
434  }
435 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addRelativePermeabilityFLAC()

void PorousFlowActionBase::addRelativePermeabilityFLAC ( bool  at_nodes,
unsigned  phase,
Real  m,
Real  s_res,
Real  sum_s_res 
)
protectedinherited

Adds a relative-permeability Material of the FLAC variety.

Parameters
phasethe phase number of the fluid
mThe FLAC exponent
s_resThe residual saturation for this phase
sum_s_resThe sum of residual saturations over all phases

Definition at line 438 of file PorousFlowActionBase.C.

Referenced by act().

440 {
441  if (_current_task == "add_material")
442  {
443  std::string material_type = "PorousFlowRelativePermeabilityFLAC";
444  InputParameters params = _factory.getValidParams(material_type);
445 
446  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
447  params.set<Real>("m") = m;
448  params.set<unsigned int>("phase") = phase;
449  params.set<Real>("s_res") = s_res;
450  params.set<Real>("sum_s_res") = sum_s_res;
451 
452  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
453  if (at_nodes)
454  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
455 
456  params.set<bool>("at_nodes") = at_nodes;
457  _problem->addMaterial(material_type, material_name, params);
458  }
459 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addSaturationAux()

void PorousFlowActionBase::addSaturationAux ( unsigned  phase)
protectedinherited

Add an AuxVariable and AuxKernel to calculate saturation.

Parameters
phaseSaturation for this fluid phase

Definition at line 106 of file PorousFlowActionBase.C.

Referenced by act().

107 {
108  std::string phase_str = Moose::stringify(phase);
109 
110  if (_current_task == "add_aux_variable")
111  _problem->addAuxVariable("saturation" + phase_str,
112  FEType(Utility::string_to_enum<Order>("CONSTANT"),
113  Utility::string_to_enum<FEFamily>("MONOMIAL")));
114 
115  if (_current_task == "add_aux_kernel")
116  {
117  std::string aux_kernel_type = "MaterialStdVectorAux";
118  InputParameters params = _factory.getValidParams(aux_kernel_type);
119 
120  std::string aux_kernel_name = "PorousFlowActionBase_SaturationAux" + phase_str;
121  params.set<MaterialPropertyName>("property") = "PorousFlow_saturation_qp";
122  params.set<unsigned>("index") = phase;
123  params.set<AuxVariableName>("variable") = "saturation" + phase_str;
124  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
125  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
126  }
127 }

◆ addSingleComponentFluidMaterial()

void PorousFlowActionBase::addSingleComponentFluidMaterial ( bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy,
const UserObjectName &  fp 
)
protectedinherited

Adds a single-component fluid Material.

Parameters
phasethe phase number of the fluid
fpthe name of the FluidProperties UserObject
compute_density_and_viscositycompute the density and viscosity of the fluid
compute_internal_energycompute the fluid internal energy
compute_enthalpycompute the fluid enthalpy
at_nodesadd a nodal material

Definition at line 355 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

361 {
362  if (_current_task == "add_material")
363  {
364  std::string material_type = "PorousFlowSingleComponentFluid";
365  InputParameters params = _factory.getValidParams(material_type);
366 
367  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
368  params.set<unsigned int>("phase") = phase;
369  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
370  params.set<bool>("compute_internal_energy") = compute_internal_energy;
371  params.set<bool>("compute_enthalpy") = compute_enthalpy;
372  params.set<UserObjectName>("fp") = fp;
373 
374  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
375  if (at_nodes)
376  material_name = "PorousFlowActionBase_FluidProperties";
377 
378  params.set<bool>("at_nodes") = at_nodes;
379  _problem->addMaterial(material_type, material_name, params);
380  }
381 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addStressAux()

void PorousFlowActionBase::addStressAux ( )
protectedinherited

Add AuxVariables and AuxKernels to compute effective stress.

Definition at line 172 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

173 {
174  if (_current_task == "add_aux_variable")
175  {
176  _problem->addAuxVariable("stress_xx",
177  FEType(Utility::string_to_enum<Order>("CONSTANT"),
178  Utility::string_to_enum<FEFamily>("MONOMIAL")));
179  _problem->addAuxVariable("stress_xy",
180  FEType(Utility::string_to_enum<Order>("CONSTANT"),
181  Utility::string_to_enum<FEFamily>("MONOMIAL")));
182  _problem->addAuxVariable("stress_xz",
183  FEType(Utility::string_to_enum<Order>("CONSTANT"),
184  Utility::string_to_enum<FEFamily>("MONOMIAL")));
185  _problem->addAuxVariable("stress_yx",
186  FEType(Utility::string_to_enum<Order>("CONSTANT"),
187  Utility::string_to_enum<FEFamily>("MONOMIAL")));
188  _problem->addAuxVariable("stress_yy",
189  FEType(Utility::string_to_enum<Order>("CONSTANT"),
190  Utility::string_to_enum<FEFamily>("MONOMIAL")));
191  _problem->addAuxVariable("stress_yz",
192  FEType(Utility::string_to_enum<Order>("CONSTANT"),
193  Utility::string_to_enum<FEFamily>("MONOMIAL")));
194  _problem->addAuxVariable("stress_zx",
195  FEType(Utility::string_to_enum<Order>("CONSTANT"),
196  Utility::string_to_enum<FEFamily>("MONOMIAL")));
197  _problem->addAuxVariable("stress_zy",
198  FEType(Utility::string_to_enum<Order>("CONSTANT"),
199  Utility::string_to_enum<FEFamily>("MONOMIAL")));
200  _problem->addAuxVariable("stress_zz",
201  FEType(Utility::string_to_enum<Order>("CONSTANT"),
202  Utility::string_to_enum<FEFamily>("MONOMIAL")));
203  }
204 
205  if (_current_task == "add_aux_kernel")
206  {
207  std::string aux_kernel_type = "RankTwoAux";
208  InputParameters params = _factory.getValidParams(aux_kernel_type);
209 
210  params.set<MaterialPropertyName>("rank_two_tensor") = "stress";
211  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
212 
213  std::string aux_kernel_name = "PorousFlowAction_stress_xx";
214  params.set<AuxVariableName>("variable") = "stress_xx";
215  params.set<unsigned>("index_i") = 0;
216  params.set<unsigned>("index_j") = 0;
217  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
218 
219  aux_kernel_name = "PorousFlowAction_stress_xy";
220  params.set<AuxVariableName>("variable") = "stress_xy";
221  params.set<unsigned>("index_i") = 0;
222  params.set<unsigned>("index_j") = 1;
223  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
224 
225  aux_kernel_name = "PorousFlowAction_stress_xz";
226  params.set<AuxVariableName>("variable") = "stress_xz";
227  params.set<unsigned>("index_i") = 0;
228  params.set<unsigned>("index_j") = 2;
229  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
230 
231  aux_kernel_name = "PorousFlowAction_stress_yx";
232  params.set<AuxVariableName>("variable") = "stress_yx";
233  params.set<unsigned>("index_i") = 1;
234  params.set<unsigned>("index_j") = 0;
235  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
236 
237  aux_kernel_name = "PorousFlowAction_stress_yy";
238  params.set<AuxVariableName>("variable") = "stress_yy";
239  params.set<unsigned>("index_i") = 1;
240  params.set<unsigned>("index_j") = 1;
241  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
242 
243  aux_kernel_name = "PorousFlowAction_stress_yz";
244  params.set<AuxVariableName>("variable") = "stress_yz";
245  params.set<unsigned>("index_i") = 1;
246  params.set<unsigned>("index_j") = 2;
247  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
248 
249  aux_kernel_name = "PorousFlowAction_stress_zx";
250  params.set<AuxVariableName>("variable") = "stress_zx";
251  params.set<unsigned>("index_i") = 2;
252  params.set<unsigned>("index_j") = 0;
253  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
254 
255  aux_kernel_name = "PorousFlowAction_stress_zy";
256  params.set<AuxVariableName>("variable") = "stress_zy";
257  params.set<unsigned>("index_i") = 2;
258  params.set<unsigned>("index_j") = 1;
259  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
260 
261  aux_kernel_name = "PorousFlowAction_stress_zz";
262  params.set<AuxVariableName>("variable") = "stress_zz";
263  params.set<unsigned>("index_i") = 2;
264  params.set<unsigned>("index_j") = 2;
265  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
266  }
267 }

◆ addTemperatureMaterial()

void PorousFlowActionBase::addTemperatureMaterial ( bool  at_nodes)
protectedinherited

Adds a nodal and a quadpoint Temperature material.

Parameters
at_nodesAdd nodal temperature Material

Definition at line 270 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

271 {
272  if (_current_task == "add_material")
273  {
274  if (!parameters().hasDefaultCoupledValue("temperature"))
275  mooseError(
276  "Attempt to add a PorousFlowTemperature material without setting a temperature variable");
277 
278  std::string material_type = "PorousFlowTemperature";
279  InputParameters params = _factory.getValidParams(material_type);
280 
281  params.applySpecificParameters(parameters(), {"temperature"});
282  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
283 
284  std::string material_name = "PorousFlowActionBase_Temperature_qp";
285  if (at_nodes)
286  material_name = "PorousFlowActionBase_Temperature";
287 
288  params.set<bool>("at_nodes") = at_nodes;
289  _problem->addMaterial(material_type, material_name, params);
290  }
291 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addVolumetricStrainMaterial()

void PorousFlowActionBase::addVolumetricStrainMaterial ( const std::vector< VariableName > &  displacements,
bool  consistent_with_displaced_mesh 
)
protectedinherited

Adds a quadpoint volumetric strain material.

Parameters
displacementsthe names of the displacement variables
consistent_with_displaced_meshThe volumetric strain should be consistent with the displaced mesh

Definition at line 338 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::act(), act(), and PorousFlowBasicTHM::act().

340 {
341  if (_current_task == "add_material")
342  {
343  std::string material_type = "PorousFlowVolumetricStrain";
344  InputParameters params = _factory.getValidParams(material_type);
345 
346  std::string material_name = "PorousFlowActionBase_VolumetricStrain";
347  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
348  params.set<std::vector<VariableName>>("displacements") = displacements;
349  params.set<bool>("consistent_with_displaced_mesh") = consistent_with_displaced_mesh;
350  _problem->addMaterial(material_type, material_name, params);
351  }
352 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

Member Data Documentation

◆ _add_darcy_aux

const bool PorousFlowSinglePhaseBase::_add_darcy_aux
protectedinherited

Add a AuxVariables to record Darcy velocity.

Definition at line 54 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and PorousFlowSinglePhaseBase::PorousFlowSinglePhaseBase().

◆ _add_saturation_aux

const bool PorousFlowUnsaturated::_add_saturation_aux
protected

Add an Aux Variable to record saturation.

Definition at line 34 of file PorousFlowUnsaturated.h.

Referenced by act(), and PorousFlowUnsaturated().

◆ _add_stress_aux

const bool PorousFlowSinglePhaseBase::_add_stress_aux
protectedinherited

Add AuxVariables for stress.

Definition at line 57 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and PorousFlowSinglePhaseBase::PorousFlowSinglePhaseBase().

◆ _biot_coefficient

const Real PorousFlowSinglePhaseBase::_biot_coefficient
protectedinherited

Fluid specific heat capacity at constant volume.

Definition at line 51 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and PorousFlowBasicTHM::act().

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protectedinherited

Coordinate system of the simulation (eg RZ, XYZ, etc)

Definition at line 73 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and PorousFlowActionBase::act().

◆ _coupled_displacements

std::vector<VariableName> PorousFlowActionBase::_coupled_displacements
protectedinherited

◆ _coupling_type

enum PorousFlowSinglePhaseBase::CouplingTypeEnum PorousFlowSinglePhaseBase::_coupling_type
protectedinherited

◆ _deps

DependencyResolver<std::string> PorousFlowDependencies::_deps
protectedinherited

All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.

Definition at line 38 of file PorousFlowDependencies.h.

Referenced by PorousFlowFullySaturated::act(), PorousFlowSinglePhaseBase::act(), act(), PorousFlowBasicTHM::act(), PorousFlowAddMaterialAction::isPFMaterialRequired(), and PorousFlowDependencies::PorousFlowDependencies().

◆ _dictator_name

const std::string PorousFlowActionBase::_dictator_name
protectedinherited

◆ _displacements

const std::vector<NonlinearVariableName>& PorousFlowActionBase::_displacements
protectedinherited

Displacement NonlinearVariable names (if any)

Definition at line 64 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and PorousFlowActionBase::PorousFlowActionBase().

◆ _fp

const UserObjectName& PorousFlowSinglePhaseBase::_fp
protectedinherited

Name of the fluid-properties UserObject.

Definition at line 48 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and PorousFlowSinglePhaseBase::PorousFlowSinglePhaseBase().

◆ _gravity

const RealVectorValue PorousFlowActionBase::_gravity
protectedinherited

◆ _mass_fraction_vars

const std::vector<VariableName>& PorousFlowActionBase::_mass_fraction_vars
protectedinherited

Name of the mass-fraction variables (if any)

Definition at line 55 of file PorousFlowActionBase.h.

Referenced by PorousFlowFullySaturated::act(), PorousFlowSinglePhaseBase::act(), act(), and PorousFlowSinglePhaseBase::addDictator().

◆ _nacl_index

const unsigned PorousFlowSinglePhaseBase::_nacl_index
protectedinherited

Index of NaCl in list of fluid components.

Definition at line 63 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and PorousFlowSinglePhaseBase::PorousFlowSinglePhaseBase().

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protectedinherited

Number of displacement variables supplied.

Definition at line 67 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and PorousFlowActionBase::PorousFlowActionBase().

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowActionBase::_num_aqueous_equilibrium
protectedinherited

Number of aqueous-equilibrium secondary species.

Definition at line 46 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::addDictator().

◆ _num_aqueous_kinetic

const unsigned int PorousFlowActionBase::_num_aqueous_kinetic
protectedinherited

Number of aqeuous-kinetic secondary species that are involved in mineralisation.

Definition at line 49 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::addDictator().

◆ _num_mass_fraction_vars

const unsigned PorousFlowActionBase::_num_mass_fraction_vars
protectedinherited

◆ _objects_to_add

std::vector<std::string> PorousFlowActionBase::_objects_to_add
protectedinherited

List of Kernels, AuxKernels, Materials, etc, to be added.

This list will be used to determine what Materials need to be added. Actions may add or remove things from this list

Definition at line 40 of file PorousFlowActionBase.h.

Referenced by PorousFlowFullySaturated::act(), PorousFlowSinglePhaseBase::act(), act(), PorousFlowBasicTHM::act(), PorousFlowBasicTHM::PorousFlowBasicTHM(), PorousFlowFullySaturated::PorousFlowFullySaturated(), PorousFlowSinglePhaseBase::PorousFlowSinglePhaseBase(), and PorousFlowUnsaturated().

◆ _pp_var

const NonlinearVariableName PorousFlowSinglePhaseBase::_pp_var
protectedinherited

Porepressure NonlinearVariable name.

Definition at line 34 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowFullySaturated::act(), act(), PorousFlowBasicTHM::act(), and PorousFlowSinglePhaseBase::addDictator().

◆ _relative_permeability_exponent

const Real PorousFlowUnsaturated::_relative_permeability_exponent
protected

Relative permeability exponent.

Definition at line 46 of file PorousFlowUnsaturated.h.

Referenced by act().

◆ _relperm_type

enum PorousFlowUnsaturated::RelpermTypeChoiceEnum PorousFlowUnsaturated::_relperm_type
protected

Referenced by act().

◆ _s_res

const Real PorousFlowUnsaturated::_s_res
protected

Residual saturation to use in the relative permeability expressions.

Definition at line 49 of file PorousFlowUnsaturated.h.

Referenced by act().

◆ _simulation_type

enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum PorousFlowSinglePhaseBase::_simulation_type
protectedinherited

◆ _temperature_var

const std::vector<VariableName>& PorousFlowActionBase::_temperature_var
protectedinherited

◆ _use_brine

const bool PorousFlowSinglePhaseBase::_use_brine
protectedinherited

◆ _van_genuchten_alpha

const Real PorousFlowUnsaturated::_van_genuchten_alpha
protected

Van Genuchten alpha parameter.

Definition at line 37 of file PorousFlowUnsaturated.h.

Referenced by act().

◆ _van_genuchten_m

const Real PorousFlowUnsaturated::_van_genuchten_m
protected

Van Genuchten m parameter.

Definition at line 40 of file PorousFlowUnsaturated.h.

Referenced by act().


The documentation for this class was generated from the following files: