www.mooseframework.org
PorousFlowDesorpedMassVolumetricExpansion.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 // MOOSE includes
11 #include "MooseVariable.h"
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<TimeKernel>();
18  params.addRequiredParam<UserObjectName>(
19  "PorousFlowDictator", "The UserObject that holds the list of Porous-Flow variable names.");
20  params.addRequiredCoupledVar(
21  "conc_var", "The variable that represents the concentration of desorped species");
22  params.addClassDescription("Desorped_mass * rate_of_solid_volumetric_expansion");
23  return params;
24 }
25 
27  const InputParameters & parameters)
28  : TimeKernel(parameters),
29  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
30  _conc_var_number(coupled("conc_var")),
31  _conc(coupledValue("conc_var")),
32  _porosity(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
33  _dporosity_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar")),
34  _dporosity_dgradvar(
35  getMaterialProperty<std::vector<RealGradient>>("dPorousFlow_porosity_qp_dgradvar")),
36  _strain_rate_qp(getMaterialProperty<Real>("PorousFlow_volumetric_strain_rate_qp")),
37  _dstrain_rate_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
38  "dPorousFlow_volumetric_strain_rate_qp_dvar"))
39 {
40 }
41 
42 Real
44 {
45  return _test[_i][_qp] * (1.0 - _porosity[_qp]) * _conc[_qp] * _strain_rate_qp[_qp];
46 }
47 
48 Real
50 {
51  return computeQpJac(_var.number());
52 }
53 
54 Real
56 {
57  return computeQpJac(jvar);
58 }
59 
60 Real
62 {
63  Real deriv = 0.0;
64 
65  if (jvar == _conc_var_number)
66  deriv = (1.0 - _porosity[_qp]) * _phi[_j][_qp] * _strain_rate_qp[_qp];
67 
69  return _test[_i][_qp] * deriv;
70  const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
71 
72  deriv -= _dporosity_dgradvar[_qp][pvar] * _grad_phi[_j][_qp] * _conc[_qp] * _strain_rate_qp[_qp];
73  deriv -= _dporosity_dvar[_qp][pvar] * _phi[_j][_qp] * _conc[_qp] * _strain_rate_qp[_qp];
74  deriv +=
75  (1.0 - _porosity[_qp]) * _conc[_qp] * _dstrain_rate_qp_dvar[_qp][pvar] * _grad_phi[_j][_qp];
76 
77  return _test[_i][_qp] * deriv;
78 }
InputParameters validParams< PorousFlowDesorpedMassVolumetricExpansion >()
const MaterialProperty< Real > & _strain_rate_qp
strain rate
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad porous-flow variable)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const PorousFlowDictator & _dictator
holds info on the Porous Flow variables
PorousFlowDesorpedMassVolumetricExpansion(const InputParameters &parameters)
const unsigned int _conc_var_number
The MOOSE variable number of the concentration variable.
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(porous-flow variable)
const MaterialProperty< std::vector< RealGradient > > & _dstrain_rate_qp_dvar
d(strain rate)/d(porous-flow variable)
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
const VariableValue & _conc
The concentration variable.
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
Real computeQpJac(unsigned int jvar) const
Derivative of the residual with respect to the Moose variable with variable number jvar...