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

Time derivative of fluid mass suitable for fully-saturated, single-phase, single-component simulations. More...

#include <PorousFlowFullySaturatedMassTimeDerivative.h>

Inheritance diagram for PorousFlowFullySaturatedMassTimeDerivative:
[legend]

Public Member Functions

 PorousFlowFullySaturatedMassTimeDerivative (const InputParameters &parameters)
 

Protected Types

enum  CouplingTypeEnum { CouplingTypeEnum::Hydro, CouplingTypeEnum::ThermoHydro, CouplingTypeEnum::HydroMechanical, CouplingTypeEnum::ThermoHydroMechanical }
 Determines whether mechanical and/or thermal contributions should be added to the residual. More...
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
Real computeQpJac (unsigned int pvar)
 Jacobian contribution for the PorousFlow variable pvar. More...
 

Protected Attributes

const PorousFlowDictator_dictator
 PorousFlowDictator UserObject. More...
 
const bool _var_is_porflow_var
 Whether the Variable for this Kernel is a PorousFlow variable. More...
 
const bool _multiply_by_density
 If true then the Kernel is the time derivative of the fluid mass, otherwise it is the derivative of the fluid volume. More...
 
enum PorousFlowFullySaturatedMassTimeDerivative::CouplingTypeEnum _coupling_type
 
const bool _includes_thermal
 Whether thermal contributions should be added to the residual. More...
 
const bool _includes_mechanical
 Whether mechanical contributions should be added to the residual. More...
 
const Real _biot_coefficient
 Biot coefficient (used in simulations involving Mechanical deformations) More...
 
const MaterialProperty< Real > & _biot_modulus
 Constant Biot modulus. More...
 
const MaterialProperty< Real > *const _thermal_coeff
 Constant volumetric thermal expansion coefficient. More...
 
const MaterialProperty< std::vector< Real > > *const _fluid_density
 Quadpoint fluid density for each phase. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_dvar
 derivative of fluid density for each phase with respect to the PorousFlow variables More...
 
const MaterialProperty< std::vector< Real > > & _pp
 Quadpoint pore pressure in each phase. More...
 
const MaterialProperty< std::vector< Real > > & _pp_old
 Old value of quadpoint pore pressure in each phase. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > & _dpp_dvar
 Derivative of porepressure in each phase wrt the PorousFlow variables. More...
 
const MaterialProperty< Real > *const _temperature
 Quadpoint temperature. More...
 
const MaterialProperty< Real > *const _temperature_old
 Old value of quadpoint temperature. More...
 
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
 Derivative of temperature wrt the PorousFlow variables. More...
 
const MaterialProperty< Real > *const _strain_rate
 Strain rate. More...
 
const MaterialProperty< std::vector< RealGradient > > *const _dstrain_rate_dvar
 Derivative of strain rate wrt the PorousFlow variables. More...
 

Detailed Description

Time derivative of fluid mass suitable for fully-saturated, single-phase, single-component simulations.

No mass-lumping is used

Definition at line 26 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Member Enumeration Documentation

◆ CouplingTypeEnum

Determines whether mechanical and/or thermal contributions should be added to the residual.

Enumerator
Hydro 
ThermoHydro 
HydroMechanical 
ThermoHydroMechanical 

Definition at line 49 of file PorousFlowFullySaturatedMassTimeDerivative.h.

49  {
50  Hydro,
51  ThermoHydro,
52  HydroMechanical,
53  ThermoHydroMechanical
enum PorousFlowFullySaturatedMassTimeDerivative::CouplingTypeEnum _coupling_type

Constructor & Destructor Documentation

◆ PorousFlowFullySaturatedMassTimeDerivative()

PorousFlowFullySaturatedMassTimeDerivative::PorousFlowFullySaturatedMassTimeDerivative ( const InputParameters &  parameters)

Definition at line 42 of file PorousFlowFullySaturatedMassTimeDerivative.C.

44  : TimeKernel(parameters),
45  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
47  _multiply_by_density(getParam<bool>("multiply_by_density")),
48  _coupling_type(getParam<MooseEnum>("coupling_type").getEnum<CouplingTypeEnum>()),
53  _biot_coefficient(getParam<Real>("biot_coefficient")),
54  _biot_modulus(getMaterialProperty<Real>("PorousFlow_constant_biot_modulus_qp")),
55  _thermal_coeff(_includes_thermal ? &getMaterialProperty<Real>(
56  "PorousFlow_constant_thermal_expansion_coefficient_qp")
57  : nullptr),
58  _fluid_density(_multiply_by_density ? &getMaterialProperty<std::vector<Real>>(
59  "PorousFlow_fluid_phase_density_qp")
60  : nullptr),
62  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
63  "dPorousFlow_fluid_phase_density_qp_dvar")
64  : nullptr),
65  _pp(getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp")),
66  _pp_old(getMaterialPropertyOld<std::vector<Real>>("PorousFlow_porepressure_qp")),
67  _dpp_dvar(
68  getMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_porepressure_qp_dvar")),
69  _temperature(_includes_thermal ? &getMaterialProperty<Real>("PorousFlow_temperature_qp")
70  : nullptr),
71  _temperature_old(_includes_thermal ? &getMaterialPropertyOld<Real>("PorousFlow_temperature_qp")
72  : nullptr),
73  _dtemperature_dvar(_includes_thermal ? &getMaterialProperty<std::vector<Real>>(
74  "dPorousFlow_temperature_qp_dvar")
75  : nullptr),
77  ? &getMaterialProperty<Real>("PorousFlow_volumetric_strain_rate_qp")
78  : nullptr),
79  _dstrain_rate_dvar(_includes_mechanical ? &getMaterialProperty<std::vector<RealGradient>>(
80  "dPorousFlow_volumetric_strain_rate_qp_dvar")
81  : nullptr)
82 {
83  if (_dictator.numComponents() != 1 || _dictator.numPhases() != 1)
84  mooseError("PorousFlowFullySaturatedMassTimeDerivative is only applicable to single-phase, "
85  "single-component fluid-flow problems. The Dictator proclaims that you have more "
86  "than one phase or more than one fluid component. The Dictator does not take such "
87  "mistakes lightly");
88 }
const bool _var_is_porflow_var
Whether the Variable for this Kernel is a PorousFlow variable.
const MaterialProperty< std::vector< Real > > & _pp
Quadpoint pore pressure in each phase.
const MaterialProperty< std::vector< Real > > *const _fluid_density
Quadpoint fluid density for each phase.
const MaterialProperty< Real > & _biot_modulus
Constant Biot modulus.
const bool _includes_thermal
Whether thermal contributions should be added to the residual.
const MaterialProperty< Real > *const _temperature_old
Old value of quadpoint temperature.
unsigned int numComponents() const
The number of fluid components.
enum PorousFlowFullySaturatedMassTimeDerivative::CouplingTypeEnum _coupling_type
bool isPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is a porous flow variable.
const bool _includes_mechanical
Whether mechanical contributions should be added to the residual.
const MaterialProperty< Real > *const _strain_rate
Strain rate.
const MaterialProperty< Real > *const _thermal_coeff
Constant volumetric thermal expansion coefficient.
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_dvar
derivative of fluid density for each phase with respect to the PorousFlow variables ...
unsigned int numPhases() const
The number of fluid phases.
const MaterialProperty< std::vector< std::vector< Real > > > & _dpp_dvar
Derivative of porepressure in each phase wrt the PorousFlow variables.
const MaterialProperty< std::vector< RealGradient > > *const _dstrain_rate_dvar
Derivative of strain rate wrt the PorousFlow variables.
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
Derivative of temperature wrt the PorousFlow variables.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const Real _biot_coefficient
Biot coefficient (used in simulations involving Mechanical deformations)
const bool _multiply_by_density
If true then the Kernel is the time derivative of the fluid mass, otherwise it is the derivative of t...
const MaterialProperty< Real > *const _temperature
Quadpoint temperature.
const MaterialProperty< std::vector< Real > > & _pp_old
Old value of quadpoint pore pressure in each phase.

Member Function Documentation

◆ computeQpJac()

Real PorousFlowFullySaturatedMassTimeDerivative::computeQpJac ( unsigned int  pvar)
protected

Jacobian contribution for the PorousFlow variable pvar.

Definition at line 123 of file PorousFlowFullySaturatedMassTimeDerivative.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

124 {
125  const unsigned phase = 0;
126  Real volume = (_pp[_qp][phase] - _pp_old[_qp][phase]) / _dt / _biot_modulus[_qp];
127  Real dvolume = _dpp_dvar[_qp][phase][pvar] / _dt / _biot_modulus[_qp] * _phi[_j][_qp];
128  if (_includes_thermal)
129  {
130  volume -= (*_thermal_coeff)[_qp] * ((*_temperature)[_qp] - (*_temperature_old)[_qp]) / _dt;
131  dvolume -= (*_thermal_coeff)[_qp] * (*_dtemperature_dvar)[_qp][pvar] / _dt * _phi[_j][_qp];
132  }
134  {
135  volume += _biot_coefficient * (*_strain_rate)[_qp];
136  dvolume += _biot_coefficient * (*_dstrain_rate_dvar)[_qp][pvar] * _grad_phi[_j][_qp];
137  }
139  return _test[_i][_qp] * ((*_fluid_density)[_qp][phase] * dvolume +
140  (*_dfluid_density_dvar)[_qp][phase][pvar] * _phi[_j][_qp] * volume);
141  return _test[_i][_qp] * dvolume;
142 }
const MaterialProperty< std::vector< Real > > & _pp
Quadpoint pore pressure in each phase.
const MaterialProperty< Real > & _biot_modulus
Constant Biot modulus.
const bool _includes_thermal
Whether thermal contributions should be added to the residual.
const bool _includes_mechanical
Whether mechanical contributions should be added to the residual.
const MaterialProperty< std::vector< std::vector< Real > > > & _dpp_dvar
Derivative of porepressure in each phase wrt the PorousFlow variables.
const Real _biot_coefficient
Biot coefficient (used in simulations involving Mechanical deformations)
const bool _multiply_by_density
If true then the Kernel is the time derivative of the fluid mass, otherwise it is the derivative of t...
const MaterialProperty< std::vector< Real > > & _pp_old
Old value of quadpoint pore pressure in each phase.

◆ computeQpJacobian()

Real PorousFlowFullySaturatedMassTimeDerivative::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 105 of file PorousFlowFullySaturatedMassTimeDerivative.C.

106 {
107  // If the variable is not a PorousFlow variable (very unusual), the diag Jacobian terms are 0
108  if (!_var_is_porflow_var)
109  return 0.0;
110  return computeQpJac(_dictator.porousFlowVariableNum(_var.number()));
111 }
const bool _var_is_porflow_var
Whether the Variable for this Kernel is a PorousFlow variable.
Real computeQpJac(unsigned int pvar)
Jacobian contribution for the PorousFlow variable pvar.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.

◆ computeQpOffDiagJacobian()

Real PorousFlowFullySaturatedMassTimeDerivative::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 114 of file PorousFlowFullySaturatedMassTimeDerivative.C.

115 {
116  // If the variable is not a PorousFlow variable, the OffDiag Jacobian terms are 0
118  return 0.0;
120 }
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
Real computeQpJac(unsigned int pvar)
Jacobian contribution for the PorousFlow variable pvar.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.

◆ computeQpResidual()

Real PorousFlowFullySaturatedMassTimeDerivative::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 91 of file PorousFlowFullySaturatedMassTimeDerivative.C.

92 {
93  const unsigned phase = 0;
94  Real volume = (_pp[_qp][phase] - _pp_old[_qp][phase]) / _dt / _biot_modulus[_qp];
96  volume -= (*_thermal_coeff)[_qp] * ((*_temperature)[_qp] - (*_temperature_old)[_qp]) / _dt;
98  volume += _biot_coefficient * (*_strain_rate)[_qp];
100  return _test[_i][_qp] * (*_fluid_density)[_qp][phase] * volume;
101  return _test[_i][_qp] * volume;
102 }
const MaterialProperty< std::vector< Real > > & _pp
Quadpoint pore pressure in each phase.
const MaterialProperty< Real > & _biot_modulus
Constant Biot modulus.
const bool _includes_thermal
Whether thermal contributions should be added to the residual.
const bool _includes_mechanical
Whether mechanical contributions should be added to the residual.
const Real _biot_coefficient
Biot coefficient (used in simulations involving Mechanical deformations)
const bool _multiply_by_density
If true then the Kernel is the time derivative of the fluid mass, otherwise it is the derivative of t...
const MaterialProperty< std::vector< Real > > & _pp_old
Old value of quadpoint pore pressure in each phase.

Member Data Documentation

◆ _biot_coefficient

const Real PorousFlowFullySaturatedMassTimeDerivative::_biot_coefficient
protected

Biot coefficient (used in simulations involving Mechanical deformations)

Definition at line 63 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _biot_modulus

const MaterialProperty<Real>& PorousFlowFullySaturatedMassTimeDerivative::_biot_modulus
protected

Constant Biot modulus.

Definition at line 66 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _coupling_type

enum PorousFlowFullySaturatedMassTimeDerivative::CouplingTypeEnum PorousFlowFullySaturatedMassTimeDerivative::_coupling_type
protected

◆ _dfluid_density_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowFullySaturatedMassTimeDerivative::_dfluid_density_dvar
protected

derivative of fluid density for each phase with respect to the PorousFlow variables

Definition at line 75 of file PorousFlowFullySaturatedMassTimeDerivative.h.

◆ _dictator

const PorousFlowDictator& PorousFlowFullySaturatedMassTimeDerivative::_dictator
protected

◆ _dpp_dvar

const MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowFullySaturatedMassTimeDerivative::_dpp_dvar
protected

Derivative of porepressure in each phase wrt the PorousFlow variables.

Definition at line 84 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJac().

◆ _dstrain_rate_dvar

const MaterialProperty<std::vector<RealGradient> >* const PorousFlowFullySaturatedMassTimeDerivative::_dstrain_rate_dvar
protected

Derivative of strain rate wrt the PorousFlow variables.

Definition at line 99 of file PorousFlowFullySaturatedMassTimeDerivative.h.

◆ _dtemperature_dvar

const MaterialProperty<std::vector<Real> >* const PorousFlowFullySaturatedMassTimeDerivative::_dtemperature_dvar
protected

Derivative of temperature wrt the PorousFlow variables.

Definition at line 93 of file PorousFlowFullySaturatedMassTimeDerivative.h.

◆ _fluid_density

const MaterialProperty<std::vector<Real> >* const PorousFlowFullySaturatedMassTimeDerivative::_fluid_density
protected

Quadpoint fluid density for each phase.

Definition at line 72 of file PorousFlowFullySaturatedMassTimeDerivative.h.

◆ _includes_mechanical

const bool PorousFlowFullySaturatedMassTimeDerivative::_includes_mechanical
protected

Whether mechanical contributions should be added to the residual.

Definition at line 60 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _includes_thermal

const bool PorousFlowFullySaturatedMassTimeDerivative::_includes_thermal
protected

Whether thermal contributions should be added to the residual.

Definition at line 57 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _multiply_by_density

const bool PorousFlowFullySaturatedMassTimeDerivative::_multiply_by_density
protected

If true then the Kernel is the time derivative of the fluid mass, otherwise it is the derivative of the fluid volume.

Definition at line 46 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _pp

const MaterialProperty<std::vector<Real> >& PorousFlowFullySaturatedMassTimeDerivative::_pp
protected

Quadpoint pore pressure in each phase.

Definition at line 78 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _pp_old

const MaterialProperty<std::vector<Real> >& PorousFlowFullySaturatedMassTimeDerivative::_pp_old
protected

Old value of quadpoint pore pressure in each phase.

Definition at line 81 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _strain_rate

const MaterialProperty<Real>* const PorousFlowFullySaturatedMassTimeDerivative::_strain_rate
protected

Strain rate.

Definition at line 96 of file PorousFlowFullySaturatedMassTimeDerivative.h.

◆ _temperature

const MaterialProperty<Real>* const PorousFlowFullySaturatedMassTimeDerivative::_temperature
protected

Quadpoint temperature.

Definition at line 87 of file PorousFlowFullySaturatedMassTimeDerivative.h.

◆ _temperature_old

const MaterialProperty<Real>* const PorousFlowFullySaturatedMassTimeDerivative::_temperature_old
protected

Old value of quadpoint temperature.

Definition at line 90 of file PorousFlowFullySaturatedMassTimeDerivative.h.

◆ _thermal_coeff

const MaterialProperty<Real>* const PorousFlowFullySaturatedMassTimeDerivative::_thermal_coeff
protected

Constant volumetric thermal expansion coefficient.

Definition at line 69 of file PorousFlowFullySaturatedMassTimeDerivative.h.

◆ _var_is_porflow_var

const bool PorousFlowFullySaturatedMassTimeDerivative::_var_is_porflow_var
protected

Whether the Variable for this Kernel is a PorousFlow variable.

Definition at line 43 of file PorousFlowFullySaturatedMassTimeDerivative.h.

Referenced by computeQpJacobian().


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