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
 holds info on the Porous Flow variables More...
 
const bool _var_is_porflow_var
 whether the Variable for this Kernel is a porous-flow 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(porous-flow variable) More...
 
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
 d(porosity)/d(grad porous-flow 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(porous-flow 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(porous-flow 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(porous-flow variable) More...
 

Detailed Description

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

Definition at line 24 of file PorousFlowHeatVolumetricExpansion.h.

Constructor & Destructor Documentation

PorousFlowHeatVolumetricExpansion::PorousFlowHeatVolumetricExpansion ( const InputParameters &  parameters)

Definition at line 31 of file PorousFlowHeatVolumetricExpansion.C.

33  : TimeKernel(parameters),
34  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
38  _strain_at_nearest_qp(getParam<bool>("strain_at_nearest_qp")),
39  _porosity(getMaterialProperty<Real>("PorousFlow_porosity_nodal")),
40  _dporosity_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_nodal_dvar")),
42  getMaterialProperty<std::vector<RealGradient>>("dPorousFlow_porosity_nodal_dgradvar")),
44  ? &getMaterialProperty<unsigned int>("PorousFlow_nearestqp_nodal")
45  : nullptr),
46  _rock_energy_nodal(getMaterialProperty<Real>("PorousFlow_matrix_internal_energy_nodal")),
48  getMaterialProperty<std::vector<Real>>("dPorousFlow_matrix_internal_energy_nodal_dvar")),
51  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_nodal")
52  : nullptr),
54  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
55  "dPorousFlow_fluid_phase_density_nodal_dvar")
56  : nullptr),
58  _fluid_present ? &getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
59  : nullptr),
61  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
62  "dPorousFlow_saturation_nodal_dvar")
63  : nullptr),
65  ? &getMaterialProperty<std::vector<Real>>(
66  "PorousFlow_fluid_phase_internal_energy_nodal")
67  : nullptr),
69  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
70  "dPorousFlow_fluid_phase_internal_energy_nodal_dvar")
71  : nullptr),
72  _strain_rate_qp(getMaterialProperty<Real>("PorousFlow_volumetric_strain_rate_qp")),
73  _dstrain_rate_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
74  "dPorousFlow_volumetric_strain_rate_qp_dvar"))
75 {
76 }
const bool _fluid_present
whether fluid is present
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(porous-flow variable)
const MaterialProperty< std::vector< Real > > *const _fluid_saturation_nodal
nodal fluid saturation
const MaterialProperty< std::vector< Real > > *const _fluid_density
nodal fluid density
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(porous-flow variable)
const MaterialProperty< Real > & _porosity
porosity
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(porous-flow variable)
const MaterialProperty< std::vector< RealGradient > > & _dstrain_rate_qp_dvar
d(strain rate)/d(porous-flow variable)
const MaterialProperty< Real > & _rock_energy_nodal
nodal rock energy density
const PorousFlowDictator & _dictator
holds info on the Porous Flow variables
unsigned int numPhases() const
the number of fluid phases
bool isPorousFlowVariable(unsigned int moose_var_num) const
returns true if moose_var_num is a porous flow variable
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad porous-flow variable)
const unsigned int _num_phases
number of fluid phases
const bool _var_is_porflow_var
whether the Variable for this Kernel is a porous-flow 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

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 118 of file PorousFlowHeatVolumetricExpansion.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

119 {
121  return 0.0;
122 
123  const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
124  const unsigned nearest_qp = (_strain_at_nearest_qp ? (*_nearest_qp)[_i] : _i);
125 
126  Real denergy = -_dporosity_dgradvar[_i][pvar] * _grad_phi[_j][_i] * _rock_energy_nodal[_i];
127  for (unsigned ph = 0; ph < _num_phases; ++ph)
128  denergy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
129  (*_energy_nodal)[_i][ph] * _dporosity_dgradvar[_i][pvar] * _grad_phi[_j][nearest_qp];
130 
131  if (_i != _j)
132  return _test[_i][_qp] * denergy * _strain_rate_qp[_qp];
133 
134  denergy += _drock_energy_nodal_dvar[_i][pvar] * (1.0 - _porosity[_i]);
135  denergy -= _rock_energy_nodal[_i] * _dporosity_dvar[_i][pvar];
136  for (unsigned ph = 0; ph < _num_phases; ++ph)
137  {
138  denergy += (*_dfluid_density_dvar)[_i][ph][pvar] * (*_fluid_saturation_nodal)[_i][ph] *
139  (*_energy_nodal)[_i][ph] * _porosity[_i];
140  denergy += (*_fluid_density)[_i][ph] * (*_dfluid_saturation_nodal_dvar)[_i][ph][pvar] *
141  (*_energy_nodal)[_i][ph] * _porosity[_i];
142  denergy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
143  (*_denergy_nodal_dvar)[_i][ph][pvar] * _porosity[_i];
144  denergy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
145  (*_energy_nodal)[_i][ph] * _dporosity_dvar[_i][pvar];
146  }
147 
148  return _test[_i][_qp] * denergy * _strain_rate_qp[_qp];
149 }
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(porous-flow variable)
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
holds info on the Porous Flow variables
bool notPorousFlowVariable(unsigned int moose_var_num) const
returns true if moose_var_num is not a porous flow variabe
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad porous-flow variable)
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
the PorousFlow variable number
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
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 102 of file PorousFlowHeatVolumetricExpansion.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

103 {
105  return 0.0;
106 
107  Real energy = (1.0 - _porosity[_i]) * _rock_energy_nodal[_i];
108  for (unsigned ph = 0; ph < _num_phases; ++ph)
109  energy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
110  (*_energy_nodal)[_i][ph] * _porosity[_i];
111 
112  const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
113  Real dvol = _dstrain_rate_qp_dvar[_qp][pvar] * _grad_phi[_j][_qp];
114 
115  return _test[_i][_qp] * energy * dvol;
116 }
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(porous-flow variable)
const MaterialProperty< Real > & _rock_energy_nodal
nodal rock energy density
const PorousFlowDictator & _dictator
holds info on the Porous Flow variables
bool notPorousFlowVariable(unsigned int moose_var_num) const
returns true if moose_var_num is not a porous flow variabe
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
the PorousFlow variable number
const unsigned int _num_phases
number of fluid phases
Real PorousFlowHeatVolumetricExpansion::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 90 of file PorousFlowHeatVolumetricExpansion.C.

91 {
92  return computedEnergyQpJac(_var.number()) + computedVolQpJac(_var.number());
93 }
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...
Real PorousFlowHeatVolumetricExpansion::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 96 of file PorousFlowHeatVolumetricExpansion.C.

97 {
98  return computedEnergyQpJac(jvar) + computedVolQpJac(jvar);
99 }
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...
Real PorousFlowHeatVolumetricExpansion::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 79 of file PorousFlowHeatVolumetricExpansion.C.

80 {
81  Real energy = (1.0 - _porosity[_i]) * _rock_energy_nodal[_i];
82  for (unsigned ph = 0; ph < _num_phases; ++ph)
83  energy += (*_fluid_density)[_i][ph] * (*_fluid_saturation_nodal)[_i][ph] *
84  (*_energy_nodal)[_i][ph] * _porosity[_i];
85 
86  return _test[_i][_qp] * energy * _strain_rate_qp[_qp];
87 }
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

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

d(internal energy)/d(PorousFlow variable)

Definition at line 83 of file PorousFlowHeatVolumetricExpansion.h.

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

d(nodal fluid density)/d(porous-flow variable)

Definition at line 71 of file PorousFlowHeatVolumetricExpansion.h.

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

d(nodal fluid saturation)/d(porous-flow variable)

Definition at line 77 of file PorousFlowHeatVolumetricExpansion.h.

const PorousFlowDictator& PorousFlowHeatVolumetricExpansion::_dictator
protected

holds info on the Porous Flow variables

Definition at line 35 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac(), and computedVolQpJac().

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

d(porosity)/d(grad porous-flow variable)

Definition at line 56 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac().

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

d(porosity)/d(porous-flow variable)

Definition at line 53 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac().

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

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

Definition at line 65 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac().

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

d(strain rate)/d(porous-flow variable)

Definition at line 89 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedVolQpJac().

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

internal energy of the phases, evaluated at the nodes

Definition at line 80 of file PorousFlowHeatVolumetricExpansion.h.

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

nodal fluid density

Definition at line 68 of file PorousFlowHeatVolumetricExpansion.h.

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

const bool PorousFlowHeatVolumetricExpansion::_fluid_present
protected

whether fluid is present

Definition at line 44 of file PorousFlowHeatVolumetricExpansion.h.

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

nodal fluid saturation

Definition at line 74 of file PorousFlowHeatVolumetricExpansion.h.

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

the nearest qp to the node

Definition at line 59 of file PorousFlowHeatVolumetricExpansion.h.

const unsigned int PorousFlowHeatVolumetricExpansion::_num_phases
protected

number of fluid phases

Definition at line 41 of file PorousFlowHeatVolumetricExpansion.h.

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

const MaterialProperty<Real>& PorousFlowHeatVolumetricExpansion::_porosity
protected

porosity

Definition at line 50 of file PorousFlowHeatVolumetricExpansion.h.

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

const MaterialProperty<Real>& PorousFlowHeatVolumetricExpansion::_rock_energy_nodal
protected

nodal rock energy density

Definition at line 62 of file PorousFlowHeatVolumetricExpansion.h.

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

const bool PorousFlowHeatVolumetricExpansion::_strain_at_nearest_qp
protected

whether the porosity uses the volumetric strain at the closest quadpoint

Definition at line 47 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac().

const MaterialProperty<Real>& PorousFlowHeatVolumetricExpansion::_strain_rate_qp
protected

strain rate

Definition at line 86 of file PorousFlowHeatVolumetricExpansion.h.

Referenced by computedEnergyQpJac(), and computeQpResidual().

const bool PorousFlowHeatVolumetricExpansion::_var_is_porflow_var
protected

whether the Variable for this Kernel is a porous-flow variable according to the Dictator

Definition at line 38 of file PorousFlowHeatVolumetricExpansion.h.


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