LCOV - code coverage report
Current view: top level - src/kernels - PorousFlowFullySaturatedUpwindHeatAdvection.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 22 23 95.7 %
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 "PorousFlowFullySaturatedUpwindHeatAdvection.h"
      11             : 
      12             : registerMooseObject("PorousFlowApp", PorousFlowFullySaturatedUpwindHeatAdvection);
      13             : 
      14             : InputParameters
      15         349 : PorousFlowFullySaturatedUpwindHeatAdvection::validParams()
      16             : {
      17         349 :   InputParameters params = PorousFlowDarcyBase::validParams();
      18         349 :   params.addClassDescription("Heat advection by a fluid.  The fluid is assumed to have a single "
      19             :                              "phase, and the advection is fully upwinded");
      20         349 :   return params;
      21           0 : }
      22             : 
      23         190 : PorousFlowFullySaturatedUpwindHeatAdvection::PorousFlowFullySaturatedUpwindHeatAdvection(
      24         190 :     const InputParameters & parameters)
      25             :   : PorousFlowDarcyBase(parameters),
      26         190 :     _enthalpy(getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_enthalpy_nodal")),
      27         380 :     _denthalpy_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
      28         190 :         "dPorousFlow_fluid_phase_enthalpy_nodal_dvar"))
      29             : {
      30         190 :   if (_dictator.numPhases() != 1)
      31           2 :     mooseError("PorousFlowFullySaturatedUpwindHeatAdvection should not be used for multi-phase "
      32             :                "scenarios as it does not include relative-permeability effects");
      33         188 : }
      34             : 
      35             : Real
      36      437578 : PorousFlowFullySaturatedUpwindHeatAdvection::mobility(unsigned nodenum, unsigned phase) const
      37             : {
      38      437578 :   return _enthalpy[nodenum][phase] * _fluid_density_node[nodenum][phase] /
      39      437578 :          _fluid_viscosity[nodenum][phase];
      40             : }
      41             : 
      42             : Real
      43      240420 : PorousFlowFullySaturatedUpwindHeatAdvection::dmobility(unsigned nodenum,
      44             :                                                        unsigned phase,
      45             :                                                        unsigned pvar) const
      46             : {
      47      240420 :   Real dm = _denthalpy_dvar[nodenum][phase][pvar] * _fluid_density_node[nodenum][phase] /
      48      240420 :             _fluid_viscosity[nodenum][phase];
      49      240420 :   dm += _enthalpy[nodenum][phase] * _dfluid_density_node_dvar[nodenum][phase][pvar] /
      50             :         _fluid_viscosity[nodenum][phase];
      51      240420 :   dm -= _enthalpy[nodenum][phase] * _fluid_density_node[nodenum][phase] *
      52      240420 :         _dfluid_viscosity_dvar[nodenum][phase][pvar] /
      53             :         Utility::pow<2>(_fluid_viscosity[nodenum][phase]);
      54      240420 :   return dm;
      55             : }

Generated by: LCOV version 1.14