www.mooseframework.org
DesorptionToPorespace.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 /****************************************************************/
8 
9 #include <iostream>
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Kernel>();
16  params.addRequiredCoupledVar("conc_var",
17  "Variable representing the concentration (kg/m^3) of "
18  "fluid in the matrix that will be desorped to "
19  "porespace");
20  params.addClassDescription("Mass flow rate to the porespace from the matrix. Add this to the "
21  "other kernels for the porepressure variable to form the complete DE");
22  return params;
23 }
24 
25 DesorptionToPorespace::DesorptionToPorespace(const InputParameters & parameters)
26  : Kernel(parameters),
27  _conc_var(coupled("conc_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_dp[_qp] * _phi[_j][_qp];
44 }
45 
46 Real
48 {
49  if (jvar != _conc_var)
50  return 0.0;
51  return -_test[_i][_qp] * _dmass_rate_from_matrix_dC[_qp] * _phi[_j][_qp];
52 }
const unsigned int _conc_var
MOOSE internal variable number corresponding to the concentration in the matrix (needed for OffDiagJa...
const MaterialProperty< Real > & _mass_rate_from_matrix
mass flow rate from matrix = mass flow rate to porespace
virtual Real computeQpJacobian() override
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
DesorptionToPorespace(const InputParameters &parameters)
InputParameters validParams< DesorptionToPorespace >()
virtual Real computeQpResidual() override
const MaterialProperty< Real > & _dmass_rate_from_matrix_dC
derivative of mass flow rate from matrix wrt concentration
const MaterialProperty< Real > & _dmass_rate_from_matrix_dp
derivative of mass flow rate from matrix wrt pressure