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

Base class for actions involving a single fluid phase. More...

#include <PorousFlowSinglePhaseBase.h>

Inheritance diagram for PorousFlowSinglePhaseBase:
[legend]

Public Member Functions

 PorousFlowSinglePhaseBase (const InputParameters &params)
 
virtual void act () override
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type) override
 

Protected Types

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 addDictator () override
 Add the PorousFlowDictator object. More...
 
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 ()
 Add all other UserObjects. 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 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

Base class for actions involving a single fluid phase.

Definition at line 22 of file PorousFlowSinglePhaseBase.h.

Member Enumeration Documentation

◆ CouplingTypeEnum

Determines the coupling type.

Enumerator
Hydro 
ThermoHydro 
HydroMechanical 
ThermoHydroMechanical 

Definition at line 38 of file PorousFlowSinglePhaseBase.h.

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

◆ StabilizationEnum

enum PorousFlowActionBase::StabilizationEnum
strongprotectedinherited
Enumerator
Full 
KT 

Definition at line 86 of file PorousFlowActionBase.h.

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

Constructor & Destructor Documentation

◆ PorousFlowSinglePhaseBase()

PorousFlowSinglePhaseBase::PorousFlowSinglePhaseBase ( const InputParameters &  params)

Definition at line 65 of file PorousFlowSinglePhaseBase.C.

66  : PorousFlowActionBase(params),
67  _pp_var(getParam<VariableName>("porepressure")),
68  _coupling_type(getParam<MooseEnum>("coupling_type").getEnum<CouplingTypeEnum>()),
73  _fp(getParam<UserObjectName>("fp")),
74  _biot_coefficient(getParam<Real>("biot_coefficient")),
75  _add_darcy_aux(getParam<bool>("add_darcy_aux")),
76  _add_stress_aux(getParam<bool>("add_stress_aux")),
77  _use_brine(getParam<bool>("use_brine")),
78  _nacl_index(getParam<unsigned>("nacl_index"))
79 {
80  if (_thermal && _temperature_var.size() != 1)
81  mooseError("PorousFlowSinglePhaseBase: You need to specify a temperature variable to perform "
82  "non-isothermal simulations");
83 
84  if (_use_brine && !params.isParamValid("mass_fraction_vars"))
85  mooseError("PorousFlowSinglePhaseBase: You need to specify at least one component in "
86  "mass_fraction_vars if use_brine is true");
87 
89  mooseError(
90  "PorousFlowSinglePhaseBase: nacl_index must be less than length of mass_fraction_vars");
91 
92  if (!_use_brine && _fp == "use_brine_material")
93  mooseError("PorousFlowSinglePhaseBase: You need to specify fp if use_brine is false");
94 }
const unsigned _nacl_index
Index of NaCl in list of fluid components.
const Real _biot_coefficient
Fluid specific heat capacity at constant volume.
PorousFlowActionBase(const InputParameters &params)
const bool _add_stress_aux
Add AuxVariables for stress.
const VariableName _pp_var
Porepressure NonlinearVariable name.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
const bool _add_darcy_aux
Add a AuxVariables to record Darcy velocity.
const UserObjectName & _fp
Name of the fluid-properties UserObject.
const std::vector< VariableName > & _temperature_var
Name of the temperature variable (if any)
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
const bool _use_brine
Use PorousFlowBrine material.
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type

Member Function Documentation

◆ act()

void PorousFlowActionBase::act ( )
overridevirtualinherited

Definition at line 115 of file PorousFlowActionBase.C.

116 {
117  // Check if the simulation is transient (note: can't do this in the ctor)
118  _transient = _problem->isTransient();
119 
120  // Make sure that all mesh subdomains have the same coordinate system
121  const auto & all_subdomains = _problem->mesh().meshSubdomains();
122  if (all_subdomains.empty())
123  mooseError("No subdomains found");
124  _coord_system = _problem->getCoordSystem(*all_subdomains.begin());
125  for (const auto & subdomain : all_subdomains)
126  if (_problem->getCoordSystem(subdomain) != _coord_system)
127  mooseError(
128  "The PorousFlow Actions require all subdomains to have the same coordinate system.");
129 
130  // Note: this must be called before addMaterials!
132 
133  // Make the vector of added objects unique
134  std::sort(_included_objects.begin(), _included_objects.end());
135  _included_objects.erase(std::unique(_included_objects.begin(), _included_objects.end()),
136  _included_objects.end());
137 
138  if (_current_task == "add_user_object")
139  addUserObjects();
140 
141  if (_current_task == "add_aux_variable" || _current_task == "add_aux_kernel")
142  addAuxObjects();
143 
144  if (_current_task == "add_kernel")
145  addKernels();
146 
147  if (_current_task == "add_material")
148  addMaterials();
149 }
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 564 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

567 {
568  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
569  {
570  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturated";
571  InputParameters params = _factory.getValidParams(userobject_type);
572  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
573  params.set<RealVectorValue>("gravity") = _gravity;
574  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
575  params.set<unsigned>("phase") = phase;
576  params.set<bool>("multiply_by_density") = multiply_by_density;
577  _problem->addUserObject(userobject_type, userobject_name, params);
578  }
579 }
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 600 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

603 {
604  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
605  {
606  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturatedHeat";
607  InputParameters params = _factory.getValidParams(userobject_type);
608  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
609  params.set<RealVectorValue>("gravity") = _gravity;
610  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
611  params.set<unsigned>("phase") = phase;
612  params.set<bool>("multiply_by_density") = multiply_by_density;
613  _problem->addUserObject(userobject_type, userobject_name, params);
614  }
615 }
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 636 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

640 {
641  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
642  {
643  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent";
644  InputParameters params = _factory.getValidParams(userobject_type);
645  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
646  params.set<RealVectorValue>("gravity") = _gravity;
647  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
648  params.set<unsigned>("phase") = phase;
649  params.set<bool>("multiply_by_density") = multiply_by_density;
650  params.set<unsigned>("fluid_component") = fluid_component;
651  _problem->addUserObject(userobject_type, userobject_name, params);
652  }
653 }
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 582 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

585 {
586  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
587  {
588  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorUnsaturated";
589  InputParameters params = _factory.getValidParams(userobject_type);
590  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
591  params.set<RealVectorValue>("gravity") = _gravity;
592  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
593  params.set<unsigned>("phase") = phase;
594  params.set<bool>("multiply_by_density") = multiply_by_density;
595  _problem->addUserObject(userobject_type, userobject_name, params);
596  }
597 }
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 618 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

621 {
622  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
623  {
624  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat";
625  InputParameters params = _factory.getValidParams(userobject_type);
626  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
627  params.set<RealVectorValue>("gravity") = _gravity;
628  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
629  params.set<unsigned>("phase") = phase;
630  params.set<bool>("multiply_by_density") = multiply_by_density;
631  _problem->addUserObject(userobject_type, userobject_name, params);
632  }
633 }
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 656 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

658 {
659  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
660  {
661  const std::string userobject_type =
662  "PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent";
663  InputParameters params = _factory.getValidParams(userobject_type);
664  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
665  params.set<RealVectorValue>("gravity") = _gravity;
666  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
667  params.set<unsigned>("phase") = phase;
668  params.set<bool>("multiply_by_density") = multiply_by_density;
669  params.set<unsigned>("fluid_component") = fluid_component;
670  _problem->addUserObject(userobject_type, userobject_name, params);
671  }
672 }
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 PorousFlowSinglePhaseBase::addAuxObjects ( )
overrideprotectedvirtual

Add all AuxVariables and AuxKernels.

Reimplemented from PorousFlowActionBase.

Reimplemented in PorousFlowUnsaturated.

Definition at line 207 of file PorousFlowSinglePhaseBase.C.

Referenced by PorousFlowUnsaturated::addAuxObjects().

208 {
210 
211  if (_add_darcy_aux)
213 
215  addStressAux();
216 }
void addStressAux()
Add AuxVariables and AuxKernels to compute effective stress.
const bool _add_stress_aux
Add AuxVariables for stress.
const bool _add_darcy_aux
Add a AuxVariables to record Darcy velocity.
void addDarcyAux(const RealVectorValue &gravity)
Add AuxVariables and AuxKernels to calculate Darcy velocity.
const RealVectorValue _gravity
Gravity.
virtual void addAuxObjects()
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 473 of file PorousFlowActionBase.C.

Referenced by addMaterials().

479 {
480  if (_current_task == "add_material")
481  {
482  std::string material_type = "PorousFlowBrine";
483  InputParameters params = _factory.getValidParams(material_type);
484 
485  params.set<std::vector<VariableName>>("xnacl") = {nacl_brine};
486  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
487  params.set<unsigned int>("phase") = phase;
488  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
489  params.set<bool>("compute_internal_energy") = compute_internal_energy;
490  params.set<bool>("compute_enthalpy") = compute_enthalpy;
491 
492  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
493  if (at_nodes)
494  material_name = "PorousFlowActionBase_FluidProperties";
495 
496  params.set<bool>("at_nodes") = at_nodes;
497  _problem->addMaterial(material_type, material_name, params);
498  }
499 }
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 551 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

552 {
553  if (_current_task == "add_user_object")
554  {
555  std::string userobject_type = "PorousFlowCapillaryPressureVG";
556  InputParameters params = _factory.getValidParams(userobject_type);
557  params.set<Real>("m") = m;
558  params.set<Real>("alpha") = alpha;
559  _problem->addUserObject(userobject_type, userobject_name, params);
560  }
561 }

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

Referenced by addAuxObjects().

220 {
221  if (_current_task == "add_aux_variable")
222  {
223  _problem->addAuxVariable("darcy_vel_x",
224  FEType(Utility::string_to_enum<Order>("CONSTANT"),
225  Utility::string_to_enum<FEFamily>("MONOMIAL")));
226  _problem->addAuxVariable("darcy_vel_y",
227  FEType(Utility::string_to_enum<Order>("CONSTANT"),
228  Utility::string_to_enum<FEFamily>("MONOMIAL")));
229  _problem->addAuxVariable("darcy_vel_z",
230  FEType(Utility::string_to_enum<Order>("CONSTANT"),
231  Utility::string_to_enum<FEFamily>("MONOMIAL")));
232  }
233 
234  if (_current_task == "add_aux_kernel")
235  {
236  std::string aux_kernel_type = "PorousFlowDarcyVelocityComponent";
237  InputParameters params = _factory.getValidParams(aux_kernel_type);
238 
239  params.set<RealVectorValue>("gravity") = gravity;
240  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
241  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
242 
243  std::string aux_kernel_name = "PorousFlowActionBase_Darcy_x_Aux";
244  params.set<MooseEnum>("component") = "x";
245  params.set<AuxVariableName>("variable") = "darcy_vel_x";
246  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
247 
248  aux_kernel_name = "PorousFlowActionBase_Darcy_y_Aux";
249  params.set<MooseEnum>("component") = "y";
250  params.set<AuxVariableName>("variable") = "darcy_vel_y";
251  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
252 
253  aux_kernel_name = "PorousFlowActionBase_Darcy_z_Aux";
254  params.set<MooseEnum>("component") = "z";
255  params.set<AuxVariableName>("variable") = "darcy_vel_z";
256  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
257  }
258 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addDictator()

void PorousFlowSinglePhaseBase::addDictator ( )
overrideprotectedvirtual

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

Referenced by addMaterials().

409 {
410  if (_current_task == "add_material")
411  {
412  std::string material_type = "PorousFlowEffectiveFluidPressure";
413  InputParameters params = _factory.getValidParams(material_type);
414 
415  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
416 
417  std::string material_name = "PorousFlowUnsaturated_EffectiveFluidPressure_qp";
418  if (at_nodes)
419  material_name = "PorousFlowUnsaturated_EffectiveFluidPressure";
420 
421  params.set<bool>("at_nodes") = at_nodes;
422  _problem->addMaterial(material_type, material_name, params);
423  }
424 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addKernels()

void PorousFlowSinglePhaseBase::addKernels ( )
overrideprotectedvirtual

Add all Kernels.

Reimplemented from PorousFlowActionBase.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 127 of file PorousFlowSinglePhaseBase.C.

Referenced by PorousFlowFullySaturated::addKernels(), PorousFlowUnsaturated::addKernels(), and PorousFlowBasicTHM::addKernels().

128 {
130 
131  if (_mechanical)
132  {
133  for (unsigned i = 0; i < _ndisp; ++i)
134  {
135  std::string kernel_name = "PorousFlowUnsaturated_grad_stress" + Moose::stringify(i);
136  std::string kernel_type = "StressDivergenceTensors";
137  if (_coord_system == Moose::COORD_RZ)
138  kernel_type = "StressDivergenceRZTensors";
139  InputParameters params = _factory.getValidParams(kernel_type);
140  params.set<NonlinearVariableName>("variable") = _displacements[i];
141  params.set<std::vector<VariableName>>("displacements") = _coupled_displacements;
142  if (_thermal)
143  {
144  params.set<std::vector<VariableName>>("temperature") = _temperature_var;
145  params.set<std::string>("thermal_eigenstrain_name") =
146  getParam<std::string>("thermal_eigenstrain_name");
147  }
148  params.set<unsigned>("component") = i;
149  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
150  _problem->addKernel(kernel_type, kernel_name, params);
151 
152  if (_gravity(i) != 0)
153  {
154  kernel_name = "PorousFlowUnsaturated_gravity" + Moose::stringify(i);
155  kernel_type = "Gravity";
156  params = _factory.getValidParams(kernel_type);
157  params.set<NonlinearVariableName>("variable") = _displacements[i];
158  params.set<Real>("value") = _gravity(i);
159  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
160  _problem->addKernel(kernel_type, kernel_name, params);
161  }
162 
163  kernel_name = "PorousFlowUnsaturated_EffStressCoupling" + Moose::stringify(i);
164  kernel_type = "PorousFlowEffectiveStressCoupling";
165  params = _factory.getValidParams(kernel_type);
166  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
167  params.set<NonlinearVariableName>("variable") = _displacements[i];
168  params.set<Real>("biot_coefficient") = _biot_coefficient;
169  params.set<unsigned>("component") = i;
170  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
171  _problem->addKernel(kernel_type, kernel_name, params);
172  }
173  }
174 
175  if (_thermal)
176  {
177  std::string kernel_name = "PorousFlowUnsaturated_HeatConduction";
178  std::string kernel_type = "PorousFlowHeatConduction";
179  InputParameters params = _factory.getValidParams(kernel_type);
180  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
181  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
182  _problem->addKernel(kernel_type, kernel_name, params);
183 
184  if (_transient)
185  {
186  kernel_name = "PorousFlowUnsaturated_EnergyTimeDerivative";
187  kernel_type = "PorousFlowEnergyTimeDerivative";
188  params = _factory.getValidParams(kernel_type);
189  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
190  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
191  _problem->addKernel(kernel_type, kernel_name, params);
192  }
193  }
194 
195  if (_thermal && _mechanical && _transient)
196  {
197  std::string kernel_name = "PorousFlowUnsaturated_HeatVolumetricExpansion";
198  std::string kernel_type = "PorousFlowHeatVolumetricExpansion";
199  InputParameters params = _factory.getValidParams(kernel_type);
200  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
201  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
202  _problem->addKernel(kernel_type, kernel_name, params);
203  }
204 }
Moose::CoordinateSystemType _coord_system
Coordinate system of the simulation (eg RZ, XYZ, etc)
virtual void addKernels()
Add all Kernels.
const Real _biot_coefficient
Fluid specific heat capacity at constant volume.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
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)
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 std::vector< VariableName > & _displacements
Displacement NonlinearVariable names (if any)

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

Referenced by addMaterials().

384 {
385  if (_current_task == "add_material")
386  {
387  if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
388  parameters().hasCoupledValue("mass_fraction_vars")))
389  mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
390  "mass_fraction_vars");
391 
392  std::string material_type = "PorousFlowMassFraction";
393  InputParameters params = _factory.getValidParams(material_type);
394 
395  params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
396  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
397 
398  std::string material_name = "PorousFlowActionBase_MassFraction_qp";
399  if (at_nodes)
400  material_name = "PorousFlowActionBase_MassFraction";
401 
402  params.set<bool>("at_nodes") = at_nodes;
403  _problem->addMaterial(material_type, material_name, params);
404  }
405 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addMaterialDependencies()

void PorousFlowSinglePhaseBase::addMaterialDependencies ( )
overrideprotectedvirtual

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

Reimplemented from PorousFlowActionBase.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 97 of file PorousFlowSinglePhaseBase.C.

Referenced by PorousFlowFullySaturated::addMaterialDependencies(), PorousFlowUnsaturated::addMaterialDependencies(), and PorousFlowBasicTHM::addMaterialDependencies().

98 {
100 
101  // Add necessary objects to list of PorousFlow objects added by this action
102  if (_mechanical)
103  {
104  _included_objects.push_back("StressDivergenceTensors");
105  _included_objects.push_back("Gravity");
106  _included_objects.push_back("PorousFlowEffectiveStressCoupling");
107  }
108 
109  if (_thermal)
110  {
111  _included_objects.push_back("PorousFlowHeatConduction");
112  if (_transient)
113  _included_objects.push_back("PorousFlowEnergyTimeDerivative");
114  }
115 
116  if (_thermal && _mechanical && _transient)
117  _included_objects.push_back("PorousFlowHeatVolumetricExpansion");
118 
119  if (_add_darcy_aux)
120  _included_objects.push_back("PorousFlowDarcyVelocityComponent");
121 
123  _included_objects.push_back("StressAux");
124 }
const bool _add_stress_aux
Add AuxVariables for stress.
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.
const bool _add_darcy_aux
Add a AuxVariables to record Darcy velocity.
bool _transient
Flag to denote if the simulation is transient.
virtual void addMaterialDependencies()
Add all material dependencies so that the correct version of each material can be added...

◆ addMaterials()

void PorousFlowSinglePhaseBase::addMaterials ( )
overrideprotectedvirtual

Add all Materials.

Reimplemented from PorousFlowActionBase.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 219 of file PorousFlowSinglePhaseBase.C.

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

220 {
222 
223  // add Materials
224  if (_deps.dependsOn(_included_objects, "temperature_qp"))
225  addTemperatureMaterial(false);
226 
227  if (_deps.dependsOn(_included_objects, "temperature_nodal"))
229 
230  if (_deps.dependsOn(_included_objects, "mass_fraction_qp"))
232 
233  if (_deps.dependsOn(_included_objects, "mass_fraction_nodal"))
235 
236  const bool compute_rho_mu_qp = _deps.dependsOn(_included_objects, "density_qp") ||
237  _deps.dependsOn(_included_objects, "viscosity_qp");
238  const bool compute_e_qp = _deps.dependsOn(_included_objects, "internal_energy_qp");
239  const bool compute_h_qp = _deps.dependsOn(_included_objects, "enthalpy_qp");
240 
241  if (compute_rho_mu_qp || compute_e_qp || compute_h_qp)
242  {
243  if (_use_brine)
244  {
245  const std::string nacl_name = _mass_fraction_vars[_nacl_index];
246  addBrineMaterial(nacl_name, false, 0, compute_rho_mu_qp, compute_e_qp, compute_h_qp);
247  }
248  else
249  addSingleComponentFluidMaterial(false, 0, compute_rho_mu_qp, compute_e_qp, compute_h_qp, _fp);
250  }
251 
252  const bool compute_rho_mu_nodal = _deps.dependsOn(_included_objects, "density_nodal") ||
253  _deps.dependsOn(_included_objects, "viscosity_nodal");
254  const bool compute_e_nodal = _deps.dependsOn(_included_objects, "internal_energy_nodal");
255  const bool compute_h_nodal = _deps.dependsOn(_included_objects, "enthalpy_nodal");
256 
257  if (compute_rho_mu_nodal || compute_e_nodal || compute_h_nodal)
258  {
259  if (_use_brine)
260  {
261  const std::string nacl_name = _mass_fraction_vars[_nacl_index];
262  addBrineMaterial(nacl_name, true, 0, compute_rho_mu_nodal, compute_e_nodal, compute_h_nodal);
263  }
264  else
266  true, 0, compute_rho_mu_nodal, compute_e_nodal, compute_h_nodal, _fp);
267  }
268 
269  if (_deps.dependsOn(_included_objects, "effective_pressure_qp"))
271 
272  if (_deps.dependsOn(_included_objects, "effective_pressure_nodal"))
274 }
const std::vector< VariableName > & _mass_fraction_vars
Name of the mass-fraction variables (if any)
const unsigned _nacl_index
Index of NaCl in list of fluid components.
void addEffectiveFluidPressureMaterial(bool at_nodes)
Adds a nodal and a quadpoint effective fluid pressure material.
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.
const UserObjectName & _fp
Name of the fluid-properties UserObject.
void addTemperatureMaterial(bool at_nodes)
Adds a nodal and a quadpoint Temperature material.
void addMassFractionMaterial(bool at_nodes)
Adds a nodal and a quadpoint MassFraction material.
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.
const bool _use_brine
Use PorousFlowBrine material.
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.
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.

◆ addRelationshipManagers()

void PorousFlowActionBase::addRelationshipManagers ( Moose::RelationshipManagerType  when_type)
overridevirtualinherited

Definition at line 106 of file PorousFlowActionBase.C.

107 {
108  InputParameters ips = (_stabilization == StabilizationEnum::KT
109  ? _factory.getValidParams("PorousFlowAdvectiveFluxCalculatorSaturated")
110  : emptyInputParameters());
111  addRelationshipManagers(input_rm_type, ips);
112 }
virtual void addRelationshipManagers(Moose::RelationshipManagerType when_type) override
enum PorousFlowActionBase::StabilizationEnum _stabilization

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

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

505 {
506  if (_current_task == "add_material")
507  {
508  std::string material_type = "PorousFlowRelativePermeabilityCorey";
509  InputParameters params = _factory.getValidParams(material_type);
510 
511  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
512  params.set<Real>("n") = n;
513  params.set<unsigned int>("phase") = phase;
514  params.set<Real>("s_res") = s_res;
515  params.set<Real>("sum_s_res") = sum_s_res;
516 
517  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
518  if (at_nodes)
519  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
520 
521  params.set<bool>("at_nodes") = at_nodes;
522  _problem->addMaterial(material_type, material_name, params);
523  }
524 }
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 527 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addMaterials().

529 {
530  if (_current_task == "add_material")
531  {
532  std::string material_type = "PorousFlowRelativePermeabilityFLAC";
533  InputParameters params = _factory.getValidParams(material_type);
534 
535  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
536  params.set<Real>("m") = m;
537  params.set<unsigned int>("phase") = phase;
538  params.set<Real>("s_res") = s_res;
539  params.set<Real>("sum_s_res") = sum_s_res;
540 
541  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
542  if (at_nodes)
543  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
544 
545  params.set<bool>("at_nodes") = at_nodes;
546  _problem->addMaterial(material_type, material_name, params);
547  }
548 }
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 195 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addAuxObjects().

196 {
197  std::string phase_str = Moose::stringify(phase);
198 
199  if (_current_task == "add_aux_variable")
200  _problem->addAuxVariable("saturation" + phase_str,
201  FEType(Utility::string_to_enum<Order>("CONSTANT"),
202  Utility::string_to_enum<FEFamily>("MONOMIAL")));
203 
204  if (_current_task == "add_aux_kernel")
205  {
206  std::string aux_kernel_type = "MaterialStdVectorAux";
207  InputParameters params = _factory.getValidParams(aux_kernel_type);
208 
209  std::string aux_kernel_name = "PorousFlowActionBase_SaturationAux" + phase_str;
210  params.set<MaterialPropertyName>("property") = "PorousFlow_saturation_qp";
211  params.set<unsigned>("index") = phase;
212  params.set<AuxVariableName>("variable") = "saturation" + phase_str;
213  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
214  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
215  }
216 }

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

Referenced by addMaterials().

450 {
451  if (_current_task == "add_material")
452  {
453  std::string material_type = "PorousFlowSingleComponentFluid";
454  InputParameters params = _factory.getValidParams(material_type);
455 
456  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
457  params.set<unsigned int>("phase") = phase;
458  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
459  params.set<bool>("compute_internal_energy") = compute_internal_energy;
460  params.set<bool>("compute_enthalpy") = compute_enthalpy;
461  params.set<UserObjectName>("fp") = fp;
462 
463  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
464  if (at_nodes)
465  material_name = "PorousFlowActionBase_FluidProperties";
466 
467  params.set<bool>("at_nodes") = at_nodes;
468  _problem->addMaterial(material_type, material_name, params);
469  }
470 }
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 261 of file PorousFlowActionBase.C.

Referenced by addAuxObjects().

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

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

Referenced by addMaterials().

360 {
361  if (_current_task == "add_material")
362  {
363  if (!parameters().hasDefaultCoupledValue("temperature"))
364  mooseError(
365  "Attempt to add a PorousFlowTemperature material without setting a temperature variable");
366 
367  std::string material_type = "PorousFlowTemperature";
368  InputParameters params = _factory.getValidParams(material_type);
369 
370  params.applySpecificParameters(parameters(), {"temperature"});
371  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
372 
373  std::string material_name = "PorousFlowActionBase_Temperature_qp";
374  if (at_nodes)
375  material_name = "PorousFlowActionBase_Temperature";
376 
377  params.set<bool>("at_nodes") = at_nodes;
378  _problem->addMaterial(material_type, material_name, params);
379  }
380 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addUserObjects()

void PorousFlowActionBase::addUserObjects ( )
protectedvirtualinherited

Add all other UserObjects.

Reimplemented in PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 174 of file PorousFlowActionBase.C.

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

175 {
176  addDictator();
177 }
virtual void addDictator()=0
Add the PorousFlowDictator object.

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

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

429 {
430  if (_current_task == "add_material")
431  {
432  std::string material_type = "PorousFlowVolumetricStrain";
433  InputParameters params = _factory.getValidParams(material_type);
434 
435  std::string material_name = "PorousFlowActionBase_VolumetricStrain";
436  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
437  params.set<std::vector<VariableName>>("displacements") = displacements;
438  params.set<bool>("consistent_with_displaced_mesh") = consistent_with_displaced_mesh;
439  _problem->addMaterial(material_type, material_name, params);
440  }
441 }
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
protected

Add a AuxVariables to record Darcy velocity.

Definition at line 56 of file PorousFlowSinglePhaseBase.h.

Referenced by addAuxObjects(), and addMaterialDependencies().

◆ _add_stress_aux

const bool PorousFlowSinglePhaseBase::_add_stress_aux
protected

Add AuxVariables for stress.

Definition at line 59 of file PorousFlowSinglePhaseBase.h.

Referenced by addAuxObjects(), and addMaterialDependencies().

◆ _biot_coefficient

const Real PorousFlowSinglePhaseBase::_biot_coefficient
protected

Fluid specific heat capacity at constant volume.

Definition at line 53 of file PorousFlowSinglePhaseBase.h.

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

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protectedinherited

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

Definition at line 89 of file PorousFlowActionBase.h.

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

◆ _coupled_displacements

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

◆ _coupling_type

enum PorousFlowSinglePhaseBase::CouplingTypeEnum PorousFlowSinglePhaseBase::_coupling_type
protected

◆ _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 75 of file PorousFlowActionBase.h.

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

◆ _flux_limiter_type

const MooseEnum PorousFlowActionBase::_flux_limiter_type
protectedinherited

◆ _fp

const UserObjectName& PorousFlowSinglePhaseBase::_fp
protected

Name of the fluid-properties UserObject.

Definition at line 50 of file PorousFlowSinglePhaseBase.h.

Referenced by addMaterials(), and PorousFlowSinglePhaseBase().

◆ _gravity

const RealVectorValue PorousFlowActionBase::_gravity
protectedinherited

◆ _included_objects

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

List of Kernels, AuxKernels, Materials, etc, that are added in this input file.

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

Definition at line 51 of file PorousFlowActionBase.h.

Referenced by PorousFlowActionBase::act(), PorousFlowFullySaturated::addMaterialDependencies(), addMaterialDependencies(), PorousFlowUnsaturated::addMaterialDependencies(), PorousFlowBasicTHM::addMaterialDependencies(), PorousFlowActionBase::addMaterialDependencies(), PorousFlowFullySaturated::addMaterials(), addMaterials(), PorousFlowBasicTHM::addMaterials(), and PorousFlowUnsaturated::addMaterials().

◆ _mass_fraction_vars

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

Name of the mass-fraction variables (if any)

Definition at line 66 of file PorousFlowActionBase.h.

Referenced by addDictator(), PorousFlowFullySaturated::addKernels(), PorousFlowUnsaturated::addKernels(), and addMaterials().

◆ _mechanical

const bool PorousFlowSinglePhaseBase::_mechanical
protected

◆ _nacl_index

const unsigned PorousFlowSinglePhaseBase::_nacl_index
protected

Index of NaCl in list of fluid components.

Definition at line 65 of file PorousFlowSinglePhaseBase.h.

Referenced by addMaterials(), and PorousFlowSinglePhaseBase().

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protectedinherited

Number of displacement variables supplied.

Definition at line 78 of file PorousFlowActionBase.h.

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

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowActionBase::_num_aqueous_equilibrium
protectedinherited

Number of aqueous-equilibrium secondary species.

Definition at line 57 of file PorousFlowActionBase.h.

Referenced by 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 60 of file PorousFlowActionBase.h.

Referenced by addDictator().

◆ _num_mass_fraction_vars

const unsigned PorousFlowActionBase::_num_mass_fraction_vars
protectedinherited

◆ _pp_var

const VariableName PorousFlowSinglePhaseBase::_pp_var
protected

◆ _stabilization

enum PorousFlowActionBase::StabilizationEnum PorousFlowActionBase::_stabilization
protectedinherited

◆ _temperature_var

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

◆ _thermal

const bool PorousFlowSinglePhaseBase::_thermal
protected

◆ _transient

bool PorousFlowActionBase::_transient
protectedinherited

◆ _use_brine

const bool PorousFlowSinglePhaseBase::_use_brine
protected

Use PorousFlowBrine material.

Definition at line 62 of file PorousFlowSinglePhaseBase.h.

Referenced by addMaterials(), and PorousFlowSinglePhaseBase().


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