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

Generated by: LCOV version 1.14