Skip to content

Commit 510f2af

Browse files
authored
Merge pull request #2458 from emaberman/fix_sst_advance
Correct inconsistency regarding the density used in conservative scalar solver
2 parents b6b175c + a4a5270 commit 510f2af

File tree

9 files changed

+108
-109
lines changed

9 files changed

+108
-109
lines changed

SU2_CFD/include/solvers/CScalarSolver.inl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,6 @@ void CScalarSolver<VariableType>::PrepareImplicitIteration(CGeometry* geometry,
490490
template <class VariableType>
491491
void CScalarSolver<VariableType>::CompleteImplicitIteration(CGeometry* geometry, CSolver** solver_container,
492492
CConfig* config) {
493-
const bool compressible = (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE);
494-
495493
ComputeUnderRelaxationFactor(config);
496494

497495
/*--- Update solution (system written in terms of increments) ---*/
@@ -505,12 +503,13 @@ void CScalarSolver<VariableType>::CompleteImplicitIteration(CGeometry* geometry,
505503
SU2_OMP_FOR_STAT(omp_chunk_size)
506504
for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) {
507505
/*--- Multiply the Solution var with density to get the conservative transported quantity, if necessary. ---*/
506+
/* Note that for consistency with residual and jacobian calaulcations, use of current density for conservative variables
507+
* of the old solution is used. see pull request https://github.com/su2code/SU2/pull/2458*/
508508
const su2double density = flowNodes->GetDensity(iPoint);
509-
const su2double density_old = compressible ? flowNodes->GetSolution_Old(iPoint, 0) : density;
510-
509+
511510
for (unsigned short iVar = 0; iVar < nVar; iVar++) {
512511
nodes->AddClippedSolution(iPoint, iVar, nodes->GetUnderRelaxation(iPoint) * LinSysSol(iPoint, iVar),
513-
lowerlimit[iVar], upperlimit[iVar], density, density_old);
512+
lowerlimit[iVar], upperlimit[iVar], density, density);
514513
}
515514
}
516515
END_SU2_OMP_FOR

TestCases/hybrid_regression.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ def main():
165165
rae2822_sst.cfg_dir = "rans/rae2822"
166166
rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg"
167167
rae2822_sst.test_iter = 20
168-
rae2822_sst.test_vals = [-0.510371, 4.905635, 0.811981, 0.061600, 0.000000]
168+
rae2822_sst.test_vals = [-0.510349, 4.950289, 0.811983, 0.061600, 0.000000]
169169
test_list.append(rae2822_sst)
170170

171171
# RAE2822 SST_SUST
172172
rae2822_sst_sust = TestCase('rae2822_sst_sust')
173173
rae2822_sst_sust.cfg_dir = "rans/rae2822"
174174
rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg"
175175
rae2822_sst_sust.test_iter = 20
176-
rae2822_sst_sust.test_vals = [-2.569447, 4.905635, 0.811980, 0.061600]
176+
rae2822_sst_sust.test_vals = [-2.678140, 4.950289, 0.811983, 0.061600]
177177
test_list.append(rae2822_sst_sust)
178178

179179
# Flat plate
@@ -206,23 +206,23 @@ def main():
206206
turb_naca0012_sst.cfg_dir = "rans/naca0012"
207207
turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg"
208208
turb_naca0012_sst.test_iter = 10
209-
turb_naca0012_sst.test_vals = [-12.232701, -14.434762, -6.411172, 1.047444, 0.019214, -1.652128, 0]
209+
turb_naca0012_sst.test_vals = [-12.232646, -14.434809, -6.037672, 1.047444, 0.019214, -1.652532, 0.000000]
210210
test_list.append(turb_naca0012_sst)
211211

212212
# NACA0012 (SST_SUST, FUN3D finest grid results: CL=1.0840, CD=0.01253)
213213
turb_naca0012_sst_sust = TestCase('turb_naca0012_sst_sust')
214214
turb_naca0012_sst_sust.cfg_dir = "rans/naca0012"
215215
turb_naca0012_sst_sust.cfg_file = "turb_NACA0012_sst_sust.cfg"
216216
turb_naca0012_sst_sust.test_iter = 10
217-
turb_naca0012_sst_sust.test_vals = [-12.152274, -14.781420, -6.725224, 1.000270, 0.019123, -1.417716]
217+
turb_naca0012_sst_sust.test_vals = [-12.152294, -14.781143, -6.357944, 1.000270, 0.019123, -1.417707]
218218
test_list.append(turb_naca0012_sst_sust)
219219

220220
# NACA0012 (SST, fixed values for turbulence quantities)
221221
turb_naca0012_sst_fixedvalues = TestCase('turb_naca0012_sst_fixedvalues')
222222
turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012"
223223
turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg"
224224
turb_naca0012_sst_fixedvalues.test_iter = 10
225-
turb_naca0012_sst_fixedvalues.test_vals = [-5.192403, -10.256922, -1.568131, 1.022561, 0.040530, -2.382766]
225+
turb_naca0012_sst_fixedvalues.test_vals = [-5.192404, -10.250818, -1.560208, 1.022562, 0.040530, -2.382731]
226226
test_list.append(turb_naca0012_sst_fixedvalues)
227227

228228
# NACA0012 (SST, explicit Euler for flow and turbulence equations)
@@ -250,7 +250,7 @@ def main():
250250
axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle"
251251
axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg"
252252
axi_rans_air_nozzle_restart.test_iter = 10
253-
axi_rans_air_nozzle_restart.test_vals = [-12.065478, -6.838586, -8.839400, -4.103176, 0]
253+
axi_rans_air_nozzle_restart.test_vals = [-12.065572, -6.837646, -8.883745, -3.822957, 0.000000]
254254
test_list.append(axi_rans_air_nozzle_restart)
255255

256256
#################################
@@ -275,7 +275,7 @@ def main():
275275
turb_naca0012_1c.cfg_dir = "rans_uq/naca0012"
276276
turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg"
277277
turb_naca0012_1c.test_iter = 10
278-
turb_naca0012_1c.test_vals = [-4.976353, 1.141375, 0.243102, -0.112154]
278+
turb_naca0012_1c.test_vals = [-4.976639, 1.141468, 0.243064, -0.112166]
279279
turb_naca0012_1c.test_vals_aarch64 = [-4.981105, 1.138873, 0.248013, -0.117248]
280280
test_list.append(turb_naca0012_1c)
281281

@@ -284,7 +284,7 @@ def main():
284284
turb_naca0012_2c.cfg_dir = "rans_uq/naca0012"
285285
turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg"
286286
turb_naca0012_2c.test_iter = 10
287-
turb_naca0012_2c.test_vals = [-5.485942, 0.968057, 0.233600, -0.114502]
287+
turb_naca0012_2c.test_vals = [-5.486005, 0.968502, 0.233564, -0.114514]
288288
turb_naca0012_2c.test_vals_aarch64 = [-5.483345, 0.968720, 0.214914, -0.124932]
289289
test_list.append(turb_naca0012_2c)
290290

@@ -293,7 +293,7 @@ def main():
293293
turb_naca0012_3c.cfg_dir = "rans_uq/naca0012"
294294
turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg"
295295
turb_naca0012_3c.test_iter = 10
296-
turb_naca0012_3c.test_vals = [-5.584306, 0.931465, 0.223394, -0.116130]
296+
turb_naca0012_3c.test_vals = [-5.584366, 0.931883, 0.223356, -0.116142]
297297
turb_naca0012_3c.test_vals_aarch64 = [-5.584300, 0.931293, 0.207447, -0.125691]
298298
test_list.append(turb_naca0012_3c)
299299

@@ -302,7 +302,7 @@ def main():
302302
turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012"
303303
turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg"
304304
turb_naca0012_p1c1.test_iter = 10
305-
turb_naca0012_p1c1.test_vals = [-5.114258, 1.076587, 0.224375, -0.118856]
305+
turb_naca0012_p1c1.test_vals = [-5.114311, 1.076961, 0.224322, -0.118874]
306306
turb_naca0012_p1c1.test_vals_aarch64 = [-5.132358, 1.075658, 0.337268, -0.082827]
307307
test_list.append(turb_naca0012_p1c1)
308308

@@ -311,7 +311,7 @@ def main():
311311
turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012"
312312
turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg"
313313
turb_naca0012_p1c2.test_iter = 10
314-
turb_naca0012_p1c2.test_vals = [-5.548775, 0.945962, 0.211150, -0.121291]
314+
turb_naca0012_p1c2.test_vals = [-5.548834, 0.946383, 0.211109, -0.121304]
315315
turb_naca0012_p1c2.test_vals_aarch64 = [-5.548775, 0.945962, 0.211150, -0.121291]
316316
test_list.append(turb_naca0012_p1c2)
317317

@@ -452,7 +452,7 @@ def main():
452452
square_cylinder.cfg_dir = "unsteady/square_cylinder"
453453
square_cylinder.cfg_file = "turb_square.cfg"
454454
square_cylinder.test_iter = 3
455-
square_cylinder.test_vals = [-2.560839, -1.176729, 0.061954, 1.399401, 2.220361, 1.399349, 2.218600, 0.000000]
455+
square_cylinder.test_vals = [-2.560838, -1.175929, 0.062081, 1.399401, 2.220361, 1.399349, 2.218600, 0.000000]
456456
square_cylinder.test_vals_aarch64 = [-2.557902, -1.173574, 0.058050, 1.399794, 2.220402, 1.399748, 2.218604, 0]
457457
square_cylinder.unsteady = True
458458
test_list.append(square_cylinder)
@@ -556,15 +556,15 @@ def main():
556556
Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger"
557557
Jones_tc_restart.cfg_file = "Jones_restart.cfg"
558558
Jones_tc_restart.test_iter = 5
559-
Jones_tc_restart.test_vals = [-7.286677, -5.327018, -14.895652, -9.330534, -12.071733, -6.548623, 73291.000000, 73291.000000, 0.020111, 82.896000]
559+
Jones_tc_restart.test_vals = [-7.308010, -5.332065, -14.895822, -9.330703, -12.071733, -6.548623, 73291.000000, 73291.000000, 0.020111, 82.896000]
560560
test_list.append(Jones_tc_restart)
561561

562562
# 2D axial stage
563563
axial_stage2D = TestCase('axial_stage2D')
564564
axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D"
565565
axial_stage2D.cfg_file = "Axial_stage2D.cfg"
566566
axial_stage2D.test_iter = 20
567-
axial_stage2D.test_vals = [1.108159, 1.561741, -2.895046, 2.607615, -2.479708, 3.063739, 106380.000000, 106380.000000, 5.733600, 64.747000]
567+
axial_stage2D.test_vals = [1.090053, 1.550934, -2.895064, 2.607596, -2.479704, 3.063740, 106380.000000, 106380.000000, 5.733600, 64.747000]
568568
axial_stage2D.test_vals_aarch64 = [0.983739, 1.534333, -2.888521, 2.606770, -2.418339, 3.087275, 106380, 106380, 5.7325, 64.711]
569569
test_list.append(axial_stage2D)
570570

@@ -573,7 +573,7 @@ def main():
573573
transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D"
574574
transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg"
575575
transonic_stator_restart.test_iter = 20
576-
transonic_stator_restart.test_vals = [-4.357748, -2.480402, -2.075152, 1.737469, -1.440919, 2.727299, -471620.000000, 94.840000, -0.054603]
576+
transonic_stator_restart.test_vals = [-4.357591, -2.480153, -2.075008, 1.737627, -1.441579, 3.240658, -471620.000000, 94.840000, -0.054589]
577577
transonic_stator_restart.test_vals_aarch64 = [-4.357748, -2.480402, -2.075152, 1.737469, -1.440919, 2.727299, -471620.000000, 94.840000, -0.054603]
578578
test_list.append(transonic_stator_restart)
579579

@@ -657,7 +657,7 @@ def main():
657657
bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D"
658658
bars_SST_2D.cfg_file = "bars.cfg"
659659
bars_SST_2D.test_iter = 13
660-
bars_SST_2D.test_vals = [13.000000, 0.268825, -1.700012]
660+
bars_SST_2D.test_vals = [13.000000, 1.167903, -1.660901]
661661
bars_SST_2D.multizone = True
662662
test_list.append(bars_SST_2D)
663663

TestCases/hybrid_regression_AD.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def main():
8686
discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012"
8787
discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg"
8888
discadj_rans_naca0012_sst.test_iter = 10
89-
discadj_rans_naca0012_sst.test_vals = [-2.237494, -0.200182, 2.762600, -0.039607]
89+
discadj_rans_naca0012_sst.test_vals = [-2.237413, -0.200125, 2.763200, -0.039612]
9090
test_list.append(discadj_rans_naca0012_sst)
9191

9292
#######################################
@@ -199,7 +199,7 @@ def main():
199199
discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D"
200200
discadj_trans_stator.cfg_file = "transonic_stator.cfg"
201201
discadj_trans_stator.test_iter = 79
202-
discadj_trans_stator.test_vals = [79.000000, 0.770094, 0.383191, 0.472139, -0.996477, 2.153270, -4.444323]
202+
discadj_trans_stator.test_vals = [79.000000, 0.770295, 0.383672, 0.472433, -0.996122, 2.153513, -4.444080]
203203
discadj_trans_stator.test_vals_aarch64 = [79, 0.769987, 0.383135, 0.472391, -0.996504, 2.153296, -4.444301]
204204
discadj_trans_stator.enabled_with_tsan = False
205205
test_list.append(discadj_trans_stator)

0 commit comments

Comments
 (0)