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

fluid_mass/dt lumped to the nodes More...

#include <Q2PNodalMass.h>

Inheritance diagram for Q2PNodalMass:
[legend]

Public Member Functions

 Q2PNodalMass (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

Protected Attributes

const RichardsDensity_density
 
const VariableValue & _other_var_nodal
 the other variable (this is porepressure if the Variable is saturation) More...
 
unsigned int _other_var_num
 variable number of the other variable More...
 
bool _var_is_pp
 whether the "other variable" is actually porepressure More...
 
const MaterialProperty< Real > & _porosity
 current value of the porosity More...
 

Detailed Description

fluid_mass/dt lumped to the nodes

Definition at line 26 of file Q2PNodalMass.h.

Constructor & Destructor Documentation

◆ Q2PNodalMass()

Q2PNodalMass::Q2PNodalMass ( const InputParameters &  parameters)

Definition at line 43 of file Q2PNodalMass.C.

44  : TimeKernel(parameters),
45  _density(getUserObject<RichardsDensity>("fluid_density")),
46  _other_var_nodal(coupledNodalValue("other_var")),
47  _other_var_num(coupled("other_var")),
48  _var_is_pp(getParam<bool>("var_is_porepressure")),
49  _porosity(getMaterialProperty<Real>("porosity"))
50 {
51 }
unsigned int _other_var_num
variable number of the other variable
Definition: Q2PNodalMass.h:44
const RichardsDensity & _density
Definition: Q2PNodalMass.h:38
const VariableValue & _other_var_nodal
the other variable (this is porepressure if the Variable is saturation)
Definition: Q2PNodalMass.h:41
bool _var_is_pp
whether the "other variable" is actually porepressure
Definition: Q2PNodalMass.h:47
const MaterialProperty< Real > & _porosity
current value of the porosity
Definition: Q2PNodalMass.h:50

Member Function Documentation

◆ computeQpJacobian()

Real Q2PNodalMass::computeQpJacobian ( )
protectedvirtual

Definition at line 74 of file Q2PNodalMass.C.

75 {
76  if (_i != _j)
77  return 0.0;
78 
79  Real mass_prime;
80 
81  if (_var_is_pp)
82  {
83  // we're calculating the derivative wrt porepressure
84  Real ddensity = _density.ddensity(_var.dofValues()[_i]);
85  mass_prime = _porosity[_qp] * ddensity * (1 - _other_var_nodal[_i]);
86  }
87  else
88  {
89  // we're calculating the deriv wrt saturation
91  mass_prime = _porosity[_qp] * density;
92  }
93 
94  return _test[_i][_qp] * mass_prime / _dt;
95 }
const RichardsDensity & _density
Definition: Q2PNodalMass.h:38
virtual Real ddensity(Real p) const =0
derivative of fluid density wrt porepressure This must be over-ridden in derived classes to provide a...
const std::string density
Definition: NS.h:17
virtual Real density(Real p) const =0
fluid density as a function of porepressure This must be over-ridden in derived classes to provide an...
const VariableValue & _other_var_nodal
the other variable (this is porepressure if the Variable is saturation)
Definition: Q2PNodalMass.h:41
bool _var_is_pp
whether the "other variable" is actually porepressure
Definition: Q2PNodalMass.h:47
const MaterialProperty< Real > & _porosity
current value of the porosity
Definition: Q2PNodalMass.h:50

◆ computeQpOffDiagJacobian()

Real Q2PNodalMass::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 98 of file Q2PNodalMass.C.

99 {
100  if (jvar != _other_var_num)
101  return 0.0;
102  if (_i != _j)
103  return 0.0;
104 
105  Real mass_prime;
106 
107  if (_var_is_pp)
108  {
109  // we're calculating the deriv wrt saturation
110  Real density = _density.density(_var.dofValues()[_i]);
111  mass_prime = -_porosity[_qp] * density;
112  }
113  else
114  {
115  // we're calculating the deriv wrt porepressure
116  Real ddensity = _density.ddensity(_other_var_nodal[_i]);
117  mass_prime = _porosity[_qp] * ddensity * _var.dofValues()[_i];
118  }
119 
120  return _test[_i][_qp] * mass_prime / _dt;
121 }
unsigned int _other_var_num
variable number of the other variable
Definition: Q2PNodalMass.h:44
const RichardsDensity & _density
Definition: Q2PNodalMass.h:38
virtual Real ddensity(Real p) const =0
derivative of fluid density wrt porepressure This must be over-ridden in derived classes to provide a...
const std::string density
Definition: NS.h:17
virtual Real density(Real p) const =0
fluid density as a function of porepressure This must be over-ridden in derived classes to provide an...
const VariableValue & _other_var_nodal
the other variable (this is porepressure if the Variable is saturation)
Definition: Q2PNodalMass.h:41
bool _var_is_pp
whether the "other variable" is actually porepressure
Definition: Q2PNodalMass.h:47
const MaterialProperty< Real > & _porosity
current value of the porosity
Definition: Q2PNodalMass.h:50

◆ computeQpResidual()

Real Q2PNodalMass::computeQpResidual ( )
protectedvirtual

Definition at line 54 of file Q2PNodalMass.C.

55 {
56  Real density;
57  Real mass;
58 
59  if (_var_is_pp)
60  {
61  density = _density.density(_var.dofValues()[_i]);
62  mass = _porosity[_qp] * density * (1 - _other_var_nodal[_i]);
63  }
64  else
65  {
67  mass = _porosity[_qp] * density * _var.dofValues()[_i];
68  }
69 
70  return _test[_i][_qp] * mass / _dt;
71 }
const RichardsDensity & _density
Definition: Q2PNodalMass.h:38
const std::string density
Definition: NS.h:17
virtual Real density(Real p) const =0
fluid density as a function of porepressure This must be over-ridden in derived classes to provide an...
const VariableValue & _other_var_nodal
the other variable (this is porepressure if the Variable is saturation)
Definition: Q2PNodalMass.h:41
bool _var_is_pp
whether the "other variable" is actually porepressure
Definition: Q2PNodalMass.h:47
const MaterialProperty< Real > & _porosity
current value of the porosity
Definition: Q2PNodalMass.h:50

Member Data Documentation

◆ _density

const RichardsDensity& Q2PNodalMass::_density
protected

Definition at line 38 of file Q2PNodalMass.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _other_var_nodal

const VariableValue& Q2PNodalMass::_other_var_nodal
protected

the other variable (this is porepressure if the Variable is saturation)

Definition at line 41 of file Q2PNodalMass.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _other_var_num

unsigned int Q2PNodalMass::_other_var_num
protected

variable number of the other variable

Definition at line 44 of file Q2PNodalMass.h.

Referenced by computeQpOffDiagJacobian().

◆ _porosity

const MaterialProperty<Real>& Q2PNodalMass::_porosity
protected

current value of the porosity

Definition at line 50 of file Q2PNodalMass.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _var_is_pp

bool Q2PNodalMass::_var_is_pp
protected

whether the "other variable" is actually porepressure

Definition at line 47 of file Q2PNodalMass.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().


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