LCOV - code coverage report
Current view: top level - src/scmclosures - SCMFrictionMATRA.C (source / functions) Hit Total Coverage
Test: idaholab/moose subchannel: #32971 (54bef8) with base c6cf66 Lines: 19 21 90.5 %
Date: 2026-05-29 20:40:47 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 "SCMFrictionMATRA.h"
      11             : 
      12             : registerMooseObject("SubChannelApp", SCMFrictionMATRA);
      13             : 
      14             : InputParameters
      15         285 : SCMFrictionMATRA::validParams()
      16             : {
      17         285 :   InputParameters params = SCMFrictionClosureBase::validParams();
      18         285 :   params.addClassDescription(
      19             :       "Class that computes the axial friction factor using the MATRA correlation.");
      20         285 :   return params;
      21           0 : }
      22             : 
      23         148 : SCMFrictionMATRA::SCMFrictionMATRA(const InputParameters & parameters)
      24             :   : SCMFrictionClosureBase(parameters),
      25         148 :     _is_quad_lattice(dynamic_cast<const QuadSubChannelMesh *>(&_subchannel_mesh) != nullptr),
      26         296 :     _quad_sch_mesh(dynamic_cast<const QuadSubChannelMesh *>(&_subchannel_mesh))
      27             : {
      28         148 : }
      29             : 
      30             : Real
      31    19775040 : SCMFrictionMATRA::computeFrictionFactor(const FrictionStruct & friction_args) const
      32             : {
      33    19775040 :   if (_is_quad_lattice)
      34    19775040 :     return computeQuadLatticeFrictionFactor(friction_args);
      35             :   else
      36           0 :     mooseError(name(),
      37             :                ": This closure model applies only for assemblies with bare fuel pins in a square "
      38             :                "lattice. ");
      39             : }
      40             : 
      41             : Real
      42    19775040 : SCMFrictionMATRA::computeQuadLatticeFrictionFactor(const FrictionStruct & friction_args) const
      43             : {
      44    19775040 :   auto Re = friction_args.Re;
      45             :   Real a(0.0), b(0.0);
      46    19775040 :   if (Re < 1)
      47             :   {
      48             :     a = 64.0;
      49             :     b = 0.0;
      50             :   }
      51    19775040 :   else if (Re >= 1 and Re < 5000)
      52             :   {
      53             :     a = 64.0;
      54             :     b = -1.0;
      55             :   }
      56             :   /// Pang, B. et al. KIT, 2013
      57    17967240 :   else if (Re >= 5000 and Re < 30000)
      58             :   {
      59             :     a = 0.316;
      60             :     b = -0.25;
      61             :   }
      62    17872920 :   else if (Re >= 30000 and Re < 1000000)
      63             :   {
      64             :     a = 0.184;
      65             :     b = -0.20;
      66             :   }
      67             :   else
      68             :   {
      69        7764 :     flagInvalidSolution("MATRA correlation out of range");
      70             :   }
      71    19775040 :   return a * std::pow(Re, b);
      72             : }

Generated by: LCOV version 1.14