From 656fa954259ea2d26123cfaa4786eff81e79d90e Mon Sep 17 00:00:00 2001 From: Clark Pederson Date: Thu, 18 Apr 2019 14:04:20 -0500 Subject: [PATCH 1/6] Add missing term to strain magnitude for 2D When summing over the diagonal components of the deviatoric rate-of-strain tensor, only the first two diagonal components are summed in 2D. This creates problems, because the third component is *not* zero. The third component of the rate-of-strain tensor in a 2D is zero (i.e. S_33 = 0). But the deviatoric rate-of-strain tensor has a nonzero third diagonal component. So in 2D, the third diagonal component must be explicitly added. This should only make significant impacts on problems where the divergence of velocity is non-negligible when compared to the diagonal components of the rate-of-strain tensor. --- SU2_CFD/src/variable_direct_mean.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SU2_CFD/src/variable_direct_mean.cpp b/SU2_CFD/src/variable_direct_mean.cpp index dff237bdedc0..24b431847239 100644 --- a/SU2_CFD/src/variable_direct_mean.cpp +++ b/SU2_CFD/src/variable_direct_mean.cpp @@ -599,6 +599,9 @@ bool CNSVariable::SetStrainMag(void) { for (iDim = 0; iDim < nDim; iDim++) { StrainMag += pow(Gradient_Primitive[iDim+1][iDim] - 1.0/3.0*Div, 2.0); } + if (nDim == 2) { + StrainMag += pow(1.0/3.0*Div, 2.0); + } /*--- Add off diagonals ---*/ From ac962229a682559e0c37601f0f0604d123dc0e9c Mon Sep 17 00:00:00 2001 From: Clark Pederson Date: Tue, 23 Apr 2019 14:11:05 -0500 Subject: [PATCH 2/6] Add correction for 2D StrainMag to incomp. --- SU2_CFD/src/variable_direct_mean_inc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SU2_CFD/src/variable_direct_mean_inc.cpp b/SU2_CFD/src/variable_direct_mean_inc.cpp index caebe36c721d..3fad8aa8c54f 100644 --- a/SU2_CFD/src/variable_direct_mean_inc.cpp +++ b/SU2_CFD/src/variable_direct_mean_inc.cpp @@ -464,6 +464,9 @@ bool CIncNSVariable::SetStrainMag(void) { for (iDim = 0; iDim < nDim; iDim++) { StrainMag += pow(Gradient_Primitive[iDim+1][iDim] - 1.0/3.0*Div, 2.0); } + if (nDim == 2) { + StrainMag += pow(1.0/3.0*Div, 2.0); + } /*--- Add off diagonals ---*/ From 879ce5675a4a7fe86064148f701c707be5ea68cd Mon Sep 17 00:00:00 2001 From: clarkpede Date: Mon, 10 Jun 2019 15:04:59 -0400 Subject: [PATCH 3/6] Update test values for new SST production Due to bugfix in how the strain magnitude is calculated, any tests involving SST have a slightly different production and slightly different test values. --- TestCases/parallel_regression.py | 22 +++++++++++----------- TestCases/parallel_regression_AD.py | 2 +- TestCases/serial_regression.py | 24 ++++++++++++------------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index f8571bb56b74..d3ba3ec5707a 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -264,7 +264,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-12.445737, -6.933165, 1.059622, 0.019138] #last 4 columns + turb_naca0012_sst.test_vals = [-12.454442, -6.574917, 1.059622, 0.019138] #last 4 columns turb_naca0012_sst.su2_exec = "parallel_computation.py -f" turb_naca0012_sst.timeout = 3200 turb_naca0012_sst.tol = 0.00001 @@ -606,7 +606,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.947155, 1.257866, 5.479018, 1.995741] #last 4 columns + turb_naca0012_1c.test_vals = [-4.947380, 1.257714, 5.477923, 1.995089] #last 4 columns turb_naca0012_1c.su2_exec = "parallel_computation.py -f" turb_naca0012_1c.timeout = 1600 turb_naca0012_1c.tol = 0.00001 @@ -617,7 +617,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.348048, 1.132075, 5.213292, 1.842312] #last 4 columns + turb_naca0012_2c.test_vals = [-5.348057, 1.132068, 5.213200, 1.842256] #last 4 columns turb_naca0012_2c.su2_exec = "parallel_computation.py -f" turb_naca0012_2c.timeout = 1600 turb_naca0012_2c.tol = 0.00001 @@ -639,7 +639,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.025714, 1.280518, 5.928580, 2.286016] #last 4 columns + turb_naca0012_p1c1.test_vals = [-5.025765, 1.280442, 5.928243, 2.285755] #last 4 columns turb_naca0012_p1c1.su2_exec = "parallel_computation.py -f" turb_naca0012_p1c1.timeout = 1600 turb_naca0012_p1c1.tol = 0.00001 @@ -650,7 +650,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.359023, 1.152958, 5.570020, 2.048439] #last 4 columns + turb_naca0012_p1c2.test_vals = [-5.359000, 1.152959, 5.569891, 2.048355] #last 4 columns turb_naca0012_p1c2.su2_exec = "parallel_computation.py -f" turb_naca0012_p1c2.timeout = 1600 turb_naca0012_p1c2.tol = 0.00001 @@ -717,7 +717,7 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-1.166470, 0.076791, 1.398549, 2.197049] #last 4 columns + square_cylinder.test_vals = [-1.164008, 0.077263, 1.398549, 2.197049] #last 4 columns square_cylinder.su2_exec = "parallel_computation.py -f" square_cylinder.timeout = 1600 square_cylinder.tol = 0.00001 @@ -817,7 +817,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [-1.789989, 5.695321, 73.361330, 0.904454] #last 4 columns + axial_stage2D.test_vals = [-1.790261, 5.696650, 73.362820, 0.904306] #last 4 columns axial_stage2D.su2_exec = "parallel_computation.py -f" axial_stage2D.timeout = 1600 axial_stage2D.tol = 0.00001 @@ -828,7 +828,7 @@ def main(): transonic_stator.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator.cfg_file = "transonic_stator.cfg" transonic_stator.test_iter = 20 - transonic_stator.test_vals = [-1.200053, 6.148389, 96.766110, 0.063114] #last 4 columns + transonic_stator.test_vals = [-1.198895, 6.148362, 96.766820, 0.063115] #last 4 columns transonic_stator.su2_exec = "parallel_computation.py -f" transonic_stator.timeout = 1600 transonic_stator.tol = 0.00001 @@ -926,7 +926,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [-2.135568, 1.642185, -0.000830, 0.117498] #last 4 columns + bars_SST_2D.test_vals = [-2.132032, 1.651883, -0.000830, 0.117497] #last 4 columns bars_SST_2D.su2_exec = "SU2_CFD" bars_SST_2D.timeout = 1600 bars_SST_2D.tol = 0.00001 @@ -1027,7 +1027,7 @@ def main(): pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" pywrapper_turb_naca0012_sst.test_iter = 10 - pywrapper_turb_naca0012_sst.test_vals = [-12.445737, -6.933165, 1.059622, 0.019138] #last 4 columns + pywrapper_turb_naca0012_sst.test_vals = [-12.454442, -6.574917, 1.059622, 0.019138] #last 4 columns pywrapper_turb_naca0012_sst.su2_exec = "mpirun -np 2 SU2_CFD.py --parallel -f" pywrapper_turb_naca0012_sst.timeout = 3200 pywrapper_turb_naca0012_sst.tol = 0.00001 @@ -1038,7 +1038,7 @@ def main(): pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" pywrapper_square_cylinder.cfg_file = "turb_square.cfg" pywrapper_square_cylinder.test_iter = 3 - pywrapper_square_cylinder.test_vals = [-1.166470, 0.076791, 1.398549, 2.197049] #last 4 columns + pywrapper_square_cylinder.test_vals = [-1.164008, 0.077263, 1.398549, 2.197049] #last 4 columns pywrapper_square_cylinder.su2_exec = "mpirun -np 2 SU2_CFD.py --parallel -f" pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 4be85b76ba62..c09bf75a78e3 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -208,7 +208,7 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [-1.923943, -2.119689, -0.510185, -20.818664] #last 4 columns + discadj_trans_stator.test_vals = [-1.923936, -2.119783, -0.510181, -20.818266] #last 4 columns discadj_trans_stator.su2_exec = "parallel_computation.py -f" discadj_trans_stator.timeout = 1600 discadj_trans_stator.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 3b04fe4c9674..2226c6ece832 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -207,7 +207,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-0.510826, 4.909714, 0.825023, 0.052675] #last 4 columns + rae2822_sst.test_vals = [-0.510826, 4.909241, 0.825023, 0.052675] #last 4 columns rae2822_sst.su2_exec = "SU2_CFD" rae2822_sst.timeout = 1600 rae2822_sst.tol = 0.00001 @@ -262,7 +262,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-12.445710, -6.918658, 1.059622, 0.019138] #last 4 columns + turb_naca0012_sst.test_vals = [-12.454420, -6.572026, 1.059622, 0.019138] #last 4 columns turb_naca0012_sst.su2_exec = "SU2_CFD" turb_naca0012_sst.timeout = 3200 turb_naca0012_sst.tol = 0.00001 @@ -604,7 +604,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.946255, 1.262038, 5.575706, 2.057785] #last 4 columns + turb_naca0012_1c.test_vals = [-4.946093, 1.262346, 5.578729, 2.059523] #last 4 columns turb_naca0012_1c.su2_exec = "SU2_CFD" turb_naca0012_1c.timeout = 1600 turb_naca0012_1c.tol = 0.00001 @@ -615,7 +615,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.343094, 1.137839, 5.337548, 1.919739] #last 4 columns + turb_naca0012_2c.test_vals = [-5.343130, 1.137800, 5.337441, 1.919677] #last 4 columns turb_naca0012_2c.su2_exec = "SU2_CFD" turb_naca0012_2c.timeout = 1600 turb_naca0012_2c.tol = 0.00001 @@ -637,7 +637,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.022106, 1.280795, 5.960837, 2.302647] #last 4 columns + turb_naca0012_p1c1.test_vals = [-5.021820, 1.281103, 5.960923, 2.302704] #last 4 columns turb_naca0012_p1c1.su2_exec = "SU2_CFD" turb_naca0012_p1c1.timeout = 1600 turb_naca0012_p1c1.tol = 0.00001 @@ -648,7 +648,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.357006, 1.154966, 5.635942, 2.088563] #last 4 columns + turb_naca0012_p1c2.test_vals = [-5.356937, 1.155037, 5.636379, 2.088827] #last 4 columns turb_naca0012_p1c2.su2_exec = "SU2_CFD" turb_naca0012_p1c2.timeout = 1600 turb_naca0012_p1c2.tol = 0.00001 @@ -715,7 +715,7 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-1.166421, 0.076804, 1.398548, 2.197047] #last 4 columns + square_cylinder.test_vals = [-1.163944, 0.077283, 1.398548, 2.197047] #last 4 columns square_cylinder.su2_exec = "SU2_CFD" square_cylinder.timeout = 1600 square_cylinder.tol = 0.00001 @@ -827,7 +827,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [-1.789990, 5.695319, 73.361330, 0.904458] #last 4 columns + axial_stage2D.test_vals = [-1.790262, 5.696645, 73.362820, 0.904310] #last 4 columns axial_stage2D.su2_exec = "SU2_CFD" axial_stage2D.timeout = 1600 axial_stage2D.tol = 0.00001 @@ -838,7 +838,7 @@ def main(): transonic_stator.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator.cfg_file = "transonic_stator.cfg" transonic_stator.test_iter = 20 - transonic_stator.test_vals = [-1.202869, 6.150690, 96.239500, 0.062740] #last 4 columns + transonic_stator.test_vals = [-1.201657, 6.150672, 96.239670, 0.062740] #last 4 columns transonic_stator.su2_exec = "SU2_CFD" transonic_stator.timeout = 1600 transonic_stator.tol = 0.00001 @@ -937,7 +937,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [-2.135568, 1.642185, -0.000830, 0.117498] #last 4 columns + bars_SST_2D.test_vals = [-2.132032, 1.651883, -0.000830, 0.117497] #last 4 columns bars_SST_2D.su2_exec = "SU2_CFD" bars_SST_2D.timeout = 1600 bars_SST_2D.tol = 0.00001 @@ -1416,7 +1416,7 @@ def main(): pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" pywrapper_turb_naca0012_sst.test_iter = 10 - pywrapper_turb_naca0012_sst.test_vals = [-12.445710, -6.918658, 1.059622, 0.019138] #last 4 columns + pywrapper_turb_naca0012_sst.test_vals = [-12.454420, -6.572026, 1.059622, 0.019138] #last 4 columns pywrapper_turb_naca0012_sst.su2_exec = "SU2_CFD.py -f" pywrapper_turb_naca0012_sst.timeout = 3200 pywrapper_turb_naca0012_sst.tol = 0.00001 @@ -1428,7 +1428,7 @@ def main(): pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" pywrapper_square_cylinder.cfg_file = "turb_square.cfg" pywrapper_square_cylinder.test_iter = 3 - pywrapper_square_cylinder.test_vals = [-1.166421, 0.076804, 1.398548, 2.197047] #last 4 columns + pywrapper_square_cylinder.test_vals = [-1.163944, 0.077283, 1.398548, 2.197047] #last 4 columns pywrapper_square_cylinder.su2_exec = "SU2_CFD.py -f" pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 From eb0a896396e4fd62398325944892cb3ea7b0d603 Mon Sep 17 00:00:00 2001 From: clarkpede Date: Tue, 11 Jun 2019 08:38:24 -0400 Subject: [PATCH 4/6] Update more SST regression test values See the previous commit for an explanation. --- TestCases/parallel_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index d3ba3ec5707a..adc687ea3ca3 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -209,7 +209,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-0.510806, 4.917085, 0.827700, 0.053330] #last 4 columns + rae2822_sst.test_vals = [-0.510806, 4.916635, 0.827705, 0.053331] #last 4 columns rae2822_sst.su2_exec = "parallel_computation.py -f" rae2822_sst.timeout = 1600 rae2822_sst.tol = 0.00001 From 486b0a9d88d76372d149c4c167c057e0800f0adc Mon Sep 17 00:00:00 2001 From: Clark Date: Fri, 12 Jul 2019 15:18:48 -0400 Subject: [PATCH 5/6] Update transonic stator test values These test values are being updated to match a bugfix in the magnitude of the deviatoric rate-of-strain tensor. --- TestCases/parallel_regression.py | 2 +- TestCases/serial_regression.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index adc687ea3ca3..3385c724c28e 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -839,7 +839,7 @@ def main(): transonic_stator_rst.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_rst.cfg_file = "transonic_stator_rst.cfg" transonic_stator_rst.test_iter = 20 - transonic_stator_rst.test_vals = [-8.277744, -3.005768, 5.285371, 0.003100] #last 4 columns + transonic_stator_rst.test_vals = [-8.248805, -2.976199, 5.285722, 0.003100] #last 4 columns transonic_stator_rst.su2_exec = "parallel_computation.py -f" transonic_stator_rst.timeout = 1600 transonic_stator_rst.tol = 0.00001 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 2226c6ece832..64ca2929dde4 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -849,7 +849,7 @@ def main(): transonic_stator_rst.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_rst.cfg_file = "transonic_stator_rst.cfg" transonic_stator_rst.test_iter = 20 - transonic_stator_rst.test_vals = [-8.277755, -3.005732, 5.285371, 0.003100] #last 4 columns + transonic_stator_rst.test_vals = [-8.248805, -2.976199, 5.285722, 0.003100] #last 4 columns transonic_stator_rst.su2_exec = "SU2_CFD" transonic_stator_rst.timeout = 1600 transonic_stator_rst.tol = 0.00001 From dcf48d6078bd31ecafe2edea1896b6ae9f8f8f80 Mon Sep 17 00:00:00 2001 From: Clark Date: Mon, 15 Jul 2019 15:57:34 -0400 Subject: [PATCH 6/6] Tweak test value for transonic stator case The previous test values of the transonic stator case were based on a 1-task MPI job (not a true serial code), so the actual test values are slighly different. This is part of the "fix production in 2D" series of bugfixes. --- TestCases/serial_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index b877d25a7b5c..ef3e0e8d2a75 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -849,7 +849,7 @@ def main(): transonic_stator_rst.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_rst.cfg_file = "transonic_stator_rst.cfg" transonic_stator_rst.test_iter = 20 - transonic_stator_rst.test_vals = [-8.248805, -2.976199, 5.285722, 0.003100] #last 4 columns + transonic_stator_rst.test_vals = [-8.248816, -2.976167, 5.285722, 0.003100] #last 4 columns transonic_stator_rst.su2_exec = "SU2_CFD" transonic_stator_rst.timeout = 1600 transonic_stator_rst.tol = 0.00001