LCOV - code coverage report
Current view: top level - src/kernels - GeochemistryTimeDerivative.C (source / functions) Hit Total Coverage
Test: idaholab/moose geochemistry: 419b9d Lines: 15 16 93.8 %
Date: 2025-08-08 20:01:54 Functions: 4 4 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 "GeochemistryTimeDerivative.h"
      11             : 
      12             : registerMooseObject("GeochemistryApp", GeochemistryTimeDerivative);
      13             : 
      14             : InputParameters
      15         103 : GeochemistryTimeDerivative::validParams()
      16             : {
      17         103 :   InputParameters params = TimeKernel::validParams();
      18         206 :   params.addCoupledVar("porosity", 1.0, "Porosity");
      19         103 :   params.addClassDescription(
      20             :       "Kernel describing porosity * d(concentration)/dt, where porosity is an AuxVariable (or just "
      21             :       "a real number) and concentration is the 'variable' for this Kernel.  This Kernel should not "
      22             :       "be used if porosity is time-dependent.  Mass lumping is employed for numerical stability");
      23         103 :   return params;
      24           0 : }
      25             : 
      26          59 : GeochemistryTimeDerivative::GeochemistryTimeDerivative(const InputParameters & parameters)
      27             :   : TimeKernel(parameters),
      28         118 :     _nodal_u_dot(_var.dofValuesDot()),
      29          59 :     _nodal_du_dot_du(_var.dofValuesDuDotDu()),
      30         118 :     _porosity(coupledValue("porosity"))
      31             : {
      32          59 : }
      33             : 
      34             : Real
      35       77528 : GeochemistryTimeDerivative::computeQpResidual()
      36             : {
      37       77528 :   return _test[_i][_qp] * _porosity[_qp] * _nodal_u_dot[_i];
      38             : }
      39             : 
      40             : Real
      41      123936 : GeochemistryTimeDerivative::computeQpJacobian()
      42             : {
      43      123936 :   if (_i == _j)
      44       40464 :     return _test[_i][_qp] * _porosity[_qp] * _nodal_du_dot_du[_j];
      45             :   else
      46             :     return 0.0;
      47             : }

Generated by: LCOV version 1.14