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

Kernel = (mass - mass_old)/dt where mass = porosity*density*saturation This is used for the time derivative in Richards simulations Note that it is not lumped, so usually you want to use RichardsLumpedMassChange instead. More...

#include <RichardsMassChange.h>

Inheritance diagram for RichardsMassChange:
[legend]

Public Member Functions

 RichardsMassChange (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
Real computeQpJac (unsigned int wrt_num)
 Derivative of residual with respect to wrt_num Richards variable This is used by both computeQpJacobian and computeQpOffDiagJacobian. More...
 

Protected Attributes

const RichardsVarNames_richards_name_UO
 holds info on the Richards variables More...
 
unsigned int _pvar
 the Richards variable number eg, if richards name = 'pwater pgas poil', and this kernel is for pgas, then _pvar = 1 More...
 
bool _use_supg
 whether to use SUPG for this kernel (not recommended) More...
 
const MaterialProperty< std::vector< Real > > & _mass
 fluid mass (or fluid masses in multiphase) at quadpoints More...
 
const MaterialProperty< std::vector< std::vector< Real > > > & _dmass
 d(fluid mass_i)/d(var_j) More...
 
const MaterialProperty< std::vector< Real > > & _mass_old
 old value of fluid mass (or fluid masses in multiphase) at quadpoints More...
 
const MaterialProperty< std::vector< RealVectorValue > > & _tauvel_SUPG
 tau_SUPG More...
 
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dtauvel_SUPG_dgradv
 derivative of tau_SUPG wrt grad(variable) More...
 
const MaterialProperty< std::vector< std::vector< RealVectorValue > > > & _dtauvel_SUPG_dv
 deriv of tau_SUPG wrt variable More...
 

Detailed Description

Kernel = (mass - mass_old)/dt where mass = porosity*density*saturation This is used for the time derivative in Richards simulations Note that it is not lumped, so usually you want to use RichardsLumpedMassChange instead.

Definition at line 26 of file RichardsMassChange.h.

Constructor & Destructor Documentation

RichardsMassChange::RichardsMassChange ( const InputParameters &  parameters)

Definition at line 31 of file RichardsMassChange.C.

32  : TimeDerivative(parameters),
33  _richards_name_UO(getUserObject<RichardsVarNames>("richardsVarNames_UO")),
35 
36  _use_supg(getParam<bool>("use_supg")),
37 
38  _mass(getMaterialProperty<std::vector<Real>>("mass")),
39  _dmass(getMaterialProperty<std::vector<std::vector<Real>>>("dmass")),
40  _mass_old(getMaterialProperty<std::vector<Real>>("mass_old")),
41 
42  _tauvel_SUPG(getMaterialProperty<std::vector<RealVectorValue>>("tauvel_SUPG")),
44  getMaterialProperty<std::vector<std::vector<RealTensorValue>>>("dtauvel_SUPG_dgradv")),
46  getMaterialProperty<std::vector<std::vector<RealVectorValue>>>("dtauvel_SUPG_dv"))
47 {
48 }
const MaterialProperty< std::vector< std::vector< Real > > > & _dmass
d(fluid mass_i)/d(var_j)
const MaterialProperty< std::vector< Real > > & _mass
fluid mass (or fluid masses in multiphase) at quadpoints
bool _use_supg
whether to use SUPG for this kernel (not recommended)
const MaterialProperty< std::vector< std::vector< RealVectorValue > > > & _dtauvel_SUPG_dv
deriv of tau_SUPG wrt variable
const MaterialProperty< std::vector< RealVectorValue > > & _tauvel_SUPG
tau_SUPG
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dtauvel_SUPG_dgradv
derivative of tau_SUPG wrt grad(variable)
const MaterialProperty< std::vector< Real > > & _mass_old
old value of fluid mass (or fluid masses in multiphase) at quadpoints
unsigned int _pvar
the Richards variable number eg, if richards name = &#39;pwater pgas poil&#39;, and this kernel is for pgas...
const RichardsVarNames & _richards_name_UO
holds info on the Richards variables
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number

Member Function Documentation

Real RichardsMassChange::computeQpJac ( unsigned int  wrt_num)
protected

Derivative of residual with respect to wrt_num Richards variable This is used by both computeQpJacobian and computeQpOffDiagJacobian.

Parameters
wrt_numtake the derivative of the residual wrt this Richards variable

Definition at line 60 of file RichardsMassChange.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

61 {
62  Real mass = _mass[_qp][_pvar];
63  Real mass_old = _mass_old[_qp][_pvar];
64  Real mass_prime = _phi[_j][_qp] * _dmass[_qp][_pvar][wrt_num];
65 
66  Real test_fcn = _test[_i][_qp];
67  Real test_fcn_prime = 0;
68 
69  if (_use_supg)
70  {
71  test_fcn += _tauvel_SUPG[_qp][_pvar] * _grad_test[_i][_qp];
72  test_fcn_prime +=
73  _grad_phi[_j][_qp] * (_dtauvel_SUPG_dgradv[_qp][_pvar][wrt_num] * _grad_test[_i][_qp]) +
74  _phi[_j][_qp] * _dtauvel_SUPG_dv[_qp][_pvar][wrt_num] * _grad_test[_i][_qp];
75  }
76  return (test_fcn * mass_prime + test_fcn_prime * (mass - mass_old)) / _dt;
77 }
const MaterialProperty< std::vector< std::vector< Real > > > & _dmass
d(fluid mass_i)/d(var_j)
const MaterialProperty< std::vector< Real > > & _mass
fluid mass (or fluid masses in multiphase) at quadpoints
bool _use_supg
whether to use SUPG for this kernel (not recommended)
const MaterialProperty< std::vector< std::vector< RealVectorValue > > > & _dtauvel_SUPG_dv
deriv of tau_SUPG wrt variable
const MaterialProperty< std::vector< RealVectorValue > > & _tauvel_SUPG
tau_SUPG
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dtauvel_SUPG_dgradv
derivative of tau_SUPG wrt grad(variable)
const MaterialProperty< std::vector< Real > > & _mass_old
old value of fluid mass (or fluid masses in multiphase) at quadpoints
unsigned int _pvar
the Richards variable number eg, if richards name = &#39;pwater pgas poil&#39;, and this kernel is for pgas...
Real RichardsMassChange::computeQpJacobian ( )
protectedvirtual

Definition at line 80 of file RichardsMassChange.C.

81 {
82  return computeQpJac(_pvar);
83 }
unsigned int _pvar
the Richards variable number eg, if richards name = &#39;pwater pgas poil&#39;, and this kernel is for pgas...
Real computeQpJac(unsigned int wrt_num)
Derivative of residual with respect to wrt_num Richards variable This is used by both computeQpJacobi...
Real RichardsMassChange::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 86 of file RichardsMassChange.C.

87 {
89  return 0.0;
90  unsigned int dvar = _richards_name_UO.richards_var_num(jvar);
91  return computeQpJac(dvar);
92 }
bool not_richards_var(unsigned int moose_var_num) const
returns true if moose_var_num is not a richards var
const RichardsVarNames & _richards_name_UO
holds info on the Richards variables
Real computeQpJac(unsigned int wrt_num)
Derivative of residual with respect to wrt_num Richards variable This is used by both computeQpJacobi...
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number
Real RichardsMassChange::computeQpResidual ( )
protectedvirtual

Definition at line 51 of file RichardsMassChange.C.

52 {
53  Real test_fcn = _test[_i][_qp];
54  if (_use_supg)
55  test_fcn += _tauvel_SUPG[_qp][_pvar] * _grad_test[_i][_qp];
56  return test_fcn * (_mass[_qp][_pvar] - _mass_old[_qp][_pvar]) / _dt;
57 }
const MaterialProperty< std::vector< Real > > & _mass
fluid mass (or fluid masses in multiphase) at quadpoints
bool _use_supg
whether to use SUPG for this kernel (not recommended)
const MaterialProperty< std::vector< RealVectorValue > > & _tauvel_SUPG
tau_SUPG
const MaterialProperty< std::vector< Real > > & _mass_old
old value of fluid mass (or fluid masses in multiphase) at quadpoints
unsigned int _pvar
the Richards variable number eg, if richards name = &#39;pwater pgas poil&#39;, and this kernel is for pgas...

Member Data Documentation

const MaterialProperty<std::vector<std::vector<Real> > >& RichardsMassChange::_dmass
protected

d(fluid mass_i)/d(var_j)

Definition at line 55 of file RichardsMassChange.h.

Referenced by computeQpJac().

const MaterialProperty<std::vector<std::vector<RealTensorValue> > >& RichardsMassChange::_dtauvel_SUPG_dgradv
protected

derivative of tau_SUPG wrt grad(variable)

Definition at line 64 of file RichardsMassChange.h.

Referenced by computeQpJac().

const MaterialProperty<std::vector<std::vector<RealVectorValue> > >& RichardsMassChange::_dtauvel_SUPG_dv
protected

deriv of tau_SUPG wrt variable

Definition at line 67 of file RichardsMassChange.h.

Referenced by computeQpJac().

const MaterialProperty<std::vector<Real> >& RichardsMassChange::_mass
protected

fluid mass (or fluid masses in multiphase) at quadpoints

Definition at line 52 of file RichardsMassChange.h.

Referenced by computeQpJac(), and computeQpResidual().

const MaterialProperty<std::vector<Real> >& RichardsMassChange::_mass_old
protected

old value of fluid mass (or fluid masses in multiphase) at quadpoints

Definition at line 58 of file RichardsMassChange.h.

Referenced by computeQpJac(), and computeQpResidual().

unsigned int RichardsMassChange::_pvar
protected

the Richards variable number eg, if richards name = 'pwater pgas poil', and this kernel is for pgas, then _pvar = 1

Definition at line 46 of file RichardsMassChange.h.

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

const RichardsVarNames& RichardsMassChange::_richards_name_UO
protected

holds info on the Richards variables

Definition at line 39 of file RichardsMassChange.h.

Referenced by computeQpOffDiagJacobian().

const MaterialProperty<std::vector<RealVectorValue> >& RichardsMassChange::_tauvel_SUPG
protected

tau_SUPG

Definition at line 61 of file RichardsMassChange.h.

Referenced by computeQpJac(), and computeQpResidual().

bool RichardsMassChange::_use_supg
protected

whether to use SUPG for this kernel (not recommended)

Definition at line 49 of file RichardsMassChange.h.

Referenced by computeQpJac(), and computeQpResidual().


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