www.mooseframework.org
DesorptionFromMatrix.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 #include "DesorptionFromMatrix.h"
8 
9 #include <iostream>
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Kernel>();
16  params.addRequiredCoupledVar(
17  "pressure_var",
18  "Variable representing the porepressure of the fluid adsorbed into the matrix");
19  params.addClassDescription("Mass flow rate from the matrix to the porespace. Add this to "
20  "TimeDerivative kernel to get complete DE for the fluid adsorbed "
21  "in the matrix");
22  return params;
23 }
24 
25 DesorptionFromMatrix::DesorptionFromMatrix(const InputParameters & parameters)
26  : Kernel(parameters),
27  _pressure_var(coupled("pressure_var")),
28  _mass_rate_from_matrix(getMaterialProperty<Real>("mass_rate_from_matrix")),
29  _dmass_rate_from_matrix_dC(getMaterialProperty<Real>("dmass_rate_from_matrix_dC")),
30  _dmass_rate_from_matrix_dp(getMaterialProperty<Real>("dmass_rate_from_matrix_dp"))
31 {
32 }
33 
34 Real
36 {
37  return _test[_i][_qp] * _mass_rate_from_matrix[_qp];
38 }
39 
40 Real
42 {
43  return _test[_i][_qp] * _dmass_rate_from_matrix_dC[_qp] * _phi[_j][_qp];
44 }
45 
46 Real
48 {
49  if (jvar != _pressure_var)
50  return 0.0;
51  return _test[_i][_qp] * _dmass_rate_from_matrix_dp[_qp] * _phi[_j][_qp];
52 }
DesorptionFromMatrix(const InputParameters &parameters)
InputParameters validParams< DesorptionFromMatrix >()
virtual Real computeQpJacobian() override
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const MaterialProperty< Real > & _dmass_rate_from_matrix_dC
derivative of mass flow rate from matrix wrt concentration
const MaterialProperty< Real > & _mass_rate_from_matrix
mass flow rate from matrix = mass flow rate to porespace
const unsigned int _pressure_var
MOOSE internal variable number corresponding to the porepressure (need this of OffDiagJacobian) ...
virtual Real computeQpResidual() override
const MaterialProperty< Real > & _dmass_rate_from_matrix_dp
derivative of mass flow rate from matrix wrt pressure