LCOV - code coverage report
Current view: top level - include/physics - WCNSFVFluidHeatTransferPhysicsBase.h (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 9fc4b0 Lines: 4 4 100.0 %
Date: 2025-08-14 10:14:56 Functions: 0 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 "NavierStokesPhysicsBase.h"
      13             : #include "WCNSFVCoupledAdvectionPhysicsHelper.h"
      14             : #include "NS.h"
      15             : 
      16             : #define registerWCNSFVFluidHeatTransferPhysicsBaseTasks(app_name, derived_name)                    \
      17             :   registerMooseAction(app_name, derived_name, "get_turbulence_physics");                           \
      18             :   registerMooseAction(app_name, derived_name, "add_variable");                                     \
      19             :   registerMooseAction(app_name, derived_name, "add_ic");                                           \
      20             :   registerMooseAction(app_name, derived_name, "add_fv_kernel");                                    \
      21             :   registerMooseAction(app_name, derived_name, "add_fv_bc");                                        \
      22             :   registerMooseAction(app_name, derived_name, "add_material")
      23             : 
      24             : /**
      25             :  * Creates all the objects needed to solve the Navier Stokes energy equation
      26             :  */
      27             : class WCNSFVFluidHeatTransferPhysicsBase : public NavierStokesPhysicsBase,
      28             :                                            public WCNSFVCoupledAdvectionPhysicsHelper
      29             : {
      30             : public:
      31             :   static InputParameters validParams();
      32             : 
      33             :   WCNSFVFluidHeatTransferPhysicsBase(const InputParameters & parameters);
      34             : 
      35             :   /// Get the name of the fluid temperature variable
      36             :   const VariableName & getFluidTemperatureName() const { return _fluid_temperature_name; }
      37             : 
      38             :   /// Get the name of the specific heat material property
      39             :   const MooseFunctorName & getSpecificHeatName() const { return _specific_heat_name; }
      40        1314 :   MooseFunctorName getSpecificEnthalpyName() const { return NS::specific_enthalpy; }
      41             :   const std::vector<MooseFunctorName> & getThermalConductivityName() const
      42             :   {
      43             :     return _thermal_conductivity_name;
      44             :   }
      45             : 
      46             :   /// Get the ambient convection parameters for parameter checking
      47             :   const std::vector<std::vector<SubdomainName>> & getAmbientConvectionBlocks() const
      48             :   {
      49          28 :     return _ambient_convection_blocks;
      50             :   }
      51             :   /// Name of the ambient convection heat transfer coefficients for each block-group
      52             :   const std::vector<MooseFunctorName> & getAmbientConvectionHTCs() const
      53             :   {
      54          28 :     return _ambient_convection_alpha;
      55             :   }
      56             : 
      57             :   /// Whether the physics is actually creating the heat equation
      58         131 :   bool hasEnergyEquation() const { return _has_energy_equation; }
      59             : 
      60             : protected:
      61             :   void actOnAdditionalTasks() override;
      62             :   void addInitialConditions() override;
      63             :   void addFVKernels() override;
      64             :   void addFVBCs() override;
      65             :   void addMaterials() override;
      66             : 
      67             :   unsigned short getNumberAlgebraicGhostingLayersNeeded() const override;
      68             : 
      69             :   /**
      70             :    * Functions adding kernels for the incompressible / weakly compressible energy equation
      71             :    */
      72             :   virtual void addEnergyTimeKernels() = 0;
      73             :   virtual void addEnergyHeatConductionKernels() = 0;
      74             :   virtual void addEnergyAdvectionKernels() = 0;
      75             :   virtual void addEnergyAmbientConvection() = 0;
      76             :   virtual void addEnergyExternalHeatSource() = 0;
      77             : 
      78             :   /// Functions adding boundary conditions for the fluid heat transfer equation.
      79             :   virtual void addEnergyInletBC() = 0;
      80             :   virtual void addEnergyWallBC() = 0;
      81             :   virtual void addEnergyOutletBC() = 0;
      82             :   virtual void addEnergySeparatorBC() = 0;
      83             : 
      84             :   /// Process thermal conductivity (multiple functor input options are available).
      85             :   /// Return true if we have vector thermal conductivity and false if scalar
      86             :   bool processThermalConductivity();
      87             : 
      88             :   /// A boolean to help compatibility with the old Modules/NavierStokesFV syntax
      89             :   const bool _has_energy_equation;
      90             :   /// User-selected option to solve for enthalpy
      91             :   const bool _solve_for_enthalpy;
      92             :   /// Name of the fluid specific enthalpy
      93             :   const VariableName _fluid_enthalpy_name;
      94             :   /// Fluid temperature name
      95             :   VariableName _fluid_temperature_name;
      96             :   /// Name of the specific heat material property
      97             :   MooseFunctorName _specific_heat_name;
      98             :   /// Vector of subdomain groups where we want to have different thermal conduction
      99             :   std::vector<std::vector<SubdomainName>> _thermal_conductivity_blocks;
     100             :   /// Name of the thermal conductivity functor for each block-group
     101             :   std::vector<MooseFunctorName> _thermal_conductivity_name;
     102             : 
     103             :   /// Vector of subdomain groups where we want to have different ambient convection
     104             :   std::vector<std::vector<SubdomainName>> _ambient_convection_blocks;
     105             :   /// Name of the ambient convection heat transfer coefficients for each block-group
     106             :   std::vector<MooseFunctorName> _ambient_convection_alpha;
     107             :   /// Name of the solid domain temperature for each block-group
     108             :   std::vector<MooseFunctorName> _ambient_temperature;
     109             : 
     110             :   /// Energy inlet boundary types
     111             :   MultiMooseEnum _energy_inlet_types;
     112             :   /// Functors describing the inlet boundary values. See energy_inlet_types for what the functors actually represent
     113             :   std::vector<MooseFunctorName> _energy_inlet_functors;
     114             :   /// Energy wall boundary types
     115             :   MultiMooseEnum _energy_wall_types;
     116             :   /// Functors describing the wall boundary values. See energy_wall_types for what the functors actually represent
     117             :   std::vector<MooseFunctorName> _energy_wall_functors;
     118             : };

Generated by: LCOV version 1.14