LCOV - code coverage report
Current view: top level - include/physics - WCNSFVFluidHeatTransferPhysicsBase.h (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #32971 (54bef8) with base c6cf66 Lines: 4 4 100.0 %
Date: 2026-05-29 20:37:52 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_variables_physics");                            \
      19             :   registerMooseAction(app_name, derived_name, "add_ics_physics");                                  \
      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_materials_physics")
      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         773 :   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          16 :     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          16 :     return _ambient_convection_alpha;
      55             :   }
      56             : 
      57             :   /// Whether the physics is actually creating the heat equation
      58          87 :   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             : 
      66             :   unsigned short getNumberAlgebraicGhostingLayersNeeded() const override;
      67             : 
      68             :   /**
      69             :    * Functions adding kernels for the incompressible / weakly compressible energy equation
      70             :    */
      71             :   virtual void addEnergyTimeKernels() = 0;
      72             :   virtual void addEnergyHeatConductionKernels() = 0;
      73             :   virtual void addEnergyAdvectionKernels() = 0;
      74             :   virtual void addEnergyAmbientConvection() = 0;
      75             :   virtual void addEnergyExternalHeatSource() = 0;
      76             : 
      77             :   /// Functions adding boundary conditions for the fluid heat transfer equation.
      78             :   virtual void addEnergyInletBC() = 0;
      79             :   virtual void addEnergyWallBC() = 0;
      80             :   virtual void addEnergyOutletBC() = 0;
      81             :   virtual void addEnergySeparatorBC() = 0;
      82             : 
      83             :   /// Process thermal conductivity (multiple functor input options are available).
      84             :   /// Return true if we have vector thermal conductivity and false if scalar
      85             :   bool processThermalConductivity();
      86             :   /// Define the effective diffusion coefficient when:
      87             :   /// - solving with a turbulence model: k <- k+kt
      88             :   /// - solving for enthalpy: k / cp
      89             :   void defineEffectiveThermalDiffusionCoeffFunctors(const bool use_ad);
      90             : 
      91             :   /// A boolean to help compatibility with the old Modules/NavierStokesFV syntax
      92             :   const bool _has_energy_equation;
      93             :   /// User-selected option to solve for enthalpy
      94             :   const bool _solve_for_enthalpy;
      95             :   /// Name of the fluid specific enthalpy
      96             :   const VariableName _fluid_enthalpy_name;
      97             :   /// Fluid temperature name
      98             :   VariableName _fluid_temperature_name;
      99             :   /// Name of the specific heat material property
     100             :   MooseFunctorName _specific_heat_name;
     101             :   /// Vector of subdomain groups where we want to have different thermal conduction
     102             :   std::vector<std::vector<SubdomainName>> _thermal_conductivity_blocks;
     103             :   /// Name of the thermal conductivity functor for each block-group
     104             :   std::vector<MooseFunctorName> _thermal_conductivity_name;
     105             : 
     106             :   /// Vector of subdomain groups where we want to have different ambient convection
     107             :   std::vector<std::vector<SubdomainName>> _ambient_convection_blocks;
     108             :   /// Name of the ambient convection heat transfer coefficients for each block-group
     109             :   std::vector<MooseFunctorName> _ambient_convection_alpha;
     110             :   /// Name of the solid domain temperature for each block-group
     111             :   std::vector<MooseFunctorName> _ambient_temperature;
     112             : 
     113             :   /// Energy inlet boundary types
     114             :   MultiMooseEnum _energy_inlet_types;
     115             :   /// Functors describing the inlet boundary values. See energy_inlet_types for what the functors actually represent
     116             :   std::vector<MooseFunctorName> _energy_inlet_functors;
     117             :   /// Energy wall boundary types
     118             :   MultiMooseEnum _energy_wall_types;
     119             :   /// Functors describing the wall boundary values. See energy_wall_types for what the functors actually represent
     120             :   std::vector<MooseFunctorName> _energy_wall_functors;
     121             : };

Generated by: LCOV version 1.14