LCOV - code coverage report
Current view: top level - src/kernels - PorousFlowFullySaturatedDarcyFlow.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 20 24 83.3 %
Date: 2025-09-04 07:55:56 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 "PorousFlowFullySaturatedDarcyFlow.h"
      11             : 
      12             : registerMooseObject("PorousFlowApp", PorousFlowFullySaturatedDarcyFlow);
      13             : 
      14             : InputParameters
      15        1154 : PorousFlowFullySaturatedDarcyFlow::validParams()
      16             : {
      17        1154 :   InputParameters params = PorousFlowFullySaturatedDarcyBase::validParams();
      18        2308 :   params.addParam<unsigned int>(
      19        2308 :       "fluid_component", 0, "The index corresponding to the fluid component for this kernel");
      20        1154 :   params.addClassDescription("Darcy flux suitable for models involving a fully-saturated single "
      21             :                              "phase, multi-component fluid.  No upwinding is used");
      22        1154 :   return params;
      23           0 : }
      24             : 
      25         659 : PorousFlowFullySaturatedDarcyFlow::PorousFlowFullySaturatedDarcyFlow(
      26         659 :     const InputParameters & parameters)
      27             :   : PorousFlowFullySaturatedDarcyBase(parameters),
      28         659 :     _mfrac(getMaterialProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_qp")),
      29        1318 :     _dmfrac_dvar(getMaterialProperty<std::vector<std::vector<std::vector<Real>>>>(
      30             :         "dPorousFlow_mass_frac_qp_dvar")),
      31        1977 :     _fluid_component(getParam<unsigned int>("fluid_component"))
      32             : {
      33         659 :   if (_fluid_component >= _dictator.numComponents())
      34           0 :     paramError(
      35             :         "fluid_component",
      36             :         "The Dictator proclaims that the maximum fluid component index in this simulation is ",
      37           0 :         _dictator.numComponents() - 1,
      38             :         " whereas you have used ",
      39           0 :         _fluid_component,
      40             :         ". Remember that indexing starts at 0. Happiness equals perfection.");
      41         659 : }
      42             : 
      43             : Real
      44    58117496 : PorousFlowFullySaturatedDarcyFlow::mobility() const
      45             : {
      46             :   const unsigned ph = 0;
      47    58117496 :   return _mfrac[_qp][ph][_fluid_component] * PorousFlowFullySaturatedDarcyBase::mobility();
      48             : }
      49             : 
      50             : Real
      51    50598176 : PorousFlowFullySaturatedDarcyFlow::dmobility(unsigned pvar) const
      52             : {
      53             :   const unsigned ph = 0;
      54    50598176 :   const Real darcy_mob = PorousFlowFullySaturatedDarcyBase::mobility();
      55    50598176 :   const Real ddarcy_mob = PorousFlowFullySaturatedDarcyBase::dmobility(pvar);
      56    50598176 :   return _dmfrac_dvar[_qp][ph][_fluid_component][pvar] * darcy_mob +
      57    50598176 :          _mfrac[_qp][ph][_fluid_component] * ddarcy_mob;
      58             : }

Generated by: LCOV version 1.14