Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update regression tests for tutorials #2423

Merged
merged 25 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion TestCases/TestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,14 @@ def run_filediff(self, with_tsan=False, with_asan=False):

# Assert that both files have the same number of lines
if len(fromlines) != len(tolines):
diff = ["ERROR: Number of lines in " + fromfile + " and " + tofile + " differ: " + len(fromlines) + " vs " + len(tolines) + "."]
stringerr = "ERROR: Number of lines in " + str(fromfile) + " and " + str(tofile) + " differ: " + str(len(fromlines)) + " vs " + str(len(tolines)) + "."
diff = [stringerr]
print("generated file = ")
for i_line in tolines:
print(i_line)
for i_line in fromlines:
print(i_line)

passed = False

# Loop through all lines
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ITER, avg_dp
1, 89.03358290403737
52 changes: 44 additions & 8 deletions TestCases/tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,34 @@ def main():
sp_pinArray_2d_dp_hf_tp.test_vals = [-4.640621, 1.436697, -0.707302, 208.023676]
test_list.append(sp_pinArray_2d_dp_hf_tp)

# 90 degree pipe bend with wall functions from the experiments of Sudo et al.
sudo_tutorial = TestCase('sudo_bend')
sudo_tutorial.cfg_dir = "../Tutorials/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions"
sudo_tutorial.cfg_file = "sudo.cfg"
sudo_tutorial.test_iter = 10
sudo_tutorial.test_vals = [-14.579462, -13.203791, -13.601782, -12.616876, -14.005299, -10.817605, 15.000000, -2.296083]
sudo_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
test_list.append(sudo_tutorial)

# design-primal: 90 degree pipe bend with wall functions from the experiments of Sudo et al.
sudo_design_primal = TestCase('sudo_bend_design_primal')
sudo_design_primal.cfg_dir = "../Tutorials/design/Inc_Turbulent_Bend_Wallfunctions"
sudo_design_primal.cfg_file = "sudo_primal.cfg"
sudo_design_primal.test_iter = 10
sudo_design_primal.test_vals = [-13.474698, -12.487574, -12.441102, -11.418111, -12.552674, -9.712569, 89.034000]
sudo_design_primal.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
test_list.append(sudo_design_primal)

# design-adjoint: 90 degree pipe bend with wall functions from the experiments of Sudo et al.
sudo_design_adjoint = TestCase('sudo_bend_design_adjoint')
sudo_design_adjoint.cfg_dir = "../Tutorials/design/Inc_Turbulent_Bend_Wallfunctions"
sudo_design_adjoint.cfg_file = "sudo_adjoint.cfg"
sudo_design_adjoint.test_iter = 10
sudo_design_adjoint.test_vals = [-4.133194, -3.691046, -2.581693, -3.476472, -3.837900, -6.900137]
sudo_design_adjoint.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD")
test_list.append(sudo_design_adjoint)


### Species Transport

# 3 species (2 eq) primitive venturi mixing
Expand Down Expand Up @@ -120,14 +148,6 @@ def main():
kenics_mixer_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
test_list.append(kenics_mixer_tutorial)

# 90 degree pipe bend with wall functions from the experiments of Sudo et al.
sudo_tutorial = TestCase('sudo_bend')
sudo_tutorial.cfg_dir = "../Tutorials/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions"
sudo_tutorial.cfg_file = "sudo.cfg"
sudo_tutorial.test_iter = 10
sudo_tutorial.test_vals = [-14.579462, -13.203791, -13.601782, -12.616876, -14.005299, -10.817605, 15.000000, -2.296083]
sudo_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
test_list.append(sudo_tutorial)

### Incompressible Combustion

Expand Down Expand Up @@ -324,6 +344,22 @@ def main():

pass_list = [ test.run_test() for test in test_list ]


# design-FADO: 90 degree pipe bend optimization
sudo_design_fado = TestCase('sudo_bend_design_fado')
sudo_design_fado.command = TestCase.Command(exec = "python", param = "optimization.py")
sudo_design_fado.cfg_dir = "../Tutorials/design/Inc_Turbulent_Bend_Wallfunctions"
sudo_design_fado.cfg_file = "sudo.cfg"
sudo_design_fado.multizone = False
sudo_design_fado.test_iter = 10
sudo_design_fado.timeout = 1600
sudo_design_fado.reference_file = "../../../TestCases/Tutorials/design/Inc_Turbulent_Bend_Wallfunctions/optim.csv.ref"
sudo_design_fado.test_file = "optim.csv"
sudo_design_fado.comp_threshold = 1e-6
sudo_design_fado.tol_file_percent = 0.1
pass_list.append(sudo_design_fado.run_filediff())
test_list.append(sudo_design_fado)

# Tests summary
print('==================================================================')
print('Summary of the parallel tests')
Expand Down