LCOV - code coverage report
Current view: top level - src/kernels - DarcyFlux.C (source / functions) Hit Total Coverage
Test: idaholab/moose richards: #31405 (292dce) with base fef103 Lines: 16 17 94.1 %
Date: 2025-09-04 07:56:35 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 "DarcyFlux.h"
      11             : #include "Material.h"
      12             : 
      13             : registerMooseObject("RichardsApp", DarcyFlux);
      14             : 
      15             : InputParameters
      16          10 : DarcyFlux::validParams()
      17             : {
      18          10 :   InputParameters params = Kernel::validParams();
      19          20 :   params.addRequiredParam<RealVectorValue>(
      20             :       "fluid_weight",
      21             :       "Fluid weight (gravity*density) as a vector pointing downwards (usually "
      22             :       "measured in kg.m^-2.s^-2 = Pa/m).  Eg '0 0 -10000'");
      23          20 :   params.addRequiredParam<Real>("fluid_viscosity",
      24             :                                 "Fluid dynamic viscosity (usually measured in Pa.s)");
      25          10 :   params.addClassDescription("Darcy flux.  nabla_i (k_ij/mu (nabla_j P - w_j)), where k_ij is the "
      26             :                              "permeability tensor, mu is the fluid viscosity, P is the fluid "
      27             :                              "pressure, and w_j is the fluid weight");
      28          10 :   return params;
      29           0 : }
      30             : 
      31           5 : DarcyFlux::DarcyFlux(const InputParameters & parameters)
      32             :   : Kernel(parameters),
      33           5 :     _fluid_weight(getParam<RealVectorValue>("fluid_weight")),
      34          10 :     _fluid_viscosity(getParam<Real>("fluid_viscosity")),
      35          15 :     _permeability(getMaterialProperty<RealTensorValue>("permeability"))
      36             : {
      37           5 : }
      38             : 
      39             : Real
      40        4752 : DarcyFlux::computeQpResidual()
      41             : {
      42        4752 :   return _grad_test[_i][_qp] * (_permeability[_qp] * (_grad_u[_qp] - _fluid_weight)) /
      43        4752 :          _fluid_viscosity;
      44             : }
      45             : 
      46             : Real
      47       14480 : DarcyFlux::computeQpJacobian()
      48             : {
      49       14480 :   return _grad_test[_i][_qp] * (_permeability[_qp] * _grad_phi[_j][_qp]) / _fluid_viscosity;
      50             : }

Generated by: LCOV version 1.14