https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static 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 Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 PorousFlowActionBase (const InputParameters &params)
 
virtual void act () override
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type) override
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void timedAct ()
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Types

enum  StabilizationEnum { StabilizationEnum::None, 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 addNearestQpMaterial ()
 Adds a PorousFlowNearestQp material. More...
 
void addVolumetricStrainMaterial (const std::vector< VariableName > &displacements, const std::string &base_name)
 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, const MooseEnum &temperature_unit, const MooseEnum &pressure_unit, const MooseEnum &time_unit)
 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, const MooseEnum &temperature_unit)
 Adds a brine fluid Material. More...
 
void addRelativePermeabilityConst (bool at_nodes, unsigned phase, Real kr)
 Adds a relative-permeability Material of the constant variety (primarily to add kr = 1 in actions that add a default relatively permeability for objects that require kr even when the flow is fully saturated with a single phase) 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)
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

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...
 
std::vector< SubdomainName > _subdomain_names
 if this vector is not empty the variables, kernels and materials are restricted to these subdomains More...
 
const bool _subdomain_names_set
 indicates, if the vector of subdomain names is set (dont set block restrictions, if not) 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
 
const bool _strain_at_nearest_qp
 Evaluate strain at the nearest quadpoint for porosity that depends on strain. More...
 
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...
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 
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 30 of file PorousFlowActionBase.h.

Member Enumeration Documentation

◆ StabilizationEnum

Enumerator
None 
Full 
KT 

Definition at line 89 of file PorousFlowActionBase.h.

89 { None, Full, KT } _stabilization;
enum PorousFlowActionBase::StabilizationEnum _stabilization

Constructor & Destructor Documentation

◆ PorousFlowActionBase()

PorousFlowActionBase::PorousFlowActionBase ( const InputParameters params)

Definition at line 100 of file PorousFlowActionBase.C.

101  : Action(params),
104  _dictator_name(getParam<std::string>("dictator_name")),
105  _subdomain_names(getParam<std::vector<SubdomainName>>("block")),
107  _num_aqueous_equilibrium(getParam<unsigned int>("number_aqueous_equilibrium")),
108  _num_aqueous_kinetic(getParam<unsigned int>("number_aqueous_kinetic")),
109  _gravity(getParam<RealVectorValue>("gravity")),
110  _mass_fraction_vars(isParamValid("mass_fraction_vars")
111  ? getParam<std::vector<VariableName>>("mass_fraction_vars")
112  : std::vector<VariableName>{}),
114  _temperature_var(isParamValid("temperature")
115  ? getParam<std::vector<VariableName>>("temperature")
116  : std::vector<VariableName>{}),
117  _displacements(getParam<std::vector<VariableName>>("displacements")),
118  _ndisp(_displacements.size()),
120  _flux_limiter_type(getParam<MooseEnum>("flux_limiter_type")),
121  _stabilization(getParam<MooseEnum>("stabilization").getEnum<StabilizationEnum>()),
122  _strain_at_nearest_qp(getParam<bool>("strain_at_nearest_qp"))
123 {
124  // convert vector of VariableName to vector of VariableName
125  for (unsigned int i = 0; i < _ndisp; ++i)
127 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
Action(const InputParameters &parameters)
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.
bool isParamValid(const std::string &name) const
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const unsigned _ndisp
Number of displacement variables supplied.
const T & getParam(const std::string &name) const
const RealVectorValue _gravity
Gravity.
const std::vector< VariableName > _temperature_var
Name of the temperature variable (if any)
bool isParamSetByUser(const std::string &nm) const
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const bool _strain_at_nearest_qp
Evaluate strain at the nearest quadpoint for porosity that depends on strain.
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
const std::vector< VariableName > _mass_fraction_vars
Name of the mass-fraction variables (if any)

Member Function Documentation

◆ act()

void PorousFlowActionBase::act ( )
overridevirtual

Implements Action.

Definition at line 139 of file PorousFlowActionBase.C.

140 {
141  // Check if the simulation is transient (note: can't do this in the ctor)
142  _transient = _problem->isTransient();
143 
144  // get subdomain IDs
145  std::set<SubdomainID> _subdomain_ids;
146  for (auto & name : _subdomain_names)
147  {
148  auto id = _mesh->getSubdomainID(name);
149  if (id == Moose::INVALID_BLOCK_ID)
150  paramError("block", "Subdomain \"" + name + "\" not found in mesh.");
151  else
152  _subdomain_ids.insert(id);
153  }
154 
155  // Make sure that all mesh subdomains have the same coordinate system
156  const auto & all_subdomains =
157  _subdomain_names.empty() ? _problem->mesh().meshSubdomains() : _subdomain_ids;
158 
159  if (all_subdomains.empty())
160  mooseError("No subdomains found");
161  _coord_system = _problem->getCoordSystem(*all_subdomains.begin());
162  for (const auto & subdomain : all_subdomains)
163  if (_problem->getCoordSystem(subdomain) != _coord_system)
164  mooseError(
165  "The PorousFlow Actions require all subdomains to have the same coordinate system.");
166 
167  // Note: this must be called before addMaterials!
169 
170  // Make the vector of added objects unique
171  std::sort(_included_objects.begin(), _included_objects.end());
172  _included_objects.erase(std::unique(_included_objects.begin(), _included_objects.end()),
173  _included_objects.end());
174 
175  if (_current_task == "add_user_object")
176  addUserObjects();
177 
178  if (_current_task == "add_aux_variable" || _current_task == "add_aux_kernel")
179  addAuxObjects();
180 
181  if (_current_task == "add_kernel")
182  addKernels();
183 
184  if (_current_task == "add_material")
185  addMaterials();
186 }
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.
virtual const std::string & name() const
const SubdomainID INVALID_BLOCK_ID
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
void paramError(const std::string &param, Args... args) const
bool _transient
Flag to denote if the simulation is transient.
std::shared_ptr< MooseMesh > & _mesh
virtual void addAuxObjects()
Add all AuxVariables and AuxKernels.
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
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 665 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

668 {
669  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
670  {
671  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturated";
672  InputParameters params = _factory.getValidParams(userobject_type);
674  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
675  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
676  params.set<RealVectorValue>("gravity") = _gravity;
677  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
678  params.set<unsigned>("phase") = phase;
679  params.set<bool>("multiply_by_density") = multiply_by_density;
680  _problem->addUserObject(userobject_type, userobject_name, params);
681  }
682 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
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 705 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

708 {
709  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
710  {
711  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturatedHeat";
712  InputParameters params = _factory.getValidParams(userobject_type);
714  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
715  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
716  params.set<RealVectorValue>("gravity") = _gravity;
717  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
718  params.set<unsigned>("phase") = phase;
719  params.set<bool>("multiply_by_density") = multiply_by_density;
720  _problem->addUserObject(userobject_type, userobject_name, params);
721  }
722 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
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 745 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

749 {
750  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
751  {
752  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent";
753  InputParameters params = _factory.getValidParams(userobject_type);
755  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
756  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
757  params.set<RealVectorValue>("gravity") = _gravity;
758  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
759  params.set<unsigned>("phase") = phase;
760  params.set<bool>("multiply_by_density") = multiply_by_density;
761  params.set<unsigned>("fluid_component") = fluid_component;
762  _problem->addUserObject(userobject_type, userobject_name, params);
763  }
764 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
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 685 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

688 {
689  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
690  {
691  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorUnsaturated";
692  InputParameters params = _factory.getValidParams(userobject_type);
694  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
695  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
696  params.set<RealVectorValue>("gravity") = _gravity;
697  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
698  params.set<unsigned>("phase") = phase;
699  params.set<bool>("multiply_by_density") = multiply_by_density;
700  _problem->addUserObject(userobject_type, userobject_name, params);
701  }
702 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
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 725 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

728 {
729  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
730  {
731  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat";
732  InputParameters params = _factory.getValidParams(userobject_type);
734  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
735  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
736  params.set<RealVectorValue>("gravity") = _gravity;
737  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
738  params.set<unsigned>("phase") = phase;
739  params.set<bool>("multiply_by_density") = multiply_by_density;
740  _problem->addUserObject(userobject_type, userobject_name, params);
741  }
742 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
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 767 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

769 {
770  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
771  {
772  const std::string userobject_type =
773  "PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent";
774  InputParameters params = _factory.getValidParams(userobject_type);
776  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
777  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
778  params.set<RealVectorValue>("gravity") = _gravity;
779  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
780  params.set<unsigned>("phase") = phase;
781  params.set<bool>("multiply_by_density") = multiply_by_density;
782  params.set<unsigned>("fluid_component") = fluid_component;
783  _problem->addUserObject(userobject_type, userobject_name, params);
784  }
785 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
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 225 of file PorousFlowActionBase.C.

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

226 {
227 }

◆ addBrineMaterial()

void PorousFlowActionBase::addBrineMaterial ( const VariableName  xnacl,
bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy,
const MooseEnum temperature_unit 
)
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
temperature_unitthe unit of temperature (Kelvin or Celsius)

Definition at line 543 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

550 {
551  if (_current_task == "add_material")
552  {
553  std::string material_type = "PorousFlowBrine";
554  InputParameters params = _factory.getValidParams(material_type);
556  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
557 
558  params.set<std::vector<VariableName>>("xnacl") = {nacl_brine};
559  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
560  params.set<unsigned int>("phase") = phase;
561  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
562  params.set<bool>("compute_internal_energy") = compute_internal_energy;
563  params.set<bool>("compute_enthalpy") = compute_enthalpy;
564  params.set<MooseEnum>("temperature_unit") = temperature_unit;
565 
566  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
567  if (at_nodes)
568  material_name = "PorousFlowActionBase_FluidProperties";
569 
570  params.set<bool>("at_nodes") = at_nodes;
571  _problem->addMaterial(material_type, material_name, params);
572  }
573 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

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

Referenced by PorousFlowUnsaturated::addUserObjects().

651 {
652  if (_current_task == "add_user_object")
653  {
654  std::string userobject_type = "PorousFlowCapillaryPressureVG";
655  InputParameters params = _factory.getValidParams(userobject_type);
657  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
658  params.set<Real>("m") = m;
659  params.set<Real>("alpha") = alpha;
660  _problem->addUserObject(userobject_type, userobject_name, params);
661  }
662 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string alpha
Definition: NS.h:134
std::shared_ptr< FEProblemBase > & _problem

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

Referenced by PorousFlowSinglePhaseBase::addAuxObjects().

270 {
271  if (_current_task == "add_aux_variable")
272  {
273  auto var_params = _factory.getValidParams("MooseVariableConstMonomial");
275  var_params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
276 
277  _problem->addAuxVariable("MooseVariableConstMonomial", "darcy_vel_x", var_params);
278  _problem->addAuxVariable("MooseVariableConstMonomial", "darcy_vel_y", var_params);
279  _problem->addAuxVariable("MooseVariableConstMonomial", "darcy_vel_z", var_params);
280  }
281 
282  if (_current_task == "add_aux_kernel")
283  {
284  std::string aux_kernel_type = "PorousFlowDarcyVelocityComponent";
285  InputParameters params = _factory.getValidParams(aux_kernel_type);
287  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
288 
289  params.set<RealVectorValue>("gravity") = gravity;
290  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
291  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
292 
293  std::string aux_kernel_name = "PorousFlowActionBase_Darcy_x_Aux";
294  params.set<MooseEnum>("component") = "x";
295  params.set<AuxVariableName>("variable") = "darcy_vel_x";
296  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
297 
298  aux_kernel_name = "PorousFlowActionBase_Darcy_y_Aux";
299  params.set<MooseEnum>("component") = "y";
300  params.set<AuxVariableName>("variable") = "darcy_vel_y";
301  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
302 
303  aux_kernel_name = "PorousFlowActionBase_Darcy_z_Aux";
304  params.set<MooseEnum>("component") = "z";
305  params.set<AuxVariableName>("variable") = "darcy_vel_z";
306  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
307  }
308 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

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

Referenced by PorousFlowSinglePhaseBase::addMaterials().

448 {
449  if (_current_task == "add_material")
450  {
451  std::string material_type = "PorousFlowEffectiveFluidPressure";
452  InputParameters params = _factory.getValidParams(material_type);
454  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
455 
456  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
457 
458  std::string material_name = "PorousFlowUnsaturated_EffectiveFluidPressure_qp";
459  if (at_nodes)
460  material_name = "PorousFlowUnsaturated_EffectiveFluidPressure";
461 
462  params.set<bool>("at_nodes") = at_nodes;
463  _problem->addMaterial(material_type, material_name, params);
464  }
465 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addKernels()

void PorousFlowActionBase::addKernels ( )
protectedvirtual

Add all Kernels.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, PorousFlowSinglePhaseBase, and PorousFlowFullySaturated.

Definition at line 230 of file PorousFlowActionBase.C.

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

231 {
232 }

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

Referenced by PorousFlowSinglePhaseBase::addMaterials().

421 {
422  if (_current_task == "add_material")
423  {
424  if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
425  parameters().hasCoupledValue("mass_fraction_vars")))
426  mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
427  "mass_fraction_vars");
428 
429  std::string material_type = "PorousFlowMassFraction";
430  InputParameters params = _factory.getValidParams(material_type);
432  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
433 
434  params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
435  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
436 
437  std::string material_name = "PorousFlowActionBase_MassFraction_qp";
438  if (at_nodes)
439  material_name = "PorousFlowActionBase_MassFraction";
440 
441  params.set<bool>("at_nodes") = at_nodes;
442  _problem->addMaterial(material_type, material_name, params);
443  }
444 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const

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

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

190 {
192  _included_objects.push_back("PorousFlowNearestQp");
193 
194  // Check to see if there are any other PorousFlow objects like BCs that
195  // may require specific versions of materials added using this action
196 
197  // Unique list of auxkernels added in input file
198  auto auxkernels = _awh.getActions<AddKernelAction>();
199  for (auto & auxkernel : auxkernels)
200  _included_objects.push_back(auxkernel->getMooseObjectType());
201 
202  // Unique list of postprocessors added in input file
203  auto postprocessors = _awh.getActions<AddPostprocessorAction>();
204  for (auto & postprocessor : postprocessors)
205  _included_objects.push_back(postprocessor->getMooseObjectType());
206 
207  // Unique list of BCs added in input file
208  auto bcs = _awh.getActions<AddBCAction>();
209  for (auto & bc : bcs)
210  _included_objects.push_back(bc->getMooseObjectType());
211 
212  // Unique list of Dirac kernels added in input file
213  auto diracs = _awh.getActions<AddDiracKernelAction>();
214  for (auto & dirac : diracs)
215  _included_objects.push_back(dirac->getMooseObjectType());
216 }
ActionWarehouse & _awh
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
const bool _strain_at_nearest_qp
Evaluate strain at the nearest quadpoint for porosity that depends on strain.
std::vector< const T *> getActions()

◆ addMaterials()

void PorousFlowActionBase::addMaterials ( )
protectedvirtual

Add all Materials.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, PorousFlowSinglePhaseBase, and PorousFlowFullySaturated.

Definition at line 235 of file PorousFlowActionBase.C.

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

236 {
237  if (_strain_at_nearest_qp && _deps.dependsOn(_included_objects, "nearest_qp_nodal"))
239 }
bool dependsOn(const std::string &key, const std::string &value)
void addNearestQpMaterial()
Adds a PorousFlowNearestQp material.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
const bool _strain_at_nearest_qp
Evaluate strain at the nearest quadpoint for porosity that depends on strain.
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.

◆ addNearestQpMaterial()

void PorousFlowActionBase::addNearestQpMaterial ( )
protected

Adds a PorousFlowNearestQp material.

Definition at line 468 of file PorousFlowActionBase.C.

Referenced by addMaterials().

469 {
470  if (_current_task == "add_material")
471  {
472  std::string material_type = "PorousFlowNearestQp";
473  InputParameters params = _factory.getValidParams(material_type);
475  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
476 
477  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
478  params.set<bool>("nodal_material") = true;
479 
480  std::string material_name = "PorousFlowActionBase_NearestQp";
481  _problem->addMaterial(material_type, material_name, params);
482  }
483 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addRelationshipManagers() [1/3]

virtual void Action::addRelationshipManagers

◆ addRelationshipManagers() [2/3]

bool Action::addRelationshipManagers

◆ addRelationshipManagers() [3/3]

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

Reimplemented from Action.

Definition at line 130 of file PorousFlowActionBase.C.

131 {
133  ? _factory.getValidParams("PorousFlowAdvectiveFluxCalculatorSaturated")
135  addRelationshipManagers(input_rm_type, ips);
136 }
InputParameters getValidParams(const std::string &name) const
InputParameters emptyInputParameters()
Factory & _factory
virtual void addRelationshipManagers(Moose::RelationshipManagerType when_type) override
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addRelativePermeabilityConst()

void PorousFlowActionBase::addRelativePermeabilityConst ( bool  at_nodes,
unsigned  phase,
Real  kr 
)
protected

Adds a relative-permeability Material of the constant variety (primarily to add kr = 1 in actions that add a default relatively permeability for objects that require kr even when the flow is fully saturated with a single phase)

Parameters
at_nodeswhether the material is nodal
phasethe phase number of the fluid
krthe relative permeability

Definition at line 576 of file PorousFlowActionBase.C.

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

577 {
578  if (_current_task == "add_material")
579  {
580  std::string material_type = "PorousFlowRelativePermeabilityConst";
581  InputParameters params = _factory.getValidParams(material_type);
583  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
584 
585  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
586  params.set<unsigned int>("phase") = phase;
587  params.set<Real>("kr") = kr;
588  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
589  if (at_nodes)
590  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
591 
592  params.set<bool>("at_nodes") = at_nodes;
593  _problem->addMaterial(material_type, material_name, params);
594  }
595 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ 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
at_nodeswhether the material is nodal
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 598 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addMaterials().

600 {
601  if (_current_task == "add_material")
602  {
603  std::string material_type = "PorousFlowRelativePermeabilityCorey";
604  InputParameters params = _factory.getValidParams(material_type);
606  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
607 
608  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
609  params.set<Real>("n") = n;
610  params.set<unsigned int>("phase") = phase;
611  params.set<Real>("s_res") = s_res;
612  params.set<Real>("sum_s_res") = sum_s_res;
613 
614  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
615  if (at_nodes)
616  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
617 
618  params.set<bool>("at_nodes") = at_nodes;
619  _problem->addMaterial(material_type, material_name, params);
620  }
621 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ 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
at_nodeswhether the material is nodal
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 624 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addMaterials().

626 {
627  if (_current_task == "add_material")
628  {
629  std::string material_type = "PorousFlowRelativePermeabilityFLAC";
630  InputParameters params = _factory.getValidParams(material_type);
632  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
633 
634  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
635  params.set<Real>("m") = m;
636  params.set<unsigned int>("phase") = phase;
637  params.set<Real>("s_res") = s_res;
638  params.set<Real>("sum_s_res") = sum_s_res;
639 
640  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
641  if (at_nodes)
642  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
643 
644  params.set<bool>("at_nodes") = at_nodes;
645  _problem->addMaterial(material_type, material_name, params);
646  }
647 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addSaturationAux()

void PorousFlowActionBase::addSaturationAux ( unsigned  phase)
protected

Add an AuxVariable and AuxKernel to calculate saturation.

Parameters
phaseSaturation for this fluid phase

Definition at line 242 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addAuxObjects().

243 {
244  std::string phase_str = Moose::stringify(phase);
245 
246  if (_current_task == "add_aux_variable")
247  {
248  auto var_params = _factory.getValidParams("MooseVariableConstMonomial");
250  var_params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
251  _problem->addAuxVariable("MooseVariableConstMonomial", "saturation" + phase_str, var_params);
252  }
253 
254  if (_current_task == "add_aux_kernel")
255  {
256  std::string aux_kernel_type = "MaterialStdVectorAux";
257  InputParameters params = _factory.getValidParams(aux_kernel_type);
258 
259  std::string aux_kernel_name = "PorousFlowActionBase_SaturationAux" + phase_str;
260  params.set<MaterialPropertyName>("property") = "PorousFlow_saturation_qp";
261  params.set<unsigned>("index") = phase;
262  params.set<AuxVariableName>("variable") = "saturation" + phase_str;
263  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
264  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
265  }
266 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
std::string stringify(const T &t)
std::shared_ptr< FEProblemBase > & _problem

◆ addSingleComponentFluidMaterial()

void PorousFlowActionBase::addSingleComponentFluidMaterial ( bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy,
const UserObjectName &  fp,
const MooseEnum temperature_unit,
const MooseEnum pressure_unit,
const MooseEnum time_unit 
)
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
temperature_unitthe unit of temperature (Kelvin or Celsius)
pressure_unitthe unit of pressure (MPa or Pa)
time_unitthe unit of time (seconds, days, hours, etc)

Definition at line 506 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

515 {
516  if (_current_task == "add_material")
517  {
518  std::string material_type = "PorousFlowSingleComponentFluid";
519  InputParameters params = _factory.getValidParams(material_type);
521  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
522 
523  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
524  params.set<unsigned int>("phase") = phase;
525  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
526  params.set<bool>("compute_internal_energy") = compute_internal_energy;
527  params.set<bool>("compute_enthalpy") = compute_enthalpy;
528  params.set<UserObjectName>("fp") = fp;
529  params.set<MooseEnum>("temperature_unit") = temperature_unit;
530  params.set<MooseEnum>("pressure_unit") = pressure_unit;
531  params.set<MooseEnum>("time_unit") = time_unit;
532 
533  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
534  if (at_nodes)
535  material_name = "PorousFlowActionBase_FluidProperties";
536 
537  params.set<bool>("at_nodes") = at_nodes;
538  _problem->addMaterial(material_type, material_name, params);
539  }
540 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addStressAux()

void PorousFlowActionBase::addStressAux ( )
protected

Add AuxVariables and AuxKernels to compute effective stress.

Definition at line 311 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::addAuxObjects().

312 {
313  if (_current_task == "add_aux_variable")
314  {
315  auto var_params = _factory.getValidParams("MooseVariableConstMonomial");
317  var_params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
318  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_xx", var_params);
319  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_xy", var_params);
320  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_xz", var_params);
321  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_yx", var_params);
322  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_yy", var_params);
323  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_yz", var_params);
324  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_zx", var_params);
325  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_zy", var_params);
326  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_zz", var_params);
327  }
328 
329  if (_current_task == "add_aux_kernel")
330  {
331  std::string aux_kernel_type = "RankTwoAux";
332  InputParameters params = _factory.getValidParams(aux_kernel_type);
333 
334  params.set<MaterialPropertyName>("rank_two_tensor") = "stress";
335  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
336 
337  std::string aux_kernel_name = "PorousFlowAction_stress_xx";
338  params.set<AuxVariableName>("variable") = "stress_xx";
339  params.set<unsigned>("index_i") = 0;
340  params.set<unsigned>("index_j") = 0;
341  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
342 
343  aux_kernel_name = "PorousFlowAction_stress_xy";
344  params.set<AuxVariableName>("variable") = "stress_xy";
345  params.set<unsigned>("index_i") = 0;
346  params.set<unsigned>("index_j") = 1;
347  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
348 
349  aux_kernel_name = "PorousFlowAction_stress_xz";
350  params.set<AuxVariableName>("variable") = "stress_xz";
351  params.set<unsigned>("index_i") = 0;
352  params.set<unsigned>("index_j") = 2;
353  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
354 
355  aux_kernel_name = "PorousFlowAction_stress_yx";
356  params.set<AuxVariableName>("variable") = "stress_yx";
357  params.set<unsigned>("index_i") = 1;
358  params.set<unsigned>("index_j") = 0;
359  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
360 
361  aux_kernel_name = "PorousFlowAction_stress_yy";
362  params.set<AuxVariableName>("variable") = "stress_yy";
363  params.set<unsigned>("index_i") = 1;
364  params.set<unsigned>("index_j") = 1;
365  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
366 
367  aux_kernel_name = "PorousFlowAction_stress_yz";
368  params.set<AuxVariableName>("variable") = "stress_yz";
369  params.set<unsigned>("index_i") = 1;
370  params.set<unsigned>("index_j") = 2;
371  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
372 
373  aux_kernel_name = "PorousFlowAction_stress_zx";
374  params.set<AuxVariableName>("variable") = "stress_zx";
375  params.set<unsigned>("index_i") = 2;
376  params.set<unsigned>("index_j") = 0;
377  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
378 
379  aux_kernel_name = "PorousFlowAction_stress_zy";
380  params.set<AuxVariableName>("variable") = "stress_zy";
381  params.set<unsigned>("index_i") = 2;
382  params.set<unsigned>("index_j") = 1;
383  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
384 
385  aux_kernel_name = "PorousFlowAction_stress_zz";
386  params.set<AuxVariableName>("variable") = "stress_zz";
387  params.set<unsigned>("index_i") = 2;
388  params.set<unsigned>("index_j") = 2;
389  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
390  }
391 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
std::shared_ptr< FEProblemBase > & _problem

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

Referenced by PorousFlowSinglePhaseBase::addMaterials().

395 {
396  if (_current_task == "add_material")
397  {
398  if (!parameters().hasDefaultCoupledValue("temperature"))
399  mooseError("Attempt to add a PorousFlowTemperature material without setting a temperature "
400  "variable");
401 
402  std::string material_type = "PorousFlowTemperature";
403  InputParameters params = _factory.getValidParams(material_type);
405  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
406 
407  params.applySpecificParameters(parameters(), {"temperature"});
408  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
409 
410  std::string material_name = "PorousFlowActionBase_Temperature_qp";
411  if (at_nodes)
412  material_name = "PorousFlowActionBase_Temperature";
413 
414  params.set<bool>("at_nodes") = at_nodes;
415  _problem->addMaterial(material_type, material_name, params);
416  }
417 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const

◆ addUserObjects()

void PorousFlowActionBase::addUserObjects ( )
protectedvirtual

Add all other UserObjects.

Reimplemented in PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 219 of file PorousFlowActionBase.C.

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

220 {
221  addDictator();
222 }
virtual void addDictator()=0
Add the PorousFlowDictator object.

◆ addVolumetricStrainMaterial()

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

Adds a quadpoint volumetric strain material.

Parameters
displacementsthe names of the displacement variables
base_nameThe base_name used in the TensorMechanics strain calculator displaced mesh

Definition at line 486 of file PorousFlowActionBase.C.

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

488 {
489  if (_current_task == "add_material")
490  {
491  std::string material_type = "PorousFlowVolumetricStrain";
492  InputParameters params = _factory.getValidParams(material_type);
494  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
495 
496  std::string material_name = "PorousFlowActionBase_VolumetricStrain";
497  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
498  params.set<std::vector<VariableName>>("displacements") = displacements;
499  if (!base_name.empty())
500  params.set<std::string>("base_name") = base_name;
501  _problem->addMaterial(material_type, material_name, params);
502  }
503 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ validParams()

InputParameters PorousFlowActionBase::validParams ( )
static

Definition at line 22 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::validParams().

23 {
25  params.addParam<std::string>(
26  "dictator_name",
27  "dictator",
28  "The name of the dictator user object that is created by this Action");
29  params.addClassDescription("Adds the PorousFlowDictator UserObject. This class also contains "
30  "many utility functions for adding other pieces of an input file, "
31  "which may be used by derived classes.");
32  params.addParam<std::vector<SubdomainName>>(
33  "block", {}, "The list of block ids (SubdomainID) on which the porous flow is defined on");
34  params.addParamNamesToGroup("block", "Advanced");
35 
36  params.addParam<RealVectorValue>("gravity",
37  RealVectorValue(0.0, 0.0, -10.0),
38  "Gravitational acceleration vector downwards (m/s^2)");
39  params.addCoupledVar("temperature",
40  293.0,
41  "For isothermal simulations, this is the temperature "
42  "at which fluid properties (and stress-free strains) "
43  "are evaluated at. Otherwise, this is the name of "
44  "the temperature variable. Units = Kelvin");
45  params.addCoupledVar("mass_fraction_vars",
46  "List of variables that represent the mass fractions. Format is 'f_ph0^c0 "
47  "f_ph0^c1 f_ph0^c2 ... f_ph0^c(N-1) f_ph1^c0 f_ph1^c1 fph1^c2 ... "
48  "fph1^c(N-1) ... fphP^c0 f_phP^c1 fphP^c2 ... fphP^c(N-1)' where "
49  "N=num_components and P=num_phases, and it is assumed that "
50  "f_ph^cN=1-sum(f_ph^c,{c,0,N-1}) so that f_ph^cN need not be given. If no "
51  "variables are provided then num_phases=1=num_components.");
52  params.addParam<unsigned int>("number_aqueous_equilibrium",
53  0,
54  "The number of secondary species in the aqueous-equilibrium "
55  "reaction system. (Leave as zero if the simulation does not "
56  "involve chemistry)");
57  params.addParam<unsigned int>("number_aqueous_kinetic",
58  0,
59  "The number of secondary species in the aqueous-kinetic reaction "
60  "system involved in precipitation and dissolution. (Leave as zero "
61  "if the simulation does not involve chemistry)");
62  params.addParam<std::vector<VariableName>>(
63  "displacements",
64  {},
65  "The name of the displacement variables (relevant only for "
66  "mechanically-coupled simulations)");
67  params.addParam<std::vector<MaterialPropertyName>>(
68  "eigenstrain_names",
69  {},
70  "List of all eigenstrain models used in mechanics calculations. "
71  "Typically the eigenstrain_name used in "
72  "ComputeThermalExpansionEigenstrain. Only needed for "
73  "thermally-coupled simulations with thermal expansion.");
74  params.addParam<bool>(
75  "use_displaced_mesh", false, "Use displaced mesh computations in mechanical kernels");
76  MooseEnum flux_limiter_type("MinMod VanLeer MC superbee None", "VanLeer");
77  params.addParam<MooseEnum>(
78  "flux_limiter_type",
79  flux_limiter_type,
80  "Type of flux limiter to use if stabilization=KT. 'None' means that no antidiffusion "
81  "will be added in the Kuzmin-Turek scheme");
82  MooseEnum stabilization("None Full KT", "Full");
83  params.addParam<MooseEnum>("stabilization",
84  stabilization,
85  "Numerical stabilization used. 'Full' means full upwinding. 'KT' "
86  "means FEM-TVD stabilization of Kuzmin-Turek");
87  params.addParam<bool>(
88  "strain_at_nearest_qp",
89  false,
90  "Only relevant for models in which porosity depends on strain. If true, then when "
91  "calculating nodal porosity that depends on strain, the strain at the nearest quadpoint will "
92  "be used. This adds a small extra computational burden, and is only necessary for "
93  "simulations involving: (1) elements that are not linear lagrange or (2) certain PorousFlow "
94  "Dirac Kernels (as specified in their documentation). If you set this to true, you will "
95  "also want to set the same parameter to true for related Kernels and Materials (which is "
96  "probably easiest to do in the GlobalParams block)");
97  return params;
98 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)

Member Data Documentation

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protected

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

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

Referenced by PorousFlowSinglePhaseBase::addKernels().

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

Name of the mass-fraction variables (if any)

Definition at line 69 of file PorousFlowActionBase.h.

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

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protected

Number of displacement variables supplied.

Definition at line 81 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::addKernels().

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowActionBase::_num_aqueous_equilibrium
protected

Number of aqueous-equilibrium secondary species.

Definition at line 60 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 63 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

◆ _strain_at_nearest_qp

const bool PorousFlowActionBase::_strain_at_nearest_qp
protected

Evaluate strain at the nearest quadpoint for porosity that depends on strain.

Definition at line 92 of file PorousFlowActionBase.h.

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

◆ _subdomain_names

std::vector<SubdomainName> PorousFlowActionBase::_subdomain_names
protected

◆ _subdomain_names_set

const bool PorousFlowActionBase::_subdomain_names_set
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: