Skip to content

Commit 7ddf9d7

Browse files
committed
fix regression test residuals
1 parent a113149 commit 7ddf9d7

File tree

4 files changed

+27
-37
lines changed

4 files changed

+27
-37
lines changed

TestCases/parallel_regression.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,17 +1479,17 @@ def main():
14791479
pywrapper_buoyancy = TestCase('pywrapper_buoyancy')
14801480
pywrapper_buoyancy.cfg_dir = "py_wrapper/custom_source_buoyancy"
14811481
pywrapper_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg"
1482-
pywrapper_buoyancy.test_iter = 1
1483-
pywrapper_buoyancy.test_vals = [0.500000]
1482+
pywrapper_buoyancy.test_iter = 0
1483+
pywrapper_buoyancy.test_vals = [-17.746018, -17.462127, -17.428851, -12.260605]
14841484
pywrapper_buoyancy.command = TestCase.Command("mpirun -np 2", "python", "run.py")
14851485
test_list.append(pywrapper_buoyancy)
14861486

14871487
# custom source: turbulent flamespeed closure (Zimont model) for PSI testcase
14881488
pywrapper_zimont = TestCase('pywrapper_zimont')
14891489
pywrapper_zimont.cfg_dir = "py_wrapper/turbulent_premixed_psi"
14901490
pywrapper_zimont.cfg_file = "psi.cfg"
1491-
pywrapper_zimont.test_iter = 1
1492-
pywrapper_zimont.test_vals = [0.500000]
1491+
pywrapper_zimont.test_iter = 0
1492+
pywrapper_zimont.test_vals = [-3.229704, -1.602176, -3.904854, -2.631849, -0.325639, -3.498356]
14931493
pywrapper_zimont.command = TestCase.Command("mpirun -np 2", "python", "run.py")
14941494
test_list.append(pywrapper_zimont)
14951495

TestCases/py_wrapper/custom_source_buoyancy/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def main():
7777
sys.stdout.flush()
7878

7979
# run N iterations
80-
for inner_iter in range(11):
80+
for inner_iter in range(2):
8181
if (rank==0):
8282
print("python iteration ", inner_iter)
8383

TestCases/py_wrapper/turbulent_premixed_psi/psi.cfg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,8 @@ CONV_STARTITER= 10
143143
MESH_FILENAME= psi.su2
144144
%
145145
SCREEN_OUTPUT= INNER_ITER WALL_TIME \
146-
RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_TKE RMS_DISSIPATION RMS_SPECIES_0 \
147-
LINSOL_ITER LINSOL_RESIDUAL \
148-
LINSOL_ITER_TURB LINSOL_RESIDUAL_TURB \
149-
LINSOL_ITER_SPECIES LINSOL_RESIDUAL_SPECIES AVG_CFL
146+
RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_TKE RMS_DISSIPATION RMS_SPECIES_0
147+
150148
SCREEN_WRT_FREQ_INNER= 1
151149
%
152150
HISTORY_OUTPUT= ITER RMS_RES LINSOL SPECIES_COEFF SPECIES_COEFF_SURF

TestCases/py_wrapper/turbulent_premixed_psi/run.py

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import sys
2929
import pysu2
30-
from mpi4py import MPI
3130
import numpy as np
3231

3332
# with mpi:
@@ -77,9 +76,7 @@ def initC(coord):
7776
def SetInitialSpecies(SU2Driver):
7877
allCoords = SU2Driver.Coordinates()
7978
iSPECIESSOLVER = SU2Driver.GetSolverIndices()['SPECIES']
80-
print("index of species solver = ",iSPECIESSOLVER)
8179
nVarsSpecies = SU2Driver.GetNumberSolverVars(iSPECIESSOLVER)
82-
print("number of species solver variables:",nVarsSpecies)
8380
for iPoint in range(SU2Driver.GetNumberNodes() - SU2Driver.GetNumberHaloNodes()):
8481
coord = allCoords.Get(iPoint)
8582
C = initC(coord)
@@ -168,7 +165,6 @@ def main():
168165
sys.stdout.flush()
169166

170167
nDim = driver.GetNumberDimensions()
171-
print("Dimensions of the problem = ",nDim)
172168

173169
# index to the flow solver
174170
# C.FLOW
@@ -179,69 +175,65 @@ def main():
179175
# SA
180176
# SST
181177
iFLOWSOLVER = driver.GetSolverIndices()['INC.FLOW']
182-
print("index of flow solver = ",iFLOWSOLVER)
183178
iSPECIESSOLVER = driver.GetSolverIndices()['SPECIES']
184-
print("index of species solver = ",iSPECIESSOLVER)
185179
iSSTSOLVER = driver.GetSolverIndices()['SST']
186-
print("index of turbulence solver = ",iSSTSOLVER)
187-
188180
# all the indices and the map to the names of the primitives
189181
primindex = driver.GetPrimitiveIndices()
190-
print("indices of primitives=",primindex)
191-
print("number of primitives:",len(primindex))
192-
193182
nElem = driver.GetNumberElements()
194-
print("number of elements:",nElem)
195-
196183
nVars = driver.GetNumberSolverVars(iFLOWSOLVER)
197-
print("number of flow solver variables:",nVars)
198-
199184
nVarsSpecies = driver.GetNumberSolverVars(iSPECIESSOLVER)
200-
print("number of species solver variables:",nVarsSpecies)
201185
nVarsTurb = driver.GetNumberSolverVars(iSSTSOLVER)
202-
print("number of turbulence solver variables:",nVarsTurb)
186+
187+
if rank == 0:
188+
print("Dimensions of the problem = ",nDim)
189+
print("index of flow solver = ",iFLOWSOLVER)
190+
print("index of turbulence solver = ",iSSTSOLVER)
191+
print("indices of primitives=",primindex)
192+
print("number of primitives:",len(primindex))
193+
print("number of elements:",nElem)
194+
print("number of flow solver variables:",nVars)
195+
print("number of species solver variables:",nVarsSpecies)
196+
print("number of turbulence solver variables:",nVarsTurb)
197+
sys.stdout.flush()
198+
199+
203200

204201
# ### Check if we do a restart or not. ###
205202
with open('psi.cfg') as f:
206203
if 'RESTART_SOL= YES' in f.read():
204+
if rank == 0:
207205
print("restarting from file")
208206
else:
209207
# We can set an initial condition by calling this function:
210-
print("Start calling SetInitialSpecies")
208+
if rank == 0:
209+
print("Using user defined initial condition.")
211210
SetInitialSpecies(driver)
212-
print("End calling SetInitialSpecies")
213211

214212
# super important to actually push the commands.
215213
sys.stdout.flush()
216214

217215
# run N iterations
218-
for inner_iter in range(1000):
216+
for inner_iter in range(2):
219217
if (rank==0):
220218
print("python iteration ", inner_iter)
221219
driver.Preprocess(inner_iter)
222220
driver.Run()
223221

224-
# set the source term, per point,
222+
# set the source term, per point
225223
for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()):
226224
# add source term:
227225
# default TFC of Zimont: rho*Sc = rho_u * U_t * grad(c)
228226
S = zimont(driver,i_node)
229227
driver.UserDefinedSource(iSPECIESSOLVER).Set(i_node,0,S)
230228

231-
232-
#S = [zimont(driver,i_node)]
233-
#driver.SetPointCustomSource(iSPECIESSOLVER, i_node,S)
234-
235-
236-
237229
# for the update of temperature, we need to update also the halo nodes
238230
for i_node in range(driver.GetNumberNodes()):
239231
# set the temperature to T = c*Tf + (1-c)*Tu
240232
update_temperature(driver, i_node)
241233

242234
driver.Postprocess()
243235
driver.Update()
244-
# Monitor the solver and output solution to file if required
236+
# Monitor the solver and output solution to file if required.
245237
#driver.Monitor(inner_iter)
246238
# Output the solution to file
247239
driver.Output(inner_iter)

0 commit comments

Comments
 (0)