LCOV - code coverage report
Current view: top level - src/kernels - DarcyFluxPressure.C (source / functions) Hit Total Coverage
Test: idaholab/moose chemical_reactions: #32971 (54bef8) with base c6cf66 Lines: 14 15 93.3 %
Date: 2026-05-29 20:35:47 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 "DarcyFluxPressure.h"
      11             : 
      12             : registerMooseObject("ChemicalReactionsApp", DarcyFluxPressure);
      13             : 
      14             : InputParameters
      15         168 : DarcyFluxPressure::validParams()
      16             : {
      17         168 :   InputParameters params = Kernel::validParams();
      18             :   RealVectorValue g(0, 0, 0);
      19         336 :   params.addParam<RealVectorValue>("gravity", g, "Gravity vector (default is (0, 0, 0))");
      20         168 :   params.addClassDescription(
      21             :       "Darcy flux: - cond * (Grad P - rho * g) where cond is the hydraulic conductivity, P is "
      22             :       "fluid pressure, rho is fluid density and g is gravity");
      23         168 :   return params;
      24           0 : }
      25             : 
      26          90 : DarcyFluxPressure::DarcyFluxPressure(const InputParameters & parameters)
      27             :   : DerivativeMaterialInterface<Kernel>(parameters),
      28          90 :     _cond(getMaterialProperty<Real>("conductivity")),
      29         180 :     _gravity(getParam<RealVectorValue>("gravity")),
      30         180 :     _density(getDefaultMaterialProperty<Real>("density"))
      31             : {
      32          90 : }
      33             : 
      34             : Real
      35      590208 : DarcyFluxPressure::computeQpResidual()
      36             : {
      37      590208 :   return _grad_test[_i][_qp] * _cond[_qp] * (_grad_u[_qp] - _density[_qp] * _gravity);
      38             : }
      39             : 
      40             : Real
      41      340480 : DarcyFluxPressure::computeQpJacobian()
      42             : {
      43      340480 :   return _grad_test[_i][_qp] * _cond[_qp] * _grad_phi[_j][_qp];
      44             : }

Generated by: LCOV version 1.14