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 24 of file Q2PNodalMass.h.

Constructor & Destructor Documentation

Q2PNodalMass::Q2PNodalMass ( const InputParameters &  parameters)

Definition at line 39 of file Q2PNodalMass.C.

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

Member Function Documentation

Real Q2PNodalMass::computeQpJacobian ( )
protectedvirtual

Definition at line 70 of file Q2PNodalMass.C.

71 {
72  if (_i != _j)
73  return 0.0;
74 
75  Real mass_prime;
76 
77  if (_var_is_pp)
78  {
79  // we're calculating the derivative wrt porepressure
80  Real ddensity = _density.ddensity(_var.nodalSln()[_i]);
81  mass_prime = _porosity[_qp] * ddensity * (1 - _other_var_nodal[_i]);
82  }
83  else
84  {
85  // we're calculating the deriv wrt saturation
87  mass_prime = _porosity[_qp] * density;
88  }
89 
90  return _test[_i][_qp] * mass_prime / _dt;
91 }
const RichardsDensity & _density
Definition: Q2PNodalMass.h:36
const std::string density
Definition: NS.h:15
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:39
bool _var_is_pp
whether the "other variable" is actually porepressure
Definition: Q2PNodalMass.h:45
const MaterialProperty< Real > & _porosity
current value of the porosity
Definition: Q2PNodalMass.h:48
virtual Real ddensity(Real p) const =0
derivative of fluid density wrt porepressure This must be over-ridden in derived classes to provide a...
Real Q2PNodalMass::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 94 of file Q2PNodalMass.C.

95 {
96  if (jvar != _other_var_num)
97  return 0.0;
98  if (_i != _j)
99  return 0.0;
100 
101  Real mass_prime;
102 
103  if (_var_is_pp)
104  {
105  // we're calculating the deriv wrt saturation
106  Real density = _density.density(_var.nodalSln()[_i]);
107  mass_prime = -_porosity[_qp] * density;
108  }
109  else
110  {
111  // we're calculating the deriv wrt porepressure
112  Real ddensity = _density.ddensity(_other_var_nodal[_i]);
113  mass_prime = _porosity[_qp] * ddensity * _var.nodalSln()[_i];
114  }
115 
116  return _test[_i][_qp] * mass_prime / _dt;
117 }
unsigned int _other_var_num
variable number of the other variable
Definition: Q2PNodalMass.h:42
const RichardsDensity & _density
Definition: Q2PNodalMass.h:36
const std::string density
Definition: NS.h:15
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:39
bool _var_is_pp
whether the "other variable" is actually porepressure
Definition: Q2PNodalMass.h:45
const MaterialProperty< Real > & _porosity
current value of the porosity
Definition: Q2PNodalMass.h:48
virtual Real ddensity(Real p) const =0
derivative of fluid density wrt porepressure This must be over-ridden in derived classes to provide a...
Real Q2PNodalMass::computeQpResidual ( )
protectedvirtual

Definition at line 50 of file Q2PNodalMass.C.

51 {
52  Real density;
53  Real mass;
54 
55  if (_var_is_pp)
56  {
57  density = _density.density(_var.nodalSln()[_i]);
58  mass = _porosity[_qp] * density * (1 - _other_var_nodal[_i]);
59  }
60  else
61  {
62  density = _density.density(_other_var_nodal[_i]);
63  mass = _porosity[_qp] * density * _var.nodalSln()[_i];
64  }
65 
66  return _test[_i][_qp] * mass / _dt;
67 }
const RichardsDensity & _density
Definition: Q2PNodalMass.h:36
const std::string density
Definition: NS.h:15
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:39
bool _var_is_pp
whether the "other variable" is actually porepressure
Definition: Q2PNodalMass.h:45
const MaterialProperty< Real > & _porosity
current value of the porosity
Definition: Q2PNodalMass.h:48

Member Data Documentation

const RichardsDensity& Q2PNodalMass::_density
protected

Definition at line 36 of file Q2PNodalMass.h.

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

const VariableValue& Q2PNodalMass::_other_var_nodal
protected

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

Definition at line 39 of file Q2PNodalMass.h.

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

unsigned int Q2PNodalMass::_other_var_num
protected

variable number of the other variable

Definition at line 42 of file Q2PNodalMass.h.

Referenced by computeQpOffDiagJacobian().

const MaterialProperty<Real>& Q2PNodalMass::_porosity
protected

current value of the porosity

Definition at line 48 of file Q2PNodalMass.h.

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

bool Q2PNodalMass::_var_is_pp
protected

whether the "other variable" is actually porepressure

Definition at line 45 of file Q2PNodalMass.h.

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


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