diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index a3f397f4d2e..5f2c6623a4a 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4381,6 +4381,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Radiation = (Kind_Radiation != RADIATION_MODEL::NONE); + /*--- The P1 model uses the dimensional Stefan-Boltzmann constant with the solver temperature. ---*/ + if (Radiation && Ref_Inc_NonDim != DIMENSIONAL) { + SU2_MPI::Error("RADIATION_MODEL requires INC_NONDIM= DIMENSIONAL.", CURRENT_FUNCTION); + } + /*--- Check for unsupported features. ---*/ if ((Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS) && (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE)){ diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 8725ea512a0..6be38d3745a 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -173,6 +173,7 @@ class CFVMFlowSolverBase : public CSolver { vector Surface_HF_Visc; /*!< \brief Total (integrated) heat flux for each monitored surface. */ vector Surface_MaxHF_Visc; /*!< \brief Maximum heat flux for each monitored surface. */ vector HF_Visc; /*!< \brief Heat load (viscous contribution) for each boundary. */ + const CSolver* RadSolver = nullptr; /*!< \brief Radiation solver, whose wall heat flux is added to HeatFlux. */ vector MaxHF_Visc; /*!< \brief Maximum heat flux (viscous contribution) for each boundary. */ su2double AllBound_HF_Visc = 0.0; /*!< \brief Heat load (viscous contribution) for all the boundaries. */ su2double AllBound_MaxHF_Visc = 0.0; /*!< \brief Maximum heat flux (viscous contribution) for all boundaries. */ diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 223ed13763b..cbab8dd56de 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -2683,6 +2683,16 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr } const bool catalytic = nemo && config->GetCatalytic_Wall(iMarker); + /*--- With a radiation model, walls also absorb the radiative heat flux of the Marshak condition. + * The wall temperature is the one the radiation solver uses in its boundary conditions. ---*/ + const bool radiative_wall = (RadSolver != nullptr) && (KindBC == BC_TYPE::ISOTHERMAL || + KindBC == BC_TYPE::HEAT_FLUX || KindBC == BC_TYPE::CHT_WALL_INTERFACE); + su2double Emissivity = 0.0, Twall_Rad = 0.0; + if (radiative_wall) { + Emissivity = config->GetWall_Emissivity(Marker_Tag); + if (KindBC == BC_TYPE::ISOTHERMAL) Twall_Rad = config->GetIsothermal_Temperature(Marker_Tag) / RefTemperature; + } + /*--- Loop over the vertices to compute the forces (work-shared across threads, see * Pressure_Forces for why the chunk size is computed and the barrier skipped). ---*/ @@ -2793,6 +2803,12 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE && !energy) dTdn = 0.0; HeatFlux[iMarker][iVertex] = thermal_conductivity * dTdn * RefHeatFlux; } + + if (radiative_wall) { + su2double Twall_local = Twall_Rad; + if (KindBC != BC_TYPE::ISOTHERMAL) Twall_local = nodes->GetTemperature(iPoint); + HeatFlux[iMarker][iVertex] += RadSolver->GetWallHeatFlux_Rad(iPoint, Emissivity, Twall_local); + } } else { const auto& thermal_conductivity_tr = nodes->GetThermalConductivity(iPoint); diff --git a/SU2_CFD/include/solvers/CRadP1Solver.hpp b/SU2_CFD/include/solvers/CRadP1Solver.hpp index 00325b90cfe..99079a12a36 100644 --- a/SU2_CFD/include/solvers/CRadP1Solver.hpp +++ b/SU2_CFD/include/solvers/CRadP1Solver.hpp @@ -256,4 +256,16 @@ class CRadP1Solver final: public CRadSolver { */ inline su2double GetTemperature_Inf(void) const { return Temperature_Inf; } + /*! + * \brief Marshak radiative heat flux into a wall, Theta*(G - 4*sigma*T_w^4). + * \note Positive when the wall absorbs heat. + * \param[in] iPoint - Point on the wall. + * \param[in] emissivity - Emissivity of the wall. + * \param[in] Twall - Temperature of the wall. + */ + inline su2double GetWallHeatFlux_Rad(unsigned long iPoint, su2double emissivity, su2double Twall) const override { + const su2double Theta = emissivity / (2.0 * (2.0 - emissivity)); + return Theta * (nodes->GetSolution(iPoint, 0) - 4.0 * STEFAN_BOLTZMANN * pow(Twall, 4.0)); + } + }; diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 9446db1e735..e2d3fcc76fc 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -2414,6 +2414,17 @@ class CSolver { */ inline virtual su2double GetTotal_HeatFlux() const { return 0; } + /*! + * \brief Get the radiative heat flux into a wall at a point, from the Marshak condition. + * \param[in] iPoint - Point on the wall. + * \param[in] emissivity - Emissivity of the wall. + * \param[in] Twall - Temperature of the wall. + * \return Heat flux, positive when the wall absorbs heat. Zero for solvers without radiation. + */ + inline virtual su2double GetWallHeatFlux_Rad(unsigned long iPoint, su2double emissivity, su2double Twall) const { + return 0; + } + /*! * \brief A virtual member. * \return Value of the heat load (integrated heat flux). diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 9684325a94d..66a9c4a6ce8 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1945,9 +1945,9 @@ void CFlowOutput::AddHeatCoefficients(const CConfig* config) { /// BEGIN_GROUP: HEAT, DESCRIPTION: Heat coefficients on all surfaces set with MARKER_MONITORING. /// DESCRIPTION: Total heatflux - AddHistoryOutput("TOTAL_HEATFLUX", "HF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total heatflux on all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + AddHistoryOutput("TOTAL_HEATFLUX", "HF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total heatflux on all surfaces set with MARKER_MONITORING, including radiation if a RADIATION_MODEL is used.", HistoryFieldType::COEFFICIENT); /// DESCRIPTION: Maximal heatflux - AddHistoryOutput("MAXIMUM_HEATFLUX", "maxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Maximum heatflux across all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + AddHistoryOutput("MAXIMUM_HEATFLUX", "maxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Maximum heatflux across all surfaces set with MARKER_MONITORING, including radiation if a RADIATION_MODEL is used.", HistoryFieldType::COEFFICIENT); vector Marker_Monitoring; Marker_Monitoring.reserve(config->GetnMarker_Monitoring()); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 046d4bc4037..6c1431250dd 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -1042,6 +1042,10 @@ void CIncEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_ unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { SU2_ZONE_SCOPED + /*--- The wall heat flux of Friction_Forces includes the radiative heat flux. ---*/ + + if (iMesh == MESH_0 && config->AddRadiation()) RadSolver = solver_container[RAD_SOL]; + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED); const bool center_jst = (config->GetKind_Centered_Flow() == CENTERED::JST || config->GetKind_Centered_Flow() == CENTERED::LD2) && (iMesh == MESH_0); diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index e5fd6ed2db9..22005c0eaed 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1703,7 +1703,7 @@ def main(): p1rad.cfg_dir = "radiation/p1model" p1rad.cfg_file = "configp1.cfg" p1rad.test_iter = 50 - p1rad.test_vals = [-8.197112, -7.856394, -2.380743, 0.381122, -57.186000] + p1rad.test_vals = [-8.197112, -7.856394, -2.380743, 0.381122, -3211.700000] test_list.append(p1rad) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index ed41021a7c9..d7317463396 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1268,7 +1268,7 @@ def main(): p1rad.cfg_dir = "radiation/p1model" p1rad.cfg_file = "configp1.cfg" p1rad.test_iter = 50 - p1rad.test_vals = [-8.284673, -8.008659, -2.424204, 0.389030, -56.560000] + p1rad.test_vals = [-8.284673, -8.008659, -2.424204, 0.389030, -3190.600000] test_list.append(p1rad) # ############################### diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 707f08851a2..94c61ff918e 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -384,6 +384,16 @@ def main(): pywrapper_psi_quench.command = TestCase.Command("mpirun -np 2", "python", "run.py") test_list.append(pywrapper_psi_quench) + # custom source: volumetric heat source with the P1 radiation model + pywrapper_p1_cavity = TestCase('p1_radiation_python') + pywrapper_p1_cavity.cfg_dir = "../Tutorials/multiphysics/P1_radiation_python" + pywrapper_p1_cavity.cfg_file = "cavity.cfg" + pywrapper_p1_cavity.test_iter = 20 + pywrapper_p1_cavity.test_vals = [-7.708332, -8.047920, -7.885417, -2.607572, -3.352777, 9.108100] + pywrapper_p1_cavity.test_vals_aarch64 = [-7.710578, -8.043164, -7.883466, -2.603692, -3.354051, 9.082500] + pywrapper_p1_cavity.command = TestCase.Command("mpirun -np 2", "python", "run.py") + test_list.append(pywrapper_p1_cavity) + ###################################### ### RUN TESTS ###