LCOV - code coverage report
Current view: top level - src/userobjects - PorousFlowAdvectiveFluxCalculatorUnsaturated.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 20 21 95.2 %
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 "PorousFlowAdvectiveFluxCalculatorUnsaturated.h"
      11             : 
      12             : registerMooseObject("PorousFlowApp", PorousFlowAdvectiveFluxCalculatorUnsaturated);
      13             : 
      14             : InputParameters
      15          41 : PorousFlowAdvectiveFluxCalculatorUnsaturated::validParams()
      16             : {
      17          41 :   InputParameters params = PorousFlowAdvectiveFluxCalculatorSaturated::validParams();
      18          41 :   params.addClassDescription(
      19             :       "Computes the advective flux of fluid of given phase, assuming unsaturated conditions.  "
      20             :       "Hence this UserObject is only relevant to single-phase situations, or multi-phase "
      21             :       "situations where each fluid component appears in one phase only.  Explicitly, the "
      22             :       "UserObject computes (density * relative_permeability / viscosity) * (- permeability * "
      23             :       "(grad(P) - density * gravity)), using the Kuzmin-Turek FEM-TVD multidimensional "
      24             :       "stabilization scheme");
      25          41 :   return params;
      26           0 : }
      27             : 
      28          22 : PorousFlowAdvectiveFluxCalculatorUnsaturated::PorousFlowAdvectiveFluxCalculatorUnsaturated(
      29          22 :     const InputParameters & parameters)
      30             :   : PorousFlowAdvectiveFluxCalculatorSaturated(parameters),
      31          22 :     _relative_permeability(
      32          44 :         getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal")),
      33          44 :     _drelative_permeability_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
      34          22 :         "dPorousFlow_relative_permeability_nodal_dvar"))
      35             : {
      36          22 : }
      37             : 
      38             : Real
      39        1840 : PorousFlowAdvectiveFluxCalculatorUnsaturated::computeU(unsigned i) const
      40             : {
      41        1840 :   return _relative_permeability[i][_phase] *
      42        1840 :          PorousFlowAdvectiveFluxCalculatorSaturated::computeU(i);
      43             : }
      44             : 
      45             : Real
      46        9200 : PorousFlowAdvectiveFluxCalculatorUnsaturated::computedU_dvar(unsigned i, unsigned pvar) const
      47             : {
      48        9200 :   Real du = _drelative_permeability_dvar[i][_phase][pvar] *
      49        9200 :             PorousFlowAdvectiveFluxCalculatorSaturated::computeU(i);
      50        9200 :   du += _relative_permeability[i][_phase] *
      51        9200 :         PorousFlowAdvectiveFluxCalculatorSaturated::computedU_dvar(i, pvar);
      52        9200 :   return du;
      53             : }

Generated by: LCOV version 1.14