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 27 of file RichardsMassChange.h.

Constructor & Destructor Documentation

◆ RichardsMassChange()

RichardsMassChange::RichardsMassChange ( const InputParameters &  parameters)

Definition at line 35 of file RichardsMassChange.C.

36  : TimeDerivative(parameters),
37  _richards_name_UO(getUserObject<RichardsVarNames>("richardsVarNames_UO")),
39 
40  _use_supg(getParam<bool>("use_supg")),
41 
42  _mass(getMaterialProperty<std::vector<Real>>("mass")),
43  _dmass(getMaterialProperty<std::vector<std::vector<Real>>>("dmass")),
44  _mass_old(getMaterialProperty<std::vector<Real>>("mass_old")),
45 
46  _tauvel_SUPG(getMaterialProperty<std::vector<RealVectorValue>>("tauvel_SUPG")),
48  getMaterialProperty<std::vector<std::vector<RealTensorValue>>>("dtauvel_SUPG_dgradv")),
50  getMaterialProperty<std::vector<std::vector<RealVectorValue>>>("dtauvel_SUPG_dv"))
51 {
52 }

Member Function Documentation

◆ computeQpJac()

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 64 of file RichardsMassChange.C.

65 {
66  Real mass = _mass[_qp][_pvar];
67  Real mass_old = _mass_old[_qp][_pvar];
68  Real mass_prime = _phi[_j][_qp] * _dmass[_qp][_pvar][wrt_num];
69 
70  Real test_fcn = _test[_i][_qp];
71  Real test_fcn_prime = 0;
72 
73  if (_use_supg)
74  {
75  test_fcn += _tauvel_SUPG[_qp][_pvar] * _grad_test[_i][_qp];
76  test_fcn_prime +=
77  _grad_phi[_j][_qp] * (_dtauvel_SUPG_dgradv[_qp][_pvar][wrt_num] * _grad_test[_i][_qp]) +
78  _phi[_j][_qp] * _dtauvel_SUPG_dv[_qp][_pvar][wrt_num] * _grad_test[_i][_qp];
79  }
80  return (test_fcn * mass_prime + test_fcn_prime * (mass - mass_old)) / _dt;
81 }

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ computeQpJacobian()

Real RichardsMassChange::computeQpJacobian ( )
protectedvirtual

Definition at line 84 of file RichardsMassChange.C.

85 {
86  return computeQpJac(_pvar);
87 }

◆ computeQpOffDiagJacobian()

Real RichardsMassChange::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 90 of file RichardsMassChange.C.

91 {
93  return 0.0;
94  unsigned int dvar = _richards_name_UO.richards_var_num(jvar);
95  return computeQpJac(dvar);
96 }

◆ computeQpResidual()

Real RichardsMassChange::computeQpResidual ( )
protectedvirtual

Definition at line 55 of file RichardsMassChange.C.

56 {
57  Real test_fcn = _test[_i][_qp];
58  if (_use_supg)
59  test_fcn += _tauvel_SUPG[_qp][_pvar] * _grad_test[_i][_qp];
60  return test_fcn * (_mass[_qp][_pvar] - _mass_old[_qp][_pvar]) / _dt;
61 }

Member Data Documentation

◆ _dmass

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

d(fluid mass_i)/d(var_j)

Definition at line 56 of file RichardsMassChange.h.

Referenced by computeQpJac().

◆ _dtauvel_SUPG_dgradv

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

derivative of tau_SUPG wrt grad(variable)

Definition at line 65 of file RichardsMassChange.h.

Referenced by computeQpJac().

◆ _dtauvel_SUPG_dv

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

deriv of tau_SUPG wrt variable

Definition at line 68 of file RichardsMassChange.h.

Referenced by computeQpJac().

◆ _mass

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

fluid mass (or fluid masses in multiphase) at quadpoints

Definition at line 53 of file RichardsMassChange.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _mass_old

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

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

Definition at line 59 of file RichardsMassChange.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _pvar

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 47 of file RichardsMassChange.h.

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

◆ _richards_name_UO

const RichardsVarNames& RichardsMassChange::_richards_name_UO
protected

holds info on the Richards variables

Definition at line 40 of file RichardsMassChange.h.

Referenced by computeQpOffDiagJacobian().

◆ _tauvel_SUPG

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

tau_SUPG

Definition at line 62 of file RichardsMassChange.h.

Referenced by computeQpJac(), and computeQpResidual().

◆ _use_supg

bool RichardsMassChange::_use_supg
protected

whether to use SUPG for this kernel (not recommended)

Definition at line 50 of file RichardsMassChange.h.

Referenced by computeQpJac(), and computeQpResidual().


The documentation for this class was generated from the following files:
RichardsMassChange::_dtauvel_SUPG_dv
const MaterialProperty< std::vector< std::vector< RealVectorValue > > > & _dtauvel_SUPG_dv
deriv of tau_SUPG wrt variable
Definition: RichardsMassChange.h:68
RichardsVarNames::richards_var_num
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number
Definition: RichardsVarNames.C:99
RichardsMassChange::_dtauvel_SUPG_dgradv
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dtauvel_SUPG_dgradv
derivative of tau_SUPG wrt grad(variable)
Definition: RichardsMassChange.h:65
RichardsMassChange::_dmass
const MaterialProperty< std::vector< std::vector< Real > > > & _dmass
d(fluid mass_i)/d(var_j)
Definition: RichardsMassChange.h:56
RichardsMassChange::_pvar
unsigned int _pvar
the Richards variable number eg, if richards name = 'pwater pgas poil', and this kernel is for pgas,...
Definition: RichardsMassChange.h:47
RichardsMassChange::_mass_old
const MaterialProperty< std::vector< Real > > & _mass_old
old value of fluid mass (or fluid masses in multiphase) at quadpoints
Definition: RichardsMassChange.h:59
RichardsMassChange::_use_supg
bool _use_supg
whether to use SUPG for this kernel (not recommended)
Definition: RichardsMassChange.h:50
RichardsMassChange::computeQpJac
Real computeQpJac(unsigned int wrt_num)
Derivative of residual with respect to wrt_num Richards variable This is used by both computeQpJacobi...
Definition: RichardsMassChange.C:64
RichardsMassChange::_tauvel_SUPG
const MaterialProperty< std::vector< RealVectorValue > > & _tauvel_SUPG
tau_SUPG
Definition: RichardsMassChange.h:62
RichardsMassChange::_richards_name_UO
const RichardsVarNames & _richards_name_UO
holds info on the Richards variables
Definition: RichardsMassChange.h:40
RichardsVarNames::not_richards_var
bool not_richards_var(unsigned int moose_var_num) const
returns true if moose_var_num is not a richards var
Definition: RichardsVarNames.C:109
RichardsMassChange::_mass
const MaterialProperty< std::vector< Real > > & _mass
fluid mass (or fluid masses in multiphase) at quadpoints
Definition: RichardsMassChange.h:53