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

Action for simulation involving a single phase, single component, fully saturated fluid, using no upwinding, no mass lumping of the fluid mass, linearised fluid-mass time derivative, and potentially no multiplication by density of the fluid kernels. More...

#include <PorousFlowBasicTHM.h>

Inheritance diagram for PorousFlowBasicTHM:
[legend]

Public Member Functions

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

Protected Types

enum  CouplingTypeEnum { CouplingTypeEnum::Hydro, CouplingTypeEnum::ThermoHydro, CouplingTypeEnum::HydroMechanical, CouplingTypeEnum::ThermoHydroMechanical }
 Determines the coupling type. More...
 
enum  SimulationTypeChoiceEnum { SimulationTypeChoiceEnum::STEADY, SimulationTypeChoiceEnum::TRANSIENT }
 Whether steady or transient simulation. More...
 

Protected Member Functions

virtual void addDictator () override
 Add the PorousFlowDictator object. More...
 
void addSaturationAux (unsigned phase)
 Add an AuxVariable and AuxKernel to calculate saturation. More...
 
void addDarcyAux (const RealVectorValue &gravity)
 Add AuxVariables and AuxKernels to calculate Darcy velocity. More...
 
void addStressAux ()
 Add AuxVariables and AuxKernels to compute effective stress. More...
 
void addTemperatureMaterial (bool at_nodes)
 Adds a nodal and a quadpoint Temperature material. More...
 
void addMassFractionMaterial (bool at_nodes)
 Adds a nodal and a quadpoint MassFraction material. More...
 
void addEffectiveFluidPressureMaterial (bool at_nodes)
 Adds a nodal and a quadpoint effective fluid pressure material. More...
 
void addVolumetricStrainMaterial (const std::vector< VariableName > &displacements, bool consistent_with_displaced_mesh)
 Adds a quadpoint volumetric strain material. More...
 
void addSingleComponentFluidMaterial (bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy, const UserObjectName &fp)
 Adds a single-component fluid Material. More...
 
void addBrineMaterial (const VariableName xnacl, bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy)
 Adds a brine fluid Material. More...
 
void addRelativePermeabilityCorey (bool at_nodes, unsigned phase, Real n, Real s_res, Real sum_s_res)
 Adds a relative-permeability Material of the Corey variety. More...
 
void addRelativePermeabilityFLAC (bool at_nodes, unsigned phase, Real m, Real s_res, Real sum_s_res)
 Adds a relative-permeability Material of the FLAC variety. More...
 
void addCapillaryPressureVG (Real m, Real alpha, std::string userobject_name)
 Adds a van Genuchten capillary pressure UserObject. More...
 

Protected Attributes

const bool _multiply_by_density
 
const NonlinearVariableName _pp_var
 Porepressure NonlinearVariable name. More...
 
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
 
enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum _simulation_type
 
const UserObjectName & _fp
 Name of the fluid-properties UserObject. More...
 
const Real _biot_coefficient
 Fluid specific heat capacity at constant volume. More...
 
const bool _add_darcy_aux
 Add a AuxVariables to record Darcy velocity. More...
 
const bool _add_stress_aux
 Add AuxVariables for stress. More...
 
const bool _use_brine
 Use PorousFlowBrine material. More...
 
const unsigned _nacl_index
 Index of NaCl in list of fluid components. More...
 
std::vector< std::string > _objects_to_add
 List of Kernels, AuxKernels, Materials, etc, to be added. More...
 
const std::string _dictator_name
 The name of the PorousFlowDictator object to be added. More...
 
const unsigned int _num_aqueous_equilibrium
 Number of aqueous-equilibrium secondary species. More...
 
const unsigned int _num_aqueous_kinetic
 Number of aqeuous-kinetic secondary species that are involved in mineralisation. More...
 
const RealVectorValue _gravity
 Gravity. More...
 
const std::vector< VariableName > & _mass_fraction_vars
 Name of the mass-fraction variables (if any) More...
 
const unsigned _num_mass_fraction_vars
 Number of mass-fraction variables. More...
 
const std::vector< VariableName > & _temperature_var
 Name of the temperature variable (if any) More...
 
const std::vector< NonlinearVariableName > & _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...
 
Moose::CoordinateSystemType _coord_system
 Coordinate system of the simulation (eg RZ, XYZ, etc) More...
 
DependencyResolver< std::string > _deps
 All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies. More...
 

Detailed Description

Action for simulation involving a single phase, single component, fully saturated fluid, using no upwinding, no mass lumping of the fluid mass, linearised fluid-mass time derivative, and potentially no multiplication by density of the fluid kernels.

Definition at line 26 of file PorousFlowBasicTHM.h.

Member Enumeration Documentation

◆ CouplingTypeEnum

enum PorousFlowSinglePhaseBase::CouplingTypeEnum
strongprotectedinherited

Determines the coupling type.

Enumerator
Hydro 
ThermoHydro 
HydroMechanical 
ThermoHydroMechanical 

Definition at line 37 of file PorousFlowSinglePhaseBase.h.

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

◆ SimulationTypeChoiceEnum

Whether steady or transient simulation.

Enumerator
STEADY 
TRANSIENT 

Definition at line 45 of file PorousFlowSinglePhaseBase.h.

45 { STEADY, TRANSIENT } _simulation_type;
enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum _simulation_type

Constructor & Destructor Documentation

◆ PorousFlowBasicTHM()

PorousFlowBasicTHM::PorousFlowBasicTHM ( const InputParameters &  params)

Definition at line 52 of file PorousFlowBasicTHM.C.

53  : PorousFlowSinglePhaseBase(params), _multiply_by_density(getParam<bool>("multiply_by_density"))
54 {
55  if (_num_mass_fraction_vars != 0)
56  mooseError("PorousFlowBasicTHM can only be used for a single-component fluid, so that no "
57  "mass-fraction variables should be provided");
58  _objects_to_add.push_back("PorousFlowFullySaturatedDarcyBase");
60  _objects_to_add.push_back("PorousFlowFullySaturatedMassTimeDerivative");
63  _objects_to_add.push_back("PorousFlowFullySaturatedHeatAdvection");
64 }
const bool _multiply_by_density
std::vector< std::string > _objects_to_add
List of Kernels, AuxKernels, Materials, etc, to be added.
PorousFlowSinglePhaseBase(const InputParameters &params)
enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum _simulation_type
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type

Member Function Documentation

◆ act()

void PorousFlowBasicTHM::act ( )
overridevirtual

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 67 of file PorousFlowBasicTHM.C.

68 {
70 
71  // add the kernels
72  if (_current_task == "add_kernel")
73  {
74  std::string kernel_name = "PorousFlowBasicTHM_DarcyFlow";
75  std::string kernel_type = "PorousFlowFullySaturatedDarcyBase";
76  InputParameters params = _factory.getValidParams(kernel_type);
77  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
78  params.set<RealVectorValue>("gravity") = _gravity;
79  params.set<bool>("multiply_by_density") = _multiply_by_density;
80  params.set<NonlinearVariableName>("variable") = _pp_var;
81  _problem->addKernel(kernel_type, kernel_name, params);
82  }
83  if (_current_task == "add_kernel" && _simulation_type == SimulationTypeChoiceEnum::TRANSIENT)
84  {
85  std::string kernel_name = "PorousFlowBasicTHM_MassTimeDerivative";
86  std::string kernel_type = "PorousFlowFullySaturatedMassTimeDerivative";
87  InputParameters params = _factory.getValidParams(kernel_type);
88  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
89  params.set<NonlinearVariableName>("variable") = _pp_var;
90  params.set<Real>("biot_coefficient") = _biot_coefficient;
91  params.set<bool>("multiply_by_density") = _multiply_by_density;
92  params.set<MooseEnum>("coupling_type") = parameters().get<MooseEnum>("coupling_type");
93  _problem->addKernel(kernel_type, kernel_name, params);
94  }
95 
98  _current_task == "add_kernel")
99  {
100  std::string kernel_name = "PorousFlowBasicTHM_HeatAdvection";
101  std::string kernel_type = "PorousFlowFullySaturatedHeatAdvection";
102  InputParameters params = _factory.getValidParams(kernel_type);
103  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
104  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
105  params.set<RealVectorValue>("gravity") = _gravity;
106  _problem->addKernel(kernel_type, kernel_name, params);
107  }
108 
109  // add Materials
110  if (_deps.dependsOn(_objects_to_add, "pressure_saturation_qp") && _current_task == "add_material")
111  {
112  std::string material_type = "PorousFlow1PhaseFullySaturated";
113  InputParameters params = _factory.getValidParams(material_type);
114  std::string material_name = "PorousFlowBasicTHM_1PhaseP_qp";
115  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
116  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
117  params.set<bool>("at_nodes") = false;
118  _problem->addMaterial(material_type, material_name, params);
119  }
120  if (_deps.dependsOn(_objects_to_add, "pressure_saturation_nodal") &&
121  _current_task == "add_material")
122  {
123  std::string material_type = "PorousFlow1PhaseFullySaturated";
124  InputParameters params = _factory.getValidParams(material_type);
125  std::string material_name = "PorousFlowBasicTHM_1PhaseP";
126  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
127  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
128  params.set<bool>("at_nodes") = true;
129  _problem->addMaterial(material_type, material_name, params);
130  }
131 
132  if ((_deps.dependsOn(_objects_to_add, "volumetric_strain_qp") ||
133  _deps.dependsOn(_objects_to_add, "volumetric_strain_nodal")) &&
137 
138  if (_deps.dependsOn(_objects_to_add, "relative_permeability_qp"))
139  addRelativePermeabilityCorey(false, 0, 0.0, 0.0, 0.0);
140  if (_deps.dependsOn(_objects_to_add, "relative_permeability_nodal"))
141  addRelativePermeabilityCorey(true, 0, 0.0, 0.0, 0.0);
142 }
const Real _biot_coefficient
Fluid specific heat capacity at constant volume.
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.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
const bool _multiply_by_density
std::vector< std::string > _objects_to_add
List of Kernels, AuxKernels, Materials, etc, to be added.
const NonlinearVariableName _pp_var
Porepressure NonlinearVariable name.
const RealVectorValue _gravity
Gravity.
const std::vector< VariableName > & _temperature_var
Name of the temperature variable (if any)
enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum _simulation_type
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
void addVolumetricStrainMaterial(const std::vector< VariableName > &displacements, bool consistent_with_displaced_mesh)
Adds a quadpoint volumetric strain material.
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.

◆ addBrineMaterial()

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

Adds a brine fluid Material.

Parameters
xnaclthe variable containing the mass fraction of NaCl in the fluid
phasethe phase number of the fluid
compute_density_and_viscositycompute the density and viscosity of the fluid
compute_internal_energycompute the fluid internal energy
compute_enthalpycompute the fluid enthalpy
at_nodesadd a nodal material

Definition at line 384 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

390 {
391  if (_current_task == "add_material")
392  {
393  std::string material_type = "PorousFlowBrine";
394  InputParameters params = _factory.getValidParams(material_type);
395 
396  params.set<std::vector<VariableName>>("xnacl") = {nacl_brine};
397  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
398  params.set<unsigned int>("phase") = phase;
399  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
400  params.set<bool>("compute_internal_energy") = compute_internal_energy;
401  params.set<bool>("compute_enthalpy") = compute_enthalpy;
402 
403  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
404  if (at_nodes)
405  material_name = "PorousFlowActionBase_FluidProperties";
406 
407  params.set<bool>("at_nodes") = at_nodes;
408  _problem->addMaterial(material_type, material_name, params);
409  }
410 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addCapillaryPressureVG()

void PorousFlowActionBase::addCapillaryPressureVG ( Real  m,
Real  alpha,
std::string  userobject_name 
)
protectedinherited

Adds a van Genuchten capillary pressure UserObject.

Parameters
mvan Genuchten exponent
alphavan Genuchten alpha
userobject_namename of the user object

Definition at line 462 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::act().

463 {
464  if (_current_task == "add_user_object")
465  {
466  std::string userobject_type = "PorousFlowCapillaryPressureVG";
467  InputParameters params = _factory.getValidParams(userobject_type);
468  params.set<Real>("m") = m;
469  params.set<Real>("alpha") = alpha;
470  _problem->addUserObject(userobject_type, userobject_name, params);
471  }
472 }

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

Referenced by PorousFlowSinglePhaseBase::act().

131 {
132  if (_current_task == "add_aux_variable")
133  {
134  _problem->addAuxVariable("darcy_vel_x",
135  FEType(Utility::string_to_enum<Order>("CONSTANT"),
136  Utility::string_to_enum<FEFamily>("MONOMIAL")));
137  _problem->addAuxVariable("darcy_vel_y",
138  FEType(Utility::string_to_enum<Order>("CONSTANT"),
139  Utility::string_to_enum<FEFamily>("MONOMIAL")));
140  _problem->addAuxVariable("darcy_vel_z",
141  FEType(Utility::string_to_enum<Order>("CONSTANT"),
142  Utility::string_to_enum<FEFamily>("MONOMIAL")));
143  }
144 
145  if (_current_task == "add_aux_kernel")
146  {
147  std::string aux_kernel_type = "PorousFlowDarcyVelocityComponent";
148  InputParameters params = _factory.getValidParams(aux_kernel_type);
149 
150  params.set<RealVectorValue>("gravity") = gravity;
151  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
152  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
153 
154  std::string aux_kernel_name = "PorousFlowActionBase_Darcy_x_Aux";
155  params.set<MooseEnum>("component") = "x";
156  params.set<AuxVariableName>("variable") = "darcy_vel_x";
157  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
158 
159  aux_kernel_name = "PorousFlowActionBase_Darcy_y_Aux";
160  params.set<MooseEnum>("component") = "y";
161  params.set<AuxVariableName>("variable") = "darcy_vel_y";
162  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
163 
164  aux_kernel_name = "PorousFlowActionBase_Darcy_z_Aux";
165  params.set<MooseEnum>("component") = "z";
166  params.set<AuxVariableName>("variable") = "darcy_vel_z";
167  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
168  }
169 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addDictator()

void PorousFlowSinglePhaseBase::addDictator ( )
overrideprotectedvirtualinherited

Add the PorousFlowDictator object.

Implements PorousFlowActionBase.

Definition at line 255 of file PorousFlowSinglePhaseBase.C.

256 {
257  std::string uo_name = _dictator_name;
258  std::string uo_type = "PorousFlowDictator";
259  InputParameters params = _factory.getValidParams(uo_type);
260  std::vector<VariableName> pf_vars = _mass_fraction_vars;
261  pf_vars.push_back(_pp_var);
264  pf_vars.push_back(_temperature_var[0]);
267  pf_vars.insert(pf_vars.end(), _coupled_displacements.begin(), _coupled_displacements.end());
268  params.set<std::vector<VariableName>>("porous_flow_vars") = pf_vars;
269  params.set<unsigned int>("number_fluid_phases") = 1;
270  params.set<unsigned int>("number_fluid_components") = _num_mass_fraction_vars + 1;
271  params.set<unsigned int>("number_aqueous_equilibrium") = _num_aqueous_equilibrium;
272  params.set<unsigned int>("number_aqueous_kinetic") = _num_aqueous_kinetic;
273  _problem->addUserObject(uo_type, uo_name, params);
274 }
const std::vector< VariableName > & _mass_fraction_vars
Name of the mass-fraction variables (if any)
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 NonlinearVariableName _pp_var
Porepressure NonlinearVariable name.
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.
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.

◆ addEffectiveFluidPressureMaterial()

void PorousFlowActionBase::addEffectiveFluidPressureMaterial ( bool  at_nodes)
protectedinherited

Adds a nodal and a quadpoint effective fluid pressure material.

Parameters
at_nodesAdd nodal effective fluid pressure material

Definition at line 319 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

320 {
321  if (_current_task == "add_material")
322  {
323  std::string material_type = "PorousFlowEffectiveFluidPressure";
324  InputParameters params = _factory.getValidParams(material_type);
325 
326  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
327 
328  std::string material_name = "PorousFlowUnsaturated_EffectiveFluidPressure_qp";
329  if (at_nodes)
330  material_name = "PorousFlowUnsaturated_EffectiveFluidPressure";
331 
332  params.set<bool>("at_nodes") = at_nodes;
333  _problem->addMaterial(material_type, material_name, params);
334  }
335 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

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

Referenced by PorousFlowSinglePhaseBase::act().

295 {
296  if (_current_task == "add_material")
297  {
298  if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
299  parameters().hasCoupledValue("mass_fraction_vars")))
300  mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
301  "mass_fraction_vars");
302 
303  std::string material_type = "PorousFlowMassFraction";
304  InputParameters params = _factory.getValidParams(material_type);
305 
306  params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
307  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
308 
309  std::string material_name = "PorousFlowActionBase_MassFraction_qp";
310  if (at_nodes)
311  material_name = "PorousFlowActionBase_MassFraction";
312 
313  params.set<bool>("at_nodes") = at_nodes;
314  _problem->addMaterial(material_type, material_name, params);
315  }
316 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addRelativePermeabilityCorey()

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

Adds a relative-permeability Material of the Corey variety.

Parameters
phasethe phase number of the fluid
nThe Corey exponent
s_resThe residual saturation for this phase
sum_s_resThe sum of residual saturations over all phases

Definition at line 413 of file PorousFlowActionBase.C.

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

416 {
417  if (_current_task == "add_material")
418  {
419  std::string material_type = "PorousFlowRelativePermeabilityCorey";
420  InputParameters params = _factory.getValidParams(material_type);
421 
422  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
423  params.set<Real>("n") = n;
424  params.set<unsigned int>("phase") = phase;
425  params.set<Real>("s_res") = s_res;
426  params.set<Real>("sum_s_res") = sum_s_res;
427 
428  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
429  if (at_nodes)
430  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
431 
432  params.set<bool>("at_nodes") = at_nodes;
433  _problem->addMaterial(material_type, material_name, params);
434  }
435 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addRelativePermeabilityFLAC()

void PorousFlowActionBase::addRelativePermeabilityFLAC ( bool  at_nodes,
unsigned  phase,
Real  m,
Real  s_res,
Real  sum_s_res 
)
protectedinherited

Adds a relative-permeability Material of the FLAC variety.

Parameters
phasethe phase number of the fluid
mThe FLAC exponent
s_resThe residual saturation for this phase
sum_s_resThe sum of residual saturations over all phases

Definition at line 438 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::act().

440 {
441  if (_current_task == "add_material")
442  {
443  std::string material_type = "PorousFlowRelativePermeabilityFLAC";
444  InputParameters params = _factory.getValidParams(material_type);
445 
446  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
447  params.set<Real>("m") = m;
448  params.set<unsigned int>("phase") = phase;
449  params.set<Real>("s_res") = s_res;
450  params.set<Real>("sum_s_res") = sum_s_res;
451 
452  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
453  if (at_nodes)
454  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
455 
456  params.set<bool>("at_nodes") = at_nodes;
457  _problem->addMaterial(material_type, material_name, params);
458  }
459 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addSaturationAux()

void PorousFlowActionBase::addSaturationAux ( unsigned  phase)
protectedinherited

Add an AuxVariable and AuxKernel to calculate saturation.

Parameters
phaseSaturation for this fluid phase

Definition at line 106 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::act().

107 {
108  std::string phase_str = Moose::stringify(phase);
109 
110  if (_current_task == "add_aux_variable")
111  _problem->addAuxVariable("saturation" + phase_str,
112  FEType(Utility::string_to_enum<Order>("CONSTANT"),
113  Utility::string_to_enum<FEFamily>("MONOMIAL")));
114 
115  if (_current_task == "add_aux_kernel")
116  {
117  std::string aux_kernel_type = "MaterialStdVectorAux";
118  InputParameters params = _factory.getValidParams(aux_kernel_type);
119 
120  std::string aux_kernel_name = "PorousFlowActionBase_SaturationAux" + phase_str;
121  params.set<MaterialPropertyName>("property") = "PorousFlow_saturation_qp";
122  params.set<unsigned>("index") = phase;
123  params.set<AuxVariableName>("variable") = "saturation" + phase_str;
124  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
125  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
126  }
127 }

◆ addSingleComponentFluidMaterial()

void PorousFlowActionBase::addSingleComponentFluidMaterial ( bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy,
const UserObjectName &  fp 
)
protectedinherited

Adds a single-component fluid Material.

Parameters
phasethe phase number of the fluid
fpthe name of the FluidProperties UserObject
compute_density_and_viscositycompute the density and viscosity of the fluid
compute_internal_energycompute the fluid internal energy
compute_enthalpycompute the fluid enthalpy
at_nodesadd a nodal material

Definition at line 355 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

361 {
362  if (_current_task == "add_material")
363  {
364  std::string material_type = "PorousFlowSingleComponentFluid";
365  InputParameters params = _factory.getValidParams(material_type);
366 
367  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
368  params.set<unsigned int>("phase") = phase;
369  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
370  params.set<bool>("compute_internal_energy") = compute_internal_energy;
371  params.set<bool>("compute_enthalpy") = compute_enthalpy;
372  params.set<UserObjectName>("fp") = fp;
373 
374  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
375  if (at_nodes)
376  material_name = "PorousFlowActionBase_FluidProperties";
377 
378  params.set<bool>("at_nodes") = at_nodes;
379  _problem->addMaterial(material_type, material_name, params);
380  }
381 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addStressAux()

void PorousFlowActionBase::addStressAux ( )
protectedinherited

Add AuxVariables and AuxKernels to compute effective stress.

Definition at line 172 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

173 {
174  if (_current_task == "add_aux_variable")
175  {
176  _problem->addAuxVariable("stress_xx",
177  FEType(Utility::string_to_enum<Order>("CONSTANT"),
178  Utility::string_to_enum<FEFamily>("MONOMIAL")));
179  _problem->addAuxVariable("stress_xy",
180  FEType(Utility::string_to_enum<Order>("CONSTANT"),
181  Utility::string_to_enum<FEFamily>("MONOMIAL")));
182  _problem->addAuxVariable("stress_xz",
183  FEType(Utility::string_to_enum<Order>("CONSTANT"),
184  Utility::string_to_enum<FEFamily>("MONOMIAL")));
185  _problem->addAuxVariable("stress_yx",
186  FEType(Utility::string_to_enum<Order>("CONSTANT"),
187  Utility::string_to_enum<FEFamily>("MONOMIAL")));
188  _problem->addAuxVariable("stress_yy",
189  FEType(Utility::string_to_enum<Order>("CONSTANT"),
190  Utility::string_to_enum<FEFamily>("MONOMIAL")));
191  _problem->addAuxVariable("stress_yz",
192  FEType(Utility::string_to_enum<Order>("CONSTANT"),
193  Utility::string_to_enum<FEFamily>("MONOMIAL")));
194  _problem->addAuxVariable("stress_zx",
195  FEType(Utility::string_to_enum<Order>("CONSTANT"),
196  Utility::string_to_enum<FEFamily>("MONOMIAL")));
197  _problem->addAuxVariable("stress_zy",
198  FEType(Utility::string_to_enum<Order>("CONSTANT"),
199  Utility::string_to_enum<FEFamily>("MONOMIAL")));
200  _problem->addAuxVariable("stress_zz",
201  FEType(Utility::string_to_enum<Order>("CONSTANT"),
202  Utility::string_to_enum<FEFamily>("MONOMIAL")));
203  }
204 
205  if (_current_task == "add_aux_kernel")
206  {
207  std::string aux_kernel_type = "RankTwoAux";
208  InputParameters params = _factory.getValidParams(aux_kernel_type);
209 
210  params.set<MaterialPropertyName>("rank_two_tensor") = "stress";
211  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
212 
213  std::string aux_kernel_name = "PorousFlowAction_stress_xx";
214  params.set<AuxVariableName>("variable") = "stress_xx";
215  params.set<unsigned>("index_i") = 0;
216  params.set<unsigned>("index_j") = 0;
217  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
218 
219  aux_kernel_name = "PorousFlowAction_stress_xy";
220  params.set<AuxVariableName>("variable") = "stress_xy";
221  params.set<unsigned>("index_i") = 0;
222  params.set<unsigned>("index_j") = 1;
223  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
224 
225  aux_kernel_name = "PorousFlowAction_stress_xz";
226  params.set<AuxVariableName>("variable") = "stress_xz";
227  params.set<unsigned>("index_i") = 0;
228  params.set<unsigned>("index_j") = 2;
229  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
230 
231  aux_kernel_name = "PorousFlowAction_stress_yx";
232  params.set<AuxVariableName>("variable") = "stress_yx";
233  params.set<unsigned>("index_i") = 1;
234  params.set<unsigned>("index_j") = 0;
235  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
236 
237  aux_kernel_name = "PorousFlowAction_stress_yy";
238  params.set<AuxVariableName>("variable") = "stress_yy";
239  params.set<unsigned>("index_i") = 1;
240  params.set<unsigned>("index_j") = 1;
241  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
242 
243  aux_kernel_name = "PorousFlowAction_stress_yz";
244  params.set<AuxVariableName>("variable") = "stress_yz";
245  params.set<unsigned>("index_i") = 1;
246  params.set<unsigned>("index_j") = 2;
247  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
248 
249  aux_kernel_name = "PorousFlowAction_stress_zx";
250  params.set<AuxVariableName>("variable") = "stress_zx";
251  params.set<unsigned>("index_i") = 2;
252  params.set<unsigned>("index_j") = 0;
253  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
254 
255  aux_kernel_name = "PorousFlowAction_stress_zy";
256  params.set<AuxVariableName>("variable") = "stress_zy";
257  params.set<unsigned>("index_i") = 2;
258  params.set<unsigned>("index_j") = 1;
259  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
260 
261  aux_kernel_name = "PorousFlowAction_stress_zz";
262  params.set<AuxVariableName>("variable") = "stress_zz";
263  params.set<unsigned>("index_i") = 2;
264  params.set<unsigned>("index_j") = 2;
265  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
266  }
267 }

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

Referenced by PorousFlowSinglePhaseBase::act().

271 {
272  if (_current_task == "add_material")
273  {
274  if (!parameters().hasDefaultCoupledValue("temperature"))
275  mooseError(
276  "Attempt to add a PorousFlowTemperature material without setting a temperature variable");
277 
278  std::string material_type = "PorousFlowTemperature";
279  InputParameters params = _factory.getValidParams(material_type);
280 
281  params.applySpecificParameters(parameters(), {"temperature"});
282  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
283 
284  std::string material_name = "PorousFlowActionBase_Temperature_qp";
285  if (at_nodes)
286  material_name = "PorousFlowActionBase_Temperature";
287 
288  params.set<bool>("at_nodes") = at_nodes;
289  _problem->addMaterial(material_type, material_name, params);
290  }
291 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addVolumetricStrainMaterial()

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

Adds a quadpoint volumetric strain material.

Parameters
displacementsthe names of the displacement variables
consistent_with_displaced_meshThe volumetric strain should be consistent with the displaced mesh

Definition at line 338 of file PorousFlowActionBase.C.

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

340 {
341  if (_current_task == "add_material")
342  {
343  std::string material_type = "PorousFlowVolumetricStrain";
344  InputParameters params = _factory.getValidParams(material_type);
345 
346  std::string material_name = "PorousFlowActionBase_VolumetricStrain";
347  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
348  params.set<std::vector<VariableName>>("displacements") = displacements;
349  params.set<bool>("consistent_with_displaced_mesh") = consistent_with_displaced_mesh;
350  _problem->addMaterial(material_type, material_name, params);
351  }
352 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

Member Data Documentation

◆ _add_darcy_aux

const bool PorousFlowSinglePhaseBase::_add_darcy_aux
protectedinherited

Add a AuxVariables to record Darcy velocity.

Definition at line 54 of file PorousFlowSinglePhaseBase.h.

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

◆ _add_stress_aux

const bool PorousFlowSinglePhaseBase::_add_stress_aux
protectedinherited

Add AuxVariables for stress.

Definition at line 57 of file PorousFlowSinglePhaseBase.h.

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

◆ _biot_coefficient

const Real PorousFlowSinglePhaseBase::_biot_coefficient
protectedinherited

Fluid specific heat capacity at constant volume.

Definition at line 51 of file PorousFlowSinglePhaseBase.h.

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

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protectedinherited

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

Definition at line 73 of file PorousFlowActionBase.h.

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

◆ _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<NonlinearVariableName>& PorousFlowActionBase::_displacements
protectedinherited

Displacement NonlinearVariable names (if any)

Definition at line 64 of file PorousFlowActionBase.h.

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

◆ _fp

const UserObjectName& PorousFlowSinglePhaseBase::_fp
protectedinherited

Name of the fluid-properties UserObject.

Definition at line 48 of file PorousFlowSinglePhaseBase.h.

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

◆ _gravity

const RealVectorValue PorousFlowActionBase::_gravity
protectedinherited

◆ _mass_fraction_vars

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

◆ _multiply_by_density

const bool PorousFlowBasicTHM::_multiply_by_density
protected

Definition at line 35 of file PorousFlowBasicTHM.h.

Referenced by act().

◆ _nacl_index

const unsigned PorousFlowSinglePhaseBase::_nacl_index
protectedinherited

Index of NaCl in list of fluid components.

Definition at line 63 of file PorousFlowSinglePhaseBase.h.

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

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protectedinherited

Number of displacement variables supplied.

Definition at line 67 of file PorousFlowActionBase.h.

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

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowActionBase::_num_aqueous_equilibrium
protectedinherited

Number of aqueous-equilibrium secondary species.

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

Referenced by PorousFlowSinglePhaseBase::addDictator().

◆ _num_mass_fraction_vars

const unsigned PorousFlowActionBase::_num_mass_fraction_vars
protectedinherited

◆ _objects_to_add

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

List of Kernels, AuxKernels, Materials, etc, to be added.

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

Definition at line 40 of file PorousFlowActionBase.h.

Referenced by PorousFlowFullySaturated::act(), PorousFlowSinglePhaseBase::act(), PorousFlowUnsaturated::act(), act(), PorousFlowBasicTHM(), PorousFlowFullySaturated::PorousFlowFullySaturated(), PorousFlowSinglePhaseBase::PorousFlowSinglePhaseBase(), and PorousFlowUnsaturated::PorousFlowUnsaturated().

◆ _pp_var

const NonlinearVariableName PorousFlowSinglePhaseBase::_pp_var
protectedinherited

Porepressure NonlinearVariable name.

Definition at line 34 of file PorousFlowSinglePhaseBase.h.

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

◆ _simulation_type

enum PorousFlowSinglePhaseBase::SimulationTypeChoiceEnum PorousFlowSinglePhaseBase::_simulation_type
protectedinherited

◆ _temperature_var

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

◆ _use_brine

const bool PorousFlowSinglePhaseBase::_use_brine
protectedinherited

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