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_fv_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 1371 : 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 : 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 k/cp diffusion coefficients when solving for enthalpy 87 : void defineKOverCpFunctors(const bool use_ad); 88 : 89 : /// A boolean to help compatibility with the old Modules/NavierStokesFV syntax 90 : const bool _has_energy_equation; 91 : /// User-selected option to solve for enthalpy 92 : const bool _solve_for_enthalpy; 93 : /// Name of the fluid specific enthalpy 94 : const VariableName _fluid_enthalpy_name; 95 : /// Fluid temperature name 96 : VariableName _fluid_temperature_name; 97 : /// Name of the specific heat material property 98 : MooseFunctorName _specific_heat_name; 99 : /// Vector of subdomain groups where we want to have different thermal conduction 100 : std::vector<std::vector<SubdomainName>> _thermal_conductivity_blocks; 101 : /// Name of the thermal conductivity functor for each block-group 102 : std::vector<MooseFunctorName> _thermal_conductivity_name; 103 : 104 : /// Vector of subdomain groups where we want to have different ambient convection 105 : std::vector<std::vector<SubdomainName>> _ambient_convection_blocks; 106 : /// Name of the ambient convection heat transfer coefficients for each block-group 107 : std::vector<MooseFunctorName> _ambient_convection_alpha; 108 : /// Name of the solid domain temperature for each block-group 109 : std::vector<MooseFunctorName> _ambient_temperature; 110 : 111 : /// Energy inlet boundary types 112 : MultiMooseEnum _energy_inlet_types; 113 : /// Functors describing the inlet boundary values. See energy_inlet_types for what the functors actually represent 114 : std::vector<MooseFunctorName> _energy_inlet_functors; 115 : /// Energy wall boundary types 116 : MultiMooseEnum _energy_wall_types; 117 : /// Functors describing the wall boundary values. See energy_wall_types for what the functors actually represent 118 : std::vector<MooseFunctorName> _energy_wall_functors; 119 : };