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