LCOV - code coverage report
Current view: top level - include/closures - ClosuresBase.h (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 3 4 75.0 %
Date: 2025-07-30 13:02:48 Functions: 2 2 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             : #pragma once
      11             : 
      12             : #include "MooseObject.h"
      13             : #include "LoggingInterface.h"
      14             : #include "NamingInterface.h"
      15             : 
      16             : class FlowChannelBase;
      17             : class HeatTransferBase;
      18             : class THMProblem;
      19             : class Factory;
      20             : 
      21             : /**
      22             :  * Base class for closures implementations
      23             :  *
      24             :  * The responsibilities of the closures objects depend on the flow model that
      25             :  * uses them. Examples of responsibilities will be to provide material properties
      26             :  * for friction factors and heat transfer coefficients.
      27             :  */
      28           0 : class ClosuresBase : public MooseObject, public LoggingInterface, public NamingInterface
      29             : {
      30             : public:
      31             :   ClosuresBase(const InputParameters & params);
      32             : 
      33             :   /**
      34             :    * Checks for errors associated with a flow channel component
      35             :    *
      36             :    * @param[in] flow_channel   Flow channel component
      37             :    */
      38          57 :   virtual void checkFlowChannel(const FlowChannelBase & /*flow_channel*/) const {}
      39             : 
      40             :   /**
      41             :    * Checks for errors associated with a heat transfer component
      42             :    *
      43             :    * @param[in] heat_transfer   Heat transfer component
      44             :    * @param[in] flow_channel   Flow channel component
      45             :    */
      46          76 :   virtual void checkHeatTransfer(const HeatTransferBase & /*heat_transfer*/,
      47             :                                  const FlowChannelBase & /*flow_channel*/) const
      48             :   {
      49          76 :   }
      50             : 
      51             :   /**
      52             :    * Adds MOOSE objects associated with a flow channel component
      53             :    *
      54             :    * @param[in] flow_channel   Flow channel component
      55             :    */
      56             :   virtual void addMooseObjectsFlowChannel(const FlowChannelBase & flow_channel) = 0;
      57             : 
      58             :   /**
      59             :    * Adds MOOSE objects associated with a heat transfer component
      60             :    *
      61             :    * @param[in] heat_transfer   Heat transfer component
      62             :    * @param[in] flow_channel   Flow channel component
      63             :    */
      64             :   virtual void addMooseObjectsHeatTransfer(const HeatTransferBase & heat_transfer,
      65             :                                            const FlowChannelBase & flow_channel) = 0;
      66             : 
      67             : protected:
      68             :   /**
      69             :    * Adds an arbitrary zero-value material
      70             :    *
      71             :    * @param[in] flow_channel   Flow channel component
      72             :    * @param[in] property_name   Name of the material property to create
      73             :    */
      74             :   void addZeroMaterial(const FlowChannelBase & flow_channel,
      75             :                        const std::string & property_name) const;
      76             : 
      77             :   /**
      78             :    * Adds a weighted average material
      79             :    *
      80             :    * @param[in] flow_channel   Flow channel component
      81             :    * @param[in] values   Values to average
      82             :    * @param[in] weights   Weights for each value
      83             :    * @param[in] property_name   Name of material property to create
      84             :    */
      85             :   void addWeightedAverageMaterial(const FlowChannelBase & flow_channel,
      86             :                                   const std::vector<MaterialPropertyName> & values,
      87             :                                   const std::vector<VariableName> & weights,
      88             :                                   const MaterialPropertyName & property_name) const;
      89             : 
      90             :   /**
      91             :    * Adds a material for wall temperature from an aux variable
      92             :    *
      93             :    * @param[in] flow_channel   Flow channel component
      94             :    * @param[in] i   index of the heat transfer
      95             :    */
      96             :   void addWallTemperatureFromAuxMaterial(const FlowChannelBase & flow_channel,
      97             :                                          unsigned int i = 0) const;
      98             : 
      99             :   /// Simulation
     100             :   THMProblem & _sim;
     101             : 
     102             :   /// Factory associated with the MooseApp
     103             :   Factory & _factory;
     104             : 
     105             : public:
     106             :   static InputParameters validParams();
     107             : };

Generated by: LCOV version 1.14