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  StabilizationEnum { StabilizationEnum::Full, StabilizationEnum::KT }
 

Protected Member Functions

virtual void addKernels () override
 Add all Kernels. More...
 
virtual void addAuxObjects () override
 Add all AuxVariables and AuxKernels. More...
 
virtual void addMaterialDependencies () override
 Add all material dependencies so that the correct version of each material can be added. More...
 
virtual void addMaterials () override
 Add all Materials. More...
 
virtual void addUserObjects () override
 Add all other UserObjects. More...
 
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...
 
void addAdvectiveFluxCalculatorSaturated (unsigned phase, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorUnsaturated (unsigned phase, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorSaturatedHeat (unsigned phase, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorUnsaturatedHeat (unsigned phase, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorSaturatedMultiComponent (unsigned phase, unsigned fluid_component, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorUnsaturatedMultiComponent (unsigned phase, unsigned fluid_component, bool multiply_by_density, std::string userobject_name)
 

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 std::string _capillary_pressure_name
 Name of the capillary pressure UserObject. More...
 
const VariableName _pp_var
 Porepressure NonlinearVariable name. More...
 
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
 
const bool _thermal
 Flags to indicate whether thermal or mechanical effects are included. More...
 
const bool _mechanical
 
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 > _included_objects
 List of Kernels, AuxKernels, Materials, etc, that are added in this input file. 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< VariableName > & _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...
 
const MooseEnum _flux_limiter_type
 Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme. More...
 
enum PorousFlowActionBase::StabilizationEnum _stabilization
 
Moose::CoordinateSystemType _coord_system
 Coordinate system of the simulation (eg RZ, XYZ, etc) More...
 
bool _transient
 Flag to denote if the simulation is transient. 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 39 of file PorousFlowSinglePhaseBase.h.

39  {
40  Hydro,
41  ThermoHydro,
42  HydroMechanical,
43  ThermoHydroMechanical
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type

◆ RelpermTypeChoiceEnum

Fluid relative permeability type (FLAC or Corey)

Enumerator
FLAC 
COREY 

Definition at line 47 of file PorousFlowUnsaturated.h.

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

◆ StabilizationEnum

enum PorousFlowActionBase::StabilizationEnum
strongprotectedinherited
Enumerator
Full 
KT 

Definition at line 84 of file PorousFlowActionBase.h.

84 { Full, KT } _stabilization;
enum PorousFlowActionBase::StabilizationEnum _stabilization

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  _capillary_pressure_name("PorousFlowUnsaturated_CapillaryPressureVG")
78 {
79 }
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.
const Real _relative_permeability_exponent
Relative permeability exponent.
PorousFlowSinglePhaseBase(const InputParameters &params)
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
const std::string _capillary_pressure_name
Name of the capillary pressure UserObject.

Member Function Documentation

◆ act()

void PorousFlowActionBase::act ( )
overridevirtualinherited

Definition at line 106 of file PorousFlowActionBase.C.

107 {
108  // Check if the simulation is transient (note: can't do this in the ctor)
109  _transient = _problem->isTransient();
110 
111  // Make sure that all mesh subdomains have the same coordinate system
112  const auto & all_subdomains = _problem->mesh().meshSubdomains();
113  if (all_subdomains.empty())
114  mooseError("No subdomains found");
115  _coord_system = _problem->getCoordSystem(*all_subdomains.begin());
116  for (const auto & subdomain : all_subdomains)
117  if (_problem->getCoordSystem(subdomain) != _coord_system)
118  mooseError(
119  "The PorousFlow Actions require all subdomains to have the same coordinate system.");
120 
121  // Note: this must be called before addMaterials!
123 
124  // Make the vector of added objects unique
125  std::sort(_included_objects.begin(), _included_objects.end());
126  _included_objects.erase(std::unique(_included_objects.begin(), _included_objects.end()),
127  _included_objects.end());
128 
129  if (_current_task == "add_user_object")
130  addUserObjects();
131 
132  if (_current_task == "add_aux_variable" || _current_task == "add_aux_kernel")
133  addAuxObjects();
134 
135  if (_current_task == "add_kernel")
136  addKernels();
137 
138  if (_current_task == "add_material")
139  addMaterials();
140 }
Moose::CoordinateSystemType _coord_system
Coordinate system of the simulation (eg RZ, XYZ, etc)
virtual void addKernels()
Add all Kernels.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
virtual void addMaterials()
Add all Materials.
bool _transient
Flag to denote if the simulation is transient.
virtual void addAuxObjects()
Add all AuxVariables and AuxKernels.
virtual void addUserObjects()
Add all other UserObjects.
virtual void addMaterialDependencies()
Add all material dependencies so that the correct version of each material can be added...

◆ addAdvectiveFluxCalculatorSaturated()

void PorousFlowActionBase::addAdvectiveFluxCalculatorSaturated ( unsigned  phase,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 555 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

558 {
559  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
560  {
561  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturated";
562  InputParameters params = _factory.getValidParams(userobject_type);
563  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
564  params.set<RealVectorValue>("gravity") = _gravity;
565  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
566  params.set<unsigned>("phase") = phase;
567  params.set<bool>("multiply_by_density") = multiply_by_density;
568  _problem->addUserObject(userobject_type, userobject_name, params);
569  }
570 }
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorSaturatedHeat()

void PorousFlowActionBase::addAdvectiveFluxCalculatorSaturatedHeat ( unsigned  phase,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 591 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

594 {
595  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
596  {
597  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturatedHeat";
598  InputParameters params = _factory.getValidParams(userobject_type);
599  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
600  params.set<RealVectorValue>("gravity") = _gravity;
601  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
602  params.set<unsigned>("phase") = phase;
603  params.set<bool>("multiply_by_density") = multiply_by_density;
604  _problem->addUserObject(userobject_type, userobject_name, params);
605  }
606 }
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorSaturatedMultiComponent()

void PorousFlowActionBase::addAdvectiveFluxCalculatorSaturatedMultiComponent ( unsigned  phase,
unsigned  fluid_component,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 627 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

631 {
632  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
633  {
634  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent";
635  InputParameters params = _factory.getValidParams(userobject_type);
636  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
637  params.set<RealVectorValue>("gravity") = _gravity;
638  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
639  params.set<unsigned>("phase") = phase;
640  params.set<bool>("multiply_by_density") = multiply_by_density;
641  params.set<unsigned>("fluid_component") = fluid_component;
642  _problem->addUserObject(userobject_type, userobject_name, params);
643  }
644 }
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorUnsaturated()

void PorousFlowActionBase::addAdvectiveFluxCalculatorUnsaturated ( unsigned  phase,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 573 of file PorousFlowActionBase.C.

Referenced by addUserObjects().

576 {
577  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
578  {
579  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorUnsaturated";
580  InputParameters params = _factory.getValidParams(userobject_type);
581  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
582  params.set<RealVectorValue>("gravity") = _gravity;
583  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
584  params.set<unsigned>("phase") = phase;
585  params.set<bool>("multiply_by_density") = multiply_by_density;
586  _problem->addUserObject(userobject_type, userobject_name, params);
587  }
588 }
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorUnsaturatedHeat()

void PorousFlowActionBase::addAdvectiveFluxCalculatorUnsaturatedHeat ( unsigned  phase,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 609 of file PorousFlowActionBase.C.

Referenced by addUserObjects().

612 {
613  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
614  {
615  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat";
616  InputParameters params = _factory.getValidParams(userobject_type);
617  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
618  params.set<RealVectorValue>("gravity") = _gravity;
619  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
620  params.set<unsigned>("phase") = phase;
621  params.set<bool>("multiply_by_density") = multiply_by_density;
622  _problem->addUserObject(userobject_type, userobject_name, params);
623  }
624 }
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorUnsaturatedMultiComponent()

void PorousFlowActionBase::addAdvectiveFluxCalculatorUnsaturatedMultiComponent ( unsigned  phase,
unsigned  fluid_component,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 647 of file PorousFlowActionBase.C.

Referenced by addUserObjects().

649 {
650  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
651  {
652  const std::string userobject_type =
653  "PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent";
654  InputParameters params = _factory.getValidParams(userobject_type);
655  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
656  params.set<RealVectorValue>("gravity") = _gravity;
657  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
658  params.set<unsigned>("phase") = phase;
659  params.set<bool>("multiply_by_density") = multiply_by_density;
660  params.set<unsigned>("fluid_component") = fluid_component;
661  _problem->addUserObject(userobject_type, userobject_name, params);
662  }
663 }
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAuxObjects()

void PorousFlowUnsaturated::addAuxObjects ( )
overrideprotectedvirtual

Add all AuxVariables and AuxKernels.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 305 of file PorousFlowUnsaturated.C.

306 {
308 
310  addSaturationAux(0);
311 }
void addSaturationAux(unsigned phase)
Add an AuxVariable and AuxKernel to calculate saturation.
const bool _add_saturation_aux
Add an Aux Variable to record saturation.
virtual void addAuxObjects() override
Add all AuxVariables and AuxKernels.

◆ 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 464 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

470 {
471  if (_current_task == "add_material")
472  {
473  std::string material_type = "PorousFlowBrine";
474  InputParameters params = _factory.getValidParams(material_type);
475 
476  params.set<std::vector<VariableName>>("xnacl") = {nacl_brine};
477  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
478  params.set<unsigned int>("phase") = phase;
479  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
480  params.set<bool>("compute_internal_energy") = compute_internal_energy;
481  params.set<bool>("compute_enthalpy") = compute_enthalpy;
482 
483  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
484  if (at_nodes)
485  material_name = "PorousFlowActionBase_FluidProperties";
486 
487  params.set<bool>("at_nodes") = at_nodes;
488  _problem->addMaterial(material_type, material_name, params);
489  }
490 }
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 542 of file PorousFlowActionBase.C.

Referenced by addUserObjects().

543 {
544  if (_current_task == "add_user_object")
545  {
546  std::string userobject_type = "PorousFlowCapillaryPressureVG";
547  InputParameters params = _factory.getValidParams(userobject_type);
548  params.set<Real>("m") = m;
549  params.set<Real>("alpha") = alpha;
550  _problem->addUserObject(userobject_type, userobject_name, params);
551  }
552 }

◆ 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 210 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addAuxObjects().

211 {
212  if (_current_task == "add_aux_variable")
213  {
214  _problem->addAuxVariable("darcy_vel_x",
215  FEType(Utility::string_to_enum<Order>("CONSTANT"),
216  Utility::string_to_enum<FEFamily>("MONOMIAL")));
217  _problem->addAuxVariable("darcy_vel_y",
218  FEType(Utility::string_to_enum<Order>("CONSTANT"),
219  Utility::string_to_enum<FEFamily>("MONOMIAL")));
220  _problem->addAuxVariable("darcy_vel_z",
221  FEType(Utility::string_to_enum<Order>("CONSTANT"),
222  Utility::string_to_enum<FEFamily>("MONOMIAL")));
223  }
224 
225  if (_current_task == "add_aux_kernel")
226  {
227  std::string aux_kernel_type = "PorousFlowDarcyVelocityComponent";
228  InputParameters params = _factory.getValidParams(aux_kernel_type);
229 
230  params.set<RealVectorValue>("gravity") = gravity;
231  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
232  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
233 
234  std::string aux_kernel_name = "PorousFlowActionBase_Darcy_x_Aux";
235  params.set<MooseEnum>("component") = "x";
236  params.set<AuxVariableName>("variable") = "darcy_vel_x";
237  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
238 
239  aux_kernel_name = "PorousFlowActionBase_Darcy_y_Aux";
240  params.set<MooseEnum>("component") = "y";
241  params.set<AuxVariableName>("variable") = "darcy_vel_y";
242  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
243 
244  aux_kernel_name = "PorousFlowActionBase_Darcy_z_Aux";
245  params.set<MooseEnum>("component") = "z";
246  params.set<AuxVariableName>("variable") = "darcy_vel_z";
247  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
248  }
249 }
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 277 of file PorousFlowSinglePhaseBase.C.

278 {
279  const std::string uo_name = _dictator_name;
280  const std::string uo_type = "PorousFlowDictator";
281  InputParameters params = _factory.getValidParams(uo_type);
282  std::vector<VariableName> pf_vars = _mass_fraction_vars;
283  pf_vars.push_back(_pp_var);
284  if (_thermal)
285  pf_vars.push_back(_temperature_var[0]);
286  if (_mechanical)
287  pf_vars.insert(pf_vars.end(), _coupled_displacements.begin(), _coupled_displacements.end());
288  params.set<std::vector<VariableName>>("porous_flow_vars") = pf_vars;
289  params.set<unsigned int>("number_fluid_phases") = 1;
290  params.set<unsigned int>("number_fluid_components") = _num_mass_fraction_vars + 1;
291  params.set<unsigned int>("number_aqueous_equilibrium") = _num_aqueous_equilibrium;
292  params.set<unsigned int>("number_aqueous_kinetic") = _num_aqueous_kinetic;
293  _problem->addUserObject(uo_type, uo_name, params);
294 }
const std::vector< VariableName > & _mass_fraction_vars
Name of the mass-fraction variables (if any)
const VariableName _pp_var
Porepressure NonlinearVariable name.
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 bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
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.
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 399 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

400 {
401  if (_current_task == "add_material")
402  {
403  std::string material_type = "PorousFlowEffectiveFluidPressure";
404  InputParameters params = _factory.getValidParams(material_type);
405 
406  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
407 
408  std::string material_name = "PorousFlowUnsaturated_EffectiveFluidPressure_qp";
409  if (at_nodes)
410  material_name = "PorousFlowUnsaturated_EffectiveFluidPressure";
411 
412  params.set<bool>("at_nodes") = at_nodes;
413  _problem->addMaterial(material_type, material_name, params);
414  }
415 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addKernels()

void PorousFlowUnsaturated::addKernels ( )
overrideprotectedvirtual

Add all Kernels.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 109 of file PorousFlowUnsaturated.C.

110 {
112 
113  // add the kernels
115  {
116  const std::string kernel_type = "PorousFlowAdvectiveFlux";
117  InputParameters params = _factory.getValidParams(kernel_type);
118  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
119  params.set<RealVectorValue>("gravity") = _gravity;
120 
121  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
122  {
123  const std::string kernel_name = "PorousFlowUnsaturated_AdvectiveFlux" + Moose::stringify(i);
124  params.set<unsigned int>("fluid_component") = i;
125  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
126  _problem->addKernel(kernel_type, kernel_name, params);
127  }
128  const std::string kernel_name =
129  "PorousFlowUnsaturated_AdvectiveFlux" + Moose::stringify(_num_mass_fraction_vars);
130  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
131  params.set<NonlinearVariableName>("variable") = _pp_var;
132  _problem->addKernel(kernel_type, kernel_name, params);
133  }
135  {
136  const std::string kernel_type = "PorousFlowFluxLimitedTVDAdvection";
137  InputParameters params = _factory.getValidParams(kernel_type);
138  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
139 
140  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
141  {
142  const std::string kernel_name = "PorousFlowFluxLimited_DarcyFlow" + Moose::stringify(i);
143  params.set<UserObjectName>("advective_flux_calculator") =
144  "PorousFlowUnsaturated_AC_" + Moose::stringify(i);
145  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
146  _problem->addKernel(kernel_type, kernel_name, params);
147  }
148  const std::string kernel_name =
149  "PorousFlowFluxLimited_DarcyFlow" + Moose::stringify(_num_mass_fraction_vars);
150  params.set<NonlinearVariableName>("variable") = _pp_var;
151  params.set<UserObjectName>("advective_flux_calculator") =
152  "PorousFlowUnsaturated_AC_" + Moose::stringify(_num_mass_fraction_vars);
153  _problem->addKernel(kernel_type, kernel_name, params);
154  }
155 
156  if (_transient)
157  {
158  std::string kernel_name = "PorousFlowUnsaturated_MassTimeDerivative";
159  std::string kernel_type = "PorousFlowMassTimeDerivative";
160  InputParameters params = _factory.getValidParams(kernel_type);
161  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
162 
163  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
164  {
165  kernel_name = "PorousFlowUnsaturated_MassTimeDerivative" + Moose::stringify(i);
166  params.set<unsigned int>("fluid_component") = i;
167  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
168  _problem->addKernel(kernel_type, kernel_name, params);
169  }
170  kernel_name =
171  "PorousFlowUnsaturated_MassTimeDerivative" + Moose::stringify(_num_mass_fraction_vars);
172  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
173  params.set<NonlinearVariableName>("variable") = _pp_var;
174  _problem->addKernel(kernel_type, kernel_name, params);
175  }
176 
177  if (_mechanical && _transient)
178  {
179  std::string kernel_name = "PorousFlowUnsaturated_MassVolumetricExpansion";
180  std::string kernel_type = "PorousFlowMassVolumetricExpansion";
181  InputParameters params = _factory.getValidParams(kernel_type);
182  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
183 
184  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
185  {
186  kernel_name = "PorousFlowUnsaturated_MassVolumetricExpansion" + Moose::stringify(i);
187  params.set<unsigned>("fluid_component") = i;
188  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
189  _problem->addKernel(kernel_type, kernel_name, params);
190  }
191  kernel_name =
192  "PorousFlowUnsaturated_MassVolumetricExpansion" + Moose::stringify(_num_mass_fraction_vars);
193  params.set<unsigned>("fluid_component") = _num_mass_fraction_vars;
194  params.set<NonlinearVariableName>("variable") = _pp_var;
195  _problem->addKernel(kernel_type, kernel_name, params);
196  }
197 
198  if (_thermal)
199  {
201  {
202  const std::string kernel_name = "PorousFlowUnsaturated_HeatAdvection";
203  const std::string kernel_type = "PorousFlowHeatAdvection";
204  InputParameters params = _factory.getValidParams(kernel_type);
205  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
206  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
207  params.set<RealVectorValue>("gravity") = _gravity;
208  _problem->addKernel(kernel_type, kernel_name, params);
209  }
211  {
212  const std::string kernel_name = "PorousFlowUnsaturated_HeatAdvection";
213  const std::string kernel_type = "PorousFlowFluxLimitedTVDAdvection";
214  InputParameters params = _factory.getValidParams(kernel_type);
215  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
216  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
217  params.set<UserObjectName>("advective_flux_calculator") = "PorousFlowUnsaturatedHeat_AC";
218  _problem->addKernel(kernel_type, kernel_name, params);
219  }
220  }
221 }
const std::vector< VariableName > & _mass_fraction_vars
Name of the mass-fraction variables (if any)
const VariableName _pp_var
Porepressure NonlinearVariable name.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
virtual void addKernels() override
Add all Kernels.
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.
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 PorousFlowActionBase::StabilizationEnum _stabilization

◆ 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 374 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

375 {
376  if (_current_task == "add_material")
377  {
378  if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
379  parameters().hasCoupledValue("mass_fraction_vars")))
380  mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
381  "mass_fraction_vars");
382 
383  std::string material_type = "PorousFlowMassFraction";
384  InputParameters params = _factory.getValidParams(material_type);
385 
386  params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
387  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
388 
389  std::string material_name = "PorousFlowActionBase_MassFraction_qp";
390  if (at_nodes)
391  material_name = "PorousFlowActionBase_MassFraction";
392 
393  params.set<bool>("at_nodes") = at_nodes;
394  _problem->addMaterial(material_type, material_name, params);
395  }
396 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addMaterialDependencies()

void PorousFlowUnsaturated::addMaterialDependencies ( )
overrideprotectedvirtual

Add all material dependencies so that the correct version of each material can be added.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 82 of file PorousFlowUnsaturated.C.

83 {
85 
86  // Add necessary objects to list of PorousFlow objects added by this action
87  _included_objects.push_back("PorousFlowAdvectiveFlux");
88 
89  if (_transient)
90  _included_objects.push_back("PorousFlowMassTimeDerivative");
91 
92  if (_mechanical && _transient)
93  _included_objects.push_back("PorousFlowMassVolumetricExpansion");
94 
95  if (_thermal)
96  _included_objects.push_back("PorousFlowHeatAdvection");
97 
99  _included_objects.push_back("SaturationAux");
100 
102  _included_objects.push_back("PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent");
103 
105  _included_objects.push_back("PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat");
106 }
const bool _add_saturation_aux
Add an Aux Variable to record saturation.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
bool _transient
Flag to denote if the simulation is transient.
virtual void addMaterialDependencies() override
Add all material dependencies so that the correct version of each material can be added...
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addMaterials()

void PorousFlowUnsaturated::addMaterials ( )
overrideprotectedvirtual

Add all Materials.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 256 of file PorousFlowUnsaturated.C.

257 {
259 
260  if (_deps.dependsOn(_included_objects, "pressure_saturation_qp"))
261  {
262  const std::string material_type = "PorousFlow1PhaseP";
263  InputParameters params = _factory.getValidParams(material_type);
264  const std::string material_name = "PorousFlowUnsaturated_1PhaseP_VG_qp";
265  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
266  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
267  params.set<UserObjectName>("capillary_pressure") = _capillary_pressure_name;
268  params.set<bool>("at_nodes") = false;
269  _problem->addMaterial(material_type, material_name, params);
270  }
271  if (_deps.dependsOn(_included_objects, "pressure_saturation_nodal"))
272  {
273  const std::string material_type = "PorousFlow1PhaseP";
274  InputParameters params = _factory.getValidParams(material_type);
275  const std::string material_name = "PorousFlowUnsaturated_1PhaseP_VG_nodal";
276  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
277  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
278  params.set<UserObjectName>("capillary_pressure") = _capillary_pressure_name;
279  params.set<bool>("at_nodes") = true;
280  _problem->addMaterial(material_type, material_name, params);
281  }
282 
283  if (_deps.dependsOn(_included_objects, "relative_permeability_qp"))
284  {
287  else
289  }
290 
291  if (_deps.dependsOn(_included_objects, "relative_permeability_nodal"))
292  {
295  else
297  }
298 
299  if (_deps.dependsOn(_included_objects, "volumetric_strain_qp") ||
300  _deps.dependsOn(_included_objects, "volumetric_strain_nodal"))
302 }
virtual void addMaterials() override
Add all Materials.
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 VariableName _pp_var
Porepressure NonlinearVariable name.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
const Real _s_res
Residual saturation to use in the relative permeability expressions.
const Real _relative_permeability_exponent
Relative permeability exponent.
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
const std::string _capillary_pressure_name
Name of the capillary pressure UserObject.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
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.
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.

◆ 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 493 of file PorousFlowActionBase.C.

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

496 {
497  if (_current_task == "add_material")
498  {
499  std::string material_type = "PorousFlowRelativePermeabilityCorey";
500  InputParameters params = _factory.getValidParams(material_type);
501 
502  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
503  params.set<Real>("n") = n;
504  params.set<unsigned int>("phase") = phase;
505  params.set<Real>("s_res") = s_res;
506  params.set<Real>("sum_s_res") = sum_s_res;
507 
508  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
509  if (at_nodes)
510  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
511 
512  params.set<bool>("at_nodes") = at_nodes;
513  _problem->addMaterial(material_type, material_name, params);
514  }
515 }
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 518 of file PorousFlowActionBase.C.

Referenced by addMaterials().

520 {
521  if (_current_task == "add_material")
522  {
523  std::string material_type = "PorousFlowRelativePermeabilityFLAC";
524  InputParameters params = _factory.getValidParams(material_type);
525 
526  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
527  params.set<Real>("m") = m;
528  params.set<unsigned int>("phase") = phase;
529  params.set<Real>("s_res") = s_res;
530  params.set<Real>("sum_s_res") = sum_s_res;
531 
532  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
533  if (at_nodes)
534  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
535 
536  params.set<bool>("at_nodes") = at_nodes;
537  _problem->addMaterial(material_type, material_name, params);
538  }
539 }
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 186 of file PorousFlowActionBase.C.

Referenced by addAuxObjects().

187 {
188  std::string phase_str = Moose::stringify(phase);
189 
190  if (_current_task == "add_aux_variable")
191  _problem->addAuxVariable("saturation" + phase_str,
192  FEType(Utility::string_to_enum<Order>("CONSTANT"),
193  Utility::string_to_enum<FEFamily>("MONOMIAL")));
194 
195  if (_current_task == "add_aux_kernel")
196  {
197  std::string aux_kernel_type = "MaterialStdVectorAux";
198  InputParameters params = _factory.getValidParams(aux_kernel_type);
199 
200  std::string aux_kernel_name = "PorousFlowActionBase_SaturationAux" + phase_str;
201  params.set<MaterialPropertyName>("property") = "PorousFlow_saturation_qp";
202  params.set<unsigned>("index") = phase;
203  params.set<AuxVariableName>("variable") = "saturation" + phase_str;
204  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
205  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
206  }
207 }

◆ 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 435 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

441 {
442  if (_current_task == "add_material")
443  {
444  std::string material_type = "PorousFlowSingleComponentFluid";
445  InputParameters params = _factory.getValidParams(material_type);
446 
447  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
448  params.set<unsigned int>("phase") = phase;
449  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
450  params.set<bool>("compute_internal_energy") = compute_internal_energy;
451  params.set<bool>("compute_enthalpy") = compute_enthalpy;
452  params.set<UserObjectName>("fp") = fp;
453 
454  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
455  if (at_nodes)
456  material_name = "PorousFlowActionBase_FluidProperties";
457 
458  params.set<bool>("at_nodes") = at_nodes;
459  _problem->addMaterial(material_type, material_name, params);
460  }
461 }
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 252 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addAuxObjects().

253 {
254  if (_current_task == "add_aux_variable")
255  {
256  _problem->addAuxVariable("stress_xx",
257  FEType(Utility::string_to_enum<Order>("CONSTANT"),
258  Utility::string_to_enum<FEFamily>("MONOMIAL")));
259  _problem->addAuxVariable("stress_xy",
260  FEType(Utility::string_to_enum<Order>("CONSTANT"),
261  Utility::string_to_enum<FEFamily>("MONOMIAL")));
262  _problem->addAuxVariable("stress_xz",
263  FEType(Utility::string_to_enum<Order>("CONSTANT"),
264  Utility::string_to_enum<FEFamily>("MONOMIAL")));
265  _problem->addAuxVariable("stress_yx",
266  FEType(Utility::string_to_enum<Order>("CONSTANT"),
267  Utility::string_to_enum<FEFamily>("MONOMIAL")));
268  _problem->addAuxVariable("stress_yy",
269  FEType(Utility::string_to_enum<Order>("CONSTANT"),
270  Utility::string_to_enum<FEFamily>("MONOMIAL")));
271  _problem->addAuxVariable("stress_yz",
272  FEType(Utility::string_to_enum<Order>("CONSTANT"),
273  Utility::string_to_enum<FEFamily>("MONOMIAL")));
274  _problem->addAuxVariable("stress_zx",
275  FEType(Utility::string_to_enum<Order>("CONSTANT"),
276  Utility::string_to_enum<FEFamily>("MONOMIAL")));
277  _problem->addAuxVariable("stress_zy",
278  FEType(Utility::string_to_enum<Order>("CONSTANT"),
279  Utility::string_to_enum<FEFamily>("MONOMIAL")));
280  _problem->addAuxVariable("stress_zz",
281  FEType(Utility::string_to_enum<Order>("CONSTANT"),
282  Utility::string_to_enum<FEFamily>("MONOMIAL")));
283  }
284 
285  if (_current_task == "add_aux_kernel")
286  {
287  std::string aux_kernel_type = "RankTwoAux";
288  InputParameters params = _factory.getValidParams(aux_kernel_type);
289 
290  params.set<MaterialPropertyName>("rank_two_tensor") = "stress";
291  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
292 
293  std::string aux_kernel_name = "PorousFlowAction_stress_xx";
294  params.set<AuxVariableName>("variable") = "stress_xx";
295  params.set<unsigned>("index_i") = 0;
296  params.set<unsigned>("index_j") = 0;
297  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
298 
299  aux_kernel_name = "PorousFlowAction_stress_xy";
300  params.set<AuxVariableName>("variable") = "stress_xy";
301  params.set<unsigned>("index_i") = 0;
302  params.set<unsigned>("index_j") = 1;
303  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
304 
305  aux_kernel_name = "PorousFlowAction_stress_xz";
306  params.set<AuxVariableName>("variable") = "stress_xz";
307  params.set<unsigned>("index_i") = 0;
308  params.set<unsigned>("index_j") = 2;
309  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
310 
311  aux_kernel_name = "PorousFlowAction_stress_yx";
312  params.set<AuxVariableName>("variable") = "stress_yx";
313  params.set<unsigned>("index_i") = 1;
314  params.set<unsigned>("index_j") = 0;
315  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
316 
317  aux_kernel_name = "PorousFlowAction_stress_yy";
318  params.set<AuxVariableName>("variable") = "stress_yy";
319  params.set<unsigned>("index_i") = 1;
320  params.set<unsigned>("index_j") = 1;
321  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
322 
323  aux_kernel_name = "PorousFlowAction_stress_yz";
324  params.set<AuxVariableName>("variable") = "stress_yz";
325  params.set<unsigned>("index_i") = 1;
326  params.set<unsigned>("index_j") = 2;
327  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
328 
329  aux_kernel_name = "PorousFlowAction_stress_zx";
330  params.set<AuxVariableName>("variable") = "stress_zx";
331  params.set<unsigned>("index_i") = 2;
332  params.set<unsigned>("index_j") = 0;
333  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
334 
335  aux_kernel_name = "PorousFlowAction_stress_zy";
336  params.set<AuxVariableName>("variable") = "stress_zy";
337  params.set<unsigned>("index_i") = 2;
338  params.set<unsigned>("index_j") = 1;
339  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
340 
341  aux_kernel_name = "PorousFlowAction_stress_zz";
342  params.set<AuxVariableName>("variable") = "stress_zz";
343  params.set<unsigned>("index_i") = 2;
344  params.set<unsigned>("index_j") = 2;
345  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
346  }
347 }

◆ 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 350 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

351 {
352  if (_current_task == "add_material")
353  {
354  if (!parameters().hasDefaultCoupledValue("temperature"))
355  mooseError(
356  "Attempt to add a PorousFlowTemperature material without setting a temperature variable");
357 
358  std::string material_type = "PorousFlowTemperature";
359  InputParameters params = _factory.getValidParams(material_type);
360 
361  params.applySpecificParameters(parameters(), {"temperature"});
362  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
363 
364  std::string material_name = "PorousFlowActionBase_Temperature_qp";
365  if (at_nodes)
366  material_name = "PorousFlowActionBase_Temperature";
367 
368  params.set<bool>("at_nodes") = at_nodes;
369  _problem->addMaterial(material_type, material_name, params);
370  }
371 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addUserObjects()

void PorousFlowUnsaturated::addUserObjects ( )
overrideprotectedvirtual

Add all other UserObjects.

Reimplemented from PorousFlowActionBase.

Definition at line 224 of file PorousFlowUnsaturated.C.

225 {
227 
228  // Add the capillary pressure UserObject
230 
231  // add Advective Flux calculator UserObjects, if required
233  {
234  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
235  {
236  const std::string userobject_name = "PorousFlowUnsaturated_AC_" + Moose::stringify(i);
237  addAdvectiveFluxCalculatorUnsaturatedMultiComponent(0, i, true, userobject_name);
238  }
239  const std::string userobject_name =
240  "PorousFlowUnsaturated_AC_" + Moose::stringify(_num_mass_fraction_vars);
241  if (_num_mass_fraction_vars == 0)
242  addAdvectiveFluxCalculatorUnsaturated(0, true, userobject_name); // 1 component only
243  else
245  0, _num_mass_fraction_vars, true, userobject_name);
246 
247  if (_thermal)
248  {
249  const std::string userobject_name = "PorousFlowUnsaturatedHeat_AC";
250  addAdvectiveFluxCalculatorUnsaturatedHeat(0, true, userobject_name);
251  }
252  }
253 }
const Real _van_genuchten_m
Van Genuchten m parameter.
const Real _van_genuchten_alpha
Van Genuchten alpha parameter.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
void addCapillaryPressureVG(Real m, Real alpha, std::string userobject_name)
Adds a van Genuchten capillary pressure UserObject.
void addAdvectiveFluxCalculatorUnsaturated(unsigned phase, bool multiply_by_density, std::string userobject_name)
const std::string _capillary_pressure_name
Name of the capillary pressure UserObject.
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
virtual void addUserObjects()
Add all other UserObjects.
void addAdvectiveFluxCalculatorUnsaturatedMultiComponent(unsigned phase, unsigned fluid_component, bool multiply_by_density, std::string userobject_name)
enum PorousFlowActionBase::StabilizationEnum _stabilization
void addAdvectiveFluxCalculatorUnsaturatedHeat(unsigned phase, bool multiply_by_density, std::string userobject_name)

◆ 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 418 of file PorousFlowActionBase.C.

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

420 {
421  if (_current_task == "add_material")
422  {
423  std::string material_type = "PorousFlowVolumetricStrain";
424  InputParameters params = _factory.getValidParams(material_type);
425 
426  std::string material_name = "PorousFlowActionBase_VolumetricStrain";
427  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
428  params.set<std::vector<VariableName>>("displacements") = displacements;
429  params.set<bool>("consistent_with_displaced_mesh") = consistent_with_displaced_mesh;
430  _problem->addMaterial(material_type, material_name, params);
431  }
432 }
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 57 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::addAuxObjects(), and PorousFlowSinglePhaseBase::addMaterialDependencies().

◆ _add_saturation_aux

const bool PorousFlowUnsaturated::_add_saturation_aux
protected

Add an Aux Variable to record saturation.

Definition at line 38 of file PorousFlowUnsaturated.h.

Referenced by addAuxObjects(), and addMaterialDependencies().

◆ _add_stress_aux

const bool PorousFlowSinglePhaseBase::_add_stress_aux
protectedinherited

Add AuxVariables for stress.

Definition at line 60 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::addAuxObjects(), and PorousFlowSinglePhaseBase::addMaterialDependencies().

◆ _biot_coefficient

const Real PorousFlowSinglePhaseBase::_biot_coefficient
protectedinherited

Fluid specific heat capacity at constant volume.

Definition at line 54 of file PorousFlowSinglePhaseBase.h.

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

◆ _capillary_pressure_name

const std::string PorousFlowUnsaturated::_capillary_pressure_name
protected

Name of the capillary pressure UserObject.

Definition at line 56 of file PorousFlowUnsaturated.h.

Referenced by addMaterials(), and addUserObjects().

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protectedinherited

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

Definition at line 87 of file PorousFlowActionBase.h.

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

◆ _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

◆ _dictator_name

const std::string PorousFlowActionBase::_dictator_name
protectedinherited

◆ _displacements

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

Displacement NonlinearVariable names (if any)

Definition at line 73 of file PorousFlowActionBase.h.

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

◆ _flux_limiter_type

const MooseEnum PorousFlowActionBase::_flux_limiter_type
protectedinherited

◆ _fp

const UserObjectName& PorousFlowSinglePhaseBase::_fp
protectedinherited

Name of the fluid-properties UserObject.

Definition at line 51 of file PorousFlowSinglePhaseBase.h.

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

◆ _gravity

const RealVectorValue PorousFlowActionBase::_gravity
protectedinherited

◆ _included_objects

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

◆ _mass_fraction_vars

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

◆ _mechanical

const bool PorousFlowSinglePhaseBase::_mechanical
protectedinherited

◆ _nacl_index

const unsigned PorousFlowSinglePhaseBase::_nacl_index
protectedinherited

Index of NaCl in list of fluid components.

Definition at line 66 of file PorousFlowSinglePhaseBase.h.

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

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protectedinherited

Number of displacement variables supplied.

Definition at line 76 of file PorousFlowActionBase.h.

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

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowActionBase::_num_aqueous_equilibrium
protectedinherited

Number of aqueous-equilibrium secondary species.

Definition at line 55 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 58 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::addDictator().

◆ _num_mass_fraction_vars

const unsigned PorousFlowActionBase::_num_mass_fraction_vars
protectedinherited

◆ _pp_var

const VariableName PorousFlowSinglePhaseBase::_pp_var
protectedinherited

◆ _relative_permeability_exponent

const Real PorousFlowUnsaturated::_relative_permeability_exponent
protected

Relative permeability exponent.

Definition at line 50 of file PorousFlowUnsaturated.h.

Referenced by addMaterials().

◆ _relperm_type

enum PorousFlowUnsaturated::RelpermTypeChoiceEnum PorousFlowUnsaturated::_relperm_type
protected

Referenced by addMaterials().

◆ _s_res

const Real PorousFlowUnsaturated::_s_res
protected

Residual saturation to use in the relative permeability expressions.

Definition at line 53 of file PorousFlowUnsaturated.h.

Referenced by addMaterials().

◆ _stabilization

enum PorousFlowActionBase::StabilizationEnum PorousFlowActionBase::_stabilization
protectedinherited

◆ _temperature_var

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

◆ _thermal

const bool PorousFlowSinglePhaseBase::_thermal
protectedinherited

◆ _transient

bool PorousFlowActionBase::_transient
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 41 of file PorousFlowUnsaturated.h.

Referenced by addUserObjects().

◆ _van_genuchten_m

const Real PorousFlowUnsaturated::_van_genuchten_m
protected

Van Genuchten m parameter.

Definition at line 44 of file PorousFlowUnsaturated.h.

Referenced by addUserObjects().


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