Skip to content

Commit 3d8c1a6

Browse files
committed
fix adjoint test, simplify SingleZoneDriver logic
1 parent 9a767e5 commit 3d8c1a6

8 files changed

Lines changed: 21 additions & 78 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,6 @@ class CConfig {
11471147
unsigned long *VolumeOutputFrequencies; /*!< \brief list containing the writing frequencies */
11481148

11491149
bool Multizone_Mesh; /*!< \brief Determines if the mesh contains multiple zones. */
1150-
bool SinglezoneDriver = true; /*!< \brief Determines if the single-zone driver is used. (TEMPORARY) */
11511150
bool Wrt_ZoneConv; /*!< \brief Write the convergence history of each individual zone to screen. */
11521151
bool Wrt_ZoneHist; /*!< \brief Write the convergence history of each individual zone to file. */
11531152
bool SpecialOutput, /*!< \brief Determines if the special output is written. */
@@ -9325,12 +9324,6 @@ class CConfig {
93259324
*/
93269325
bool GetMultizone_Residual(void) const { return Multizone_Residual; }
93279326

9328-
/*!
9329-
* \brief Check if the (new) single-zone driver is to be used (temporary)
9330-
* \return YES if the (new) single-zone driver is to be used.
9331-
*/
9332-
bool GetSinglezone_Driver(void) const { return SinglezoneDriver; }
9333-
93349327
/*!
93359328
* \brief Get the Kind of Radiation model applied.
93369329
* \return Kind of radiation model used.

Common/src/CConfig.cpp

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2984,52 +2984,8 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){
29842984
newString.append(": invalid option name");
29852985
newString.append(". Check current SU2 options in config_template.cfg.");
29862986
newString.append("\n");
2987-
if (!option_name.compare("RELAXATION_FACTOR_ADJFLOW"))
2988-
newString.append("Option RELAXATION_FACTOR_ADJFLOW is now RELAXATION_FACTOR_ADJOINT, "
2989-
"and it also applies to discrete adjoint problems.\n\n");
2990-
else if (!option_name.compare("WRT_MESH_QUALITY"))
2991-
newString.append("WRT_MESH_QUALITY is deprecated. Use VOLUME_OUTPUT= (MESH_QUALITY, ...) instead.\n\n");
2992-
else if (!option_name.compare("VISUALIZE_SURFACE_DEF"))
2993-
newString.append("VISUALIZE_SURFACE_DEF is deprecated. Simply add a surface format to OUTPUT_FILES.\n\n");
2994-
else if (!option_name.compare("VISUALIZE_VOLUME_DEF"))
2995-
newString.append("VISUALIZE_VOLUME_DEF is deprecated. Simply add a volume format to OUTPUT_FILES.\n\n");
2996-
else if (!option_name.compare("WRT_BINARY_RESTART"))
2997-
newString.append("WRT_BINARY_RESTART is deprecated. The type of restart is determined from the OUTPUT_FILES list.\n\n");
2998-
else if (!option_name.compare("WRT_RESIDUALS"))
2999-
newString.append("WRT_RESIDUALS is deprecated. Use VOLUME_OUTPUT= ( RESIDUAL, ... ) instead.\n\n");
3000-
else if (!option_name.compare("WRT_LIMITERS"))
3001-
newString.append("WRT_LIMITERS is deprecated. Use VOLUME_OUTPUT= ( LIMITER, ... ) instead.\n\n");
3002-
else if (!option_name.compare("WRT_CON_FREQ"))
3003-
newString.append("WRT_CON_FREQ is deprecated. Use SCREEN_WRT_FREQ_INNER or SCREEN_WRT_FREQ_OUTER for multizone cases instead.\n\n");
3004-
else if (!option_name.compare("WRT_CON_FREQ_DUALTIME"))
3005-
newString.append("WRT_CON_FREQ_DUALTIME is deprecated. Use SCREEN_WRT_FREQ_TIME instead.\n\n");
3006-
else if (!option_name.compare("WRT_SRF_SOL"))
3007-
newString.append("WRT_SRF_SOL is deprecated. Simply add a surface format to OUTPUT_FILES.\n\n");
3008-
else if (!option_name.compare("WRT_CSV_SOL"))
3009-
newString.append("WRT_CSV_SOL is deprecated. Simply add a CSV format to OUTPUT_FILES.\n\n");
3010-
else if (!option_name.compare("WRT_SOL_FREQ"))
3011-
newString.append("WRT_SOL_FREQ is deprecated. Use OUTPUT_WRT_FREQ instead.\n\n");
3012-
else if (!option_name.compare("WRT_SOL_FREQ_DUALTIME"))
3013-
newString.append("WRT_SOL_FREQ_DUALTIME is deprecated. Use OUTPUT_WRT_FREQ instead.\n\n");
3014-
else if (!option_name.compare("UNST_RESTART_ITER"))
3015-
newString.append("UNST_RESTART_ITER is deprecated. Use RESTART_ITER instead.\n\n");
3016-
else if (!option_name.compare("DYN_RESTART_ITER"))
3017-
newString.append("DYN_RESTART_ITER is deprecated. Use RESTART_ITER instead.\n\n");
3018-
else if (!option_name.compare("CONV_CRITERIA"))
3019-
newString.append("CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n"
3020-
"RESIDUAL for any RMS_* BGS_* value. CAUCHY for coefficients like DRAG etc.\n\n");
3021-
else if (!option_name.compare("THERMAL_DIFFUSIVITY"))
3022-
newString.append("THERMAL_DIFFUSIVITY is deprecated. See the INC_ENERGY_EQUATION options instead.\n\n");
3023-
else if (!option_name.compare("THERMAL_DIFFUSIVITY_SOLID"))
3024-
newString.append("THERMAL_DIFFUSIVITY_SOLID is deprecated. Set THERMAL_CONDUCTIVITY_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n");
3025-
else if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY"))
3026-
newString.append("SOLID_THERMAL_CONDUCTIVITY is deprecated. Use THERMAL_CONDUCTIVITY_CONSTANT instead.\n\n");
3027-
else if (!option_name.compare("SOLID_DENSITY"))
3028-
newString.append("SOLID_DENSITY is deprecated. Use MATERIAL_DENSITY instead.\n\n");
3029-
else if (!option_name.compare("SOLID_TEMPERATURE_INIT"))
3030-
newString.append("SOLID_TEMPERATURE_INIT is deprecated. Use FREESTREAM_TEMPERATURE instead.\n\n");
3031-
else if (!option_name.compare("SA_QCR"))
3032-
newString.append("SA_QCR is deprecated. Use SA_OPTIONS=QCR2000 instead.\n\n");
2987+
if (!option_name.compare("SINGLEZONE_DRIVER"))
2988+
newString.append("Option SINGLEZONE_DRIVER is deprecated, it does not have a replacement.\n\n");
30332989
else {
30342990
/*--- Find the most likely candidate for the unrecognized option, based on the length
30352991
of start and end character sequences shared by candidates and the option. ---*/
@@ -3296,8 +3252,6 @@ void CConfig::SetnZone(){
32963252
SU2_MPI::Error("Number of markers in MARKER_ZONE_INTERFACE must be a multiple of 2", CURRENT_FUNCTION);
32973253
}
32983254

3299-
SinglezoneDriver = NO;
3300-
33013255
if (Multizone_Mesh){
33023256

33033257
/*--- Get the number of zones from the mesh file --- */

SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ void CDiscAdjFluidIteration::InitializeAdjoint(CSolver***** solver, CGeometry***
469469
solver[iZone][iInst][MESH_0][ADJRAD_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]);
470470
}
471471

472-
if (config[iZone]->GetFluidProblem() && config[iZone]->GetSinglezone_Driver()) {
472+
if (config[iZone]->GetFluidProblem() && !config[iZone]->GetMultizone_Problem()) {
473473
solver[iZone][iInst][MESH_0][FLOW_SOL]->SetVertexTractionsAdjoint(geometry[iZone][iInst][MESH_0], config[iZone]);
474474
}
475475

@@ -601,7 +601,7 @@ void CDiscAdjFluidIteration::RegisterOutput(CSolver***** solver, CGeometry**** g
601601
if (config[iZone]->AddRadiation()) {
602602
solver[iZone][iInst][MESH_0][ADJRAD_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]);
603603
}
604-
if (config[iZone]->GetFluidProblem() && config[iZone]->GetSinglezone_Driver()) {
604+
if (config[iZone]->GetFluidProblem() && !config[iZone]->GetMultizone_Problem()) {
605605
solver[iZone][iInst][MESH_0][FLOW_SOL]->RegisterVertexTractions(geometry[iZone][iInst][MESH_0], config[iZone]);
606606
}
607607

SU2_CFD/src/iteration/CFEAIteration.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,9 @@ bool CFEAIteration::Monitor(COutput* output, CIntegration**** integration, CGeom
240240

241241
UsedTime = StopTime - StartTime;
242242

243-
if (config[val_iZone]->GetMultizone_Problem() || config[val_iZone]->GetSinglezone_Driver()) {
244-
output->SetHistoryOutput(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0],
245-
config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(),
246-
config[val_iZone]->GetInnerIter());
247-
}
243+
output->SetHistoryOutput(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0],
244+
config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(),
245+
config[val_iZone]->GetInnerIter());
248246

249247
return output->GetConvergence();
250248
}

SU2_CFD/src/iteration/CFluidIteration.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,9 @@ bool CFluidIteration::Monitor(COutput* output, CIntegration**** integration, CGe
213213

214214
UsedTime = StopTime - StartTime;
215215

216-
if (config[val_iZone]->GetMultizone_Problem() || config[val_iZone]->GetSinglezone_Driver()) {
217-
output->SetHistoryOutput(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0],
218-
config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(),
219-
config[val_iZone]->GetInnerIter());
220-
}
216+
output->SetHistoryOutput(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0],
217+
config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(),
218+
config[val_iZone]->GetInnerIter());
221219

222220
/*--- If convergence was reached --*/
223221
StopCalc = output->GetConvergence();
@@ -238,7 +236,7 @@ void CFluidIteration::Postprocess(COutput* output, CIntegration**** integration,
238236
CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) {
239237

240238
/*--- Temporary: enable only for single-zone driver. This should be removed eventually when generalized. ---*/
241-
if (config[val_iZone]->GetSinglezone_Driver()) {
239+
if (!config[val_iZone]->GetMultizone_Problem()) {
242240

243241
/*--- Compute the tractions at the vertices ---*/
244242
solver[val_iZone][val_iInst][MESH_0][FLOW_SOL]->ComputeVertexTractions(geometry[val_iZone][val_iInst][MESH_0],

TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ KIND_TURB_MODEL= SST
1717
MATH_PROBLEM= DISCRETE_ADJOINT
1818
RESTART_SOL= NO
1919
NZONES= 1
20-
%SINGLEZONE_DRIVER=NO
2120

2221
% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%
2322
%
@@ -87,6 +86,7 @@ AVERAGE_MACH_LIMIT= 0.03
8786
%
8887
MARKER_PLOTTING= (airfoil)
8988
MARKER_MONITORING= (airfoil)
89+
MARKER_ANALYZE= (outflow, inflow)
9090

9191
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%
9292
%
@@ -152,13 +152,13 @@ FFD_CONTINUITY= 2ND_DERIVATIVE
152152
%
153153
DEFINITION_DV= ( 19, 1.0 | airfoil | MAIN_BOX, 0, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 1, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 2, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 3, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 4, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 0, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 1, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 2, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 3, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 4, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 0, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 1, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 2, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 3, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 4, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 0, 3, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 1, 3, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 2, 3, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 3, 3, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 4, 3, 0.0, 0.0 )
154154
OPT_CONSTRAINT= ( FLOW_ANGLE_OUT < -74.0 ) * 0.001
155-
OPT_OBJECTIVE= ENTROPY_GENERATION* 0.0001
155+
OPT_OBJECTIVE= SURFACE_PRESSURE_DROP* 0.0001
156156
OPT_ITERATIONS= 19
157157
OPT_ACCURACY= 1E-10
158158

159159
% --------------------- OBJECTIVE FUNCTION DEFINITION -----------------------%
160160
%
161-
OBJECTIVE_FUNCTION= ENTROPY_GENERATION
161+
OBJECTIVE_FUNCTION= SURFACE_PRESSURE_DROP
162162

163163
% --------------------------- CONVERGENCE PARAMETERS --------------------------%
164164
%

TestCases/hybrid_regression.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -539,25 +539,25 @@ def main():
539539
Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger"
540540
Jones_tc_restart.cfg_file = "Jones_restart.cfg"
541541
Jones_tc_restart.test_iter = 5
542-
Jones_tc_restart.test_vals = [-6.986563, -3.096834, -14.849532, -9.102914, -11.787851, -6.266208, 7.3266e+04, 7.3266e+04]
542+
Jones_tc_restart.test_vals = [-6.986581, -3.096834, -14.849548, -9.102930, -11.787851, -6.266207, 73266, 73266]
543543
test_list.append(Jones_tc_restart)
544544

545545
# 2D axial stage
546546
axial_stage2D = TestCase('axial_stage2D')
547547
axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D"
548548
axial_stage2D.cfg_file = "Axial_stage2D.cfg"
549549
axial_stage2D.test_iter = 20
550-
axial_stage2D.test_vals = [1.047323, 1.661341, -2.913940, 2.588179, -2.486770, 3.050954, 1.0638e+05, 1.0638e+05]
551-
axial_stage2D.test_vals_aarch64 = [1.047323, 1.661341, -2.913940, 2.588179, -2.486770, 3.050954, 1.0638e+05, 1.0638e+05]
550+
axial_stage2D.test_vals = [1.047244, 1.661126, -2.914064, 2.588061, -2.486924, 3.050785, 106380, 106380]
551+
axial_stage2D.test_vals_aarch64 = [1.047244, 1.661126, -2.914064, 2.588061, -2.486924, 3.050785, 106380, 106380]
552552
test_list.append(axial_stage2D)
553553

554554
# 2D transonic stator restart
555555
transonic_stator_restart = TestCase('transonic_stator_restart')
556556
transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D"
557557
transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg"
558558
transonic_stator_restart.test_iter = 20
559-
transonic_stator_restart.test_vals = [-7.534574, -6.838075, -6.618228, -1.567726, -6.767343, -0.738638, -4.7165e+05]
560-
transonic_stator_restart.test_vals_aarch64 = [-7.534574, -6.838075, -6.618228, -1.567726, -6.767343, -0.738638, -4.7165e+05]
559+
transonic_stator_restart.test_vals = [-7.542642, -6.840866, -6.669194, -1.578593, -6.793009, -0.742574, -471650]
560+
transonic_stator_restart.test_vals_aarch64 = [-7.542642, -6.840866, -6.669194, -1.578593, -6.793009, -0.742574, -471650]
561561
test_list.append(transonic_stator_restart)
562562

563563
######################################

TestCases/parallel_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,15 +992,15 @@ def main():
992992
axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D"
993993
axial_stage2D.cfg_file = "Axial_stage2D.cfg"
994994
axial_stage2D.test_iter = 20
995-
axial_stage2D.test_vals = [1.047323, 1.661341, -2.913940, 2.588179, -2.486770, 3.050954, 1.0638e+05, 1.0638e+05]
995+
axial_stage2D.test_vals = [1.047301, 1.661328, -2.913923, 2.588194, -2.486769, 3.050953, 106380, 106380]
996996
test_list.append(axial_stage2D)
997997

998998
# 2D transonic stator restart
999999
transonic_stator_restart = TestCase('transonic_stator_restart')
10001000
transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D"
10011001
transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg"
10021002
transonic_stator_restart.test_iter = 20
1003-
transonic_stator_restart.test_vals = [-7.534574, -6.838075, -6.618228, -1.567726, -6.767343, -0.738638, -4.7165e+05]
1003+
transonic_stator_restart.test_vals = [-7.544516, -6.822541, -6.689799, -1.581068, -6.798361, -0.746758, -471650]
10041004
test_list.append(transonic_stator_restart)
10051005

10061006
######################################

0 commit comments

Comments
 (0)