Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 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 : InputParameters 17 215 : DesorptionToPorespace::validParams() 18 : { 19 215 : InputParameters params = Kernel::validParams(); 20 430 : params.addRequiredCoupledVar("conc_var", 21 : "Variable representing the concentration (kg/m^3) of " 22 : "fluid in the matrix that will be desorped to " 23 : "porespace"); 24 215 : params.addClassDescription("Mass flow rate to the porespace from the matrix. Add this to the " 25 : "other kernels for the porepressure variable to form the complete DE"); 26 215 : return params; 27 0 : } 28 : 29 121 : DesorptionToPorespace::DesorptionToPorespace(const InputParameters & parameters) 30 : : Kernel(parameters), 31 121 : _conc_var(coupled("conc_var")), 32 242 : _mass_rate_from_matrix(getMaterialProperty<Real>("mass_rate_from_matrix")), 33 242 : _dmass_rate_from_matrix_dC(getMaterialProperty<Real>("dmass_rate_from_matrix_dC")), 34 363 : _dmass_rate_from_matrix_dp(getMaterialProperty<Real>("dmass_rate_from_matrix_dp")) 35 : { 36 121 : } 37 : 38 : Real 39 50904 : DesorptionToPorespace::computeQpResidual() 40 : { 41 50904 : return -_test[_i][_qp] * _mass_rate_from_matrix[_qp]; 42 : } 43 : 44 : Real 45 60432 : DesorptionToPorespace::computeQpJacobian() 46 : { 47 60432 : return -_test[_i][_qp] * _dmass_rate_from_matrix_dp[_qp] * _phi[_j][_qp]; 48 : } 49 : 50 : Real 51 29376 : DesorptionToPorespace::computeQpOffDiagJacobian(unsigned int jvar) 52 : { 53 29376 : if (jvar != _conc_var) 54 : return 0.0; 55 29376 : return -_test[_i][_qp] * _dmass_rate_from_matrix_dC[_qp] * _phi[_j][_qp]; 56 : }