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
PorousFlowUnsaturated Class Reference

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

#include <PorousFlowUnsaturated.h>

Inheritance diagram for PorousFlowUnsaturated:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 PorousFlowUnsaturated (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  RelpermTypeChoiceEnum { RelpermTypeChoiceEnum::FLAC, RelpermTypeChoiceEnum::COREY }
 Fluid relative permeability type (FLAC or Corey) More...
 
enum  CouplingTypeEnum { CouplingTypeEnum::Hydro, CouplingTypeEnum::ThermoHydro, CouplingTypeEnum::HydroMechanical, CouplingTypeEnum::ThermoHydroMechanical }
 Determines the coupling type. More...
 
enum  FluidPropertiesTypeEnum { FluidPropertiesTypeEnum::PorousFlowSingleComponentFluid, FluidPropertiesTypeEnum::PorousFlowBrine, FluidPropertiesTypeEnum::Custom }
 Determines the fluid-properties type. More...
 
enum  StabilizationEnum { StabilizationEnum::None, StabilizationEnum::Full, StabilizationEnum::KT }
 

Protected Member Functions

virtual void addKernels () override
 Add all Kernels. More...
 
virtual void addAuxObjects () override
 Add all AuxVariables and AuxKernels. More...
 
virtual void addMaterialDependencies () override
 Add all material dependencies so that the correct version of each material can be added. More...
 
virtual void addMaterials () override
 Add all Materials. More...
 
virtual void addUserObjects () override
 Add all other UserObjects. More...
 
virtual void addDictator () override
 Add the PorousFlowDictator object. More...
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
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)
 
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

const bool _add_saturation_aux
 Add an Aux Variable to record saturation. More...
 
const Real _van_genuchten_alpha
 Van Genuchten alpha parameter. More...
 
const Real _van_genuchten_m
 Van Genuchten m parameter. More...
 
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
 
const Real _relative_permeability_exponent
 Relative permeability exponent. More...
 
const Real _s_res
 Residual saturation to use in the relative permeability expressions. More...
 
const std::string _capillary_pressure_name
 Name of the capillary pressure UserObject. More...
 
const VariableName _pp_var
 Porepressure NonlinearVariable name. More...
 
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
 
const bool _thermal
 Flags to indicate whether thermal or mechanical effects are included. More...
 
const bool _mechanical
 
enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum _fluid_properties_type
 
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...
 
VariableName _nacl_name
 Name of the NaCl variable. More...
 
const std::vector< AuxVariableName > _save_component_rate_in
 Name of the variables (if any) that will record the fluid-components' rate of change. More...
 
const MooseEnum _temperature_unit
 Unit used for temperature. More...
 
const MooseEnum _pressure_unit
 Unit used for porepressure. More...
 
const MooseEnum _time_unit
 Unit used for time. More...
 
const std::string _base_name
 base_name used in the TensorMechanics strain calculator 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...
 
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

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

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

Definition at line 19 of file PorousFlowUnsaturated.h.

Member Enumeration Documentation

◆ CouplingTypeEnum

enum PorousFlowSinglePhaseBase::CouplingTypeEnum
strongprotectedinherited

Determines the coupling type.

Enumerator
Hydro 
ThermoHydro 
HydroMechanical 
ThermoHydroMechanical 

Definition at line 35 of file PorousFlowSinglePhaseBase.h.

35  {
36  Hydro,
37  ThermoHydro,
38  HydroMechanical,
39  ThermoHydroMechanical
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type

◆ FluidPropertiesTypeEnum

Determines the fluid-properties type.

Enumerator
PorousFlowSingleComponentFluid 
PorousFlowBrine 
Custom 

Definition at line 47 of file PorousFlowSinglePhaseBase.h.

47  {
50  Custom
PorousFlowSingleComponentFluidTempl< false > PorousFlowSingleComponentFluid
Fluid properties of Brine.
enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum _fluid_properties_type

◆ RelpermTypeChoiceEnum

Fluid relative permeability type (FLAC or Corey)

Enumerator
FLAC 
COREY 

Definition at line 43 of file PorousFlowUnsaturated.h.

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

◆ StabilizationEnum

enum PorousFlowActionBase::StabilizationEnum
strongprotectedinherited
Enumerator
None 
Full 
KT 

Definition at line 89 of file PorousFlowActionBase.h.

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

Constructor & Destructor Documentation

◆ PorousFlowUnsaturated()

PorousFlowUnsaturated::PorousFlowUnsaturated ( const InputParameters params)

Definition at line 67 of file PorousFlowUnsaturated.C.

68  : PorousFlowSinglePhaseBase(params),
69  _add_saturation_aux(getParam<bool>("add_saturation_aux")),
70  _van_genuchten_alpha(getParam<Real>("van_genuchten_alpha")),
71  _van_genuchten_m(getParam<Real>("van_genuchten_m")),
73  getParam<MooseEnum>("relative_permeability_type").getEnum<RelpermTypeChoiceEnum>()),
74  _relative_permeability_exponent(getParam<Real>("relative_permeability_exponent")),
75  _s_res(getParam<Real>("residual_saturation")),
76  _capillary_pressure_name("PorousFlowUnsaturated_CapillaryPressureVG")
77 {
79  paramError("stabilization", "Some stabilization must be used in PorousFlowUnsaturated");
80 }
const Real _van_genuchten_m
Van Genuchten m parameter.
const bool _add_saturation_aux
Add an Aux Variable to record saturation.
const Real _van_genuchten_alpha
Van Genuchten alpha parameter.
const Real _s_res
Residual saturation to use in the relative permeability expressions.
void paramError(const std::string &param, Args... args) const
const Real _relative_permeability_exponent
Relative permeability exponent.
PorousFlowSinglePhaseBase(const InputParameters &params)
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
const std::string _capillary_pressure_name
Name of the capillary pressure UserObject.
enum PorousFlowActionBase::StabilizationEnum _stabilization

Member Function Documentation

◆ act()

void PorousFlowActionBase::act ( )
overridevirtualinherited

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

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

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

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

Definition at line 685 of file PorousFlowActionBase.C.

Referenced by 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 
)
protectedinherited

Definition at line 725 of file PorousFlowActionBase.C.

Referenced by 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 
)
protectedinherited

Definition at line 767 of file PorousFlowActionBase.C.

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

Add all AuxVariables and AuxKernels.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 331 of file PorousFlowUnsaturated.C.

332 {
334 
336  addSaturationAux(0);
337 }
void addSaturationAux(unsigned phase)
Add an AuxVariable and AuxKernel to calculate saturation.
const bool _add_saturation_aux
Add an Aux Variable to record saturation.
virtual void addAuxObjects() override
Add all AuxVariables and AuxKernels.

◆ addBrineMaterial()

void PorousFlowActionBase::addBrineMaterial ( const VariableName  xnacl,
bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy,
const MooseEnum temperature_unit 
)
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
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 
)
protectedinherited

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

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

void PorousFlowSinglePhaseBase::addDictator ( )
overrideprotectedvirtualinherited

Add the PorousFlowDictator object.

Implements PorousFlowActionBase.

Definition at line 383 of file PorousFlowSinglePhaseBase.C.

384 {
385  const std::string uo_name = _dictator_name;
386  const std::string uo_type = "PorousFlowDictator";
387  InputParameters params = _factory.getValidParams(uo_type);
388  std::vector<VariableName> pf_vars = _mass_fraction_vars;
389  pf_vars.push_back(_pp_var);
390  if (_thermal)
391  pf_vars.push_back(_temperature_var[0]);
392  if (_mechanical)
393  pf_vars.insert(pf_vars.end(), _coupled_displacements.begin(), _coupled_displacements.end());
394  params.set<std::vector<VariableName>>("porous_flow_vars") = pf_vars;
395  params.set<unsigned int>("number_fluid_phases") = 1;
396  params.set<unsigned int>("number_fluid_components") = _num_mass_fraction_vars + 1;
397  params.set<unsigned int>("number_aqueous_equilibrium") = _num_aqueous_equilibrium;
398  params.set<unsigned int>("number_aqueous_kinetic") = _num_aqueous_kinetic;
399  _problem->addUserObject(uo_type, uo_name, params);
400 }
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
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.
Factory & _factory
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.
std::shared_ptr< FEProblemBase > & _problem
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.
const std::vector< VariableName > _mass_fraction_vars
Name of the mass-fraction variables (if any)

◆ 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 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 PorousFlowUnsaturated::addKernels ( )
overrideprotectedvirtual

Add all Kernels.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 110 of file PorousFlowUnsaturated.C.

111 {
113 
114  // add the kernels
116  {
117  const std::string kernel_type = "PorousFlowAdvectiveFlux";
118  InputParameters params = _factory.getValidParams(kernel_type);
120  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
121  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
122  params.set<RealVectorValue>("gravity") = _gravity;
123 
124  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
125  {
126  const std::string kernel_name = "PorousFlowUnsaturated_AdvectiveFlux" + Moose::stringify(i);
127  params.set<unsigned int>("fluid_component") = i;
128  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
129  _problem->addKernel(kernel_type, kernel_name, params);
130  }
131  const std::string kernel_name =
132  "PorousFlowUnsaturated_AdvectiveFlux" + Moose::stringify(_num_mass_fraction_vars);
133  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
134  params.set<NonlinearVariableName>("variable") = _pp_var;
135  _problem->addKernel(kernel_type, kernel_name, params);
136  }
138  {
139  const std::string kernel_type = "PorousFlowFluxLimitedTVDAdvection";
140  InputParameters params = _factory.getValidParams(kernel_type);
142  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
143  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
144 
145  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
146  {
147  const std::string kernel_name = "PorousFlowFluxLimited_DarcyFlow" + Moose::stringify(i);
148  params.set<UserObjectName>("advective_flux_calculator") =
149  "PorousFlowUnsaturated_AC_" + Moose::stringify(i);
150  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
151  _problem->addKernel(kernel_type, kernel_name, params);
152  }
153  const std::string kernel_name =
154  "PorousFlowFluxLimited_DarcyFlow" + Moose::stringify(_num_mass_fraction_vars);
155  params.set<NonlinearVariableName>("variable") = _pp_var;
156  params.set<UserObjectName>("advective_flux_calculator") =
157  "PorousFlowUnsaturated_AC_" + Moose::stringify(_num_mass_fraction_vars);
158  _problem->addKernel(kernel_type, kernel_name, params);
159  }
160 
161  if (_transient)
162  {
163  std::string kernel_name = "PorousFlowUnsaturated_MassTimeDerivative";
164  std::string kernel_type = "PorousFlowMassTimeDerivative";
165  InputParameters params = _factory.getValidParams(kernel_type);
167  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
168  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
169  params.set<bool>("strain_at_nearest_qp") = _strain_at_nearest_qp;
170  if (!_base_name.empty())
171  params.set<std::string>("base_name") = _base_name;
172 
173  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
174  {
175  kernel_name = "PorousFlowUnsaturated_MassTimeDerivative" + Moose::stringify(i);
176  params.set<unsigned int>("fluid_component") = i;
177  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
178  if (_save_component_rate_in.size() != 0)
179  params.set<std::vector<AuxVariableName>>("save_in") = {_save_component_rate_in[i]};
180  _problem->addKernel(kernel_type, kernel_name, params);
181  }
182  kernel_name =
183  "PorousFlowUnsaturated_MassTimeDerivative" + Moose::stringify(_num_mass_fraction_vars);
184  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
185  params.set<NonlinearVariableName>("variable") = _pp_var;
186  if (_save_component_rate_in.size() != 0)
187  params.set<std::vector<AuxVariableName>>("save_in") = {
189  _problem->addKernel(kernel_type, kernel_name, params);
190  }
191 
192  if (_mechanical && _transient)
193  {
194  std::string kernel_name = "PorousFlowUnsaturated_MassVolumetricExpansion";
195  std::string kernel_type = "PorousFlowMassVolumetricExpansion";
196  InputParameters params = _factory.getValidParams(kernel_type);
198  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
199  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
200  params.set<bool>("strain_at_nearest_qp") = _strain_at_nearest_qp;
201 
202  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
203  {
204  kernel_name = "PorousFlowUnsaturated_MassVolumetricExpansion" + Moose::stringify(i);
205  params.set<unsigned>("fluid_component") = i;
206  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
207  _problem->addKernel(kernel_type, kernel_name, params);
208  }
209  kernel_name =
210  "PorousFlowUnsaturated_MassVolumetricExpansion" + Moose::stringify(_num_mass_fraction_vars);
211  params.set<unsigned>("fluid_component") = _num_mass_fraction_vars;
212  params.set<NonlinearVariableName>("variable") = _pp_var;
213  _problem->addKernel(kernel_type, kernel_name, params);
214  }
215 
216  if (_thermal)
217  {
219  {
220  const std::string kernel_name = "PorousFlowUnsaturated_HeatAdvection";
221  const std::string kernel_type = "PorousFlowHeatAdvection";
222  InputParameters params = _factory.getValidParams(kernel_type);
224  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
225  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
226  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
227  params.set<RealVectorValue>("gravity") = _gravity;
228  _problem->addKernel(kernel_type, kernel_name, params);
229  }
231  {
232  const std::string kernel_name = "PorousFlowUnsaturated_HeatAdvection";
233  const std::string kernel_type = "PorousFlowFluxLimitedTVDAdvection";
234  InputParameters params = _factory.getValidParams(kernel_type);
236  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
237  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
238  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
239  params.set<UserObjectName>("advective_flux_calculator") = "PorousFlowUnsaturatedHeat_AC";
240  _problem->addKernel(kernel_type, kernel_name, params);
241  }
242  }
243 }
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
const VariableName _pp_var
Porepressure NonlinearVariable name.
const std::vector< AuxVariableName > _save_component_rate_in
Name of the variables (if any) that will record the fluid-components&#39; rate of change.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
virtual void addKernels() override
Add all Kernels.
std::string stringify(const T &t)
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 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.
std::shared_ptr< FEProblemBase > & _problem
const std::string _base_name
base_name used in the TensorMechanics strain calculator
enum PorousFlowActionBase::StabilizationEnum _stabilization
const std::vector< VariableName > _mass_fraction_vars
Name of the mass-fraction variables (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 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 PorousFlowUnsaturated::addMaterialDependencies ( )
overrideprotectedvirtual

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

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 83 of file PorousFlowUnsaturated.C.

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

◆ addMaterials()

void PorousFlowUnsaturated::addMaterials ( )
overrideprotectedvirtual

Add all Materials.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 278 of file PorousFlowUnsaturated.C.

279 {
281 
282  if (_deps.dependsOn(_included_objects, "pressure_saturation_qp"))
283  {
284  const std::string material_type = "PorousFlow1PhaseP";
285  const std::string material_name = "PorousFlowUnsaturated_1PhaseP_VG_qp";
286  InputParameters params = _factory.getValidParams(material_type);
288  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
289  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
290  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
291  params.set<UserObjectName>("capillary_pressure") = _capillary_pressure_name;
292  params.set<bool>("at_nodes") = false;
293  _problem->addMaterial(material_type, material_name, params);
294  }
295  if (_deps.dependsOn(_included_objects, "pressure_saturation_nodal"))
296  {
297  const std::string material_type = "PorousFlow1PhaseP";
298  const std::string material_name = "PorousFlowUnsaturated_1PhaseP_VG_nodal";
299  InputParameters params = _factory.getValidParams(material_type);
301  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
302  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
303  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
304  params.set<UserObjectName>("capillary_pressure") = _capillary_pressure_name;
305  params.set<bool>("at_nodes") = true;
306  _problem->addMaterial(material_type, material_name, params);
307  }
308 
309  if (_deps.dependsOn(_included_objects, "relative_permeability_qp"))
310  {
313  else
315  }
316 
317  if (_deps.dependsOn(_included_objects, "relative_permeability_nodal"))
318  {
321  else
323  }
324 
325  if (_deps.dependsOn(_included_objects, "volumetric_strain_qp") ||
326  _deps.dependsOn(_included_objects, "volumetric_strain_nodal"))
328 }
virtual void addMaterials() override
Add all Materials.
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
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.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
bool dependsOn(const std::string &key, const std::string &value)
const VariableName _pp_var
Porepressure NonlinearVariable name.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
Factory & _factory
const Real _s_res
Residual saturation to use in the relative permeability expressions.
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const Real _relative_permeability_exponent
Relative permeability exponent.
enum PorousFlowUnsaturated::RelpermTypeChoiceEnum _relperm_type
const std::string _capillary_pressure_name
Name of the capillary pressure UserObject.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
void addVolumetricStrainMaterial(const std::vector< VariableName > &displacements, const std::string &base_name)
Adds a quadpoint volumetric strain material.
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.
std::shared_ptr< FEProblemBase > & _problem
const std::string _base_name
base_name used in the TensorMechanics strain calculator
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.

◆ addNearestQpMaterial()

void PorousFlowActionBase::addNearestQpMaterial ( )
protectedinherited

Adds a PorousFlowNearestQp material.

Definition at line 468 of file PorousFlowActionBase.C.

Referenced by PorousFlowActionBase::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
inherited

◆ addRelationshipManagers() [2/3]

bool Action::addRelationshipManagers
inherited

◆ addRelationshipManagers() [3/3]

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

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

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

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

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

Add an AuxVariable and AuxKernel to calculate saturation.

Parameters
phaseSaturation for this fluid phase

Definition at line 242 of file PorousFlowActionBase.C.

Referenced by 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 
)
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
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 ( )
protectedinherited

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

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

Add all other UserObjects.

Reimplemented from PorousFlowActionBase.

Definition at line 246 of file PorousFlowUnsaturated.C.

247 {
249 
250  // Add the capillary pressure UserObject
252 
253  // add Advective Flux calculator UserObjects, if required
255  {
256  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
257  {
258  const std::string userobject_name = "PorousFlowUnsaturated_AC_" + Moose::stringify(i);
259  addAdvectiveFluxCalculatorUnsaturatedMultiComponent(0, i, true, userobject_name);
260  }
261  const std::string userobject_name =
262  "PorousFlowUnsaturated_AC_" + Moose::stringify(_num_mass_fraction_vars);
263  if (_num_mass_fraction_vars == 0)
264  addAdvectiveFluxCalculatorUnsaturated(0, true, userobject_name); // 1 component only
265  else
267  0, _num_mass_fraction_vars, true, userobject_name);
268 
269  if (_thermal)
270  {
271  const std::string userobject_name = "PorousFlowUnsaturatedHeat_AC";
272  addAdvectiveFluxCalculatorUnsaturatedHeat(0, true, userobject_name);
273  }
274  }
275 }
const Real _van_genuchten_m
Van Genuchten m parameter.
const Real _van_genuchten_alpha
Van Genuchten alpha parameter.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
void addCapillaryPressureVG(Real m, Real alpha, std::string userobject_name)
Adds a van Genuchten capillary pressure UserObject.
void addAdvectiveFluxCalculatorUnsaturated(unsigned phase, bool multiply_by_density, std::string userobject_name)
std::string stringify(const T &t)
const std::string _capillary_pressure_name
Name of the capillary pressure UserObject.
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
virtual void addUserObjects()
Add all other UserObjects.
void addAdvectiveFluxCalculatorUnsaturatedMultiComponent(unsigned phase, unsigned fluid_component, bool multiply_by_density, std::string userobject_name)
enum PorousFlowActionBase::StabilizationEnum _stabilization
void addAdvectiveFluxCalculatorUnsaturatedHeat(unsigned phase, bool multiply_by_density, std::string userobject_name)

◆ addVolumetricStrainMaterial()

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

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

Definition at line 27 of file PorousFlowUnsaturated.C.

28 {
30  params.addParam<bool>("add_saturation_aux", true, "Add an AuxVariable that records saturation");
31  params.addRangeCheckedParam<Real>(
32  "van_genuchten_alpha",
33  1.0E-6,
34  "van_genuchten_alpha > 0.0",
35  "Van Genuchten alpha parameter used to determine saturation from porepressure");
36  params.addRangeCheckedParam<Real>(
37  "van_genuchten_m",
38  0.6,
39  "van_genuchten_m > 0 & van_genuchten_m < 1",
40  "Van Genuchten m parameter used to determine saturation from porepressure");
41  MooseEnum relperm_type_choice("FLAC Corey", "FLAC");
42  params.addParam<MooseEnum>("relative_permeability_type",
43  relperm_type_choice,
44  "Type of relative-permeability function. FLAC relperm = (1+m)S^m - "
45  "mS^(1+m). Corey relperm = S^m. m is the exponent. Here S = "
46  "(saturation - residual)/(1 - residual)");
47  params.addRangeCheckedParam<Real>("relative_permeability_exponent",
48  3.0,
49  "relative_permeability_exponent>=0",
50  "Relative permeability exponent");
51  params.addRangeCheckedParam<Real>(
52  "residual_saturation",
53  0.0,
54  "residual_saturation>=0.0 & residual_saturation<1.0",
55  "Residual saturation to use in the relative permeability expression");
56  params.addClassDescription("Adds Kernels and fluid-property Materials necessary to simulate a "
57  "single-phase saturated-unsaturated flow problem. The saturation is "
58  "computed using van Genuchten's expression. No Kernels for diffusion "
59  "and dispersion of fluid components are added. To run a simulation "
60  "you will also need to provide various other Materials for each mesh "
61  "block, depending on your simulation type, viz: permeability, "
62  "porosity, elasticity tensor, strain calculator, stress calculator, "
63  "matrix internal energy, thermal conductivity, diffusivity");
64  return params;
65 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)

Member Data Documentation

◆ _add_darcy_aux

const bool PorousFlowSinglePhaseBase::_add_darcy_aux
protectedinherited

Add a AuxVariables to record Darcy velocity.

Definition at line 60 of file PorousFlowSinglePhaseBase.h.

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

◆ _add_saturation_aux

const bool PorousFlowUnsaturated::_add_saturation_aux
protected

Add an Aux Variable to record saturation.

Definition at line 34 of file PorousFlowUnsaturated.h.

Referenced by addAuxObjects(), and addMaterialDependencies().

◆ _add_stress_aux

const bool PorousFlowSinglePhaseBase::_add_stress_aux
protectedinherited

Add AuxVariables for stress.

Definition at line 63 of file PorousFlowSinglePhaseBase.h.

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

◆ _base_name

const std::string PorousFlowSinglePhaseBase::_base_name
protectedinherited

◆ _biot_coefficient

const Real PorousFlowSinglePhaseBase::_biot_coefficient
protectedinherited

Fluid specific heat capacity at constant volume.

Definition at line 57 of file PorousFlowSinglePhaseBase.h.

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

◆ _capillary_pressure_name

const std::string PorousFlowUnsaturated::_capillary_pressure_name
protected

Name of the capillary pressure UserObject.

Definition at line 52 of file PorousFlowUnsaturated.h.

Referenced by addMaterials(), and addUserObjects().

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protectedinherited

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

Definition at line 95 of file PorousFlowActionBase.h.

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

◆ _coupled_displacements

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

◆ _coupling_type

enum PorousFlowSinglePhaseBase::CouplingTypeEnum PorousFlowSinglePhaseBase::_coupling_type
protectedinherited

◆ _deps

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

◆ _dictator_name

const std::string PorousFlowActionBase::_dictator_name
protectedinherited

◆ _displacements

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

Displacement NonlinearVariable names (if any)

Definition at line 78 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::addKernels().

◆ _fluid_properties_type

enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum PorousFlowSinglePhaseBase::_fluid_properties_type
protectedinherited

◆ _flux_limiter_type

const MooseEnum PorousFlowActionBase::_flux_limiter_type
protectedinherited

◆ _fp

UserObjectName PorousFlowSinglePhaseBase::_fp
protectedinherited

◆ _gravity

const RealVectorValue PorousFlowActionBase::_gravity
protectedinherited

◆ _included_objects

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

◆ _mass_fraction_vars

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

Name of the mass-fraction variables (if any)

Definition at line 69 of file PorousFlowActionBase.h.

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

◆ _mechanical

const bool PorousFlowSinglePhaseBase::_mechanical
protectedinherited

◆ _nacl_name

VariableName PorousFlowSinglePhaseBase::_nacl_name
protectedinherited

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protectedinherited

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
protectedinherited

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
protectedinherited

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
protectedinherited

◆ _pp_var

const VariableName PorousFlowSinglePhaseBase::_pp_var
protectedinherited

◆ _pressure_unit

const MooseEnum PorousFlowSinglePhaseBase::_pressure_unit
protectedinherited

◆ _relative_permeability_exponent

const Real PorousFlowUnsaturated::_relative_permeability_exponent
protected

Relative permeability exponent.

Definition at line 46 of file PorousFlowUnsaturated.h.

Referenced by addMaterials().

◆ _relperm_type

enum PorousFlowUnsaturated::RelpermTypeChoiceEnum PorousFlowUnsaturated::_relperm_type
protected

Referenced by addMaterials().

◆ _s_res

const Real PorousFlowUnsaturated::_s_res
protected

Residual saturation to use in the relative permeability expressions.

Definition at line 49 of file PorousFlowUnsaturated.h.

Referenced by addMaterials().

◆ _save_component_rate_in

const std::vector<AuxVariableName> PorousFlowSinglePhaseBase::_save_component_rate_in
protectedinherited

Name of the variables (if any) that will record the fluid-components' rate of change.

Definition at line 69 of file PorousFlowSinglePhaseBase.h.

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

◆ _stabilization

enum PorousFlowActionBase::StabilizationEnum PorousFlowActionBase::_stabilization
protectedinherited

◆ _strain_at_nearest_qp

const bool PorousFlowActionBase::_strain_at_nearest_qp
protectedinherited

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(), addKernels(), PorousFlowActionBase::addMaterialDependencies(), and PorousFlowActionBase::addMaterials().

◆ _subdomain_names

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

◆ _subdomain_names_set

const bool PorousFlowActionBase::_subdomain_names_set
protectedinherited

◆ _temperature_unit

const MooseEnum PorousFlowSinglePhaseBase::_temperature_unit
protectedinherited

Unit used for temperature.

Definition at line 72 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

◆ _temperature_var

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

◆ _thermal

const bool PorousFlowSinglePhaseBase::_thermal
protectedinherited

◆ _time_unit

const MooseEnum PorousFlowSinglePhaseBase::_time_unit
protectedinherited

◆ _transient

bool PorousFlowActionBase::_transient
protectedinherited

◆ _van_genuchten_alpha

const Real PorousFlowUnsaturated::_van_genuchten_alpha
protected

Van Genuchten alpha parameter.

Definition at line 37 of file PorousFlowUnsaturated.h.

Referenced by addUserObjects().

◆ _van_genuchten_m

const Real PorousFlowUnsaturated::_van_genuchten_m
protected

Van Genuchten m parameter.

Definition at line 40 of file PorousFlowUnsaturated.h.

Referenced by addUserObjects().


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