Skip to content

Commit f3ce25f

Browse files
Merge branch 'develop' into fix/probe-performance-clean
2 parents 8713ad1 + 02b07fb commit f3ce25f

12 files changed

Lines changed: 47 additions & 59 deletions

File tree

SU2_CFD/include/fluid/CIncIdealGas.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CIncIdealGas final : public CFluidModel {
3939
/*!
4040
* \brief Constructor of the class.
4141
*/
42-
CIncIdealGas(su2double val_Cp, su2double val_gas_constant, su2double val_operating_pressure, su2double val_Temperature_Ref) {
42+
CIncIdealGas(su2double val_Cp, su2double val_gas_constant, su2double val_operating_pressure, su2double val_Std_Ref_Temp_ND) {
4343
/*--- In the incompressible ideal gas model, the thermodynamic pressure
4444
is decoupled from the governing equations and held constant. The
4545
density is therefore only a function of temperature variations. ---*/
@@ -48,7 +48,7 @@ class CIncIdealGas final : public CFluidModel {
4848
Gamma = 1.0;
4949
Cp = val_Cp;
5050
Cv = Cp;
51-
Std_Ref_Temp_ND = STD_REF_TEMP / val_Temperature_Ref;
51+
Std_Ref_Temp_ND = val_Std_Ref_Temp_ND;
5252
}
5353

5454
/*!

SU2_CFD/src/solvers/CIncEulerSolver.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i
297297

298298
config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT/(config->GetMolecular_Weight()/1000.0));
299299
Pressure_Thermodynamic = Density_FreeStream*Temperature_FreeStream*config->GetGas_Constant();
300-
auxFluidModel = new CIncIdealGas(config->GetSpecific_Heat_Cp(), config->GetGas_Constant(), Pressure_Thermodynamic, Temperature_FreeStream);
300+
auxFluidModel = new CIncIdealGas(config->GetSpecific_Heat_Cp(), config->GetGas_Constant(), Pressure_Thermodynamic, STD_REF_TEMP);
301301
auxFluidModel->SetTDState_T(Temperature_FreeStream);
302302
Pressure_Thermodynamic = auxFluidModel->GetPressure();
303303
config->SetPressure_Thermodynamic(Pressure_Thermodynamic);
@@ -307,7 +307,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i
307307

308308
config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT/(config->GetMolecular_Weight()/1000.0));
309309
Pressure_Thermodynamic = Density_FreeStream*Temperature_FreeStream*config->GetGas_Constant();
310-
auxFluidModel = new CIncIdealGasPolynomial<N_POLY_COEFFS>(config->GetGas_Constant(), Pressure_Thermodynamic, Temperature_FreeStream);
310+
auxFluidModel = new CIncIdealGasPolynomial<N_POLY_COEFFS>(config->GetGas_Constant(), Pressure_Thermodynamic, STD_REF_TEMP);
311311
if (viscous) {
312312
/*--- Variable Cp model via polynomial. ---*/
313313
for (iVar = 0; iVar < config->GetnPolyCoeffs(); iVar++)
@@ -383,10 +383,10 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i
383383
Pressure_Ref = 1.0;
384384
}
385385
else if (config->GetRef_Inc_NonDim() == INITIAL_VALUES) {
386-
Density_Ref = Density_FreeStream;
387-
Velocity_Ref = ModVel_FreeStream;
388-
Temperature_Ref = Temperature_FreeStream;
389-
Pressure_Ref = Density_Ref*Velocity_Ref*Velocity_Ref;
386+
Density_Ref = Density_FreeStream;
387+
Velocity_Ref = ModVel_FreeStream;
388+
Temperature_Ref = Temperature_FreeStream;
389+
Pressure_Ref = Density_Ref*Velocity_Ref*Velocity_Ref;
390390
}
391391
else if (config->GetRef_Inc_NonDim() == REFERENCE_VALUES) {
392392
Density_Ref = config->GetInc_Density_Ref();
@@ -484,7 +484,7 @@ Pressure_Ref = Density_Ref*Velocity_Ref*Velocity_Ref;
484484
break;
485485

486486
case INC_IDEAL_GAS:
487-
fluidModel = new CIncIdealGas(Specific_Heat_CpND, Gas_ConstantND, Pressure_ThermodynamicND, Temperature_FreeStreamND);
487+
fluidModel = new CIncIdealGas(Specific_Heat_CpND, Gas_ConstantND, Pressure_ThermodynamicND, STD_REF_TEMP / config->GetTemperature_Ref());
488488
fluidModel->SetTDState_T(Temperature_FreeStreamND);
489489
break;
490490

TestCases/hybrid_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def main():
375375
inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity"
376376
inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg"
377377
inc_buoyancy.test_iter = 20
378-
inc_buoyancy.test_vals = [-3.860443, -3.122399, 4.074529, -23.413000]
378+
inc_buoyancy.test_vals = [-3.860465, -3.122402, 1.322722, -23.413000]
379379
test_list.append(inc_buoyancy)
380380

381381
# Laminar heated cylinder with polynomial fluid model
@@ -665,8 +665,8 @@ def main():
665665
slinc_steady.cfg_dir = "sliding_interface/incompressible_steady"
666666
slinc_steady.cfg_file = "config.cfg"
667667
slinc_steady.test_iter = 19
668-
slinc_steady.test_vals = [19.000000, -1.048972, -1.324971]
669-
slinc_steady.test_vals_aarch64 = [19.000000, -1.048972, -1.324971]
668+
slinc_steady.test_vals = [19.000000, -1.154874, -1.378120]
669+
slinc_steady.test_vals_aarch64 = [19.000000, -1.154874, -1.378120]
670670
slinc_steady.multizone = True
671671
test_list.append(slinc_steady)
672672

TestCases/parallel_regression.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def main():
628628
inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity"
629629
inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg"
630630
inc_buoyancy.test_iter = 20
631-
inc_buoyancy.test_vals = [-3.860462, -3.122401, 4.074510, -23.414000]
631+
inc_buoyancy.test_vals = [-3.860462, -3.122401, 1.322722, -23.414000]
632632
test_list.append(inc_buoyancy)
633633

634634
# Laminar heated cylinder with polynomial fluid model
@@ -1234,7 +1234,7 @@ def main():
12341234
slinc_steady.cfg_dir = "sliding_interface/incompressible_steady"
12351235
slinc_steady.cfg_file = "config.cfg"
12361236
slinc_steady.test_iter = 19
1237-
slinc_steady.test_vals = [19.000000, -1.013427, -1.222965]
1237+
slinc_steady.test_vals = [19.000000, -1.131557, -1.370471]
12381238
slinc_steady.timeout = 100
12391239
slinc_steady.tol = 0.00002
12401240
slinc_steady.multizone = True
@@ -1361,7 +1361,7 @@ def main():
13611361
p1rad.cfg_dir = "radiation/p1model"
13621362
p1rad.cfg_file = "configp1.cfg"
13631363
p1rad.test_iter = 50
1364-
p1rad.test_vals = [-7.700974, -7.734765, -2.061661, 0.382811, -57.861000]
1364+
p1rad.test_vals = [-8.197112, -7.856394, -2.380743, 0.381122, -57.186000]
13651365
test_list.append(p1rad)
13661366

13671367

@@ -1529,8 +1529,8 @@ def main():
15291529
pywrapper_buoyancy.cfg_dir = "py_wrapper/custom_source_buoyancy"
15301530
pywrapper_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg"
15311531
pywrapper_buoyancy.test_iter = 0
1532-
pywrapper_buoyancy.test_vals = [-13.314107, -13.764877, -13.136439, -5.379183]
1533-
pywrapper_buoyancy.test_vals_aarch64 = [-17.746018, -17.460693, -17.430708, -12.260624]
1532+
pywrapper_buoyancy.test_vals = [-13.227985, -13.678478, -13.050758, -7.777151]
1533+
pywrapper_buoyancy.test_vals_aarch64 = [-13.227985, -13.678478, -13.050758, -7.777151]
15341534
pywrapper_buoyancy.command = TestCase.Command("mpirun -np 2", "python", "run.py")
15351535
test_list.append(pywrapper_buoyancy)
15361536

@@ -1539,7 +1539,7 @@ def main():
15391539
pywrapper_zimont.cfg_dir = "py_wrapper/turbulent_premixed_psi"
15401540
pywrapper_zimont.cfg_file = "psi.cfg"
15411541
pywrapper_zimont.test_iter = 0
1542-
pywrapper_zimont.test_vals = [-9.317943, -0.377235, -1.091632, -0.502950, 2.968250, -1.242417]
1542+
pywrapper_zimont.test_vals = [-3.415653, -2.221781, -3.107330, -2.569248, 0.531838, -3.796447]
15431543
pywrapper_zimont.command = TestCase.Command("mpirun -np 2", "python", "run.py")
15441544
test_list.append(pywrapper_zimont)
15451545

TestCases/parallel_regression_AD.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def main():
290290
discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d"
291291
discadj_cht.cfg_file = "cht_2d_3cylinders.cfg"
292292
discadj_cht.test_iter = 10
293-
discadj_cht.test_vals = [-6.111499, -2.668835, -2.669557, -2.669594]
293+
discadj_cht.test_vals = [-6.308199, -3.086021, -3.086022, -3.086022]
294294
test_list.append(discadj_cht)
295295

296296
# 2D DA cht streamwise periodic case, 2 zones, avg temp objective

TestCases/py_wrapper/turbulent_premixed_psi/run.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@
5050
k_u = 0.0523
5151
# unburnt heat capacity of methane-air (phi=0.5, P=5)
5252
cp_u = 1350.0
53-
54-
# P = rho*R*T
55-
# 5 = 2.55 * R * 673
56-
# R = 0.0029
53+
# laminar burning velocity of methane-air at phi=0.5, P=5
54+
Slu = 0.232
55+
Le = 1.0
5756

5857

5958
# ################################################################## #
@@ -94,18 +93,6 @@ def update_temperature(SU2Driver, iPoint):
9493
C = SU2Driver.Solution(iSPECIESSOLVER)(iPoint,0)
9594
T = Tu*(1-C) + Tf*C
9695

97-
#iFLOWSOLVER = SU2Driver.GetSolverIndices()['INC.FLOW']
98-
#solindex = getsolvar(SU2Driver)
99-
#iTEMP = solindex.get("TEMPERATURE")
100-
#T = SU2Driver.Solution(iFLOWSOLVER)(iPoint,iTEMP)
101-
#SU2Driver.Solution(iFLOWSOLVER).Set(iPoint,iTEMP,cp_u*T)
102-
103-
prim_indices = SU2Driver.GetPrimitiveIndices()
104-
iTemp = prim_indices['TEMPERATURE']
105-
SU2Driver.Primitives().Set(iPoint,iTemp, T)
106-
#ih = prim_indices['ENTHALPY']
107-
#SU2Driver.Primitives().Set(iPoint,ih, cp_u*(T-Tref))
108-
10996
iFLOWSOLVER = SU2Driver.GetSolverIndices()['INC.FLOW']
11097
iENTH = 3
11198
#h =
@@ -115,7 +102,7 @@ def update_temperature(SU2Driver, iPoint):
115102
# ################################################################## #
116103
# Source term according to Zimont
117104
# ################################################################## #
118-
def zimont(SU2Driver, iPoint):
105+
def zimont(SU2Driver, iPoint, nDim):
119106

120107
iSSTSOLVER = SU2Driver.GetSolverIndices()['SST']
121108
tke, dissipation = SU2Driver.Solution(iSSTSOLVER)(iPoint)
@@ -127,19 +114,20 @@ def zimont(SU2Driver, iPoint):
127114
iDENSITY = primindex.get("DENSITY")
128115
iMU = primindex.get("LAMINAR_VISCOSITY")
129116

130-
# laminar burning velocity of methane-air at phi=0.5, P=5
131-
Slu = 0.232
132-
133117
rho = SU2Driver.Primitives()(iPoint,iDENSITY)
134118
mu = SU2Driver.Primitives()(iPoint,iMU)
135119
nu=mu/rho
136120
# Turbulent Flamespeed Closure with Dinkelacker correction
137121
up = np.sqrt((2.0/3.0) * tke )
138122
lt = (0.09**0.75) * (tke**1.5) / dissipation
139123
Re = up*lt/nu
140-
Le = 1.0
141124
Ut = Slu * (1.0 + (0.46/Le) * np.power(Re,0.25) * np.power(up/Slu,0.3) * np.power(Pu,0.2) )
142-
norm_gradc = np.sqrt(gradc[0]*gradc[0] + gradc[1]*gradc[1])
125+
126+
norm_gradc = 0.0
127+
for idim in range(nDim):
128+
norm_gradc += gradc[idim]*gradc[idim]
129+
norm_gradc = np.sqrt(norm_gradc)
130+
143131
Sc = rho_u * Ut * norm_gradc
144132

145133
return Sc
@@ -233,7 +221,7 @@ def main():
233221
for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()):
234222
# add source term:
235223
# default TFC of Zimont: rho*Sc = rho_u * U_t * grad(c)
236-
S = zimont(driver,i_node)
224+
S = zimont(driver,i_node, nDim)
237225
Source.Set(i_node,0,S)
238226

239227
# for the update of temperature, we need to update also the halo nodes

TestCases/radiation/p1adjoint/of_grad_cd.csv.ref

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"VARIABLE" , "GRADIENT" , "FINDIFF_STEP"
2-
0 , -0.000958205 , 0.001
3-
1 , -0.00432733 , 0.001
2+
0 , -0.000958193 , 0.001
3+
1 , -0.00432732 , 0.001
44
2 , -0.0111443 , 0.001
55
3 , -0.0214515 , 0.001
66
4 , -0.0343997 , 0.001
@@ -20,16 +20,16 @@
2020
18 , -0.042129 , 0.001
2121
19 , -0.0303137 , 0.001
2222
20 , -0.0203813 , 0.001
23-
21 , -0.0126226 , 0.001
24-
22 , -0.00700441 , 0.001
25-
23 , -0.00322726 , 0.001
26-
24 , -0.000951904 , 0.001
27-
25 , 0.00128803 , 0.001
28-
26 , 0.0051774 , 0.001
23+
21 , -0.0126225 , 0.001
24+
22 , -0.0070044 , 0.001
25+
23 , -0.00322725 , 0.001
26+
24 , -0.000951896 , 0.001
27+
25 , 0.00128802 , 0.001
28+
26 , 0.00517739 , 0.001
2929
27 , 0.0125547 , 0.001
3030
28 , 0.0234674 , 0.001
3131
29 , 0.0370465 , 0.001
32-
30 , 0.0521956 , 0.001
32+
30 , 0.0521957 , 0.001
3333
31 , 0.0678379 , 0.001
3434
32 , 0.0827257 , 0.001
3535
33 , 0.0955787 , 0.001
@@ -47,5 +47,5 @@
4747
45 , 0.0192316 , 0.001
4848
46 , 0.0124655 , 0.001
4949
47 , 0.00752232 , 0.001
50-
48 , 0.0039072 , 0.001
50+
48 , 0.00390719 , 0.001
5151
49 , 0.00131195 , 0.001

TestCases/serial_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def main():
415415
inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity"
416416
inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg"
417417
inc_buoyancy.test_iter = 20
418-
inc_buoyancy.test_vals = [-3.860463, -3.122402, 4.074509, -23.414000]
418+
inc_buoyancy.test_vals = [-3.860466, -3.122403, 1.322721, -23.413000]
419419
test_list.append(inc_buoyancy)
420420

421421
# Laminar heated cylinder with polynomial fluid model
@@ -994,7 +994,7 @@ def main():
994994
slinc_steady.cfg_dir = "sliding_interface/incompressible_steady"
995995
slinc_steady.cfg_file = "config.cfg"
996996
slinc_steady.test_iter = 19
997-
slinc_steady.test_vals = [19.000000, -1.050011, -1.303591]
997+
slinc_steady.test_vals = [19.000000, -1.148249, -1.398402]
998998
slinc_steady.timeout = 100
999999
slinc_steady.multizone = True
10001000
test_list.append(slinc_steady)
@@ -1106,7 +1106,7 @@ def main():
11061106
p1rad.cfg_dir = "radiation/p1model"
11071107
p1rad.cfg_file = "configp1.cfg"
11081108
p1rad.test_iter = 50
1109-
p1rad.test_vals = [-7.939639, -7.898740, -2.238329, 0.388591, -56.886000]
1109+
p1rad.test_vals = [-8.284674, -8.008659, -2.424204, 0.389030, -56.560000]
11101110
test_list.append(p1rad)
11111111

11121112
# ###############################

TestCases/serial_regression_AD.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def main():
219219
discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d"
220220
discadj_cht.cfg_file = "cht_2d_3cylinders.cfg"
221221
discadj_cht.test_iter = 10
222-
discadj_cht.test_vals = [-6.111521, -2.668836, -2.669558, -2.669595]
222+
discadj_cht.test_vals = [-6.308199, -3.086023, -3.086024, -3.086024]
223223
test_list.append(discadj_cht)
224224

225225
######################################

TestCases/tutorials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def main():
4949
cht_incompressible_unsteady.cfg_dir = "../Tutorials/multiphysics/unsteady_cht/"
5050
cht_incompressible_unsteady.cfg_file = "cht_2d_3cylinders.cfg"
5151
cht_incompressible_unsteady.test_iter = 2
52-
cht_incompressible_unsteady.test_vals = [-2.536012, -0.080399, -0.080399, -0.080399, -12.421963, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 238.240000]
52+
cht_incompressible_unsteady.test_vals = [-3.075372, -0.080399, -0.080399, -0.080399, -11.163219, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 238.240000]
5353
cht_incompressible_unsteady.multizone = True
5454
cht_incompressible_unsteady.unsteady = True
5555
test_list.append(cht_incompressible_unsteady)

0 commit comments

Comments
 (0)