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

Base class for PorousFlow actions. More...

#include <PorousFlowActionBase.h>

Inheritance diagram for PorousFlowActionBase:
[legend]

Public Member Functions

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

Protected Types

enum  StabilizationEnum { StabilizationEnum::Full, StabilizationEnum::KT }
 

Protected Member Functions

virtual void addDictator ()=0
 Add the PorousFlowDictator object. More...
 
virtual void addUserObjects ()
 Add all other UserObjects. More...
 
virtual void addAuxObjects ()
 Add all AuxVariables and AuxKernels. More...
 
virtual void addKernels ()
 Add all Kernels. More...
 
virtual void addMaterialDependencies ()
 Add all material dependencies so that the correct version of each material can be added. More...
 
virtual void addMaterials ()
 Add all Materials. 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

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

Base class for PorousFlow actions.

This act() method makes consistency checks and calls several methods that should be implemented in derived classes. This class also contains a number of utility functions that may be used by derived classes.

Derived classes should typically only override the following methods:

Definition at line 36 of file PorousFlowActionBase.h.

Member Enumeration Documentation

◆ StabilizationEnum

Enumerator
Full 
KT 

Definition at line 84 of file PorousFlowActionBase.h.

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

Constructor & Destructor Documentation

◆ PorousFlowActionBase()

PorousFlowActionBase::PorousFlowActionBase ( const InputParameters &  params)

Definition at line 83 of file PorousFlowActionBase.C.

84  : Action(params),
87  _dictator_name(getParam<std::string>("dictator_name")),
88  _num_aqueous_equilibrium(getParam<unsigned int>("number_aqueous_equilibrium")),
89  _num_aqueous_kinetic(getParam<unsigned int>("number_aqueous_kinetic")),
90  _gravity(getParam<RealVectorValue>("gravity")),
91  _mass_fraction_vars(getParam<std::vector<VariableName>>("mass_fraction_vars")),
93  _temperature_var(getParam<std::vector<VariableName>>("temperature")),
94  _displacements(getParam<std::vector<VariableName>>("displacements")),
95  _ndisp(_displacements.size()),
97  _flux_limiter_type(getParam<MooseEnum>("flux_limiter_type")),
98  _stabilization(getParam<MooseEnum>("stabilization").getEnum<StabilizationEnum>())
99 {
100  // convert vector of VariableName to vector of VariableName
101  for (unsigned int i = 0; i < _ndisp; ++i)
103 }
const std::vector< VariableName > & _mass_fraction_vars
Name of the mass-fraction variables (if any)
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 unsigned int _num_aqueous_kinetic
Number of aqeuous-kinetic secondary species that are involved in mineralisation.
const unsigned _ndisp
Number of displacement variables supplied.
const RealVectorValue _gravity
Gravity.
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 std::vector< VariableName > & _displacements
Displacement NonlinearVariable names (if any)
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

Member Function Documentation

◆ act()

void PorousFlowActionBase::act ( )
overridevirtual

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 
)
protected

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 
)
protected

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 
)
protected

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 
)
protected

Definition at line 573 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::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 
)
protected

Definition at line 609 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::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 
)
protected

Definition at line 647 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::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 PorousFlowActionBase::addAuxObjects ( )
protectedvirtual

Add all AuxVariables and AuxKernels.

Reimplemented in PorousFlowUnsaturated, and PorousFlowSinglePhaseBase.

Definition at line 171 of file PorousFlowActionBase.C.

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

172 {
173 }

◆ addBrineMaterial()

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

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 
)
protected

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 PorousFlowUnsaturated::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)
protected

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()

virtual void PorousFlowActionBase::addDictator ( )
protectedpure virtual

Add the PorousFlowDictator object.

Implemented in PorousFlowSinglePhaseBase.

Referenced by addUserObjects().

◆ addEffectiveFluidPressureMaterial()

void PorousFlowActionBase::addEffectiveFluidPressureMaterial ( bool  at_nodes)
protected

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 PorousFlowActionBase::addKernels ( )
protectedvirtual

Add all Kernels.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, PorousFlowSinglePhaseBase, and PorousFlowFullySaturated.

Definition at line 176 of file PorousFlowActionBase.C.

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

177 {
178 }

◆ addMassFractionMaterial()

void PorousFlowActionBase::addMassFractionMaterial ( bool  at_nodes)
protected

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 PorousFlowActionBase::addMaterialDependencies ( )
protectedvirtual

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

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, PorousFlowSinglePhaseBase, and PorousFlowFullySaturated.

Definition at line 143 of file PorousFlowActionBase.C.

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

144 {
145  // Check to see if there are any other PorousFlow objects like BCs that
146  // may require specific versions of materials added using this action
147 
148  // Unique list of auxkernels added in input file
149  auto auxkernels = _awh.getActions<AddKernelAction>();
150  for (auto & auxkernel : auxkernels)
151  _included_objects.push_back(auxkernel->getMooseObjectType());
152 
153  // Unique list of postprocessors added in input file
154  auto postprocessors = _awh.getActions<AddPostprocessorAction>();
155  for (auto & postprocessor : postprocessors)
156  _included_objects.push_back(postprocessor->getMooseObjectType());
157 
158  // Unique list of BCs added in input file
159  auto bcs = _awh.getActions<AddBCAction>();
160  for (auto & bc : bcs)
161  _included_objects.push_back(bc->getMooseObjectType());
162 }
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.

◆ addMaterials()

void PorousFlowActionBase::addMaterials ( )
protectedvirtual

Add all Materials.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, PorousFlowSinglePhaseBase, and PorousFlowFullySaturated.

Definition at line 181 of file PorousFlowActionBase.C.

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

182 {
183 }

◆ addRelativePermeabilityCorey()

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

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(), PorousFlowUnsaturated::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 
)
protected

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 PorousFlowUnsaturated::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)
protected

Add an AuxVariable and AuxKernel to calculate saturation.

Parameters
phaseSaturation for this fluid phase

Definition at line 186 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::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 
)
protected

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 ( )
protected

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)
protected

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 PorousFlowActionBase::addUserObjects ( )
protectedvirtual

Add all other UserObjects.

Reimplemented in PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 165 of file PorousFlowActionBase.C.

Referenced by act(), PorousFlowFullySaturated::addUserObjects(), and PorousFlowUnsaturated::addUserObjects().

166 {
167  addDictator();
168 }
virtual void addDictator()=0
Add the PorousFlowDictator object.

◆ addVolumetricStrainMaterial()

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

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(), PorousFlowUnsaturated::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

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protected

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

Definition at line 87 of file PorousFlowActionBase.h.

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

◆ _coupled_displacements

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

◆ _deps

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

◆ _dictator_name

const std::string PorousFlowActionBase::_dictator_name
protected

◆ _displacements

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

Displacement NonlinearVariable names (if any)

Definition at line 73 of file PorousFlowActionBase.h.

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

◆ _flux_limiter_type

const MooseEnum PorousFlowActionBase::_flux_limiter_type
protected

◆ _gravity

const RealVectorValue PorousFlowActionBase::_gravity
protected

◆ _included_objects

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

◆ _mass_fraction_vars

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

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protected

Number of displacement variables supplied.

Definition at line 76 of file PorousFlowActionBase.h.

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

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowActionBase::_num_aqueous_equilibrium
protected

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
protected

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
protected

◆ _stabilization

enum PorousFlowActionBase::StabilizationEnum PorousFlowActionBase::_stabilization
protected

◆ _temperature_var

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

◆ _transient

bool PorousFlowActionBase::_transient
protected

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