LCOV - code coverage report
Current view: top level - src/auxkernels - ReynoldsNumberAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 23 24 95.8 %
Date: 2026-05-29 20:41:18 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 "ReynoldsNumberAux.h"
      11             : #include "SinglePhaseFluidProperties.h"
      12             : #include "Numerics.h"
      13             : 
      14             : registerMooseObject("ThermalHydraulicsApp", ReynoldsNumberAux);
      15             : 
      16             : InputParameters
      17          19 : ReynoldsNumberAux::validParams()
      18             : {
      19          19 :   InputParameters params = AuxKernel::validParams();
      20          19 :   params.addClassDescription("Computes the Reynolds number.");
      21          38 :   params.addCoupledVar("alpha", 1, "Volume fraction of the phase");
      22          38 :   params.addRequiredCoupledVar("rho", "Density of the phase");
      23          38 :   params.addRequiredCoupledVar("vel", "Component of phase velocity aligned with the flow");
      24          38 :   params.addRequiredCoupledVar("D_h", "Hydraulic diameter");
      25          38 :   params.addRequiredCoupledVar("v", "Specific volume");
      26          38 :   params.addRequiredCoupledVar("e", "Specific internal energy");
      27          38 :   params.addRequiredParam<UserObjectName>("fp",
      28             :                                           "The name of the user object with fluid properties");
      29          19 :   return params;
      30           0 : }
      31             : 
      32          10 : ReynoldsNumberAux::ReynoldsNumberAux(const InputParameters & parameters)
      33             :   : AuxKernel(parameters),
      34          10 :     _alpha(coupledValue("alpha")),
      35          10 :     _rho(coupledValue("rho")),
      36          10 :     _vel(coupledValue("vel")),
      37          10 :     _D_h(coupledValue("D_h")),
      38          10 :     _v(coupledValue("v")),
      39          10 :     _e(coupledValue("e")),
      40          20 :     _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
      41             : {
      42          10 : }
      43             : 
      44             : Real
      45           6 : ReynoldsNumberAux::computeValue()
      46             : {
      47           6 :   Real visc = _fp.mu_from_v_e(_v[_qp], _e[_qp]);
      48           6 :   return THM::Reynolds(_alpha[_qp], _rho[_qp], _vel[_qp], _D_h[_qp], visc);
      49             : }

Generated by: LCOV version 1.14