LCOV - code coverage report
Current view: top level - src/kernels - DesorptionFromMatrix.C (source / functions) Hit Total Coverage
Test: idaholab/moose chemical_reactions: #31405 (292dce) with base fef103 Lines: 18 19 94.7 %
Date: 2025-09-04 07:52:33 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          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 "DesorptionFromMatrix.h"
      11             : 
      12             : #include <iostream>
      13             : 
      14             : registerMooseObject("ChemicalReactionsApp", DesorptionFromMatrix);
      15             : 
      16             : InputParameters
      17         215 : DesorptionFromMatrix::validParams()
      18             : {
      19         215 :   InputParameters params = Kernel::validParams();
      20         430 :   params.addRequiredCoupledVar(
      21             :       "pressure_var",
      22             :       "Variable representing the porepressure of the fluid adsorbed into the matrix");
      23         215 :   params.addClassDescription("Mass flow rate from the matrix to the porespace.  Add this to "
      24             :                              "TimeDerivative kernel to get complete DE for the fluid adsorbed "
      25             :                              "in the matrix");
      26         215 :   return params;
      27           0 : }
      28             : 
      29         121 : DesorptionFromMatrix::DesorptionFromMatrix(const InputParameters & parameters)
      30             :   : Kernel(parameters),
      31         121 :     _pressure_var(coupled("pressure_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       23412 : DesorptionFromMatrix::computeQpResidual()
      40             : {
      41       23412 :   return _test[_i][_qp] * _mass_rate_from_matrix[_qp];
      42             : }
      43             : 
      44             : Real
      45       14688 : DesorptionFromMatrix::computeQpJacobian()
      46             : {
      47       14688 :   return _test[_i][_qp] * _dmass_rate_from_matrix_dC[_qp] * _phi[_j][_qp];
      48             : }
      49             : 
      50             : Real
      51       29376 : DesorptionFromMatrix::computeQpOffDiagJacobian(unsigned int jvar)
      52             : {
      53       29376 :   if (jvar != _pressure_var)
      54             :     return 0.0;
      55       29376 :   return _test[_i][_qp] * _dmass_rate_from_matrix_dp[_qp] * _phi[_j][_qp];
      56             : }

Generated by: LCOV version 1.14