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

Generated by: LCOV version 1.14