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

Kernel = energy_density * d(volumetric_strain)/dt which is lumped to the nodes. More...

#include <PorousFlowHeatVolumetricExpansion.h>

Inheritance diagram for PorousFlowHeatVolumetricExpansion:
[legend]

Public Member Functions

 PorousFlowHeatVolumetricExpansion (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
Real computedEnergyQpJac (unsigned int jvar)
 Derivative of energy part of the residual with respect to the Variable with variable number jvar. More...
 
Real computedVolQpJac (unsigned int jvar)
 Derivative of volumetric-strain part of the residual with respect to the Variable with variable number jvar. 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 according to the Dictator. More...
 
const unsigned int _num_phases
 Number of fluid phases. More...
 
const bool _fluid_present
 Whether fluid is present. More...
 
const bool _strain_at_nearest_qp
 Whether the porosity uses the volumetric strain at the closest quadpoint. More...
 
const MaterialProperty< Real > & _porosity
 Porosity. More...
 
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
 d(porosity)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
 d(porosity)/d(grad PorousFlow variable) More...
 
const MaterialProperty< unsigned int > *const _nearest_qp
 The nearest qp to the node. More...
 
const MaterialProperty< Real > & _rock_energy_nodal
 Nodal rock energy density. More...
 
const MaterialProperty< std::vector< Real > > & _drock_energy_nodal_dvar
 d(nodal rock energy density)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _fluid_density
 Nodal fluid density. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_dvar
 d(nodal fluid density)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _fluid_saturation_nodal
 Nodal fluid saturation. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_saturation_nodal_dvar
 d(nodal fluid saturation)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _energy_nodal
 Internal energy of the phases, evaluated at the nodes. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _denergy_nodal_dvar
 d(internal energy)/d(PorousFlow variable) More...
 
const MaterialProperty< Real > & _strain_rate_qp
 Strain rate. More...
 
const MaterialProperty< std::vector< RealGradient > > & _dstrain_rate_qp_dvar
 d(strain rate)/d(PorousFlow variable) More...
 

Detailed Description

Kernel = energy_density * d(volumetric_strain)/dt which is lumped to the nodes.

Definition at line 25 of file PorousFlowHeatVolumetricExpansion.h.

Constructor & Destructor Documentation

◆ PorousFlowHeatVolumetricExpansion()

PorousFlowHeatVolumetricExpansion::PorousFlowHeatVolumetricExpansion ( const InputParameters &  parameters)

Definition at line 34 of file PorousFlowHeatVolumetricExpansion.C.

36  : TimeKernel(parameters),
37  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
41  _strain_at_nearest_qp(getParam<bool>("strain_at_nearest_qp")),
42  _porosity(getMaterialProperty<Real>("PorousFlow_porosity_nodal")),
43  _dporosity_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_nodal_dvar")),
45  getMaterialProperty<std::vector<RealGradient>>("dPorousFlow_porosity_nodal_dgradvar")),
47  ? &getMaterialProperty<unsigned int>("PorousFlow_nearestqp_nodal")
48  : nullptr),
49  _rock_energy_nodal(getMaterialProperty<Real>("PorousFlow_matrix_internal_energy_nodal")),
51  getMaterialProperty<std::vector<Real>>("dPorousFlow_matrix_internal_energy_nodal_dvar")),
52  _fluid_density(_fluid_present ? &getMaterialProperty<std::vector<Real>>(
53  "PorousFlow_fluid_phase_density_nodal")
54  : nullptr),
55  _dfluid_density_dvar(_fluid_present ? &getMaterialProperty<std::vector<std::vector<Real>>>(
56  "dPorousFlow_fluid_phase_density_nodal_dvar")
57  : nullptr),
59  _fluid_present ? &getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
60  : nullptr),
62  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
63  "dPorousFlow_saturation_nodal_dvar")
64  : nullptr),
65  _energy_nodal(_fluid_present ? &getMaterialProperty<std::vector<Real>>(
66  "PorousFlow_fluid_phase_internal_energy_nodal")
67  : nullptr),
68  _denergy_nodal_dvar(_fluid_present ? &getMaterialProperty<std::vector<std::vector<Real>>>(
69  "dPorousFlow_fluid_phase_internal_energy_nodal_dvar")
70  : nullptr),
71  _strain_rate_qp(getMaterialProperty<Real>("PorousFlow_volumetric_strain_rate_qp")),
72  _dstrain_rate_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
73  "dPorousFlow_volumetric_strain_rate_qp_dvar"))
74 {
75 }
const bool _fluid_present
Whether fluid is present.
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(PorousFlow variable)
const MaterialProperty< std::vector< Real > > *const _fluid_saturation_nodal
Nodal fluid saturation.
const MaterialProperty< std::vector< Real > > *const _fluid_density
Nodal fluid density.
bool isPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is a porous flow variable.
const MaterialProperty< std::vector< std::vector< Real > > > *const _denergy_nodal_dvar
d(internal energy)/d(PorousFlow variable)
const MaterialProperty< unsigned int > *const _nearest_qp
The nearest qp to the node.
const MaterialProperty< Real > & _strain_rate_qp
Strain rate.
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_saturation_nodal_dvar
d(nodal fluid saturation)/d(PorousFlow variable)
const MaterialProperty< Real > & _porosity
Porosity.
unsigned int numPhases() const
The number of fluid phases.
const MaterialProperty< std::vector< Real > > & _drock_energy_nodal_dvar
d(nodal rock energy density)/d(PorousFlow variable)
const MaterialProperty< std::vector< Real > > *const _energy_nodal
Internal energy of the phases, evaluated at the nodes.
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_dvar
d(nodal fluid density)/d(PorousFlow variable)
const MaterialProperty< std::vector< RealGradient > > & _dstrain_rate_qp_dvar
d(strain rate)/d(PorousFlow variable)
const MaterialProperty< Real > & _rock_energy_nodal
Nodal rock energy density.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad PorousFlow variable)
const unsigned int _num_phases
Number of fluid phases.
const bool _var_is_porflow_var
Whether the Variable for this Kernel is a PorousFlow variable according to the Dictator.
const bool _strain_at_nearest_qp
Whether the porosity uses the volumetric strain at the closest quadpoint.

Member Function Documentation

◆ computedEnergyQpJac()

Real PorousFlowHeatVolumetricExpansion::computedEnergyQpJac ( unsigned int  jvar)
protected

Derivative of energy part of the residual with respect to the Variable with variable number jvar.

This is used by both computeQpJacobian and computeQpOffDiagJacobian

Parameters
jvartake the derivative of the energy part of the residual wrt this variable number

Definition at line 117 of file PorousFlowHeatVolumetricExpansion.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

118 {
120  return 0.0;
121 
122  const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
123  const unsigned nearest_qp = (_strain_at_nearest_qp ? (*_nearest_qp)[_i] : _i);
124 
125  Real denergy = -_dporosity_dgradvar[_i][pvar] * _grad_phi[_j][_i] * _rock_energy_nodal[_i];
126  for (unsigned ph = 0; ph < _num_phases; ++ph)
127  denergy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
128  (*_energy_nodal)[_i][ph] * _dporosity_dgradvar[_i][pvar] * _grad_phi[_j][nearest_qp];
129 
130  if (_i != _j)
131  return _test[_i][_qp] * denergy * _strain_rate_qp[_qp];
132 
133  denergy += _drock_energy_nodal_dvar[_i][pvar] * (1.0 - _porosity[_i]);
134  denergy -= _rock_energy_nodal[_i] * _dporosity_dvar[_i][pvar];
135  for (unsigned ph = 0; ph < _num_phases; ++ph)
136  {
137  denergy += (*_dfluid_density_dvar)[_i][ph][pvar] * (*_fluid_saturation_nodal)[_i][ph] *
138  (*_energy_nodal)[_i][ph] * _porosity[_i];
139  denergy += (*_fluid_density)[_i][ph] * (*_dfluid_saturation_nodal_dvar)[_i][ph][pvar] *
140  (*_energy_nodal)[_i][ph] * _porosity[_i];
141  denergy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
142  (*_denergy_nodal_dvar)[_i][ph][pvar] * _porosity[_i];
143  denergy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
144  (*_energy_nodal)[_i][ph] * _dporosity_dvar[_i][pvar];
145  }
146 
147  return _test[_i][_qp] * denergy * _strain_rate_qp[_qp];
148 }
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(PorousFlow variable)
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
const MaterialProperty< std::vector< Real > > *const _fluid_density
Nodal fluid density.
const MaterialProperty< Real > & _strain_rate_qp
Strain rate.
const MaterialProperty< Real > & _porosity
Porosity.
const MaterialProperty< std::vector< Real > > & _drock_energy_nodal_dvar
d(nodal rock energy density)/d(PorousFlow variable)
const MaterialProperty< Real > & _rock_energy_nodal
Nodal rock energy density.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad PorousFlow variable)
const unsigned int _num_phases
Number of fluid phases.
const bool _strain_at_nearest_qp
Whether the porosity uses the volumetric strain at the closest quadpoint.

◆ computedVolQpJac()

Real PorousFlowHeatVolumetricExpansion::computedVolQpJac ( unsigned int  jvar)
protected

Derivative of volumetric-strain part of the residual with respect to the Variable with variable number jvar.

This is used by both computeQpJacobian and computeQpOffDiagJacobian

Parameters
jvartake the derivative of the volumetric-strain part of the residual wrt this variable number

Definition at line 101 of file PorousFlowHeatVolumetricExpansion.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

102 {
104  return 0.0;
105 
106  Real energy = (1.0 - _porosity[_i]) * _rock_energy_nodal[_i];
107  for (unsigned ph = 0; ph < _num_phases; ++ph)
108  energy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
109  (*_energy_nodal)[_i][ph] * _porosity[_i];
110 
111  const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
112  Real dvol = _dstrain_rate_qp_dvar[_qp][pvar] * _grad_phi[_j][_qp];
113 
114  return _test[_i][_qp] * energy * dvol;
115 }
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
const MaterialProperty< std::vector< Real > > *const _fluid_density
Nodal fluid density.
const MaterialProperty< Real > & _porosity
Porosity.
const MaterialProperty< std::vector< RealGradient > > & _dstrain_rate_qp_dvar
d(strain rate)/d(PorousFlow variable)
const MaterialProperty< Real > & _rock_energy_nodal
Nodal rock energy density.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
const unsigned int _num_phases
Number of fluid phases.

◆ computeQpJacobian()

Real PorousFlowHeatVolumetricExpansion::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 89 of file PorousFlowHeatVolumetricExpansion.C.

90 {
91  return computedEnergyQpJac(_var.number()) + computedVolQpJac(_var.number());
92 }
Real computedVolQpJac(unsigned int jvar)
Derivative of volumetric-strain part of the residual with respect to the Variable with variable numbe...
Real computedEnergyQpJac(unsigned int jvar)
Derivative of energy part of the residual with respect to the Variable with variable number jvar...

◆ computeQpOffDiagJacobian()

Real PorousFlowHeatVolumetricExpansion::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 95 of file PorousFlowHeatVolumetricExpansion.C.

96 {
97  return computedEnergyQpJac(jvar) + computedVolQpJac(jvar);
98 }
Real computedVolQpJac(unsigned int jvar)
Derivative of volumetric-strain part of the residual with respect to the Variable with variable numbe...
Real computedEnergyQpJac(unsigned int jvar)
Derivative of energy part of the residual with respect to the Variable with variable number jvar...

◆ computeQpResidual()

Real PorousFlowHeatVolumetricExpansion::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 78 of file PorousFlowHeatVolumetricExpansion.C.

79 {
80  Real energy = (1.0 - _porosity[_i]) * _rock_energy_nodal[_i];
81  for (unsigned ph = 0; ph < _num_phases; ++ph)
82  energy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
83  (*_energy_nodal)[_i][ph] * _porosity[_i];
84 
85  return _test[_i][_qp] * energy * _strain_rate_qp[_qp];
86 }
const MaterialProperty< std::vector< Real > > *const _fluid_density
Nodal fluid density.
const MaterialProperty< Real > & _strain_rate_qp
Strain rate.
const MaterialProperty< Real > & _porosity
Porosity.
const MaterialProperty< Real > & _rock_energy_nodal
Nodal rock energy density.
const unsigned int _num_phases
Number of fluid phases.

Member Data Documentation

◆ _denergy_nodal_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowHeatVolumetricExpansion::_denergy_nodal_dvar
protected

d(internal energy)/d(PorousFlow variable)

Definition at line 84 of file PorousFlowHeatVolumetricExpansion.h.

◆ _dfluid_density_dvar

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

d(nodal fluid density)/d(PorousFlow variable)

Definition at line 72 of file PorousFlowHeatVolumetricExpansion.h.

◆ _dfluid_saturation_nodal_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowHeatVolumetricExpansion::_dfluid_saturation_nodal_dvar
protected

d(nodal fluid saturation)/d(PorousFlow variable)

Definition at line 78 of file PorousFlowHeatVolumetricExpansion.h.

◆ _dictator

const PorousFlowDictator& PorousFlowHeatVolumetricExpansion::_dictator
protected

PorousFlowDictator UserObject.

Definition at line 36 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac(), and computedVolQpJac().

◆ _dporosity_dgradvar

const MaterialProperty<std::vector<RealGradient> >& PorousFlowHeatVolumetricExpansion::_dporosity_dgradvar
protected

d(porosity)/d(grad PorousFlow variable)

Definition at line 57 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac().

◆ _dporosity_dvar

const MaterialProperty<std::vector<Real> >& PorousFlowHeatVolumetricExpansion::_dporosity_dvar
protected

d(porosity)/d(PorousFlow variable)

Definition at line 54 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac().

◆ _drock_energy_nodal_dvar

const MaterialProperty<std::vector<Real> >& PorousFlowHeatVolumetricExpansion::_drock_energy_nodal_dvar
protected

d(nodal rock energy density)/d(PorousFlow variable)

Definition at line 66 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac().

◆ _dstrain_rate_qp_dvar

const MaterialProperty<std::vector<RealGradient> >& PorousFlowHeatVolumetricExpansion::_dstrain_rate_qp_dvar
protected

d(strain rate)/d(PorousFlow variable)

Definition at line 90 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedVolQpJac().

◆ _energy_nodal

const MaterialProperty<std::vector<Real> >* const PorousFlowHeatVolumetricExpansion::_energy_nodal
protected

Internal energy of the phases, evaluated at the nodes.

Definition at line 81 of file PorousFlowHeatVolumetricExpansion.h.

◆ _fluid_density

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

Nodal fluid density.

Definition at line 69 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac(), computedVolQpJac(), and computeQpResidual().

◆ _fluid_present

const bool PorousFlowHeatVolumetricExpansion::_fluid_present
protected

Whether fluid is present.

Definition at line 45 of file PorousFlowHeatVolumetricExpansion.h.

◆ _fluid_saturation_nodal

const MaterialProperty<std::vector<Real> >* const PorousFlowHeatVolumetricExpansion::_fluid_saturation_nodal
protected

Nodal fluid saturation.

Definition at line 75 of file PorousFlowHeatVolumetricExpansion.h.

◆ _nearest_qp

const MaterialProperty<unsigned int>* const PorousFlowHeatVolumetricExpansion::_nearest_qp
protected

The nearest qp to the node.

Definition at line 60 of file PorousFlowHeatVolumetricExpansion.h.

◆ _num_phases

const unsigned int PorousFlowHeatVolumetricExpansion::_num_phases
protected

Number of fluid phases.

Definition at line 42 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac(), computedVolQpJac(), and computeQpResidual().

◆ _porosity

const MaterialProperty<Real>& PorousFlowHeatVolumetricExpansion::_porosity
protected

Porosity.

Definition at line 51 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac(), computedVolQpJac(), and computeQpResidual().

◆ _rock_energy_nodal

const MaterialProperty<Real>& PorousFlowHeatVolumetricExpansion::_rock_energy_nodal
protected

Nodal rock energy density.

Definition at line 63 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac(), computedVolQpJac(), and computeQpResidual().

◆ _strain_at_nearest_qp

const bool PorousFlowHeatVolumetricExpansion::_strain_at_nearest_qp
protected

Whether the porosity uses the volumetric strain at the closest quadpoint.

Definition at line 48 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac().

◆ _strain_rate_qp

const MaterialProperty<Real>& PorousFlowHeatVolumetricExpansion::_strain_rate_qp
protected

Strain rate.

Definition at line 87 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac(), and computeQpResidual().

◆ _var_is_porflow_var

const bool PorousFlowHeatVolumetricExpansion::_var_is_porflow_var
protected

Whether the Variable for this Kernel is a PorousFlow variable according to the Dictator.

Definition at line 39 of file PorousFlowHeatVolumetricExpansion.h.


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