LCOV - code coverage report
Current view: top level - src/userobjects - PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent.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 "PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent.h"
      11             : 
      12             : registerMooseObject("PorousFlowApp", PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent);
      13             : 
      14             : InputParameters
      15         507 : PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent::validParams()
      16             : {
      17         507 :   InputParameters params = PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent::validParams();
      18         507 :   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         507 :   return params;
      25           0 : }
      26             : 
      27         305 : PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent::
      28         305 :     PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent(const InputParameters & parameters)
      29             :   : PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent(parameters),
      30         305 :     _relative_permeability(
      31         610 :         getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal")),
      32         610 :     _drelative_permeability_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
      33         305 :         "dPorousFlow_relative_permeability_nodal_dvar"))
      34             : {
      35         305 : }
      36             : 
      37             : Real
      38       95252 : PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent::computeU(unsigned i) const
      39             : {
      40       95252 :   return _relative_permeability[i][_phase] *
      41       95252 :          PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent::computeU(i);
      42             : }
      43             : 
      44             : Real
      45      256864 : PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent::computedU_dvar(unsigned i,
      46             :                                                                            unsigned pvar) const
      47             : {
      48      256864 :   Real du = _drelative_permeability_dvar[i][_phase][pvar] *
      49      256864 :             PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent::computeU(i);
      50      256864 :   du += _relative_permeability[i][_phase] *
      51      256864 :         PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent::computedU_dvar(i, pvar);
      52      256864 :   return du;
      53             : }

Generated by: LCOV version 1.14