Skip to content

Commit 7141b3a

Browse files
authored
Merge pull request #872 from su2code/feature_radiation
P1 solver for Radiative Heat Transfer
2 parents dc771ff + 7ff5771 commit 7141b3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3064
-359
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ bin/
7676
TestData
7777
*.stl
7878

79+
# Ignore output files if tests are run locally
80+
*.vtk
81+
*.vtu
82+
*.ref
83+
7984
Mercurial
8085
.hg*
8186

Common/include/CConfig.hpp

Lines changed: 140 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ class CConfig {
500500
Kind_TimeStep_Heat, /*!< \brief Time stepping method for the (fvm) heat equation. */
501501
Kind_TimeIntScheme_FEA, /*!< \brief Time integration for the FEA equations. */
502502
Kind_SpaceIteScheme_FEA, /*!< \brief Iterative scheme for nonlinear structural analysis. */
503+
Kind_TimeIntScheme_Radiation, /*!< \brief Time integration for the Radiation equations. */
503504
Kind_ConvNumScheme, /*!< \brief Global definition of the convective term. */
504505
Kind_ConvNumScheme_Flow, /*!< \brief Centered or upwind scheme for the flow equations. */
505506
Kind_ConvNumScheme_FEM_Flow, /*!< \brief Finite element scheme for the flow equations. */
@@ -1010,27 +1011,6 @@ class CConfig {
10101011
unsigned short Kind_HybridRANSLES; /*!< \brief Kind of Hybrid RANS/LES. */
10111012
unsigned short Kind_RoeLowDiss; /*!< \brief Kind of Roe scheme with low dissipation for unsteady flows. */
10121013
bool QCR; /*!< \brief Spalart-Allmaras with Quadratic Constitutive Relation, 2000 version (SA-QCR2000) . */
1013-
su2double *default_vel_inf, /*!< \brief Default freestream velocity array for the COption class. */
1014-
*default_eng_cyl, /*!< \brief Default engine box array for the COption class. */
1015-
*default_eng_val, /*!< \brief Default engine box array values for the COption class. */
1016-
*default_cfl_adapt, /*!< \brief Default CFL adapt param array for the COption class. */
1017-
*default_jst_coeff, /*!< \brief Default artificial dissipation (flow) array for the COption class. */
1018-
*default_ffd_coeff, /*!< \brief Default artificial dissipation (flow) array for the COption class. */
1019-
*default_mixedout_coeff, /*!< \brief Default default mixedout algorithm coefficients for the COption class. */
1020-
*default_rampRotFrame_coeff, /*!< \brief Default ramp rotating frame coefficients for the COption class. */
1021-
*default_rampOutPres_coeff, /*!< \brief Default ramp outlet pressure coefficients for the COption class. */
1022-
*default_jst_adj_coeff, /*!< \brief Default artificial dissipation (adjoint) array for the COption class. */
1023-
*default_ad_coeff_heat, /*!< \brief Default artificial dissipation (heat) array for the COption class. */
1024-
*default_obj_coeff, /*!< \brief Default objective array for the COption class. */
1025-
*default_geo_loc, /*!< \brief Default SU2_GEO section locations array for the COption class. */
1026-
*default_distortion, /*!< \brief Default SU2_GEO section locations array for the COption class. */
1027-
*default_ea_lim, /*!< \brief Default equivalent area limit array for the COption class. */
1028-
*default_grid_fix, /*!< \brief Default fixed grid (non-deforming region) array for the COption class. */
1029-
*default_htp_axis, /*!< \brief Default HTP axis for the COption class. */
1030-
*default_ffd_axis, /*!< \brief Default FFD axis for the COption class. */
1031-
*default_inc_crit, /*!< \brief Default incremental criteria array for the COption class. */
1032-
*default_extrarelfac, /*!< \brief Default extra relaxation factor for Giles BC in the COption class. */
1033-
*default_sineload_coeff; /*!< \brief Default values for a sine load. */
10341014

10351015
unsigned short nSpanWiseSections; /*!< \brief number of span-wise sections */
10361016
unsigned short nSpanMaxAllZones; /*!< \brief number of maximum span-wise sections for all zones */
@@ -1046,8 +1026,6 @@ class CConfig {
10461026
su2double FinalRotation_Rate_Z; /*!< \brief Final rotation rate Z if Ramp rotating frame is activated. */
10471027
su2double FinalOutletPressure; /*!< \brief Final outlet pressure if Ramp outlet pressure is activated. */
10481028
su2double MonitorOutletPressure; /*!< \brief Monitor outlet pressure if Ramp outlet pressure is activated. */
1049-
su2double *default_body_force; /*!< \brief Default body force vector for the COption class. */
1050-
su2double *default_nacelle_location; /*!< \brief Location of the nacelle. */
10511029
su2double *default_cp_polycoeffs; /*!< \brief Array for specific heat polynomial coefficients. */
10521030
su2double *default_mu_polycoeffs; /*!< \brief Array for viscosity polynomial coefficients. */
10531031
su2double *default_kt_polycoeffs; /*!< \brief Array for thermal conductivity polynomial coefficients. */
@@ -1070,6 +1048,46 @@ class CConfig {
10701048
*top_optim_filter_radius; /*!< \brief Radius of the filter(s) used on the design density for topology optimization. */
10711049
unsigned short top_optim_proj_type; /*!< \brief The projection function used in topology optimization. */
10721050
su2double top_optim_proj_param; /*!< \brief The value of the parameter for the projection function. */
1051+
bool HeatSource; /*!< \brief Flag to know if there is a volumetric heat source on the flow. */
1052+
su2double ValHeatSource; /*!< \brief Value of the volumetric heat source on the flow (W/m3). */
1053+
su2double Heat_Source_Rot_Z; /*!< \brief Rotation of the volumetric heat source on the Z axis. */
1054+
su2double *Heat_Source_Center, /*!< \brief Position of the center of the heat source. */
1055+
*Heat_Source_Axes; /*!< \brief Principal axes (x, y, z) of the ellipsoid containing the heat source. */
1056+
unsigned short Kind_Radiation; /*!< \brief Kind of radiation model used. */
1057+
unsigned short Kind_P1_Init; /*!< \brief Kind of initialization used in the P1 model. */
1058+
su2double Absorption_Coeff, /*!< \brief Absorption coefficient of the medium (radiation). */
1059+
Scattering_Coeff; /*!< \brief Scattering coefficient of the medium (radiation). */
1060+
unsigned short nMarker_Emissivity; /*!< \brief Number of markers for which the emissivity is defined. */
1061+
string *Marker_Emissivity; /*!< \brief Wall markers with defined emissivity. */
1062+
su2double *Wall_Emissivity; /*!< \brief Emissivity of the wall. */
1063+
bool Radiation; /*!< \brief Determines if a radiation model is incorporated. */
1064+
su2double CFL_Rad; /*!< \brief CFL Number for the radiation solver. */
1065+
1066+
su2double default_vel_inf[3], /*!< \brief Default freestream velocity array for the COption class. */
1067+
default_eng_cyl[7], /*!< \brief Default engine box array for the COption class. */
1068+
default_eng_val[5], /*!< \brief Default engine box array values for the COption class. */
1069+
default_cfl_adapt[4], /*!< \brief Default CFL adapt param array for the COption class. */
1070+
default_jst_coeff[2], /*!< \brief Default artificial dissipation (flow) array for the COption class. */
1071+
default_ffd_coeff[3], /*!< \brief Default artificial dissipation (flow) array for the COption class. */
1072+
default_mixedout_coeff[3], /*!< \brief Default default mixedout algorithm coefficients for the COption class. */
1073+
default_rampRotFrame_coeff[3], /*!< \brief Default ramp rotating frame coefficients for the COption class. */
1074+
default_rampOutPres_coeff[3], /*!< \brief Default ramp outlet pressure coefficients for the COption class. */
1075+
default_jst_adj_coeff[2], /*!< \brief Default artificial dissipation (adjoint) array for the COption class. */
1076+
default_ad_coeff_heat[2], /*!< \brief Default artificial dissipation (heat) array for the COption class. */
1077+
default_obj_coeff[5], /*!< \brief Default objective array for the COption class. */
1078+
default_geo_loc[2], /*!< \brief Default SU2_GEO section locations array for the COption class. */
1079+
default_distortion[2], /*!< \brief Default SU2_GEO section locations array for the COption class. */
1080+
default_ea_lim[3], /*!< \brief Default equivalent area limit array for the COption class. */
1081+
default_grid_fix[6], /*!< \brief Default fixed grid (non-deforming region) array for the COption class. */
1082+
default_htp_axis[2], /*!< \brief Default HTP axis for the COption class. */
1083+
default_ffd_axis[3], /*!< \brief Default FFD axis for the COption class. */
1084+
default_inc_crit[3], /*!< \brief Default incremental criteria array for the COption class. */
1085+
default_extrarelfac[2], /*!< \brief Default extra relaxation factor for Giles BC in the COption class. */
1086+
default_sineload_coeff[3], /*!< \brief Default values for a sine load. */
1087+
default_body_force[3], /*!< \brief Default body force vector for the COption class. */
1088+
default_nacelle_location[5], /*!< \brief Location of the nacelle. */
1089+
default_hs_axes[3], /*!< \brief Default principal axes (x, y, z) of the ellipsoid containing the heat source. */
1090+
default_hs_center[3]; /*!< \brief Default position of the center of the heat source. */
10731091

10741092
unsigned short Riemann_Solver_FEM; /*!< \brief Riemann solver chosen for the DG method. */
10751093
su2double Quadrature_Factor_Straight; /*!< \brief Factor applied during quadrature of elements with a constant Jacobian. */
@@ -1094,7 +1112,7 @@ class CConfig {
10941112
Restart_Iter; /*!< \brief Determines the restart iteration in the multizone problem */
10951113
su2double Time_Step; /*!< \brief Determines the time step for the multizone problem */
10961114
su2double Max_Time; /*!< \brief Determines the maximum time for the time-domain problems */
1097-
su2double *default_wrt_freq;
1115+
10981116
unsigned long HistoryWrtFreq[3], /*!< \brief Array containing history writing frequencies for timer iter, outer iter, inner iter */
10991117
ScreenWrtFreq[3]; /*!< \brief Array containing screen writing frequencies for timer iter, outer iter, inner iter */
11001118
unsigned long VolumeWrtFreq; /*!< \brief Writing frequency for solution files. */
@@ -4298,6 +4316,15 @@ class CConfig {
42984316
*/
42994317
unsigned short GetKind_TimeIntScheme_FEA(void) const { return Kind_TimeIntScheme_FEA; }
43004318

4319+
/*!
4320+
* \brief Get the kind of integration scheme (explicit or implicit)
4321+
* for the radiation equations.
4322+
* \note This value is obtained from the config file, and it is constant
4323+
* during the computation.
4324+
* \return Kind of integration scheme for the radiation equations.
4325+
*/
4326+
unsigned short GetKind_TimeIntScheme_Radiation(void) const { return Kind_TimeIntScheme_Radiation; }
4327+
43014328
/*!
43024329
* \brief Get the kind of integration scheme (explicit or implicit)
43034330
* for the template equations.
@@ -5837,6 +5864,52 @@ class CConfig {
58375864
*/
58385865
const su2double* GetBody_Force_Vector(void) const { return Body_Force_Vector; }
58395866

5867+
/*!
5868+
* \brief Get information about the volumetric heat source.
5869+
* \return <code>TRUE</code> if it uses a volumetric heat source; otherwise <code>FALSE</code>.
5870+
*/
5871+
inline bool GetHeatSource(void) const { return HeatSource; }
5872+
5873+
/*!
5874+
* \brief Get information about the volumetric heat source.
5875+
* \return Value of the volumetric heat source
5876+
*/
5877+
inline su2double GetHeatSource_Val(void) const {return ValHeatSource;}
5878+
5879+
/*!
5880+
* \brief Get the rotation angle of the volumetric heat source in axis Z.
5881+
* \return Rotation (Z) of the volumetric heat source
5882+
*/
5883+
inline su2double GetHeatSource_Rot_Z(void) const {return Heat_Source_Rot_Z;}
5884+
5885+
/*!
5886+
* \brief Set the rotation angle of the volumetric heat source in axis Z.
5887+
* \param[in] val_rot - Rotation (Z) of the volumetric heat source
5888+
*/
5889+
inline void SetHeatSource_Rot_Z(su2double val_rot) {Heat_Source_Rot_Z = val_rot;}
5890+
5891+
/*!
5892+
* \brief Get the position of the center of the volumetric heat source.
5893+
* \return Pointer to the center of the ellipsoid that introduces a volumetric heat source.
5894+
*/
5895+
inline const su2double* GetHeatSource_Center(void) const {return Heat_Source_Center;}
5896+
5897+
/*!
5898+
* \brief Set the position of the center of the volumetric heat source.
5899+
* \param[in] x_cent = X position of the center of the volumetric heat source.
5900+
* \param[in] y_cent = Y position of the center of the volumetric heat source.
5901+
* \param[in] z_cent = Z position of the center of the volumetric heat source.
5902+
*/
5903+
inline void SetHeatSource_Center(su2double x_cent, su2double y_cent, su2double z_cent) {
5904+
Heat_Source_Center[0] = x_cent; Heat_Source_Center[1] = y_cent; Heat_Source_Center[2] = z_cent;
5905+
}
5906+
5907+
/*!
5908+
* \brief Get the radius of the ellipsoid that introduces a volumetric heat source.
5909+
* \return Pointer to the radii (x, y, z) of the ellipsoid that introduces a volumetric heat source.
5910+
*/
5911+
inline const su2double* GetHeatSource_Axes(void) const {return Heat_Source_Axes;}
5912+
58405913
/*!
58415914
* \brief Get information about the rotational frame.
58425915
* \return <code>TRUE</code> if there is a rotational frame; otherwise <code>FALSE</code>.
@@ -9005,6 +9078,49 @@ class CConfig {
90059078
*/
90069079
bool GetSinglezone_Driver(void) const { return SinglezoneDriver; }
90079080

9081+
/*!
9082+
* \brief Get the Kind of Radiation model applied.
9083+
* \return Kind of radiation model used.
9084+
*/
9085+
unsigned short GetKind_RadiationModel(void) const { return Kind_Radiation; }
9086+
9087+
/*!
9088+
* \brief Get the Kind of P1 initialization method applied.
9089+
* \return Kind of P1 initialization method used.
9090+
*/
9091+
unsigned short GetKind_P1_Init(void) const { return Kind_P1_Init; }
9092+
9093+
/*!
9094+
* \brief Get the value of the absorption coefficient of the medium.
9095+
* \return Value of the absorption coefficient of the medium.
9096+
*/
9097+
su2double GetAbsorption_Coeff(void) const { return Absorption_Coeff; }
9098+
9099+
/*!
9100+
* \brief Get the value of the scattering coefficient of the medium.
9101+
* \return Value of the scattering coefficient of the medium.
9102+
*/
9103+
su2double GetScattering_Coeff(void) const { return Scattering_Coeff; }
9104+
9105+
/*!
9106+
* \brief Get the wall emissivity at a boundary.
9107+
* \param[in] val_index - Index corresponding to the boundary.
9108+
* \return The wall emissivity.
9109+
*/
9110+
su2double GetWall_Emissivity(string val_index) const;
9111+
9112+
/*!
9113+
* \brief Get the value of the CFL condition for radiation solvers.
9114+
* \return Value of the CFL condition for radiation solvers.
9115+
*/
9116+
su2double GetCFL_Rad(void) const { return CFL_Rad; }
9117+
9118+
/*!
9119+
* \brief Determines if radiation needs to be incorporated to the analysis.
9120+
* \return Radiation boolean
9121+
*/
9122+
bool AddRadiation(void) const { return Radiation; }
9123+
90089124
/*!
90099125
* \brief Check if the convergence history of each individual zone is written to screen
90109126
* \return YES if the zone convergence history of each individual zone must be written to screen

Common/include/option_structure.hpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ const su2double FOUR3 = 4.0 / 3.0; /*!< \brief Four divided by three. */
105105

106106
const su2double PI_NUMBER = 4.0 * atan(1.0); /*!< \brief Pi number. */
107107

108+
const su2double STEFAN_BOLTZMANN = 5.670367E-08; /*!< \brief Stefan-Boltzmann constant in W/(m^2*K^4). */
109+
108110
const int MASTER_NODE = 0; /*!< \brief Master node for MPI parallelization. */
109111
const int SINGLE_NODE = 1; /*!< \brief There is only a node in the MPI parallelization. */
110112
const int SINGLE_ZONE = 1; /*!< \brief There is only a zone. */
@@ -436,6 +438,8 @@ enum RUNTIME_TYPE {
436438
RUNTIME_HEAT_SYS = 21, /*!< \brief One-physics case, the code is solving the heat equation. */
437439
RUNTIME_ADJHEAT_SYS = 31, /*!< \brief One-physics case, the code is solving the adjoint heat equation. */
438440
RUNTIME_TRANS_SYS = 22, /*!< \brief One-physics case, the code is solving the turbulence model. */
441+
RUNTIME_RADIATION_SYS = 23, /*!< \brief One-physics case, the code is solving the radiation model. */
442+
RUNTIME_ADJRAD_SYS = 24, /*!< \brief One-physics case, the code is solving the adjoint radiation model. */
439443
};
440444

441445
const int FLOW_SOL = 0; /*!< \brief Position of the mean flow solution in the solver container array. */
@@ -447,6 +451,8 @@ const int ADJTURB_SOL = 3; /*!< \brief Position of the continuous adjoint turbu
447451
const int TRANS_SOL = 4; /*!< \brief Position of the transition model solution in the solver container array. */
448452
const int HEAT_SOL = 5; /*!< \brief Position of the heat equation in the solution solver array. */
449453
const int ADJHEAT_SOL = 6; /*!< \brief Position of the adjoint heat equation in the solution solver array. */
454+
const int RAD_SOL = 7; /*!< \brief Position of the radiation equation in the solution solver array. */
455+
const int ADJRAD_SOL = 8; /*!< \brief Position of the continuous adjoint turbulence solution in the solver container array. */
450456

451457
const int FEA_SOL = 0; /*!< \brief Position of the FEA equation in the solution solver array. */
452458
const int ADJFEA_SOL = 1; /*!< \brief Position of the FEA adjoint equation in the solution solver array. */
@@ -1154,6 +1160,30 @@ static const MapType<string, ENUM_DVFEA> DVFEA_Map = {
11541160
MakePair("ELECTRIC_FIELD", ELECTRIC_FIELD)
11551161
};
11561162

1163+
/*!
1164+
* \brief Kinds of radiation models
1165+
*/
1166+
enum ENUM_RADIATION {
1167+
NO_RADIATION = 0, /*!< \brief No radiation model */
1168+
P1_MODEL = 1 /*!< \brief P1 Radiation model. */
1169+
};
1170+
static const MapType<string, ENUM_RADIATION> Radiation_Map = {
1171+
MakePair("NONE", NO_RADIATION)
1172+
MakePair("P1", P1_MODEL)
1173+
};
1174+
1175+
/*!
1176+
* \brief Kinds of P1 initialization
1177+
*/
1178+
enum ENUM_P1_INIT {
1179+
P1_INIT_ZERO = 0, /*!< \brief Initialize the P1 model from zero values */
1180+
P1_INIT_TEMP = 1 /*!< \brief Initialize the P1 model from blackbody energy computed from the initial temperature. */
1181+
};
1182+
static const MapType<string, ENUM_P1_INIT> P1_Init_Map = {
1183+
MakePair("ZERO", P1_INIT_ZERO)
1184+
MakePair("TEMPERATURE_INIT", P1_INIT_TEMP)
1185+
};
1186+
11571187
/*!
11581188
* \brief Kinds of coupling methods at CHT interfaces.
11591189
* The first (temperature) part determines the BC method on the fluid side, the second (heatflux) part determines

0 commit comments

Comments
 (0)