LCOV - code coverage report
Current view: top level - src/ics - SpecificTotalEnthalpyIC.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 18 19 94.7 %
Date: 2025-07-30 13:02:48 Functions: 3 3 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 "SpecificTotalEnthalpyIC.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", SpecificTotalEnthalpyIC);
      13             : 
      14             : InputParameters
      15        8877 : SpecificTotalEnthalpyIC::validParams()
      16             : {
      17        8877 :   InputParameters params = InitialCondition::validParams();
      18       17754 :   params.addRequiredCoupledVar("rhoA", "Conserved density");
      19       17754 :   params.addRequiredCoupledVar("rhoEA", "Conserved total energy");
      20       17754 :   params.addRequiredCoupledVar("p", "Pressure");
      21       17754 :   params.addRequiredCoupledVar("A", "Cross-sectional area");
      22       17754 :   params.addCoupledVar("alpha", 1., "Volume fraction");
      23        8877 :   params.addClassDescription(
      24             :       "Sets the initial condition for the special total enthalpy of a phase");
      25             : 
      26        8877 :   return params;
      27           0 : }
      28             : 
      29        4841 : SpecificTotalEnthalpyIC::SpecificTotalEnthalpyIC(const InputParameters & parameters)
      30             :   : InitialCondition(parameters),
      31        4841 :     _rhoA(coupledValue("rhoA")),
      32        4841 :     _rhoEA(coupledValue("rhoEA")),
      33        4841 :     _pressure(coupledValue("p")),
      34        4841 :     _area(coupledValue("A")),
      35        9682 :     _alpha(coupledValue("alpha"))
      36             : {
      37        4841 : }
      38             : 
      39             : Real
      40       62775 : SpecificTotalEnthalpyIC::value(const Point & /*p*/)
      41             : {
      42       62775 :   return (_rhoEA[_qp] + _alpha[_qp] * _pressure[_qp] * _area[_qp]) / _rhoA[_qp];
      43             : }

Generated by: LCOV version 1.14