www.mooseframework.org
DesorptionFromMatrix.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "DesorptionFromMatrix.h"
11 
12 #include <iostream>
13 
14 registerMooseObject("ChemicalReactionsApp", DesorptionFromMatrix);
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<Kernel>();
21  params.addRequiredCoupledVar(
22  "pressure_var",
23  "Variable representing the porepressure of the fluid adsorbed into the matrix");
24  params.addClassDescription("Mass flow rate from the matrix to the porespace. Add this to "
25  "TimeDerivative kernel to get complete DE for the fluid adsorbed "
26  "in the matrix");
27  return params;
28 }
29 
30 DesorptionFromMatrix::DesorptionFromMatrix(const InputParameters & parameters)
31  : Kernel(parameters),
32  _pressure_var(coupled("pressure_var")),
33  _mass_rate_from_matrix(getMaterialProperty<Real>("mass_rate_from_matrix")),
34  _dmass_rate_from_matrix_dC(getMaterialProperty<Real>("dmass_rate_from_matrix_dC")),
35  _dmass_rate_from_matrix_dp(getMaterialProperty<Real>("dmass_rate_from_matrix_dp"))
36 {
37 }
38 
39 Real
41 {
42  return _test[_i][_qp] * _mass_rate_from_matrix[_qp];
43 }
44 
45 Real
47 {
48  return _test[_i][_qp] * _dmass_rate_from_matrix_dC[_qp] * _phi[_j][_qp];
49 }
50 
51 Real
53 {
54  if (jvar != _pressure_var)
55  return 0.0;
56  return _test[_i][_qp] * _dmass_rate_from_matrix_dp[_qp] * _phi[_j][_qp];
57 }
DesorptionFromMatrix::computeQpJacobian
virtual Real computeQpJacobian() override
Definition: DesorptionFromMatrix.C:46
DesorptionFromMatrix::computeQpResidual
virtual Real computeQpResidual() override
Definition: DesorptionFromMatrix.C:40
DesorptionFromMatrix::DesorptionFromMatrix
DesorptionFromMatrix(const InputParameters &parameters)
Definition: DesorptionFromMatrix.C:30
DesorptionFromMatrix::_mass_rate_from_matrix
const MaterialProperty< Real > & _mass_rate_from_matrix
mass flow rate from matrix = mass flow rate to porespace
Definition: DesorptionFromMatrix.h:39
DesorptionFromMatrix.h
registerMooseObject
registerMooseObject("ChemicalReactionsApp", DesorptionFromMatrix)
DesorptionFromMatrix::_pressure_var
const unsigned int _pressure_var
MOOSE internal variable number corresponding to the porepressure (need this of OffDiagJacobian)
Definition: DesorptionFromMatrix.h:36
DesorptionFromMatrix::_dmass_rate_from_matrix_dp
const MaterialProperty< Real > & _dmass_rate_from_matrix_dp
derivative of mass flow rate from matrix wrt pressure
Definition: DesorptionFromMatrix.h:45
DesorptionFromMatrix
Mass flow rate of adsorbed fluid from matrix Add this to TimeDerivative to form the entire DE for des...
Definition: DesorptionFromMatrix.h:25
validParams< DesorptionFromMatrix >
InputParameters validParams< DesorptionFromMatrix >()
Definition: DesorptionFromMatrix.C:18
DesorptionFromMatrix::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
Definition: DesorptionFromMatrix.C:52
DesorptionFromMatrix::_dmass_rate_from_matrix_dC
const MaterialProperty< Real > & _dmass_rate_from_matrix_dC
derivative of mass flow rate from matrix wrt concentration
Definition: DesorptionFromMatrix.h:42