LCOV - code coverage report
Current view: top level - src/auxkernels - THMSpecificVolumeAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #33187 (5aa0b2) with base d7c4bd Lines: 15 16 93.8 %
Date: 2026-06-30 12:25:31 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 "THMSpecificVolumeAux.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", THMSpecificVolumeAux);
      13             : 
      14             : InputParameters
      15        4419 : THMSpecificVolumeAux::validParams()
      16             : {
      17        4419 :   InputParameters params = AuxKernel::validParams();
      18        8838 :   params.addRequiredCoupledVar("rhoA",
      19             :                                "Density of the phase (conserved), \alpha \rho A for 2-phase model");
      20        8838 :   params.addRequiredCoupledVar("A", "Cross-sectional area");
      21        8838 :   params.addCoupledVar("alpha", 1., "Volume fraction");
      22        4419 :   params.addClassDescription("Computes the specific volume for the phase.");
      23             : 
      24        4419 :   return params;
      25           0 : }
      26             : 
      27        2353 : THMSpecificVolumeAux::THMSpecificVolumeAux(const InputParameters & parameters)
      28             :   : AuxKernel(parameters),
      29        2353 :     _rhoA(coupledValue("rhoA")),
      30        2353 :     _area(coupledValue("A")),
      31        4706 :     _alpha(coupledValue("alpha"))
      32             : {
      33        2353 : }
      34             : 
      35             : Real
      36      637982 : THMSpecificVolumeAux::computeValue()
      37             : {
      38             :   mooseAssert(_rhoA[_qp] != 0, "Detected zero density.");
      39      637982 :   Real v = _alpha[_qp] * _area[_qp] / _rhoA[_qp];
      40             :   mooseAssert(v >= 0., "specific volume is negative.");
      41      637982 :   return v;
      42             : }

Generated by: LCOV version 1.14