def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.559002, -8.926022, -0.000000, 0.005588] #last 4 columns discadj_naca0012.su2_exec = "SU2_CFD_AD" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.759637, -3.864023, -0.000000, 0.000000] #last 4 columns discadj_cylinder3D.su2_exec = "SU2_CFD_AD" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) # Arina nozzle 2D discadj_arina2k = TestCase('discadj_arina2k') discadj_arina2k.cfg_dir = "disc_adj_euler/arina2k" discadj_arina2k.cfg_file = "Arina2KRS.cfg" discadj_arina2k.test_iter = 20 discadj_arina2k.test_vals = [2.108283, 1.574295, 47250.0, 0.0] #last 4 columns discadj_arina2k.su2_exec = "SU2_CFD_AD" discadj_arina2k.timeout = 8400 discadj_arina2k.tol = 0.00001 test_list.append(discadj_arina2k) ####################################################### ### Disc. adj. compressible RANS ### ####################################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [ -2.230556, 0.696586, 0.180740, -0.000018 ] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [ -2.221232, -0.492215, 0.557480, 0.000027 ] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [20.0, -4.092007, -2.652750, 0.0] #last 4 columns discadj_incomp_NACA0012.su2_exec = "SU2_CFD_AD" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder (Heated) discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [ 20.000000, -2.374306, -2.371564, 0.000000 ] #last 4 columns discadj_incomp_cylinder.su2_exec = "SU2_CFD_AD" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 SA discadj_incomp_turb_NACA0012_sa = TestCase( 'discadj_incomp_turb_NACA0012_sa') discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 discadj_incomp_turb_NACA0012_sa.test_vals = [ 10.000000, -3.845979, -1.031095, 0.000000 ] #last 4 columns discadj_incomp_turb_NACA0012_sa.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sa) # Adjoint Incompressible Turbulent NACA 0012 SST discadj_incomp_turb_NACA0012_sst = TestCase( 'discadj_incomp_turb_NACA0012_sst') discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 discadj_incomp_turb_NACA0012_sst.test_vals = [ -3.845577, -2.414021, -8.420183, 0.000000 ] #last 4 columns discadj_incomp_turb_NACA0012_sst.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746909, -1.544883, -0.008321, 0.000014] #last 4 columns discadj_cylinder.su2_exec = "SU2_CFD_AD" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ########################################################################## ### Unsteady Disc. adj. compressible RANS DualTimeStepping 1st order ### ########################################################################## # Turbulent Cylinder discadj_DT_1ST_cylinder = TestCase('unsteady_cylinder_DT_1ST') discadj_DT_1ST_cylinder.cfg_dir = "disc_adj_rans/cylinder_DT_1ST" discadj_DT_1ST_cylinder.cfg_file = "cylinder.cfg" discadj_DT_1ST_cylinder.test_iter = 9 discadj_DT_1ST_cylinder.test_vals = [ 3.698168, -1.607050, -0.002159, 0.000028 ] #last 4 columns discadj_DT_1ST_cylinder.su2_exec = "SU2_CFD_AD" discadj_DT_1ST_cylinder.timeout = 1600 discadj_DT_1ST_cylinder.tol = 0.00001 discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) ###################################################### ### Unsteady Disc. adj. compressible pitching NACA ### ###################################################### # compressible pitching NACA0012 discadj_pitchingNACA0012 = TestCase('pitchingNACA0012') discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 discadj_pitchingNACA0012.test_vals = [ -1.223509, -1.646090, -0.007671, 0.000013 ] #last 4 columns discadj_pitchingNACA0012.su2_exec = "SU2_CFD_AD" discadj_pitchingNACA0012.timeout = 1600 discadj_pitchingNACA0012.tol = 0.00001 discadj_pitchingNACA0012.unsteady = True test_list.append(discadj_pitchingNACA0012) # deforming pitching NACA0012 unst_deforming_naca0012 = TestCase('unst_deforming_naca0012') unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform_ad.cfg" unst_deforming_naca0012.test_iter = 4 unst_deforming_naca0012.test_vals = [ -1.867980, -1.741743, 1090.200000, 0.000006 ] #last 4 columns unst_deforming_naca0012.su2_exec = "SU2_CFD_AD" unst_deforming_naca0012.timeout = 1600 unst_deforming_naca0012.tol = 0.00001 unst_deforming_naca0012.unsteady = True test_list.append(unst_deforming_naca0012) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 4 discadj_fea.test_vals = [-2.849531, -3.238474, -3.6413e-04, -8.7087] #last 4 columns discadj_fea.su2_exec = "SU2_CFD_AD" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Disc. adj. heat ### ################################### # Discrete adjoint for heated cylinder discadj_heat = TestCase('discadj_heat') discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 discadj_heat.test_vals = [-2.271573, 0.671242, -3.172000, -8.231600] #last 4 columns discadj_heat.su2_exec = "SU2_CFD_AD" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 test_list.append(discadj_heat) ################################### ### Coupled RHT-CFD Adjoint ### ################################### # Coupled discrete adjoint for radiative heat transfer in heated cylinder discadj_rht = TestCase('discadj_rht') discadj_rht.cfg_dir = "radiation/p1adjoint" discadj_rht.cfg_file = "configp1adjoint.cfg" discadj_rht.test_iter = 10 discadj_rht.su2_exec = "discrete_adjoint.py -f" discadj_rht.timeout = 1600 discadj_rht.reference_file = "of_grad_cd.csv.ref" discadj_rht.test_file = "of_grad_cd.csv" test_list.append(discadj_rht) ################################### ### Coupled FSI Adjoint ### ################################### # Structural model discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "config.cfg" discadj_fsi.test_iter = 6 discadj_fsi.test_vals = [6, -1.572702, -3.084381, 4.3990e-04, -1.0631] #last 5 columns discadj_fsi.su2_exec = "SU2_CFD_AD" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) ################################### ### Coupled CHT Adjoint ### ################################### # Coupled discrete adjoint for heatflux in heated cylinder array discadj_cht = TestCase('discadj_cht') discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" discadj_cht.test_iter = 10 discadj_cht.test_vals = [-2.364405, -3.085551, -3.085518, -3.085513] #last 4 columns discadj_cht.su2_exec = "SU2_CFD_AD" discadj_cht.timeout = 1600 discadj_cht.tol = 0.00001 test_list.append(discadj_cht) ###################################### ### RUN TESTS ### ###################################### pass_list = [test.run_test() for test in test_list] ###################################### ### RUN PYTHON TESTS ### ###################################### # test discrete_adjoint.py discadj_euler_py = TestCase('discadj_euler_py') discadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" discadj_euler_py.cfg_file = "inv_NACA0012.cfg" discadj_euler_py.test_iter = 10 discadj_euler_py.su2_exec = "discrete_adjoint.py -f" discadj_euler_py.timeout = 1600 discadj_euler_py.reference_file = "of_grad_cd_disc.dat.ref" discadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_euler_py.run_filediff()) test_list.append(discadj_euler_py) # test discrete_adjoint with multiple ffd boxes discadj_multiple_ffd_py = TestCase('discadj_multiple_ffd_py') discadj_multiple_ffd_py.cfg_dir = "multiple_ffd/naca0012" discadj_multiple_ffd_py.cfg_file = "inv_NACA0012_ffd.cfg" discadj_multiple_ffd_py.test_iter = 9 discadj_multiple_ffd_py.su2_exec = "discrete_adjoint.py -f" discadj_multiple_ffd_py.timeout = 1600 discadj_multiple_ffd_py.reference_file = "of_grad_cd.dat.ref" discadj_multiple_ffd_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_multiple_ffd_py.run_filediff()) test_list.append(discadj_multiple_ffd_py) # test direct_differentiation.py directdiff_euler_py = TestCase('directdiff_euler_py') directdiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" directdiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" directdiff_euler_py.test_iter = 10 directdiff_euler_py.su2_exec = "direct_differentiation.py -f" directdiff_euler_py.timeout = 1600 directdiff_euler_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_euler_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_euler_py.run_filediff()) test_list.append(directdiff_euler_py) # test direct_differentiation.py with multiple ffd boxes directdiff_multiple_ffd_py = TestCase('directdiff_multiple_ffd_py') directdiff_multiple_ffd_py.cfg_dir = "multiple_ffd/naca0012" directdiff_multiple_ffd_py.cfg_file = "inv_NACA0012_ffd.cfg" directdiff_multiple_ffd_py.test_iter = 9 directdiff_multiple_ffd_py.su2_exec = "direct_differentiation.py -f" directdiff_multiple_ffd_py.timeout = 1600 directdiff_multiple_ffd_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_multiple_ffd_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_multiple_ffd_py.run_filediff()) test_list.append(directdiff_multiple_ffd_py) # test continuous_adjoint.py, with multiple objectives # discadj_multi_py = TestCase('discadj_multi_py') # discadj_multi_py.cfg_dir = "cont_adj_euler/wedge" # discadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" # discadj_multi_py.test_iter = 10 # discadj_multi_py.su2_exec = "discrete_adjoint.py" # discadj_multi_py.timeout = 1600 # discadj_multi_py.reference_file = "of_grad_combo.dat.refdiscrete" # discadj_multi_py.test_file = "of_grad_combo.dat" # pass_list.append(discadj_multi_py.run_filediff()) # test_list.append(discadj_multi_py) # FEA AD Flow Load Sensitivity pywrapper_FEA_AD_FlowLoad = TestCase('pywrapper_FEA_AD_FlowLoad') pywrapper_FEA_AD_FlowLoad.cfg_dir = "py_wrapper/disc_adj_fea/flow_load_sens" pywrapper_FEA_AD_FlowLoad.cfg_file = "configAD_fem.cfg" pywrapper_FEA_AD_FlowLoad.test_iter = 100 pywrapper_FEA_AD_FlowLoad.test_vals = [ -0.13945587401579657, -0.585985886606256, -0.00036377840086080753, -0.0031005670174756375 ] #last 4 columns pywrapper_FEA_AD_FlowLoad.su2_exec = "python run_adjoint.py -f" pywrapper_FEA_AD_FlowLoad.timeout = 1600 pywrapper_FEA_AD_FlowLoad.tol = 0.000001 pywrapper_FEA_AD_FlowLoad.new_output = False test_list.append(pywrapper_FEA_AD_FlowLoad) pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) # Flow AD Mesh Displacement Sensitivity pywrapper_FEA_AD_FlowLoad = TestCase('pywrapper_CFD_AD_MeshDisp') pywrapper_FEA_AD_FlowLoad.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" pywrapper_FEA_AD_FlowLoad.cfg_file = "configAD_flow.cfg" pywrapper_FEA_AD_FlowLoad.test_iter = 1000 pywrapper_FEA_AD_FlowLoad.test_vals = [ 30.000000, -2.518695, 1.390150, 0.000000 ] #last 4 columns pywrapper_FEA_AD_FlowLoad.su2_exec = "python run_adjoint.py -f" pywrapper_FEA_AD_FlowLoad.timeout = 1600 pywrapper_FEA_AD_FlowLoad.tol = 0.000001 pywrapper_FEA_AD_FlowLoad.new_output = False test_list.append(pywrapper_FEA_AD_FlowLoad) pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) # Tests summary print('==================================================================') print('Summary of the serial tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s' % test.tag) else: print('* FAILED - %s' % test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.559002, -8.926022, -0.000000, 0.005588] #last 4 columns discadj_naca0012.su2_exec = "parallel_computation.py -f" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.724803, -3.838647, 0.000000, 0.000000] #last 4 columns discadj_cylinder3D.su2_exec = "parallel_computation.py -f" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) # Arina nozzle 2D discadj_arina2k = TestCase('discadj_arina2k') discadj_arina2k.cfg_dir = "disc_adj_euler/arina2k" discadj_arina2k.cfg_file = "Arina2KRS.cfg" discadj_arina2k.test_iter = 20 discadj_arina2k.test_vals = [2.438813, 1.976484, 47258.000000, 0.000000] #last 4 columns discadj_arina2k.su2_exec = "parallel_computation.py -f" discadj_arina2k.timeout = 8400 discadj_arina2k.tol = 0.00001 test_list.append(discadj_arina2k) #################################### ### Disc. adj. compressible RANS ### #################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [-2.230578, 0.678810, 0.181780, -0.000018] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "parallel_computation.py -f" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [-2.223209, -0.496681, 0.154390, -0.000022] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "parallel_computation.py -f" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [20.000000, -3.566362, -2.541739, 0.000000] #last 4 columns discadj_incomp_NACA0012.su2_exec = "parallel_computation.py -f" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder (Heated) discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [20.000000, -2.188743, -2.068616, 0.000000] #last 4 columns discadj_incomp_cylinder.su2_exec = "parallel_computation.py -f" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 SA discadj_incomp_turb_NACA0012_sa = TestCase('discadj_incomp_turb_NACA0012_sa') discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 discadj_incomp_turb_NACA0012_sa.test_vals = [10.000000, -3.846036, -1.031071, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sa.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sa) # Adjoint Incompressible Turbulent NACA 0012 SST discadj_incomp_turb_NACA0012_sst = TestCase('discadj_incomp_turb_NACA0012_sst') discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845625, -2.413047, -8.419973, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sst.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746900, -1.544893, -8.3447e-03, 1.3808e-05] #last 4 columns discadj_cylinder.su2_exec = "parallel_computation.py -f" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ########################################################################## ### Unsteady Disc. adj. compressible RANS DualTimeStepping 1st order ### ########################################################################## # Turbulent Cylinder discadj_DT_1ST_cylinder = TestCase('unsteady_cylinder_DT_1ST') discadj_DT_1ST_cylinder.cfg_dir = "disc_adj_rans/cylinder_DT_1ST" discadj_DT_1ST_cylinder.cfg_file = "cylinder.cfg" discadj_DT_1ST_cylinder.test_iter = 9 discadj_DT_1ST_cylinder.test_vals = [3.698165, -1.607052, -2.2503e-03, 2.7212e-05] #last 4 columns discadj_DT_1ST_cylinder.su2_exec = "parallel_computation.py -f" discadj_DT_1ST_cylinder.timeout = 1600 discadj_DT_1ST_cylinder.tol = 0.00001 discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) ###################################################### ### Unsteady Disc. adj. compressible pitching NACA ### ###################################################### # compressible pitching NACA0012 discadj_pitchingNACA0012 = TestCase('pitchingNACA0012') discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 discadj_pitchingNACA0012.test_vals = [-1.091129, -1.545863, -0.037418, 0.000108] #last 4 columns discadj_pitchingNACA0012.su2_exec = "parallel_computation.py -f" discadj_pitchingNACA0012.timeout = 1600 discadj_pitchingNACA0012.tol = 0.00001 discadj_pitchingNACA0012.unsteady = True test_list.append(discadj_pitchingNACA0012) ####################################################### ### Disc. adj. turbomachinery ### ####################################################### # Transonic Stator 2D discadj_trans_stator = TestCase('transonic_stator') 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 = [79.000000, -1.927296, -1.401205] #last 4 columns discadj_trans_stator.su2_exec = "parallel_computation.py -f" discadj_trans_stator.timeout = 1600 discadj_trans_stator.tol = 0.00001 test_list.append(discadj_trans_stator) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 9 discadj_fea.test_vals = [-6.492475, -6.401201, -0.000364, -8.708700] #last 4 columns discadj_fea.su2_exec = "parallel_computation.py -f" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Disc. adj. heat ### ################################### # Discrete adjoint for heated cylinder discadj_heat = TestCase('discadj_heat') discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 discadj_heat.test_vals = [-2.281765, 0.706808, -0.743990, -6.866000] #last 4 columns discadj_heat.su2_exec = "parallel_computation.py -f" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 test_list.append(discadj_heat) ################################### ### Coupled FSI Adjoint ### ################################### # Legacy driver discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "config.cfg" discadj_fsi.test_iter = 3000 discadj_fsi.test_vals = [0.958848,-0.157601,2.726147,1.798362] #last 4 columns discadj_fsi.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) # Multi physics framework discadj_fsi2 = TestCase('discadj_fsi_airfoil') discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" discadj_fsi2.cfg_file = "config.cfg" discadj_fsi2.test_iter = 8 discadj_fsi2.test_vals = [-5.070991, -2.5239e-13] #last 2 columns discadj_fsi2.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_fsi2.timeout = 1600 discadj_fsi2.tol = 1e-16 test_list.append(discadj_fsi2) ################################### ### Coupled CHT Adjoint ### ################################### # Coupled discrete adjoint for heatflux in heated cylinder array discadj_cht = TestCase('discadj_cht') discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" discadj_cht.test_iter = 10 discadj_cht.test_vals = [-2.381654, -3.099873, -3.099844, -3.099841] #last 4 columns discadj_cht.su2_exec = "parallel_computation.py -f" discadj_cht.timeout = 1600 discadj_cht.tol = 0.00001 test_list.append(discadj_cht) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ################################################## ### Structural Adjoint - Topology Optimization ### ################################################## # test discrete_adjoint.py discadj_topol_optim = TestCase('discadj_topol_optim') discadj_topol_optim.cfg_dir = "fea_topology" discadj_topol_optim.cfg_file = "config.cfg" discadj_topol_optim.test_iter = 0 discadj_topol_optim.su2_exec = "parallel_computation.py -f" discadj_topol_optim.timeout = 1600 discadj_topol_optim.reference_file = "grad_ref_node.dat.ref" discadj_topol_optim.test_file = "grad_ref_node.dat" pass_list.append(discadj_topol_optim.run_filediff()) test_list.append(discadj_topol_optim) # Tests summary print('==================================================================') print('Summary of the parallel tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s'%test.tag) else: print('* FAILED - %s'%test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.606839, -9.035212, -0.000000, 0.005688] #last 4 columns discadj_naca0012.su2_exec = "SU2_CFD_AD" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.724711, -4.052467, -0.000000, 0.000000] #last 4 columns discadj_cylinder3D.su2_exec = "SU2_CFD_AD" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) ####################################################### ### Disc. adj. compressible RANS ### ####################################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [ -1.751962, 0.485775, 0.182122, -0.000018 ] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [ -1.654903, -0.491416, 0.109157, 0.000011 ] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "cont_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [ -2.911277, -2.705448, 0.000000, 0.000000 ] #last 4 columns discadj_incomp_NACA0012.su2_exec = "SU2_CFD_AD" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "cont_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "lam_incomp_cylinder_disc.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [ -2.731029, -2.243767, 0.000000, 0.000000 ] #last 4 columns discadj_incomp_cylinder.su2_exec = "SU2_CFD_AD" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 discadj_incomp_turb_NACA0012 = TestCase('discadj_incomp_turb_NACA0012') discadj_incomp_turb_NACA0012.cfg_dir = "incomp_rans/naca0012" discadj_incomp_turb_NACA0012.cfg_file = "naca0012_disc.cfg" discadj_incomp_turb_NACA0012.test_iter = 100 discadj_incomp_turb_NACA0012.test_vals = [ -3.645349, -1.625510, 0.000000, 0.000000 ] #last 4 columns discadj_incomp_turb_NACA0012.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012.timeout = 1600 discadj_incomp_turb_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746904, -1.544886, -0.008345, 0.000014] #last 4 columns discadj_cylinder.su2_exec = "SU2_CFD_AD" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 9 discadj_fea.test_vals = [-6.403771, -6.404196, -3.6413e-04, -8.7087e+00] #last 4 columns discadj_fea.su2_exec = "SU2_CFD_AD" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Coupled FSI Adjoint ### ################################### # Structural model discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "configAD_fsi.cfg" discadj_fsi.test_iter = 3000 discadj_fsi.test_vals = [0.958848, -0.157183, 0.658415, 1.302076] #last 4 columns discadj_fsi.su2_exec = "SU2_CFD_AD" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) ###################################### ### RUN TESTS ### ###################################### pass_list = [test.run_test() for test in test_list] ###################################### ### RUN PYTHON TESTS ### ###################################### # test discrete_adjoint.py discadj_euler_py = TestCase('discadj_euler_py') discadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" discadj_euler_py.cfg_file = "inv_NACA0012.cfg" discadj_euler_py.test_iter = 10 discadj_euler_py.su2_exec = "discrete_adjoint.py" discadj_euler_py.timeout = 1600 discadj_euler_py.reference_file = "of_grad_cd_disc.dat.ref" discadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_euler_py.run_filediff()) test_list.append(discadj_euler_py) # test direct_differentiation.py directdiff_euler_py = TestCase('directdiff_euler_py') directdiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" directdiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" directdiff_euler_py.test_iter = 10 directdiff_euler_py.su2_exec = "direct_differentiation.py" directdiff_euler_py.timeout = 1600 directdiff_euler_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_euler_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_euler_py.run_filediff()) test_list.append(directdiff_euler_py) # test continuous_adjoint.py, with multiple objectives discadj_multi_py = TestCase('discadj_multi_py') discadj_multi_py.cfg_dir = "cont_adj_euler/wedge" discadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" discadj_multi_py.test_iter = 10 discadj_multi_py.su2_exec = "discrete_adjoint.py" discadj_multi_py.timeout = 1600 discadj_multi_py.reference_file = "of_grad_combo.dat.refdiscrete" discadj_multi_py.test_file = "of_grad_combo.dat" pass_list.append(discadj_multi_py.run_filediff()) test_list.append(discadj_multi_py) # Tests summary print('==================================================================') print('Summary of the serial tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s' % test.tag) else: print('* FAILED - %s' % test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): """This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. """ test_list = [] ########################## ### Compressible Euler ### ########################## # Channel channel = TestCase("channel") channel.cfg_dir = "euler/channel" channel.cfg_file = "inv_channel_RK.cfg" channel.test_iter = 100 channel.test_vals = [-3.110240, 2.263506, 0.008686, 0.029098] # last 4 columns channel.su2_exec = "SU2_CFD" channel.timeout = 1600 channel.tol = 0.00001 test_list.append(channel) # NACA0012 naca0012 = TestCase("naca0012") naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe.cfg" naca0012.test_iter = 100 naca0012.test_vals = [-6.191618, -5.592802, 0.334809, 0.022197] # last 4 columns naca0012.su2_exec = "SU2_CFD" naca0012.timeout = 1600 naca0012.tol = 0.00001 test_list.append(naca0012) # Supersonic wedge wedge = TestCase("wedge") wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 100 wedge.test_vals = [-1.769374, 3.848733, -0.252191, 0.044410] # last 4 columns wedge.su2_exec = "SU2_CFD" wedge.timeout = 1600 wedge.tol = 0.00001 test_list.append(wedge) # ONERA M6 Wing oneram6 = TestCase("oneram6") oneram6.cfg_dir = "euler/oneram6" oneram6.cfg_file = "inv_ONERAM6.cfg" oneram6.test_iter = 10 oneram6.test_vals = [-13.393130, -12.928941, 0.282557, 0.012706] # last 4 columns oneram6.su2_exec = "SU2_CFD" oneram6.timeout = 9600 oneram6.tol = 0.00001 test_list.append(oneram6) ########################## ### Compressible N-S ### ########################## # Laminar flat plate flatplate = TestCase("flatplate") flatplate.cfg_dir = "navierstokes/flatplate" flatplate.cfg_file = "lam_flatplate.cfg" flatplate.test_iter = 100 flatplate.test_vals = [-5.231916, 0.261866, -0.166832, 0.012717] # last 4 columns flatplate.su2_exec = "SU2_CFD" flatplate.timeout = 1600 flatplate.tol = 0.00001 test_list.append(flatplate) # Laminar cylinder (steady) cylinder = TestCase("cylinder") cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 cylinder.test_vals = [-6.765426, -1.297422, 0.019496, 0.310082] # last 4 columns cylinder.su2_exec = "SU2_CFD" cylinder.timeout = 1600 cylinder.tol = 0.00001 test_list.append(cylinder) # Laminar cylinder (low Mach correction) cylinder_lowmach = TestCase("cylinder_lowmach") cylinder_lowmach.cfg_dir = "navierstokes/cylinder" cylinder_lowmach.cfg_file = "cylinder_lowmach.cfg" cylinder_lowmach.test_iter = 25 cylinder_lowmach.test_vals = [-6.850123, -1.388088, -0.056090, 108.140177] # last 4 columns cylinder_lowmach.su2_exec = "SU2_CFD" cylinder_lowmach.timeout = 1600 cylinder_lowmach.tol = 0.00001 test_list.append(cylinder_lowmach) ########################## ### Compressible RANS ### ########################## # RAE2822 SA rae2822_sa = TestCase("rae2822_sa") rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 100 rae2822_sa.test_vals = [-3.442524, -5.441383, 0.884279, 0.024730] # last 4 columns rae2822_sa.su2_exec = "SU2_CFD" rae2822_sa.timeout = 1600 rae2822_sa.tol = 0.00001 test_list.append(rae2822_sa) # RAE2822 SST rae2822_sst = TestCase("rae2822_sst") rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 100 rae2822_sst.test_vals = [-1.185243, 4.018464, 0.886786, 0.024927] # last 4 columns rae2822_sst.su2_exec = "SU2_CFD" rae2822_sst.timeout = 1600 rae2822_sst.tol = 0.00001 test_list.append(rae2822_sst) # Flat plate turb_flatplate = TestCase("turb_flatplate") turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 100 turb_flatplate.test_vals = [-5.069447, -7.354601, -0.187187, 0.010831] # last 4 columns turb_flatplate.su2_exec = "SU2_CFD" turb_flatplate.timeout = 1600 turb_flatplate.tol = 0.00001 test_list.append(turb_flatplate) # ONERA M6 Wing turb_oneram6 = TestCase("turb_oneram6") turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 turb_oneram6.test_vals = [-2.327509, -6.563372, 0.230438, 0.155815] # last 4 columns turb_oneram6.su2_exec = "SU2_CFD" turb_oneram6.timeout = 3200 turb_oneram6.tol = 0.00001 test_list.append(turb_oneram6) # NACA0012 (SA, FUN3D results for finest grid: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase("turb_naca0012_sa") turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 10 turb_naca0012_sa.test_vals = [-12.000763, -9.145363, 1.070528, 0.019417] # last 4 columns turb_naca0012_sa.su2_exec = "SU2_CFD" turb_naca0012_sa.timeout = 3200 turb_naca0012_sa.tol = 0.00001 test_list.append(turb_naca0012_sa) # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) turb_naca0012_sst = TestCase("turb_naca0012_sst") 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 = [-15.039675, -7.219913, 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 test_list.append(turb_naca0012_sst) ############################ ### Incompressible RANS ### ############################ # NACA0012 inc_turb_naca0012 = TestCase("inc_turb_naca0012") inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 inc_turb_naca0012.test_vals = [-4.710052, -11.007500, -0.000001, 0.210445] # last 4 columns inc_turb_naca0012.su2_exec = "SU2_CFD" inc_turb_naca0012.timeout = 1600 inc_turb_naca0012.tol = 0.00001 test_list.append(inc_turb_naca0012) ##################################### ### Cont. adj. compressible Euler ### ##################################### # Inviscid NACA0012 contadj_naca0012 = TestCase("contadj_naca0012") contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" contadj_naca0012.cfg_file = "inv_NACA0012.cfg" contadj_naca0012.test_iter = 5 contadj_naca0012.test_vals = [-9.787554, -15.192510, 0.300920, 0.536870] # last 4 columns contadj_naca0012.su2_exec = "SU2_CFD" contadj_naca0012.timeout = 1600 contadj_naca0012.tol = 0.00001 test_list.append(contadj_naca0012) # Inviscid ONERA M6 contadj_oneram6 = TestCase("contadj_oneram6") contadj_oneram6.cfg_dir = "cont_adj_euler/oneram6" contadj_oneram6.cfg_file = "inv_ONERAM6.cfg" contadj_oneram6.test_iter = 10 contadj_oneram6.test_vals = [-12.133352, -12.707213, 6.8590e-01, 1.4092e-01] # last 4 columns contadj_oneram6.su2_exec = "SU2_CFD" contadj_oneram6.timeout = 1600 contadj_oneram6.tol = 0.00001 test_list.append(contadj_oneram6) # Inviscid WEDGE: generalized adjoint and custom DV contadj_wedge = TestCase("contadj_wedge") contadj_wedge.cfg_dir = "cont_adj_euler/wedge" contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" contadj_wedge.test_iter = 10 contadj_wedge.test_vals = [-7.364977, -13.301134, 0.000266, 0.000000] # last 4 columns contadj_wedge.su2_exec = "SU2_CFD" contadj_wedge.timeout = 1600 contadj_wedge.tol = 0.00001 test_list.append(contadj_wedge) ################################### ### Cont. adj. compressible N-S ### ################################### # Adjoint laminar cylinder contadj_ns_cylinder = TestCase("contadj_ns_cylinder") contadj_ns_cylinder.cfg_dir = "cont_adj_navierstokes/cylinder" contadj_ns_cylinder.cfg_file = "lam_cylinder.cfg" contadj_ns_cylinder.test_iter = 100 contadj_ns_cylinder.test_vals = [-3.677184, -9.141850, -2.056700, 4.497000] # last 4 columns contadj_ns_cylinder.su2_exec = "SU2_CFD" contadj_ns_cylinder.timeout = 1600 contadj_ns_cylinder.tol = 0.00001 test_list.append(contadj_ns_cylinder) # Adjoint laminar naca0012 subsonic contadj_ns_naca0012_sub = TestCase("contadj_ns_naca0012_sub") contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_sub.test_iter = 100 contadj_ns_naca0012_sub.test_vals = [-2.744551, -8.216469, 0.518810, 0.229160] # last 4 columns contadj_ns_naca0012_sub.su2_exec = "SU2_CFD" contadj_ns_naca0012_sub.timeout = 1600 contadj_ns_naca0012_sub.tol = 0.00001 test_list.append(contadj_ns_naca0012_sub) # Adjoint laminar naca0012 transonic contadj_ns_naca0012_trans = TestCase("contadj_ns_naca0012_trans") contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_trans.test_iter = 100 contadj_ns_naca0012_trans.test_vals = [-1.041539, -6.578524, 1.772300, 0.620880] # last 4 columns contadj_ns_naca0012_trans.su2_exec = "SU2_CFD" contadj_ns_naca0012_trans.timeout = 1600 contadj_ns_naca0012_trans.tol = 0.00001 test_list.append(contadj_ns_naca0012_trans) ####################################################### ### Cont. adj. compressible RANS (frozen viscosity) ### ####################################################### # Adjoint turbulent NACA0012 contadj_rans_naca0012 = TestCase("contadj_rans_naca0012") contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" contadj_rans_naca0012.test_iter = 100 contadj_rans_naca0012.test_vals = [-0.814757, -5.726517, -19.169000, -2.994100] # last 4 columns contadj_rans_naca0012.su2_exec = "SU2_CFD" contadj_rans_naca0012.timeout = 1600 contadj_rans_naca0012.tol = 0.00001 test_list.append(contadj_rans_naca0012) # Adjoint turbulent RAE2822 contadj_rans_rae2822 = TestCase("contadj_rans_rae2822") contadj_rans_rae2822.cfg_dir = "cont_adj_rans/rae2822" contadj_rans_rae2822.cfg_file = "turb_SA_RAE2822.cfg" contadj_rans_rae2822.test_iter = 100 contadj_rans_rae2822.test_vals = [-5.377843, -10.882446, -0.212470, 0.269390] # last 4 columns contadj_rans_rae2822.su2_exec = "SU2_CFD" contadj_rans_rae2822.timeout = 1600 contadj_rans_rae2822.tol = 0.00001 test_list.append(contadj_rans_rae2822) ####################################### ### Cont. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 contadj_incomp_NACA0012 = TestCase("contadj_incomp_NACA0012") contadj_incomp_NACA0012.cfg_dir = "cont_adj_incomp_euler/naca0012" contadj_incomp_NACA0012.cfg_file = "incomp_NACA0012.cfg" contadj_incomp_NACA0012.test_iter = 5 contadj_incomp_NACA0012.test_vals = [-11.980272, -12.146779, 1.9399, 0.000000] # last 4 columns contadj_incomp_NACA0012.su2_exec = "SU2_CFD" contadj_incomp_NACA0012.timeout = 1600 contadj_incomp_NACA0012.tol = 0.00001 test_list.append(contadj_incomp_NACA0012) ##################################### ### Cont. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder contadj_incomp_cylinder = TestCase("contadj_incomp_cylinder") contadj_incomp_cylinder.cfg_dir = "cont_adj_incomp_navierstokes/cylinder" contadj_incomp_cylinder.cfg_file = "lam_incomp_cylinder.cfg" contadj_incomp_cylinder.test_iter = 25 contadj_incomp_cylinder.test_vals = [-5.718622, -7.027366, -2.932100, 0.000000] # last 4 columns contadj_incomp_cylinder.su2_exec = "SU2_CFD" contadj_incomp_cylinder.timeout = 1600 contadj_incomp_cylinder.tol = 0.00001 test_list.append(contadj_incomp_cylinder) # ###################################### # ### Spectral Method ### # ###################################### # spectral = TestCase('spectral') # spectral.cfg_dir = "spectral_method" # spectral.cfg_file = "spectral.cfg" # spectral.test_iter = 25 # spectral.test_vals = [-1.621870,3.852164,0.007465,0.084358] # spectral.su2_exec = "SU2_CFD" # spectral.timeout = 1600 # spectral.tol = 0.00001 # test_list.append(spectral) ###################################### ### Moving Wall ### ###################################### # Lid-driven cavity cavity = TestCase("cavity") cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 cavity.test_vals = [-5.627934, -0.164470, 0.051972, 2.547034] # last 4 columns cavity.su2_exec = "SU2_CFD" cavity.timeout = 1600 cavity.tol = 0.00001 test_list.append(cavity) # Spinning cylinder spinning_cylinder = TestCase("spinning_cylinder") spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 spinning_cylinder.test_vals = [-7.709662, -2.274900, 1.418422, 1.734206] # last 4 columns spinning_cylinder.su2_exec = "SU2_CFD" spinning_cylinder.timeout = 1600 spinning_cylinder.tol = 0.00001 test_list.append(spinning_cylinder) ###################################### ### Unsteady ### ###################################### # Square cylinder square_cylinder = TestCase("square_cylinder") square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 square_cylinder.test_vals = [-1.544603, 0.048578, 1.398951, 2.196894] # last 4 columns square_cylinder.su2_exec = "SU2_CFD" square_cylinder.timeout = 1600 square_cylinder.tol = 0.00001 test_list.append(square_cylinder) # Gust sine_gust = TestCase("sine_gust") sine_gust.cfg_dir = "gust" sine_gust.cfg_file = "inv_gust_NACA0012.cfg" sine_gust.test_iter = 5 sine_gust.test_vals = [-1.977531, 3.481790, -0.006222, -0.001342] # last 4 columns sine_gust.su2_exec = "SU2_CFD" sine_gust.timeout = 1600 sine_gust.tol = 0.00001 sine_gust.unsteady = True test_list.append(sine_gust) # Aeroelastic aeroelastic = TestCase("aeroelastic") aeroelastic.cfg_dir = "aeroelastic" aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" aeroelastic.test_iter = 2 aeroelastic.test_vals = [0.077106, 0.036449, -1.684916e-03, -1.131735e-04] # last 4 columns aeroelastic.su2_exec = "SU2_CFD" aeroelastic.timeout = 1600 aeroelastic.tol = 0.000001 aeroelastic.unsteady = True test_list.append(aeroelastic) ###################################### ### NICFD ### ###################################### # ls89_sa ls89_sa = TestCase("ls89_sa") ls89_sa.cfg_dir = "nicf/LS89" ls89_sa.cfg_file = "turb_SA_PR.cfg" ls89_sa.test_iter = 100 ls89_sa.test_vals = [-6.383146, -13.350551, 0.069079, 0.160886] # last 4 columns ls89_sa.su2_exec = "SU2_CFD" ls89_sa.timeout = 1600 ls89_sa.tol = 0.00001 test_list.append(ls89_sa) # # ls89_sst # ls89_sst = TestCase('ls89_sst') # ls89_sst.cfg_dir = "nicf/LS89" # ls89_sst.cfg_file = "turb_SST_PR.cfg" # ls89_sst.test_iter = 100 # ls89_sst.test_vals = [-8.548266, -1.449437, 0.067986, 0.151168] #last 4 columns # ls89_sst.su2_exec = "SU2_CFD" # ls89_sst.timeout = 1600 # ls89_sst.tol = 0.00001 # test_list.append(ls89_sst) # Rarefaction shock wave edge_VW edge_VW = TestCase("edge_VW") edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 100 edge_VW.test_vals = [-5.055874, 1.117978, -0.000009, 0.000000] # last 4 columns edge_VW.su2_exec = "SU2_CFD" edge_VW.timeout = 1600 edge_VW.tol = 0.00001 test_list.append(edge_VW) # Rarefaction shock wave edge_PPR edge_PPR = TestCase("edge_PPR") edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 100 edge_PPR.test_vals = [-5.484387, 0.656352, -0.000037, 0.000000] # last 4 columns edge_PPR.su2_exec = "SU2_CFD" edge_PPR.timeout = 1600 edge_PPR.tol = 0.00001 test_list.append(edge_PPR) ###################################### ### turboSU2 ### ###################################### # Mini centrifugal turbine blade centrifugal_blade = TestCase("centrifugal_blade") centrifugal_blade.cfg_dir = "turbomachinery/centrifugal_blade" centrifugal_blade.cfg_file = "centrifugal_blade.cfg" centrifugal_blade.test_iter = 100 centrifugal_blade.test_vals = [-9.106943, -0.460429, 1.069070e01, 3.396010e-01] # last 4 columns centrifugal_blade.su2_exec = "SU2_CFD" centrifugal_blade.timeout = 1600 centrifugal_blade.tol = 0.000001 test_list.append(centrifugal_blade) # Mini centrifugal turbine stage centrifugal_stage = TestCase("centrifugal_stage") centrifugal_stage.cfg_dir = "turbomachinery/centrifugal_stage" centrifugal_stage.cfg_file = "centrifugal_stage.cfg" centrifugal_stage.test_iter = 100 centrifugal_stage.test_vals = [-10.166364, 1.621172, 2.206476e01, 5.271075e-01] # last 4 columns centrifugal_stage.su2_exec = "SU2_CFD" centrifugal_stage.timeout = 1600 centrifugal_stage.tol = 0.000001 test_list.append(centrifugal_stage) ########################## ### FEA - FSI ### ########################## # Static beam, 3d statbeam3d = TestCase("statbeam3d") statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" statbeam3d.cfg_file = "configBeam_3d.cfg" statbeam3d.test_iter = 0 statbeam3d.test_vals = [-8.498274, -8.230638, -8.123824, 6.4095e04] # last 4 columns statbeam3d.su2_exec = "SU2_CFD" statbeam3d.timeout = 1600 statbeam3d.tol = 0.00001 test_list.append(statbeam3d) # Dynamic beam, 2d dynbeam2d = TestCase("dynbeam2d") dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.test_iter = 6 dynbeam2d.test_vals = [-9.420640, -5.365872, -12.430382, 6.5210e04] # last 4 columns dynbeam2d.su2_exec = "SU2_CFD" dynbeam2d.timeout = 1600 dynbeam2d.tol = 0.00001 test_list.append(dynbeam2d) # FSI, 2d fsi2d = TestCase("fsi2d") fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI_2D.cfg" fsi2d.test_iter = 4 fsi2d.test_vals = [2, 0.500000, -7.779713, -1.141613] # last 4 columns fsi2d.su2_exec = "SU2_CFD" fsi2d.timeout = 1600 fsi2d.tol = 0.00001 test_list.append(fsi2d) ###################################### ### RUN TESTS ### ###################################### pass_list = [test.run_test() for test in test_list] ###################################### ### RUN SU2_GEO TESTS ### ###################################### # NACA0012 naca0012_geo = TestCase("naca0012_geo") naca0012_geo.cfg_dir = "optimization_euler/steady_naca0012" naca0012_geo.cfg_file = "inv_NACA0012_adv.cfg" naca0012_geo.test_vals = [0.120011, 0.0816925, 0.0, 1.0] # max thickness, area, twist, chord naca0012_geo.su2_exec = "SU2_GEO" naca0012_geo.timeout = 1600 naca0012_geo.tol = 0.00001 pass_list.append(naca0012_geo.run_geo()) test_list.append(naca0012_geo) ###################################### ### RUN SU2_DEF TESTS ### ###################################### # RAE2822 rae2822_def = TestCase("rae2822_def") rae2822_def.cfg_dir = "optimization_rans/steady_rae2822" rae2822_def.cfg_file = "def_SA_RAE2822.cfg" rae2822_def.test_iter = 100 rae2822_def.test_vals = [8.06616e-14] # residual rae2822_def.su2_exec = "SU2_DEF" rae2822_def.timeout = 1600 rae2822_def.tol = 1e-14 pass_list.append(rae2822_def.run_def()) test_list.append(rae2822_def) # Inviscid ONERAM6 oneram6_sa_def = TestCase("oneram6_sa_def") oneram6_sa_def.cfg_dir = "optimization_euler/steady_oneram6" oneram6_sa_def.cfg_file = "def_ONERAM6.cfg" oneram6_sa_def.test_iter = 600 oneram6_sa_def.test_vals = [3.46695e-13] # residual oneram6_sa_def.su2_exec = "SU2_DEF" oneram6_sa_def.timeout = 1600 oneram6_sa_def.tol = 1e-13 pass_list.append(oneram6_sa_def.run_def()) test_list.append(oneram6_sa_def) ###################################### ### RUN PYTHON TESTS ### ###################################### # test continuous_adjoint.py contadj_euler_py = TestCase("contadj_euler_py") contadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" contadj_euler_py.cfg_file = "inv_NACA0012.cfg" contadj_euler_py.test_iter = 10 contadj_euler_py.su2_exec = "continuous_adjoint.py" contadj_euler_py.timeout = 1600 contadj_euler_py.reference_file = "of_grad_cd.dat.ref" contadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(contadj_euler_py.run_filediff()) test_list.append(contadj_euler_py) # test finite_difference.py findiff_euler_py = TestCase("findiff_euler_py") findiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" findiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" findiff_euler_py.test_iter = 10 findiff_euler_py.su2_exec = "finite_differences.py" findiff_euler_py.timeout = 1600 findiff_euler_py.reference_file = "of_grad_findiff.dat.ref" findiff_euler_py.test_file = "FINDIFF/of_grad_findiff.dat" pass_list.append(findiff_euler_py.run_filediff()) test_list.append(findiff_euler_py) # test shape_optimization.py shape_opt_euler_py = TestCase("shape_opt_euler_py") shape_opt_euler_py.cfg_dir = "optimization_euler/steady_naca0012" shape_opt_euler_py.cfg_file = "inv_NACA0012_adv.cfg" shape_opt_euler_py.test_iter = 1 shape_opt_euler_py.test_vals = [1, 1, 2.134974e-05, 3.829535e-03] # last 4 columns shape_opt_euler_py.su2_exec = "shape_optimization.py -f" shape_opt_euler_py.timeout = 1600 shape_opt_euler_py.tol = 0.00001 pass_list.append(shape_opt_euler_py.run_opt()) test_list.append(shape_opt_euler_py) # Tests summary print "==================================================================" print "Summary of the serial tests" for i, test in enumerate(test_list): if pass_list[i]: print " passed - %s" % test.tag else: print "* FAILED - %s" % test.tag if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.606839,-9.035212,-3.3386e-07,1.8777e-01] #last 4 columns discadj_naca0012.su2_exec = "SU2_CFD_AD" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) ####################################################### ### Disc. adj. compressible RANS ### ####################################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [-1.751947, 0.485758, 0.181440, -0.385110] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [-1.658566, -0.487694, 0.087556, -0.537010] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 10 discadj_cylinder.test_vals = [3.522068,-1.787841,-1.2030e-02,1.1156e-03] #last 4 columns discadj_cylinder.su2_exec = "SU2_CFD_AD" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ###################################### ### RUN PYTHON TESTS ### ###################################### # test discrete_adjoint.py discadj_euler_py = TestCase('discadj_euler_py') discadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" discadj_euler_py.cfg_file = "inv_NACA0012.cfg" discadj_euler_py.test_iter = 10 discadj_euler_py.su2_exec = "discrete_adjoint.py" discadj_euler_py.timeout = 1600 discadj_euler_py.reference_file = "of_grad_cd_disc.dat.ref" discadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_euler_py.run_filediff()) test_list.append(discadj_euler_py) # test direct_differentiation.py directdiff_euler_py = TestCase('directdiff_euler_py') directdiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" directdiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" directdiff_euler_py.test_iter = 10 directdiff_euler_py.su2_exec = "direct_differentiation.py" directdiff_euler_py.timeout = 1600 directdiff_euler_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_euler_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_euler_py.run_filediff()) test_list.append(directdiff_euler_py) # Tests summary print '==================================================================' print 'Summary of the serial tests' for i, test in enumerate(test_list): if (pass_list[i]): print ' passed - %s'%test.tag else: print '* FAILED - %s'%test.tag if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.561506, -8.926634, -0.000000, 0.005587] discadj_naca0012.su2_exec = "parallel_computation.py -f" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.734502, -3.839637, 0.000000, 0.000000] discadj_cylinder3D.su2_exec = "parallel_computation.py -f" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) # Arina nozzle 2D discadj_arina2k = TestCase('discadj_arina2k') discadj_arina2k.cfg_dir = "disc_adj_euler/arina2k" discadj_arina2k.cfg_file = "Arina2KRS.cfg" discadj_arina2k.test_iter = 20 discadj_arina2k.test_vals = [-3.111181, -3.501516, 6.8705e-02, 0] discadj_arina2k.su2_exec = "parallel_computation.py -f" discadj_arina2k.timeout = 1600 discadj_arina2k.tol = 0.00001 test_list.append(discadj_arina2k) # Equivalent area NACA64-206 ea_naca64206 = TestCase('ea_naca64206') ea_naca64206.cfg_dir = "optimization_euler/equivalentarea_naca64206" ea_naca64206.cfg_file = "NACA64206.cfg" ea_naca64206.test_iter = 10 ea_naca64206.test_vals = [3.181093, 2.471539, -5487700.0, 8.3604] ea_naca64206.su2_exec = "mpirun -n 2 SU2_CFD_AD" ea_naca64206.timeout = 1600 ea_naca64206.tol = 0.00001 test_list.append(ea_naca64206) #################################### ### Disc. adj. compressible RANS ### #################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [-2.230578, 0.696567, 0.181590, -0.000018, 5, -3.421214, 5, -6.798877] discadj_rans_naca0012_sa.su2_exec = "parallel_computation.py -f" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [-2.221792, -0.491538, 0.182010, -0.000018] discadj_rans_naca0012_sst.su2_exec = "parallel_computation.py -f" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [20.000000, -4.095412, -2.690483, 0.000000] discadj_incomp_NACA0012.su2_exec = "parallel_computation.py -f" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder (Heated) discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [20.000000, -2.195581, -2.162081, 0.000000] discadj_incomp_cylinder.su2_exec = "parallel_computation.py -f" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 SA discadj_incomp_turb_NACA0012_sa = TestCase('discadj_incomp_turb_NACA0012_sa') discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 discadj_incomp_turb_NACA0012_sa.test_vals = [10.000000, -3.846018, -1.031079, 0.000000] discadj_incomp_turb_NACA0012_sa.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sa) # Adjoint Incompressible Turbulent NACA 0012 SST discadj_incomp_turb_NACA0012_sst = TestCase('discadj_incomp_turb_NACA0012_sst') discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845593, -2.413098, -8.419991, 0.000000] discadj_incomp_turb_NACA0012_sst.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746909, -1.544883, -0.008321, 0.000014] #last 4 columns discadj_cylinder.su2_exec = "parallel_computation.py -f" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ############################################################## ### Unsteady Disc. adj. compressible RANS Windowed Average ### ############################################################## # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder_windowed_average_AD') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder_Windowing_AD.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.004406] #last column discadj_cylinder.su2_exec = "parallel_computation.py -f" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ############################################################## ### Unsteady Disc. adj. compressible RANS Windowed Average ### ############################################################## # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder_windowed_average') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder_Windowing.cfg" discadj_cylinder.test_iter = 6 discadj_cylinder.test_vals = [0.202349, -0.000119, 1.899933, -0.000050, 1.067900] discadj_cylinder.su2_exec = "parallel_computation.py -f" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.0001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ########################################################################## ### Unsteady Disc. adj. compressible RANS DualTimeStepping 1st order ### ########################################################################## # Turbulent Cylinder discadj_DT_1ST_cylinder = TestCase('unsteady_cylinder_DT_1ST') discadj_DT_1ST_cylinder.cfg_dir = "disc_adj_rans/cylinder_DT_1ST" discadj_DT_1ST_cylinder.cfg_file = "cylinder.cfg" discadj_DT_1ST_cylinder.test_iter = 9 discadj_DT_1ST_cylinder.test_vals = [3.698168, -1.607050, -0.002159, 0.000028] #last 4 columns discadj_DT_1ST_cylinder.su2_exec = "parallel_computation.py -f" discadj_DT_1ST_cylinder.timeout = 1600 discadj_DT_1ST_cylinder.tol = 0.00001 discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) ###################################################### ### Unsteady Disc. adj. compressible pitching NACA ### ###################################################### # compressible pitching NACA0012 discadj_pitchingNACA0012 = TestCase('pitchingNACA0012') discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 discadj_pitchingNACA0012.test_vals = [-1.223480, -1.639387, -0.007591, 0.000013] discadj_pitchingNACA0012.su2_exec = "parallel_computation.py -f" discadj_pitchingNACA0012.timeout = 1600 discadj_pitchingNACA0012.tol = 0.00001 discadj_pitchingNACA0012.unsteady = True test_list.append(discadj_pitchingNACA0012) ####################################################### ### Disc. adj. turbomachinery ### ####################################################### # Transonic Stator 2D discadj_trans_stator = TestCase('transonic_stator') 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 = [79.000000, -1.941681, -1.998327] discadj_trans_stator.su2_exec = "parallel_computation.py -f" discadj_trans_stator.timeout = 1600 discadj_trans_stator.tol = 0.00001 test_list.append(discadj_trans_stator) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 4 discadj_fea.test_vals = [-2.849774, -3.238669, -0.000364, -8.708700] #last 4 columns discadj_fea.su2_exec = "parallel_computation.py -f" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Disc. adj. heat ### ################################### # Discrete adjoint for heated cylinder discadj_heat = TestCase('discadj_heat') discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 discadj_heat.test_vals = [-2.280433, 0.714828, -0.743730, -6.767300] discadj_heat.su2_exec = "parallel_computation.py -f" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 test_list.append(discadj_heat) ################################### ### Coupled FSI Adjoint ### ################################### # Legacy driver discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "config.cfg" discadj_fsi.test_iter = 6 discadj_fsi.test_vals = [6.000000, -1.559957, -3.080711, 0.000440, -1.063100] discadj_fsi.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) # Multi physics framework discadj_fsi2 = TestCase('discadj_fsi_airfoil') discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" discadj_fsi2.cfg_file = "config.cfg" discadj_fsi2.test_iter = 8 discadj_fsi2.test_vals = [-5.318452, -2.4380e-13] discadj_fsi2.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_fsi2.timeout = 1600 discadj_fsi2.tol = 1e-16 test_list.append(discadj_fsi2) ################################### ### Coupled CHT Adjoint ### ################################### # Coupled discrete adjoint for heatflux in heated cylinder array discadj_cht = TestCase('discadj_cht') discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" discadj_cht.test_iter = 10 discadj_cht.test_vals = [-2.364405, -3.085549, -3.085516, -3.085511] discadj_cht.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_cht.timeout = 1600 discadj_cht.tol = 0.00001 test_list.append(discadj_cht) # 2D DA cht streamwise periodic case, 2 zones, avg temp objective da_sp_pinArray_cht_2d_dp_hf = TestCase('da_sp_pinArray_cht_2d_dp_hf') da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.800529, -4.065499, -4.137153] #last 4 lines da_sp_pinArray_cht_2d_dp_hf.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_sp_pinArray_cht_2d_dp_hf.timeout = 1600 da_sp_pinArray_cht_2d_dp_hf.tol = 0.00001 da_sp_pinArray_cht_2d_dp_hf.multizone = True test_list.append(da_sp_pinArray_cht_2d_dp_hf) # 2D unsteady CHT vortex shedding at RE=200. TAVG_Temperature OF da_unsteadyCHT_cylinder = TestCase('da_unsteadyCHT_cylinder') da_unsteadyCHT_cylinder.cfg_dir = "coupled_cht/disc_adj_unsteadyCHT_cylinder" da_unsteadyCHT_cylinder.cfg_file = "chtMaster.cfg" da_unsteadyCHT_cylinder.test_iter = 2 da_unsteadyCHT_cylinder.test_vals = [-3.521358, -4.312658, -4.271025, -9.846075, -7.967741, 0.0000e+00, 3.6840e+00, 2.9483e-01] da_unsteadyCHT_cylinder.su2_exec = "mpirun -n 2 SU2_CFD_AD" da_unsteadyCHT_cylinder.timeout = 1600 da_unsteadyCHT_cylinder.tol = 0.00001 da_unsteadyCHT_cylinder.unsteady = True da_unsteadyCHT_cylinder.multizone = True test_list.append(da_unsteadyCHT_cylinder) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ################################################## ### Structural Adjoint - Topology Optimization ### ################################################## # test discrete_adjoint.py discadj_topol_optim = TestCase('discadj_topol_optim') discadj_topol_optim.cfg_dir = "fea_topology" discadj_topol_optim.cfg_file = "config.cfg" discadj_topol_optim.test_iter = 0 discadj_topol_optim.su2_exec = "parallel_computation.py -f" discadj_topol_optim.timeout = 1600 discadj_topol_optim.reference_file = "grad_ref_node.dat.ref" discadj_topol_optim.test_file = "grad_ref_node.dat" pass_list.append(discadj_topol_optim.run_filediff()) test_list.append(discadj_topol_optim) #################################################################################### ### Unsteady Disc. adj. compressible RANS Windowed Average with restart solution ### #################################################################################### # NACA0012 Airfoil unsteady_naca0012 = TestCase('unsteady_NACA0012_restart_adjoint') unsteady_naca0012.cfg_dir = "disc_adj_rans/naca0012" unsteady_naca0012.cfg_file = "naca0012.cfg" unsteady_naca0012.test_iter = 14 unsteady_naca0012.su2_exec = "discrete_adjoint.py -f" unsteady_naca0012.timeout = 1600 unsteady_naca0012.reference_file = "of_grad_cd.csv.ref" unsteady_naca0012.test_file = "of_grad_cd.csv" unsteady_naca0012.unsteady = True pass_list.append(unsteady_naca0012.run_filediff()) test_list.append(unsteady_naca0012) #################################################################################### ### Unsteady Disc. adj. compressible RANS Windowed Average only adjoint ### #################################################################################### # NACA0012 Airfoil (Test depends on results of "unsteady_NACA0012_restart_adjoint") unsteady_naca0012 = TestCase('unsteady_NACA0012_adjoint_only') unsteady_naca0012.cfg_dir = "disc_adj_rans/naca0012" unsteady_naca0012.cfg_file = "naca0012.cfg" unsteady_naca0012.test_iter = 14 unsteady_naca0012.su2_exec = "discrete_adjoint.py -m adj -f" unsteady_naca0012.timeout = 1600 unsteady_naca0012.reference_file = "of_grad_cd.csv.ref" unsteady_naca0012.test_file = "of_grad_cd.csv" unsteady_naca0012.unsteady = True pass_list.append(unsteady_naca0012.run_filediff()) test_list.append(unsteady_naca0012) #################################################################### ### Unsteady Disc. adj. compressible RANS restart optimization ### #################################################################### # test shape_optimization.py naca_restart_shape_opt = TestCase('restart_shape_optimization') naca_restart_shape_opt.cfg_dir = "optimization_rans/naca0012" naca_restart_shape_opt.cfg_file = "naca0012.cfg" naca_restart_shape_opt.test_iter = 1 naca_restart_shape_opt.test_vals = [1.000000, 1.000000, 0.007046, 0.196671] naca_restart_shape_opt.su2_exec = "shape_optimization.py -f" naca_restart_shape_opt.timeout = 1600 naca_restart_shape_opt.tol = 0.00001 pass_list.append(naca_restart_shape_opt.run_opt()) test_list.append(naca_restart_shape_opt) #################################################################### ### Unsteady Disc. Adj. Coupled FSI ### #################################################################### # Unsteady multi physics framework dyn_discadj_fsi = TestCase('dyn_discadj_fsi') dyn_discadj_fsi.cfg_dir = "disc_adj_fsi/dyn_fsi" dyn_discadj_fsi.cfg_file = "config.cfg" dyn_discadj_fsi.test_iter = 2 dyn_discadj_fsi.su2_exec = "mpirun -n 2 SU2_CFD_AD" dyn_discadj_fsi.timeout = 1600 dyn_discadj_fsi.reference_file = "grad_dv.opt.ref" dyn_discadj_fsi.test_file = "grad_young.opt" dyn_discadj_fsi.unsteady = True pass_list.append(dyn_discadj_fsi.run_filediff()) test_list.append(dyn_discadj_fsi) # Tests summary print('==================================================================') print('Summary of the parallel tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s'%test.tag) else: print('* FAILED - %s'%test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.559002, -8.926022, -0.000000, 0.005588] #last 4 columns discadj_naca0012.su2_exec = "parallel_computation.py -f" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.755976, -3.858734, 0.000000, 0.000000] #last 4 columns discadj_cylinder3D.su2_exec = "parallel_computation.py -f" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) # Arina nozzle 2D discadj_arina2k = TestCase('discadj_arina2k') discadj_arina2k.cfg_dir = "disc_adj_euler/arina2k" discadj_arina2k.cfg_file = "Arina2KRS.cfg" discadj_arina2k.test_iter = 20 discadj_arina2k.test_vals = [2.190119, 1.635847, 47258.0, 0.0] #last 4 columns discadj_arina2k.su2_exec = "parallel_computation.py -f" discadj_arina2k.timeout = 8400 discadj_arina2k.tol = 0.00001 test_list.append(discadj_arina2k) #################################### ### Disc. adj. compressible RANS ### #################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [ -2.230573, 0.696562, 0.181780, -0.000018 ] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "parallel_computation.py -f" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [ -2.221040, -0.491759, 0.557480, 0.000027 ] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "parallel_computation.py -f" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [20.0, -4.107713, -2.670916, 0.0] #last 4 columns discadj_incomp_NACA0012.su2_exec = "parallel_computation.py -f" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder (Heated) discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [ 20.000000, -2.188743, -2.068616, 0.000000 ] #last 4 columns discadj_incomp_cylinder.su2_exec = "parallel_computation.py -f" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 SA discadj_incomp_turb_NACA0012_sa = TestCase( 'discadj_incomp_turb_NACA0012_sa') discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 discadj_incomp_turb_NACA0012_sa.test_vals = [ 10.000000, -3.846036, -1.031071, 0.000000 ] #last 4 columns discadj_incomp_turb_NACA0012_sa.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sa) # Adjoint Incompressible Turbulent NACA 0012 SST discadj_incomp_turb_NACA0012_sst = TestCase( 'discadj_incomp_turb_NACA0012_sst') discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 discadj_incomp_turb_NACA0012_sst.test_vals = [ -3.845624, -2.413044, -8.419978, 0.000000 ] #last 4 columns discadj_incomp_turb_NACA0012_sst.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746909, -1.544883, -0.008321, 0.000014] #last 4 columns discadj_cylinder.su2_exec = "parallel_computation.py -f" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ############################################################## ### Unsteady Disc. adj. compressible RANS Windowed Average ### ############################################################## # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder_windowed_average_AD') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder_Windowing_AD.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.004406] #last column discadj_cylinder.su2_exec = "parallel_computation.py -f" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ############################################################## ### Unsteady Disc. adj. compressible RANS Windowed Average ### ############################################################## # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder_windowed_average') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder_Windowing.cfg" discadj_cylinder.test_iter = 6 discadj_cylinder.test_vals = [ 0.202376, -0.000030, 2.688758, -0.000032, 1.0679e+00 ] #last 5 columns discadj_cylinder.su2_exec = "parallel_computation.py -f" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.0001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ########################################################################## ### Unsteady Disc. adj. compressible RANS DualTimeStepping 1st order ### ########################################################################## # Turbulent Cylinder discadj_DT_1ST_cylinder = TestCase('unsteady_cylinder_DT_1ST') discadj_DT_1ST_cylinder.cfg_dir = "disc_adj_rans/cylinder_DT_1ST" discadj_DT_1ST_cylinder.cfg_file = "cylinder.cfg" discadj_DT_1ST_cylinder.test_iter = 9 discadj_DT_1ST_cylinder.test_vals = [ 3.698168, -1.607050, -0.002159, 0.000028 ] #last 4 columns discadj_DT_1ST_cylinder.su2_exec = "parallel_computation.py -f" discadj_DT_1ST_cylinder.timeout = 1600 discadj_DT_1ST_cylinder.tol = 0.00001 discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) ###################################################### ### Unsteady Disc. adj. compressible pitching NACA ### ###################################################### # compressible pitching NACA0012 discadj_pitchingNACA0012 = TestCase('pitchingNACA0012') discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 discadj_pitchingNACA0012.test_vals = [ -1.225570, -1.643131, -0.007597, 0.000013 ] #last 4 columns discadj_pitchingNACA0012.su2_exec = "parallel_computation.py -f" discadj_pitchingNACA0012.timeout = 1600 discadj_pitchingNACA0012.tol = 0.00001 discadj_pitchingNACA0012.unsteady = True test_list.append(discadj_pitchingNACA0012) ####################################################### ### Disc. adj. turbomachinery ### ####################################################### # Transonic Stator 2D discadj_trans_stator = TestCase('transonic_stator') 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 = [79.000000, -1.942123, -1.998834] #last 4 columns discadj_trans_stator.su2_exec = "parallel_computation.py -f" discadj_trans_stator.timeout = 1600 discadj_trans_stator.tol = 0.00001 test_list.append(discadj_trans_stator) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 4 discadj_fea.test_vals = [-2.849526, -3.238467, -3.6413e-04, -8.7087] #last 4 columns discadj_fea.su2_exec = "parallel_computation.py -f" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Disc. adj. heat ### ################################### # Discrete adjoint for heated cylinder discadj_heat = TestCase('discadj_heat') discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 discadj_heat.test_vals = [-2.281765, 0.706808, -0.743990, -6.866000] #last 4 columns discadj_heat.su2_exec = "parallel_computation.py -f" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 test_list.append(discadj_heat) ################################### ### Coupled FSI Adjoint ### ################################### # Legacy driver discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "config.cfg" discadj_fsi.test_iter = 6 discadj_fsi.test_vals = [6, -1.563852, -3.075167, 4.3991e-04, -1.0631] #last 5 columns discadj_fsi.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) # Multi physics framework discadj_fsi2 = TestCase('discadj_fsi_airfoil') discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" discadj_fsi2.cfg_file = "config.cfg" discadj_fsi2.test_iter = 8 discadj_fsi2.test_vals = [-5.320965, -2.4380e-13] #last 2 columns discadj_fsi2.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_fsi2.timeout = 1600 discadj_fsi2.tol = 1e-16 test_list.append(discadj_fsi2) ################################### ### Coupled CHT Adjoint ### ################################### # Coupled discrete adjoint for heatflux in heated cylinder array discadj_cht = TestCase('discadj_cht') discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" discadj_cht.test_iter = 10 discadj_cht.test_vals = [-2.381654, -3.099873, -3.099844, -3.099841] #last 4 columns discadj_cht.su2_exec = "mpirun -n 2 SU2_CFD_AD" discadj_cht.timeout = 1600 discadj_cht.tol = 0.00001 test_list.append(discadj_cht) ###################################### ### RUN TESTS ### ###################################### pass_list = [test.run_test() for test in test_list] ################################################## ### Structural Adjoint - Topology Optimization ### ################################################## # test discrete_adjoint.py discadj_topol_optim = TestCase('discadj_topol_optim') discadj_topol_optim.cfg_dir = "fea_topology" discadj_topol_optim.cfg_file = "config.cfg" discadj_topol_optim.test_iter = 0 discadj_topol_optim.su2_exec = "parallel_computation.py -f" discadj_topol_optim.timeout = 1600 discadj_topol_optim.reference_file = "grad_ref_node.dat.ref" discadj_topol_optim.test_file = "grad_ref_node.dat" pass_list.append(discadj_topol_optim.run_filediff()) test_list.append(discadj_topol_optim) #################################################################################### ### Unsteady Disc. adj. compressible RANS Windowed Average with restart solution ### #################################################################################### # NACA0012 Airfoil unsteady_naca0012 = TestCase('unsteady_NACA0012_restart_adjoint') unsteady_naca0012.cfg_dir = "disc_adj_rans/naca0012" unsteady_naca0012.cfg_file = "naca0012.cfg" unsteady_naca0012.test_iter = 14 unsteady_naca0012.su2_exec = "discrete_adjoint.py -f" unsteady_naca0012.timeout = 1600 unsteady_naca0012.reference_file = "of_grad_cd.csv.ref" unsteady_naca0012.test_file = "of_grad_cd.csv" unsteady_naca0012.unsteady = True pass_list.append(unsteady_naca0012.run_filediff()) test_list.append(unsteady_naca0012) #################################################################################### ### Unsteady Disc. adj. compressible RANS Windowed Average only adjoint ### #################################################################################### # NACA0012 Airfoil (Test depends on results of "unsteady_NACA0012_restart_adjoint") unsteady_naca0012 = TestCase('unsteady_NACA0012_adjoint_only') unsteady_naca0012.cfg_dir = "disc_adj_rans/naca0012" unsteady_naca0012.cfg_file = "naca0012.cfg" unsteady_naca0012.test_iter = 14 unsteady_naca0012.su2_exec = "discrete_adjoint.py -m adj -f" unsteady_naca0012.timeout = 1600 unsteady_naca0012.reference_file = "of_grad_cd.csv.ref" unsteady_naca0012.test_file = "of_grad_cd.csv" unsteady_naca0012.unsteady = True pass_list.append(unsteady_naca0012.run_filediff()) test_list.append(unsteady_naca0012) #################################################################### ### Unsteady Disc. adj. compressible RANS restart optimization ### #################################################################### # test shape_optimization.py naca_restart_shape_opt = TestCase('restart_shape_optimization') naca_restart_shape_opt.cfg_dir = "optimization_rans/naca0012" naca_restart_shape_opt.cfg_file = "naca0012.cfg" naca_restart_shape_opt.test_iter = 1 naca_restart_shape_opt.test_vals = [ 1.000000, 1.000000, 0.007046, 0.196883 ] #last 4 columns naca_restart_shape_opt.su2_exec = "shape_optimization.py -f" naca_restart_shape_opt.timeout = 1600 naca_restart_shape_opt.tol = 0.00001 pass_list.append(naca_restart_shape_opt.run_opt()) test_list.append(naca_restart_shape_opt) # Tests summary print('==================================================================') print('Summary of the parallel tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s' % test.tag) else: print('* FAILED - %s' % test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.606839, -9.035212, -0.000000, 0.005688] #last 4 columns discadj_naca0012.su2_exec = "SU2_CFD_AD" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.724711, -4.052467, -0.000000, 0.000000] #last 4 columns discadj_cylinder3D.su2_exec = "SU2_CFD_AD" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) ####################################################### ### Disc. adj. compressible RANS ### ####################################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [-1.751962, 0.485775, 0.182122, -0.000018] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [-1.654903, -0.491416, 0.109157, 0.000011] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "cont_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [-3.391214, -2.560170, 0.000000, 0.000000] #last 4 columns discadj_incomp_NACA0012.su2_exec = "SU2_CFD_AD" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "cont_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "lam_incomp_cylinder_disc.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [-2.802148, -2.228080, 0.000000, 0.000000] #last 4 columns discadj_incomp_cylinder.su2_exec = "SU2_CFD_AD" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 discadj_incomp_turb_NACA0012 = TestCase('discadj_incomp_turb_NACA0012') discadj_incomp_turb_NACA0012.cfg_dir = "incomp_rans/naca0012" discadj_incomp_turb_NACA0012.cfg_file = "naca0012_disc.cfg" discadj_incomp_turb_NACA0012.test_iter = 10 discadj_incomp_turb_NACA0012.test_vals = [-3.847506, -1.009607, 0.000000, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012.timeout = 1600 discadj_incomp_turb_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746904, -1.544886, -0.008345, 0.000014] #last 4 columns discadj_cylinder.su2_exec = "SU2_CFD_AD" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 9 discadj_fea.test_vals = [-6.403771, -6.404196, -3.6413e-04, -8.7087e+00] #last 4 columns discadj_fea.su2_exec = "SU2_CFD_AD" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Coupled FSI Adjoint ### ################################### # Structural model discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "configAD_fsi.cfg" discadj_fsi.test_iter = 3000 discadj_fsi.test_vals = [0.958848,-0.157183,0.658415,1.302076] #last 4 columns discadj_fsi.su2_exec = "SU2_CFD_AD" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ###################################### ### RUN PYTHON TESTS ### ###################################### # test discrete_adjoint.py discadj_euler_py = TestCase('discadj_euler_py') discadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" discadj_euler_py.cfg_file = "inv_NACA0012.cfg" discadj_euler_py.test_iter = 10 discadj_euler_py.su2_exec = "discrete_adjoint.py" discadj_euler_py.timeout = 1600 discadj_euler_py.reference_file = "of_grad_cd_disc.dat.ref" discadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_euler_py.run_filediff()) test_list.append(discadj_euler_py) # test direct_differentiation.py directdiff_euler_py = TestCase('directdiff_euler_py') directdiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" directdiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" directdiff_euler_py.test_iter = 10 directdiff_euler_py.su2_exec = "direct_differentiation.py" directdiff_euler_py.timeout = 1600 directdiff_euler_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_euler_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_euler_py.run_filediff()) test_list.append(directdiff_euler_py) # test continuous_adjoint.py, with multiple objectives discadj_multi_py = TestCase('discadj_multi_py') discadj_multi_py.cfg_dir = "cont_adj_euler/wedge" discadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" discadj_multi_py.test_iter = 10 discadj_multi_py.su2_exec = "discrete_adjoint.py" discadj_multi_py.timeout = 1600 discadj_multi_py.reference_file = "of_grad_combo.dat.refdiscrete" discadj_multi_py.test_file = "of_grad_combo.dat" pass_list.append(discadj_multi_py.run_filediff()) test_list.append(discadj_multi_py) # Tests summary print('==================================================================') print('Summary of the serial tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s'%test.tag) else: print('* FAILED - %s'%test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.606839, -9.035212, -0.000000, 0.005688] #last 4 columns discadj_naca0012.su2_exec = "SU2_CFD_AD" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) ####################################################### ### Disc. adj. compressible RANS ### ####################################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [-1.751947, 0.485758, 0.181440, -0.000017] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [-1.658566, -0.487694, 0.087556, 0.000023] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 10 discadj_cylinder.test_vals = [3.522068, -1.787841, -0.012030, 0.000017] #last 4 columns discadj_cylinder.su2_exec = "SU2_CFD_AD" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ###################################### ### RUN PYTHON TESTS ### ###################################### # test discrete_adjoint.py discadj_euler_py = TestCase('discadj_euler_py') discadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" discadj_euler_py.cfg_file = "inv_NACA0012.cfg" discadj_euler_py.test_iter = 10 discadj_euler_py.su2_exec = "discrete_adjoint.py" discadj_euler_py.timeout = 1600 discadj_euler_py.reference_file = "of_grad_cd_disc.dat.ref" discadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_euler_py.run_filediff()) test_list.append(discadj_euler_py) # test direct_differentiation.py directdiff_euler_py = TestCase('directdiff_euler_py') directdiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" directdiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" directdiff_euler_py.test_iter = 10 directdiff_euler_py.su2_exec = "direct_differentiation.py" directdiff_euler_py.timeout = 1600 directdiff_euler_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_euler_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_euler_py.run_filediff()) test_list.append(directdiff_euler_py) # test continuous_adjoint.py, with multiple objectives discadj_multi_py = TestCase('discadj_multi_py') discadj_multi_py.cfg_dir = "cont_adj_euler/wedge" discadj_multi_py.cfg_file = "inv_wedge_ROE_disc_multiobj.cfg" discadj_multi_py.test_iter = 10 discadj_multi_py.su2_exec = "discrete_adjoint.py" discadj_multi_py.timeout = 1600 discadj_multi_py.reference_file = "of_grad_combo.dat.refdiscrete" discadj_multi_py.test_file = "of_grad_combo.dat" pass_list.append(discadj_multi_py.run_filediff()) test_list.append(discadj_multi_py) # Tests summary print '==================================================================' print 'Summary of the serial tests' for i, test in enumerate(test_list): if (pass_list[i]): print ' passed - %s'%test.tag else: print '* FAILED - %s'%test.tag if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): """This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. """ test_list = [] ########################## ### Compressible Euler ### ########################## # Channel channel = TestCase("channel") channel.cfg_dir = "euler/channel" channel.cfg_file = "inv_channel_RK.cfg" channel.test_iter = 100 channel.test_vals = [-3.071007, 2.301191, 0.008562, 0.028922] # last 4 columns channel.su2_exec = "parallel_computation.py -f" channel.timeout = 1600 channel.tol = 0.00001 test_list.append(channel) # NACA0012 naca0012 = TestCase("naca0012") naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe.cfg" naca0012.test_iter = 100 naca0012.test_vals = [-6.237188, -5.641250, 0.334843, 0.022206] # last 4 columns naca0012.su2_exec = "parallel_computation.py -f" naca0012.timeout = 1600 naca0012.tol = 0.00001 test_list.append(naca0012) # Supersonic wedge wedge = TestCase("wedge") wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 100 wedge.test_vals = [-1.690232, 3.924432, -0.252221, 0.044419] # last 4 columns wedge.su2_exec = "parallel_computation.py -f" wedge.timeout = 1600 wedge.tol = 0.00001 test_list.append(wedge) # ONERA M6 Wing oneram6 = TestCase("oneram6") oneram6.cfg_dir = "euler/oneram6" oneram6.cfg_file = "inv_ONERAM6.cfg" oneram6.test_iter = 10 oneram6.test_vals = [-13.400678, -12.932056, 0.282557, 0.012706] # last 4 columns oneram6.su2_exec = "parallel_computation.py -f" oneram6.timeout = 3200 oneram6.tol = 0.00001 test_list.append(oneram6) ########################## ### Compressible N-S ### ########################## # Laminar flat plate flatplate = TestCase("flatplate") flatplate.cfg_dir = "navierstokes/flatplate" flatplate.cfg_file = "lam_flatplate.cfg" flatplate.test_iter = 100 flatplate.test_vals = [-5.231727, 0.261637, -0.166869, 0.012707] # last 4 columns flatplate.su2_exec = "parallel_computation.py -f" flatplate.timeout = 1600 flatplate.tol = 0.00001 test_list.append(flatplate) # Laminar cylinder (steady) cylinder = TestCase("cylinder") cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 cylinder.test_vals = [-6.757291, -1.289309, -0.125948, 0.625438] # last 4 columns cylinder.su2_exec = "parallel_computation.py -f" cylinder.timeout = 1600 cylinder.tol = 0.00001 test_list.append(cylinder) # Laminar cylinder (low Mach correction) cylinder_lowmach = TestCase("cylinder_lowmach") cylinder_lowmach.cfg_dir = "navierstokes/cylinder" cylinder_lowmach.cfg_file = "cylinder_lowmach.cfg" cylinder_lowmach.test_iter = 25 cylinder_lowmach.test_vals = [-6.861860, -1.399846, -1.557250, 110.230719] # last 4 columns cylinder_lowmach.su2_exec = "parallel_computation.py -f" cylinder_lowmach.timeout = 1600 cylinder_lowmach.tol = 0.00001 test_list.append(cylinder_lowmach) ########################## ### Compressible RANS ### ########################## # RAE2822 SA rae2822_sa = TestCase("rae2822_sa") rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 100 rae2822_sa.test_vals = [-3.647743, -5.442583, 0.903159, 0.025800] # last 4 columns rae2822_sa.su2_exec = "parallel_computation.py -f" rae2822_sa.timeout = 1600 rae2822_sa.tol = 0.00001 test_list.append(rae2822_sa) # RAE2822 SST rae2822_sst = TestCase("rae2822_sst") rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 100 rae2822_sst.test_vals = [-1.198777, 4.013989, 0.904265, 0.025941] # last 4 columns rae2822_sst.su2_exec = "parallel_computation.py -f" rae2822_sst.timeout = 1600 rae2822_sst.tol = 0.00001 test_list.append(rae2822_sst) # Flat plate turb_flatplate = TestCase("turb_flatplate") turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 100 turb_flatplate.test_vals = [-5.071289, -7.366446, -0.187145, 0.010957] # last 4 columns turb_flatplate.su2_exec = "parallel_computation.py -f" turb_flatplate.timeout = 1600 turb_flatplate.tol = 0.00001 test_list.append(turb_flatplate) # ONERA M6 Wing turb_oneram6 = TestCase("turb_oneram6") turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 turb_oneram6.test_vals = [-2.327509, -6.563372, 0.230438, 0.155815] # last 4 columns turb_oneram6.su2_exec = "parallel_computation.py -f" turb_oneram6.timeout = 3200 turb_oneram6.tol = 0.00001 test_list.append(turb_oneram6) # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase("turb_naca0012_sa") turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 10 turb_naca0012_sa.test_vals = [-12.000764, -9.145363, 1.070528, 0.019417] # last 4 columns turb_naca0012_sa.su2_exec = "parallel_computation.py -f" turb_naca0012_sa.timeout = 3200 turb_naca0012_sa.tol = 0.00001 test_list.append(turb_naca0012_sa) # NACA0012 (SST, FUN3D finest grid results: CL=1.0840, CD=0.01253) turb_naca0012_sst = TestCase("turb_naca0012_sst") 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 = [-15.039645, -7.220177, 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 test_list.append(turb_naca0012_sst) ############################ ### Incompressible RANS ### ############################ # NACA0012 inc_turb_naca0012 = TestCase("inc_turb_naca0012") inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 inc_turb_naca0012.test_vals = [-4.710048, -11.007498, 0.000002, 0.210441] # last 4 columns inc_turb_naca0012.su2_exec = "parallel_computation.py -f" inc_turb_naca0012.timeout = 1600 inc_turb_naca0012.tol = 0.00001 test_list.append(inc_turb_naca0012) ##################################### ### Cont. adj. compressible Euler ### ##################################### # Inviscid NACA0012 contadj_naca0012 = TestCase("contadj_naca0012") contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" contadj_naca0012.cfg_file = "inv_NACA0012.cfg" contadj_naca0012.test_iter = 5 contadj_naca0012.test_vals = [-9.783712, -15.192812, 0.300920, 0.536870] # last 4 columns contadj_naca0012.su2_exec = "parallel_computation.py -f" contadj_naca0012.timeout = 1600 contadj_naca0012.tol = 0.00001 test_list.append(contadj_naca0012) # Inviscid ONERA M6 contadj_oneram6 = TestCase("contadj_oneram6") contadj_oneram6.cfg_dir = "cont_adj_euler/oneram6" contadj_oneram6.cfg_file = "inv_ONERAM6.cfg" contadj_oneram6.test_iter = 10 contadj_oneram6.test_vals = [-12.131587, -12.703243, 0.685900, 0.140920] # last 4 columns contadj_oneram6.su2_exec = "parallel_computation.py -f" contadj_oneram6.timeout = 1600 contadj_oneram6.tol = 0.00001 test_list.append(contadj_oneram6) # Inviscid WEDGE: generalized adjoint and custom DV contadj_wedge = TestCase("contadj_wedge") contadj_wedge.cfg_dir = "cont_adj_euler/wedge" contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" contadj_wedge.test_iter = 10 contadj_wedge.test_vals = [2.780403, -3.223266, -1448300.000000, -0.000004] # last 4 columns contadj_wedge.su2_exec = "parallel_computation.py -f" contadj_wedge.timeout = 1600 contadj_wedge.tol = 0.00001 test_list.append(contadj_wedge) ################################### ### Cont. adj. compressible N-S ### ################################### # Adjoint laminar cylinder contadj_ns_cylinder = TestCase("contadj_ns_cylinder") contadj_ns_cylinder.cfg_dir = "cont_adj_navierstokes/cylinder" contadj_ns_cylinder.cfg_file = "lam_cylinder.cfg" contadj_ns_cylinder.test_iter = 100 contadj_ns_cylinder.test_vals = [-3.659040, -9.117773, 2.056700, 4.497000] # last 4 columns contadj_ns_cylinder.su2_exec = "parallel_computation.py -f" contadj_ns_cylinder.timeout = 1600 contadj_ns_cylinder.tol = 0.00001 test_list.append(contadj_ns_cylinder) # Adjoint laminar naca0012 subsonic contadj_ns_naca0012_sub = TestCase("contadj_ns_naca0012_sub") contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_sub.test_iter = 100 contadj_ns_naca0012_sub.test_vals = [-2.744551, -8.216469, 0.518810, 0.229160] # last 4 columns contadj_ns_naca0012_sub.su2_exec = "parallel_computation.py -f" contadj_ns_naca0012_sub.timeout = 1600 contadj_ns_naca0012_sub.tol = 0.00001 test_list.append(contadj_ns_naca0012_sub) # Adjoint laminar naca0012 transonic contadj_ns_naca0012_trans = TestCase("contadj_ns_naca0012_trans") contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_trans.test_iter = 100 contadj_ns_naca0012_trans.test_vals = [-1.041539, -6.578524, 1.772300, 0.620880] # last 4 columns contadj_ns_naca0012_trans.su2_exec = "parallel_computation.py -f" contadj_ns_naca0012_trans.timeout = 1600 contadj_ns_naca0012_trans.tol = 0.00001 test_list.append(contadj_ns_naca0012_trans) ####################################################### ### Cont. adj. compressible RANS (frozen viscosity) ### ####################################################### # Adjoint turbulent NACA0012 contadj_rans_naca0012 = TestCase("contadj_rans_naca0012") contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" contadj_rans_naca0012.test_iter = 100 contadj_rans_naca0012.test_vals = [-0.814757, -5.726517, 19.169000, -2.994100] # last 4 columns contadj_rans_naca0012.su2_exec = "parallel_computation.py -f" contadj_rans_naca0012.timeout = 1600 contadj_rans_naca0012.tol = 0.00001 test_list.append(contadj_rans_naca0012) # Adjoint turbulent RAE2822 contadj_rans_rae2822 = TestCase("contadj_rans_rae822") contadj_rans_rae2822.cfg_dir = "cont_adj_rans/rae2822" contadj_rans_rae2822.cfg_file = "turb_SA_RAE2822.cfg" contadj_rans_rae2822.test_iter = 100 contadj_rans_rae2822.test_vals = [-5.380929, -10.886092, -0.212470, 0.269390] # last 4 columns contadj_rans_rae2822.su2_exec = "parallel_computation.py -f" contadj_rans_rae2822.timeout = 1600 contadj_rans_rae2822.tol = 0.00001 test_list.append(contadj_rans_rae2822) ####################################### ### Cont. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 contadj_incomp_NACA0012 = TestCase("contadj_incomp_NACA0012") contadj_incomp_NACA0012.cfg_dir = "cont_adj_incomp_euler/naca0012" contadj_incomp_NACA0012.cfg_file = "incomp_NACA0012.cfg" contadj_incomp_NACA0012.test_iter = 5 contadj_incomp_NACA0012.test_vals = [-11.968536, -12.133235, 1.939900, 0.000000] # last 4 columns contadj_incomp_NACA0012.su2_exec = "parallel_computation.py -f" contadj_incomp_NACA0012.timeout = 1600 contadj_incomp_NACA0012.tol = 0.00001 test_list.append(contadj_incomp_NACA0012) ##################################### ### Cont. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder contadj_incomp_cylinder = TestCase("contadj_incomp_cylinder") contadj_incomp_cylinder.cfg_dir = "cont_adj_incomp_navierstokes/cylinder" contadj_incomp_cylinder.cfg_file = "lam_incomp_cylinder.cfg" contadj_incomp_cylinder.test_iter = 25 contadj_incomp_cylinder.test_vals = [-5.718840, -7.012324, 2.932100, 0.000000] # last 4 columns contadj_incomp_cylinder.su2_exec = "parallel_computation.py -f" contadj_incomp_cylinder.timeout = 1600 contadj_incomp_cylinder.tol = 0.00001 test_list.append(contadj_incomp_cylinder) ###################################### ### Moving Wall ### ###################################### # Lid-driven cavity cavity = TestCase("cavity") cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 cavity.test_vals = [-5.597018, -0.133158, 0.169034, 0.821371] # last 4 columns cavity.su2_exec = "parallel_computation.py -f" cavity.timeout = 1600 cavity.tol = 0.00001 test_list.append(cavity) # Spinning cylinder spinning_cylinder = TestCase("spinning_cylinder") spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 spinning_cylinder.test_vals = [-7.648320, -2.202753, 1.236836, 1.609040] # last 4 columns spinning_cylinder.su2_exec = "parallel_computation.py -f" spinning_cylinder.timeout = 1600 spinning_cylinder.tol = 0.00001 test_list.append(spinning_cylinder) ###################################### ### Unsteady ### ###################################### # Square cylinder square_cylinder = TestCase("square_cylinder") square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 square_cylinder.test_vals = [-1.166422, 0.076751, 1.398549, 2.197047] # last 4 columns square_cylinder.su2_exec = "parallel_computation.py -f" square_cylinder.timeout = 1600 square_cylinder.tol = 0.00001 square_cylinder.unsteady = True test_list.append(square_cylinder) # Gust sine_gust = TestCase("sine_gust") sine_gust.cfg_dir = "gust" sine_gust.cfg_file = "inv_gust_NACA0012.cfg" sine_gust.test_iter = 5 sine_gust.test_vals = [-1.977531, 3.481790, -0.014552, -0.004969] # last 4 columns sine_gust.su2_exec = "parallel_computation.py -f" sine_gust.timeout = 1600 sine_gust.tol = 0.00001 sine_gust.unsteady = True test_list.append(sine_gust) # Aeroelastic aeroelastic = TestCase("aeroelastic") aeroelastic.cfg_dir = "aeroelastic" aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" aeroelastic.test_iter = 2 aeroelastic.test_vals = [0.077169, 0.036452, -0.001685, -0.000113] # last 4 columns aeroelastic.su2_exec = "parallel_computation.py -f" aeroelastic.timeout = 1600 aeroelastic.tol = 0.000001 aeroelastic.unsteady = True test_list.append(aeroelastic) ###################################### ### NICFD ### ###################################### # Rarefaction shock wave edge_VW edge_VW = TestCase("edge_VW") edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 100 edge_VW.test_vals = [-5.058481, 1.115321, -0.000009, 0.000000] # last 4 columns edge_VW.su2_exec = "parallel_computation.py -f" edge_VW.timeout = 1600 edge_VW.tol = 0.00001 test_list.append(edge_VW) # Rarefaction shock wave edge_PPR edge_PPR = TestCase("edge_PPR") edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 100 edge_PPR.test_vals = [-5.486409, 0.654417, -0.000037, 0.000000] # last 4 columns edge_PPR.su2_exec = "parallel_computation.py -f" edge_PPR.timeout = 1600 edge_PPR.tol = 0.00001 test_list.append(edge_PPR) ########################## ### FEA - FSI ### ########################## # Static beam, 3d statbeam3d = TestCase("statbeam3d") statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" statbeam3d.cfg_file = "configBeam_3d.cfg" statbeam3d.test_iter = 0 statbeam3d.test_vals = [-8.520066, -8.069308, -8.062384, 64095.000000] # last 4 columns statbeam3d.su2_exec = "parallel_computation_fsi.py -f" statbeam3d.timeout = 1600 statbeam3d.tol = 0.00001 test_list.append(statbeam3d) # Dynamic beam, 2d dynbeam2d = TestCase("dynbeam2d") dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.test_iter = 6 dynbeam2d.test_vals = [-9.420641, -5.365871, -12.430382, 6.5210e04] # last 4 columns dynbeam2d.su2_exec = "parallel_computation_fsi.py -f" dynbeam2d.timeout = 1600 dynbeam2d.tol = 0.00001 test_list.append(dynbeam2d) # FSI, 2d fsi2d = TestCase("fsi2d") fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI_2D.cfg" fsi2d.test_iter = 4 fsi2d.test_vals = [2.000000, 0.500000, -7.777910, -1.139830] # last 4 columns fsi2d.su2_exec = "parallel_computation_fsi.py -f" fsi2d.timeout = 1600 fsi2d.tol = 0.00001 test_list.append(fsi2d) ########################## ### Python wrapper ### ########################## # NACA0012 pywrapper_naca0012 = TestCase("pywrapper_naca0012") pywrapper_naca0012.cfg_dir = "euler/naca0012" pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" pywrapper_naca0012.test_iter = 100 pywrapper_naca0012.test_vals = [-6.237188, -5.641250, 0.334843, 0.022206] # last 4 columns pywrapper_naca0012.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py -f" pywrapper_naca0012.timeout = 1600 pywrapper_naca0012.tol = 0.00001 test_list.append(pywrapper_naca0012) # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) pywrapper_turb_naca0012_sst = TestCase("pywrapper_turb_naca0012_sst") 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 = [-15.039645, -7.220177, 1.059622, 0.019138] # last 4 columns pywrapper_turb_naca0012_sst.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py -f" pywrapper_turb_naca0012_sst.timeout = 3200 pywrapper_turb_naca0012_sst.tol = 0.00001 test_list.append(pywrapper_turb_naca0012_sst) # Square cylinder pywrapper_square_cylinder = TestCase("pywrapper_square_cylinder") 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.166422, 0.076751, 1.398549, 2.197047] # last 4 columns pywrapper_square_cylinder.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py -f" pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 pywrapper_square_cylinder.unsteady = True test_list.append(pywrapper_square_cylinder) # Aeroelastic pywrapper_aeroelastic = TestCase("pywrapper_aeroelastic") pywrapper_aeroelastic.cfg_dir = "aeroelastic" pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" pywrapper_aeroelastic.test_iter = 2 pywrapper_aeroelastic.test_vals = [0.077169, 0.036452, -0.001685, -0.000113] # last 4 columns pywrapper_aeroelastic.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py -f" pywrapper_aeroelastic.timeout = 1600 pywrapper_aeroelastic.tol = 0.000001 pywrapper_aeroelastic.unsteady = True test_list.append(pywrapper_aeroelastic) # FSI, 2d pywrapper_fsi2d = TestCase("pywrapper_fsi2d") pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI_2D.cfg" pywrapper_fsi2d.test_iter = 4 pywrapper_fsi2d.test_vals = [2.000000, 0.500000, -7.777910, -1.139830] # last 4 columns pywrapper_fsi2d.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py --nZone 2 --fsi True -f" pywrapper_fsi2d.timeout = 1600 pywrapper_fsi2d.tol = 0.00001 test_list.append(pywrapper_fsi2d) ###################################### ### RUN TESTS ### ###################################### pass_list = [test.run_test() for test in test_list] ###################################### ### RUN SU2_DEF TESTS ### ###################################### # Inviscid NACA0012 (triangles) naca0012_def = TestCase("naca0012_def") naca0012_def.cfg_dir = "deformation/naca0012" naca0012_def.cfg_file = "def_NACA0012.cfg" naca0012_def.test_iter = 250 naca0012_def.test_vals = [5.44754e-15] # residual naca0012_def.su2_exec = "mpirun -n 2 SU2_DEF" naca0012_def.timeout = 1600 naca0012_def.tol = 1e-15 pass_list.append(naca0012_def.run_def()) test_list.append(naca0012_def) # RAE2822 (mixed tris + quads) rae2822_def = TestCase("rae2822_def") rae2822_def.cfg_dir = "deformation/rae2822" rae2822_def.cfg_file = "def_RAE2822.cfg" rae2822_def.test_iter = 150 rae2822_def.test_vals = [1.47076e-15] # residual rae2822_def.su2_exec = "mpirun -n 2 SU2_DEF" rae2822_def.timeout = 1600 rae2822_def.tol = 1e-16 pass_list.append(rae2822_def.run_def()) test_list.append(rae2822_def) # Turb NACA4412 (quads, wall distance) naca4412_def = TestCase("naca4412_def") naca4412_def.cfg_dir = "deformation/naca4412" naca4412_def.cfg_file = "def_NACA4412.cfg" naca4412_def.test_iter = 300 naca4412_def.test_vals = [4.46129e-15] # residual naca4412_def.su2_exec = "mpirun -n 2 SU2_DEF" naca4412_def.timeout = 1600 naca4412_def.tol = 1e-15 pass_list.append(naca4412_def.run_def()) test_list.append(naca4412_def) # Brick of tets (inverse volume) brick_tets_def = TestCase("brick_tets_def") brick_tets_def.cfg_dir = "deformation/brick_tets" brick_tets_def.cfg_file = "def_brick_tets.cfg" brick_tets_def.test_iter = 1000 brick_tets_def.test_vals = [9.35558e-16] # residual brick_tets_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_tets_def.timeout = 1600 brick_tets_def.tol = 1e-15 pass_list.append(brick_tets_def.run_def()) test_list.append(brick_tets_def) # Brick of isotropic hexas (inverse volume) brick_hex_def = TestCase("brick_hex_def") brick_hex_def.cfg_dir = "deformation/brick_hex" brick_hex_def.cfg_file = "def_brick_hex.cfg" brick_hex_def.test_iter = 1000 brick_hex_def.test_vals = [1.46423e-15] # residual brick_hex_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_hex_def.timeout = 1600 brick_hex_def.tol = 1e-15 pass_list.append(brick_hex_def.run_def()) test_list.append(brick_hex_def) # Brick with a pyramid layer (inverse volume) brick_pyra_def = TestCase("brick_pyra_def") brick_pyra_def.cfg_dir = "deformation/brick_pyra" brick_pyra_def.cfg_file = "def_brick_pyra.cfg" brick_pyra_def.test_iter = 100 brick_pyra_def.test_vals = [5.97202e-15] # residual brick_pyra_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_pyra_def.timeout = 1600 brick_pyra_def.tol = 1e-15 pass_list.append(brick_pyra_def.run_def()) test_list.append(brick_pyra_def) # Brick of isotropic prisms (inverse volume) brick_prism_def = TestCase("brick_prism_def") brick_prism_def.cfg_dir = "deformation/brick_prism" brick_prism_def.cfg_file = "def_brick_prism.cfg" brick_prism_def.test_iter = 100 brick_prism_def.test_vals = [2.80867e-14] # residual brick_prism_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_prism_def.timeout = 1600 brick_prism_def.tol = 1e-15 pass_list.append(brick_prism_def.run_def()) test_list.append(brick_prism_def) # Brick of prisms with high aspect ratio cells near the wall (wall distance) brick_prism_rans_def = TestCase("brick_prism_rans_def") brick_prism_rans_def.cfg_dir = "deformation/brick_prism_rans" brick_prism_rans_def.cfg_file = "def_brick_prism_rans.cfg" brick_prism_rans_def.test_iter = 50 brick_prism_rans_def.test_vals = [3.5265e-15] # residual brick_prism_rans_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_prism_rans_def.timeout = 1600 brick_prism_rans_def.tol = 1e-15 pass_list.append(brick_prism_rans_def.run_def()) test_list.append(brick_prism_rans_def) # Brick of hexas with high aspect ratio cells near the wall (inverse volume) brick_hex_rans_def = TestCase("brick_hex_rans_def") brick_hex_rans_def.cfg_dir = "deformation/brick_hex_rans" brick_hex_rans_def.cfg_file = "def_brick_hex_rans.cfg" brick_hex_rans_def.test_iter = 600 brick_hex_rans_def.test_vals = [2.75292e-14] # residual brick_hex_rans_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_hex_rans_def.timeout = 1600 brick_hex_rans_def.tol = 1e-16 pass_list.append(brick_hex_rans_def.run_def()) test_list.append(brick_hex_rans_def) ###################################### ### RUN EXTERNAL FSI COUPLING TEST ### ###################################### # Pitch-plunge NACA 0012 (external FSI coupling) coupled_FSI = TestCase("coupled_FSI") coupled_FSI.cfg_dir = "coupled_fsi/2d_aeroelasticity" coupled_FSI.cfg_file = "FSICoupler_config.cfg" coupled_FSI.test_iter = 1 coupled_FSI.su2_exec = "mpirun -np 2 fsi_computation.py" coupled_FSI.timeout = 1600 coupled_FSI.reference_file = "StructHistory.dat.ref_parallel" coupled_FSI.test_file = "StructHistory.dat" pass_list.append(coupled_FSI.run_filediff()) test_list.append(coupled_FSI) # Tests summary print "==================================================================" print "Summary of the parallel tests" for i, test in enumerate(test_list): if pass_list[i]: print " passed - %s" % test.tag else: print "* FAILED - %s" % test.tag if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ########################## ### Compressible Euler ### ########################## # Channel channel = TestCase('channel') channel.cfg_dir = "euler/channel" channel.cfg_file = "inv_channel_RK.cfg" channel.test_iter = 100 channel.test_vals = [-3.110240, 2.263506, 0.008686, 0.029098] #last 4 columns channel.su2_exec = "SU2_CFD" channel.timeout = 1600 channel.tol = 0.00001 test_list.append(channel) # NACA0012 naca0012 = TestCase('naca0012') naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe.cfg" naca0012.test_iter = 100 naca0012.test_vals = [-6.191618, -5.592802, 0.334809, 0.022197] #last 4 columns naca0012.su2_exec = "SU2_CFD" naca0012.timeout = 1600 naca0012.tol = 0.00001 test_list.append(naca0012) # Supersonic wedge wedge = TestCase('wedge') wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 100 wedge.test_vals = [-1.769374, 3.848733, -0.252191, 0.044410] #last 4 columns wedge.su2_exec = "SU2_CFD" wedge.timeout = 1600 wedge.tol = 0.00001 test_list.append(wedge) # ONERA M6 Wing oneram6 = TestCase('oneram6') oneram6.cfg_dir = "euler/oneram6" oneram6.cfg_file = "inv_ONERAM6.cfg" oneram6.test_iter = 10 oneram6.test_vals = [-13.393130, -12.928941, 0.282557, 0.012706] #last 4 columns oneram6.su2_exec = "SU2_CFD" oneram6.timeout = 9600 oneram6.tol = 0.00001 test_list.append(oneram6) ########################## ### Compressible N-S ### ########################## # Laminar flat plate flatplate = TestCase('flatplate') flatplate.cfg_dir = "navierstokes/flatplate" flatplate.cfg_file = "lam_flatplate.cfg" flatplate.test_iter = 100 flatplate.test_vals = [-5.231916, 0.261866, -0.166832, 0.012717] #last 4 columns flatplate.su2_exec = "SU2_CFD" flatplate.timeout = 1600 flatplate.tol = 0.00001 test_list.append(flatplate) # Laminar cylinder (steady) cylinder = TestCase('cylinder') cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 cylinder.test_vals = [-6.765426, -1.297422, 0.019496, 0.310082] #last 4 columns cylinder.su2_exec = "SU2_CFD" cylinder.timeout = 1600 cylinder.tol = 0.00001 test_list.append(cylinder) # Laminar cylinder (low Mach correction) cylinder_lowmach = TestCase('cylinder_lowmach') cylinder_lowmach.cfg_dir = "navierstokes/cylinder" cylinder_lowmach.cfg_file = "cylinder_lowmach.cfg" cylinder_lowmach.test_iter = 25 cylinder_lowmach.test_vals = [-6.850123, -1.388088, -0.056090, 108.140177] #last 4 columns cylinder_lowmach.su2_exec = "SU2_CFD" cylinder_lowmach.timeout = 1600 cylinder_lowmach.tol = 0.00001 test_list.append(cylinder_lowmach) ########################## ### Compressible RANS ### ########################## # RAE2822 SA rae2822_sa = TestCase('rae2822_sa') rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 100 rae2822_sa.test_vals = [-3.442524, -5.441383, 0.884279, 0.024730] #last 4 columns rae2822_sa.su2_exec = "SU2_CFD" rae2822_sa.timeout = 1600 rae2822_sa.tol = 0.00001 test_list.append(rae2822_sa) # RAE2822 SST rae2822_sst = TestCase('rae2822_sst') rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 100 rae2822_sst.test_vals = [-1.185243, 4.018464, 0.886786, 0.024927] #last 4 columns rae2822_sst.su2_exec = "SU2_CFD" rae2822_sst.timeout = 1600 rae2822_sst.tol = 0.00001 test_list.append(rae2822_sst) # Flat plate turb_flatplate = TestCase('turb_flatplate') turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 100 turb_flatplate.test_vals = [-5.069447, -7.354601, -0.187187, 0.010831] #last 4 columns turb_flatplate.su2_exec = "SU2_CFD" turb_flatplate.timeout = 1600 turb_flatplate.tol = 0.00001 test_list.append(turb_flatplate) # ONERA M6 Wing turb_oneram6 = TestCase('turb_oneram6') turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 turb_oneram6.test_vals = [-2.327509, -6.563372, 0.230438, 0.155815] #last 4 columns turb_oneram6.su2_exec = "SU2_CFD" turb_oneram6.timeout = 3200 turb_oneram6.tol = 0.00001 test_list.append(turb_oneram6) # NACA0012 (SA, FUN3D results for finest grid: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 10 turb_naca0012_sa.test_vals = [-12.000763, -9.145363, 1.070528, 0.019417] #last 4 columns turb_naca0012_sa.su2_exec = "SU2_CFD" turb_naca0012_sa.timeout = 3200 turb_naca0012_sa.tol = 0.00001 test_list.append(turb_naca0012_sa) # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) turb_naca0012_sst = TestCase('turb_naca0012_sst') 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 = [-15.039675, -7.219913, 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 test_list.append(turb_naca0012_sst) ############################ ### Incompressible RANS ### ############################ # NACA0012 inc_turb_naca0012 = TestCase('inc_turb_naca0012') inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 inc_turb_naca0012.test_vals = [-4.710052, -11.007500, -0.000001, 0.210445] #last 4 columns inc_turb_naca0012.su2_exec = "SU2_CFD" inc_turb_naca0012.timeout = 1600 inc_turb_naca0012.tol = 0.00001 test_list.append(inc_turb_naca0012) ##################################### ### Cont. adj. compressible Euler ### ##################################### # Inviscid NACA0012 contadj_naca0012 = TestCase('contadj_naca0012') contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" contadj_naca0012.cfg_file = "inv_NACA0012.cfg" contadj_naca0012.test_iter = 5 contadj_naca0012.test_vals = [-9.787554, -15.192510, 0.300920, 0.536870] #last 4 columns contadj_naca0012.su2_exec = "SU2_CFD" contadj_naca0012.timeout = 1600 contadj_naca0012.tol = 0.00001 test_list.append(contadj_naca0012) # Inviscid ONERA M6 contadj_oneram6 = TestCase('contadj_oneram6') contadj_oneram6.cfg_dir = "cont_adj_euler/oneram6" contadj_oneram6.cfg_file = "inv_ONERAM6.cfg" contadj_oneram6.test_iter = 10 contadj_oneram6.test_vals = [ -12.133352, -12.707213, 6.8590e-01, 1.4092e-01 ] #last 4 columns contadj_oneram6.su2_exec = "SU2_CFD" contadj_oneram6.timeout = 1600 contadj_oneram6.tol = 0.00001 test_list.append(contadj_oneram6) # Inviscid WEDGE: tests generalized adjoint contadj_wedge = TestCase('contadj_wedge') contadj_wedge.cfg_dir = "cont_adj_euler/wedge" contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" contadj_wedge.test_iter = 10 contadj_wedge.test_vals = [ 2.780403, -3.223266, -1448300.000000, -0.000004 ] #last 4 columns contadj_wedge.su2_exec = "SU2_CFD" contadj_wedge.timeout = 1600 contadj_wedge.tol = 0.00001 test_list.append(contadj_wedge) ################################### ### Cont. adj. compressible N-S ### ################################### # Adjoint laminar cylinder contadj_ns_cylinder = TestCase('contadj_ns_cylinder') contadj_ns_cylinder.cfg_dir = "cont_adj_navierstokes/cylinder" contadj_ns_cylinder.cfg_file = "lam_cylinder.cfg" contadj_ns_cylinder.test_iter = 100 contadj_ns_cylinder.test_vals = [-3.677184, -9.141850, 2.056700, 4.497000] #last 4 columns contadj_ns_cylinder.su2_exec = "SU2_CFD" contadj_ns_cylinder.timeout = 1600 contadj_ns_cylinder.tol = 0.00001 test_list.append(contadj_ns_cylinder) # Adjoint laminar naca0012 subsonic contadj_ns_naca0012_sub = TestCase('contadj_ns_naca0012_sub') contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_sub.test_iter = 100 contadj_ns_naca0012_sub.test_vals = [ -2.744551, -8.216469, 0.518810, 0.229160 ] #last 4 columns contadj_ns_naca0012_sub.su2_exec = "SU2_CFD" contadj_ns_naca0012_sub.timeout = 1600 contadj_ns_naca0012_sub.tol = 0.00001 test_list.append(contadj_ns_naca0012_sub) # Adjoint laminar naca0012 transonic contadj_ns_naca0012_trans = TestCase('contadj_ns_naca0012_trans') contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_trans.test_iter = 100 contadj_ns_naca0012_trans.test_vals = [ -1.041539, -6.578524, 1.772300, 0.620880 ] #last 4 columns contadj_ns_naca0012_trans.su2_exec = "SU2_CFD" contadj_ns_naca0012_trans.timeout = 1600 contadj_ns_naca0012_trans.tol = 0.00001 test_list.append(contadj_ns_naca0012_trans) ####################################################### ### Cont. adj. compressible RANS (frozen viscosity) ### ####################################################### # Adjoint turbulent NACA0012 contadj_rans_naca0012 = TestCase('contadj_rans_naca0012') contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" contadj_rans_naca0012.test_iter = 100 contadj_rans_naca0012.test_vals = [ -0.814757, -5.726517, 19.169000, -2.994100 ] #last 4 columns contadj_rans_naca0012.su2_exec = "SU2_CFD" contadj_rans_naca0012.timeout = 1600 contadj_rans_naca0012.tol = 0.00001 test_list.append(contadj_rans_naca0012) # Adjoint turbulent RAE2822 contadj_rans_rae2822 = TestCase('contadj_rans_rae2822') contadj_rans_rae2822.cfg_dir = "cont_adj_rans/rae2822" contadj_rans_rae2822.cfg_file = "turb_SA_RAE2822.cfg" contadj_rans_rae2822.test_iter = 100 contadj_rans_rae2822.test_vals = [ -5.377843, -10.882446, -0.212470, 0.269390 ] #last 4 columns contadj_rans_rae2822.su2_exec = "SU2_CFD" contadj_rans_rae2822.timeout = 1600 contadj_rans_rae2822.tol = 0.00001 test_list.append(contadj_rans_rae2822) ####################################### ### Cont. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 contadj_incomp_NACA0012 = TestCase('contadj_incomp_NACA0012') contadj_incomp_NACA0012.cfg_dir = "cont_adj_incomp_euler/naca0012" contadj_incomp_NACA0012.cfg_file = "incomp_NACA0012.cfg" contadj_incomp_NACA0012.test_iter = 5 contadj_incomp_NACA0012.test_vals = [ -11.980272, -12.146779, 1.9399, 0.000000 ] #last 4 columns contadj_incomp_NACA0012.su2_exec = "SU2_CFD" contadj_incomp_NACA0012.timeout = 1600 contadj_incomp_NACA0012.tol = 0.00001 test_list.append(contadj_incomp_NACA0012) ##################################### ### Cont. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder contadj_incomp_cylinder = TestCase('contadj_incomp_cylinder') contadj_incomp_cylinder.cfg_dir = "cont_adj_incomp_navierstokes/cylinder" contadj_incomp_cylinder.cfg_file = "lam_incomp_cylinder.cfg" contadj_incomp_cylinder.test_iter = 25 contadj_incomp_cylinder.test_vals = [ -5.718622, -7.027366, 2.932100, 0.000000 ] #last 4 columns contadj_incomp_cylinder.su2_exec = "SU2_CFD" contadj_incomp_cylinder.timeout = 1600 contadj_incomp_cylinder.tol = 0.00001 test_list.append(contadj_incomp_cylinder) # ###################################### # ### Spectral Method ### # ###################################### # spectral = TestCase('spectral') # spectral.cfg_dir = "spectral_method" # spectral.cfg_file = "spectral.cfg" # spectral.test_iter = 25 # spectral.test_vals = [-1.621870,3.852164,0.007465,0.084358] # spectral.su2_exec = "SU2_CFD" # spectral.timeout = 1600 # spectral.tol = 0.00001 # test_list.append(spectral) ###################################### ### Moving Wall ### ###################################### # Lid-driven cavity cavity = TestCase('cavity') cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 cavity.test_vals = [-5.627934, -0.164470, 0.051972, 2.547034] #last 4 columns cavity.su2_exec = "SU2_CFD" cavity.timeout = 1600 cavity.tol = 0.00001 test_list.append(cavity) # Spinning cylinder spinning_cylinder = TestCase('spinning_cylinder') spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 spinning_cylinder.test_vals = [-7.709662, -2.274900, 1.418422, 1.734206] #last 4 columns spinning_cylinder.su2_exec = "SU2_CFD" spinning_cylinder.timeout = 1600 spinning_cylinder.tol = 0.00001 test_list.append(spinning_cylinder) ###################################### ### Unsteady ### ###################################### # Square cylinder square_cylinder = TestCase('square_cylinder') square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 square_cylinder.test_vals = [-1.166406, 0.076804, 1.398548, 2.197047] #last 4 columns square_cylinder.su2_exec = "SU2_CFD" square_cylinder.timeout = 1600 square_cylinder.tol = 0.00001 square_cylinder.unsteady = True test_list.append(square_cylinder) # Gust sine_gust = TestCase('sine_gust') sine_gust.cfg_dir = "gust" sine_gust.cfg_file = "inv_gust_NACA0012.cfg" sine_gust.test_iter = 5 sine_gust.test_vals = [-1.977531, 3.481790, -0.006222, -0.001342] #last 4 columns sine_gust.su2_exec = "SU2_CFD" sine_gust.timeout = 1600 sine_gust.tol = 0.00001 sine_gust.unsteady = True test_list.append(sine_gust) # Aeroelastic aeroelastic = TestCase('aeroelastic') aeroelastic.cfg_dir = "aeroelastic" aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" aeroelastic.test_iter = 2 aeroelastic.test_vals = [0.077106, 0.036449, -1.684916e-03, -1.131735e-04] #last 4 columns aeroelastic.su2_exec = "SU2_CFD" aeroelastic.timeout = 1600 aeroelastic.tol = 0.000001 aeroelastic.unsteady = True test_list.append(aeroelastic) ###################################### ### NICFD ### ###################################### # ls89_sa ls89_sa = TestCase('ls89_sa') ls89_sa.cfg_dir = "nicf/LS89" ls89_sa.cfg_file = "turb_SA_PR.cfg" ls89_sa.test_iter = 100 ls89_sa.test_vals = [-5.062991, -13.374292, 0.128005, 0.323965] #last 4 columns ls89_sa.su2_exec = "SU2_CFD" ls89_sa.timeout = 1600 ls89_sa.tol = 0.00001 test_list.append(ls89_sa) # # ls89_sst # ls89_sst = TestCase('ls89_sst') # ls89_sst.cfg_dir = "nicf/LS89" # ls89_sst.cfg_file = "turb_SST_PR.cfg" # ls89_sst.test_iter = 100 # ls89_sst.test_vals = [-8.548266, -1.449437, 0.067986, 0.151168] #last 4 columns # ls89_sst.su2_exec = "SU2_CFD" # ls89_sst.timeout = 1600 # ls89_sst.tol = 0.00001 # test_list.append(ls89_sst) # Rarefaction shock wave edge_VW edge_VW = TestCase('edge_VW') edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 100 edge_VW.test_vals = [-5.055874, 1.117978, -0.000009, 0.000000] #last 4 columns edge_VW.su2_exec = "SU2_CFD" edge_VW.timeout = 1600 edge_VW.tol = 0.00001 test_list.append(edge_VW) # Rarefaction shock wave edge_PPR edge_PPR = TestCase('edge_PPR') edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 100 edge_PPR.test_vals = [-5.484387, 0.656352, -0.000037, 0.000000] #last 4 columns edge_PPR.su2_exec = "SU2_CFD" edge_PPR.timeout = 1600 edge_PPR.tol = 0.00001 test_list.append(edge_PPR) ###################################### ### turboSU2 ### ###################################### # Mini centrifugal turbine blade centrifugal_blade = TestCase('centrifugal_blade') centrifugal_blade.cfg_dir = "turbomachinery/centrifugal_blade" centrifugal_blade.cfg_file = "centrifugal_blade.cfg" centrifugal_blade.test_iter = 100 centrifugal_blade.test_vals = [ -9.106943, -0.460429, 1.069070e+01, 3.396010e-01 ] #last 4 columns centrifugal_blade.su2_exec = "SU2_CFD" centrifugal_blade.timeout = 1600 centrifugal_blade.tol = 0.000001 test_list.append(centrifugal_blade) # Mini centrifugal turbine stage centrifugal_stage = TestCase('centrifugal_stage') centrifugal_stage.cfg_dir = "turbomachinery/centrifugal_stage" centrifugal_stage.cfg_file = "centrifugal_stage.cfg" centrifugal_stage.test_iter = 100 centrifugal_stage.test_vals = [ -10.166364, 1.621172, 2.206476e+01, 5.271075e-01 ] #last 4 columns centrifugal_stage.su2_exec = "SU2_CFD" centrifugal_stage.timeout = 1600 centrifugal_stage.tol = 0.000001 test_list.append(centrifugal_stage) ########################## ### FEA - FSI ### ########################## # Static beam, 3d statbeam3d = TestCase('statbeam3d') statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" statbeam3d.cfg_file = "configBeam_3d.cfg" statbeam3d.test_iter = 0 statbeam3d.test_vals = [-8.498274, -8.230638, -8.123824, 6.4095e+04] #last 4 columns statbeam3d.su2_exec = "SU2_CFD" statbeam3d.timeout = 1600 statbeam3d.tol = 0.00001 test_list.append(statbeam3d) # Dynamic beam, 2d dynbeam2d = TestCase('dynbeam2d') dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.test_iter = 6 dynbeam2d.test_vals = [-9.420640, -5.365872, -12.430382, 6.5210e+04] #last 4 columns dynbeam2d.su2_exec = "SU2_CFD" dynbeam2d.timeout = 1600 dynbeam2d.tol = 0.00001 test_list.append(dynbeam2d) # FSI, 2d fsi2d = TestCase('fsi2d') fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI_2D.cfg" fsi2d.test_iter = 4 fsi2d.test_vals = [2.000000, 0.500000, -7.777916, -1.139835] #last 4 columns fsi2d.su2_exec = "SU2_CFD" fsi2d.timeout = 1600 fsi2d.tol = 0.00001 test_list.append(fsi2d) ###################################### ### RUN TESTS ### ###################################### pass_list = [test.run_test() for test in test_list] ###################################### ### RUN SU2_GEO TESTS ### ###################################### # NACA0012 naca0012_geo = TestCase('naca0012_geo') naca0012_geo.cfg_dir = "optimization_euler/steady_naca0012" naca0012_geo.cfg_file = "inv_NACA0012_adv.cfg" naca0012_geo.test_vals = [0.120011, 0.0816925, 0.0, 1.0] #max thickness, area, twist, chord naca0012_geo.su2_exec = "SU2_GEO" naca0012_geo.timeout = 1600 naca0012_geo.tol = 0.00001 pass_list.append(naca0012_geo.run_geo()) test_list.append(naca0012_geo) ###################################### ### RUN SU2_DEF TESTS ### ###################################### # Inviscid NACA0012 (triangles) naca0012_def = TestCase('naca0012_def') naca0012_def.cfg_dir = "deformation/naca0012" naca0012_def.cfg_file = "def_NACA0012.cfg" naca0012_def.test_iter = 400 naca0012_def.test_vals = [4.30698e-15] #residual naca0012_def.su2_exec = "SU2_DEF" naca0012_def.timeout = 1600 naca0012_def.tol = 1e-15 pass_list.append(naca0012_def.run_def()) test_list.append(naca0012_def) # RAE2822 (mixed tris + quads) rae2822_def = TestCase('rae2822_def') rae2822_def.cfg_dir = "deformation/rae2822" rae2822_def.cfg_file = "def_RAE2822.cfg" rae2822_def.test_iter = 150 rae2822_def.test_vals = [5.59336e-16] #residual rae2822_def.su2_exec = "SU2_DEF" rae2822_def.timeout = 1600 rae2822_def.tol = 1e-16 pass_list.append(rae2822_def.run_def()) test_list.append(rae2822_def) # Turb NACA4412 (quads, wall distance) naca4412_def = TestCase('naca4412_def') naca4412_def.cfg_dir = "deformation/naca4412" naca4412_def.cfg_file = "def_NACA4412.cfg" naca4412_def.test_iter = 300 naca4412_def.test_vals = [3.26428e-15] #residual naca4412_def.su2_exec = "SU2_DEF" naca4412_def.timeout = 1600 naca4412_def.tol = 1e-15 pass_list.append(naca4412_def.run_def()) test_list.append(naca4412_def) # Brick of tets (inverse volume) brick_tets_def = TestCase('brick_tets_def') brick_tets_def.cfg_dir = "deformation/brick_tets" brick_tets_def.cfg_file = "def_brick_tets.cfg" brick_tets_def.test_iter = 50 brick_tets_def.test_vals = [7.34025e-15] #residual brick_tets_def.su2_exec = "SU2_DEF" brick_tets_def.timeout = 1600 brick_tets_def.tol = 1e-15 pass_list.append(brick_tets_def.run_def()) test_list.append(brick_tets_def) # Brick of isotropic hexas (inverse volume) brick_hex_def = TestCase('brick_hex_def') brick_hex_def.cfg_dir = "deformation/brick_hex" brick_hex_def.cfg_file = "def_brick_hex.cfg" brick_hex_def.test_iter = 50 brick_hex_def.test_vals = [1.55154e-15] #residual brick_hex_def.su2_exec = "SU2_DEF" brick_hex_def.timeout = 1600 brick_hex_def.tol = 1e-15 pass_list.append(brick_hex_def.run_def()) test_list.append(brick_hex_def) # Brick with a pyramid layer (inverse volume) brick_pyra_def = TestCase('brick_pyra_def') brick_pyra_def.cfg_dir = "deformation/brick_pyra" brick_pyra_def.cfg_file = "def_brick_pyra.cfg" brick_pyra_def.test_iter = 400 brick_pyra_def.test_vals = [3.79432e-15] #residual brick_pyra_def.su2_exec = "SU2_DEF" brick_pyra_def.timeout = 1600 brick_pyra_def.tol = 1e-15 pass_list.append(brick_pyra_def.run_def()) test_list.append(brick_pyra_def) # Brick of isotropic prisms (inverse volume) brick_prism_def = TestCase('brick_prism_def') brick_prism_def.cfg_dir = "deformation/brick_prism" brick_prism_def.cfg_file = "def_brick_prism.cfg" brick_prism_def.test_iter = 150 brick_prism_def.test_vals = [9.14366e-15] #residual brick_prism_def.su2_exec = "SU2_DEF" brick_prism_def.timeout = 1600 brick_prism_def.tol = 1e-15 pass_list.append(brick_prism_def.run_def()) test_list.append(brick_prism_def) # Brick of prisms with high aspect ratio cells near the wall (wall distance) brick_prism_rans_def = TestCase('brick_prism_rans_def') brick_prism_rans_def.cfg_dir = "deformation/brick_prism_rans" brick_prism_rans_def.cfg_file = "def_brick_prism_rans.cfg" brick_prism_rans_def.test_iter = 100 brick_prism_rans_def.test_vals = [1.64462e-15] #residual brick_prism_rans_def.su2_exec = "SU2_DEF" brick_prism_rans_def.timeout = 1600 brick_prism_rans_def.tol = 1e-15 pass_list.append(brick_prism_rans_def.run_def()) test_list.append(brick_prism_rans_def) # Brick of hexas with high aspect ratio cells near the wall (inverse volume) brick_hex_rans_def = TestCase('brick_hex_rans_def') brick_hex_rans_def.cfg_dir = "deformation/brick_hex_rans" brick_hex_rans_def.cfg_file = "def_brick_hex_rans.cfg" brick_hex_rans_def.test_iter = 50 brick_hex_rans_def.test_vals = [9.26657e-16] #residual brick_hex_rans_def.su2_exec = "SU2_DEF" brick_hex_rans_def.timeout = 1600 brick_hex_rans_def.tol = 1e-16 pass_list.append(brick_hex_rans_def.run_def()) test_list.append(brick_hex_rans_def) ###################################### ### RUN PYTHON TESTS ### ###################################### # test continuous_adjoint.py contadj_euler_py = TestCase('contadj_euler_py') contadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" contadj_euler_py.cfg_file = "inv_NACA0012.cfg" contadj_euler_py.test_iter = 10 contadj_euler_py.su2_exec = "continuous_adjoint.py" contadj_euler_py.timeout = 1600 contadj_euler_py.reference_file = "of_grad_cd.dat.ref" contadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(contadj_euler_py.run_filediff()) test_list.append(contadj_euler_py) # test finite_difference.py findiff_euler_py = TestCase('findiff_euler_py') findiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" findiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" findiff_euler_py.test_iter = 10 findiff_euler_py.su2_exec = "finite_differences.py" findiff_euler_py.timeout = 1600 findiff_euler_py.reference_file = "of_grad_findiff.dat.ref" findiff_euler_py.test_file = "FINDIFF/of_grad_findiff.dat" pass_list.append(findiff_euler_py.run_filediff()) test_list.append(findiff_euler_py) # test shape_optimization.py shape_opt_euler_py = TestCase('shape_opt_euler_py') shape_opt_euler_py.cfg_dir = "optimization_euler/steady_naca0012" shape_opt_euler_py.cfg_file = "inv_NACA0012_adv.cfg" shape_opt_euler_py.test_iter = 1 shape_opt_euler_py.test_vals = [1, 1, 2.134974E-05, 3.829535E-03] #last 4 columns shape_opt_euler_py.su2_exec = "shape_optimization.py -f" shape_opt_euler_py.timeout = 1600 shape_opt_euler_py.tol = 0.00001 pass_list.append(shape_opt_euler_py.run_opt()) test_list.append(shape_opt_euler_py) # test continuous_adjoint.py, with multiple objectives contadj_multi_py = TestCase('contadj_multi_py') contadj_multi_py.cfg_dir = "cont_adj_euler/wedge" contadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" contadj_multi_py.test_iter = 10 contadj_multi_py.su2_exec = "continuous_adjoint.py" contadj_multi_py.timeout = 1600 contadj_multi_py.reference_file = "of_grad_combo.dat.ref" contadj_multi_py.test_file = "of_grad_combo.dat" pass_list.append(contadj_multi_py.run_filediff()) test_list.append(contadj_multi_py) ########################## ### Python wrapper ### ########################## # NACA0012 pywrapper_naca0012 = TestCase('pywrapper_naca0012') pywrapper_naca0012.cfg_dir = "euler/naca0012" pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" pywrapper_naca0012.test_iter = 100 pywrapper_naca0012.test_vals = [-6.191618, -5.592802, 0.334809, 0.022197] #last 4 columns pywrapper_naca0012.su2_exec = "pyWrap_SU2_CFD.py -f" pywrapper_naca0012.timeout = 1600 pywrapper_naca0012.tol = 0.00001 test_list.append(pywrapper_naca0012) pass_list.append(pywrapper_naca0012.run_test()) # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) pywrapper_turb_naca0012_sst = TestCase('pywrapper_turb_naca0012_sst') 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 = [ -15.039675, -7.219913, 1.059622, 0.019138 ] #last 4 columns pywrapper_turb_naca0012_sst.su2_exec = "pyWrap_SU2_CFD.py -f" pywrapper_turb_naca0012_sst.timeout = 3200 pywrapper_turb_naca0012_sst.tol = 0.00001 test_list.append(pywrapper_turb_naca0012_sst) pass_list.append(pywrapper_turb_naca0012_sst.run_test()) # Square cylinder pywrapper_square_cylinder = TestCase('pywrapper_square_cylinder') 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.166406, 0.076804, 1.398548, 2.197047 ] #last 4 columns pywrapper_square_cylinder.su2_exec = "pyWrap_SU2_CFD.py -f" pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 pywrapper_square_cylinder.unsteady = True test_list.append(pywrapper_square_cylinder) pass_list.append(pywrapper_square_cylinder.run_test()) # Aeroelastic pywrapper_aeroelastic = TestCase('pywrapper_aeroelastic') pywrapper_aeroelastic.cfg_dir = "aeroelastic" pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" pywrapper_aeroelastic.test_iter = 2 pywrapper_aeroelastic.test_vals = [ 0.077106, 0.036449, -1.684916e-03, -1.131735e-04 ] #last 4 columns pywrapper_aeroelastic.su2_exec = "pyWrap_SU2_CFD.py -f" pywrapper_aeroelastic.timeout = 1600 pywrapper_aeroelastic.tol = 0.000001 pywrapper_aeroelastic.unsteady = True test_list.append(pywrapper_aeroelastic) pass_list.append(pywrapper_aeroelastic.run_test()) # FSI, 2d pywrapper_fsi2d = TestCase('pywrapper_fsi2d') pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI_2D.cfg" pywrapper_fsi2d.test_iter = 4 pywrapper_fsi2d.test_vals = [2.000000, 0.500000, -7.777916, -1.139835] #last 4 columns pywrapper_fsi2d.su2_exec = "pyWrap_SU2_CFD.py --nZone 2 --fsi True -f" pywrapper_fsi2d.timeout = 1600 pywrapper_fsi2d.tol = 0.00001 test_list.append(pywrapper_fsi2d) pass_list.append(pywrapper_fsi2d.run_test()) ###################################### ### RUN EXTERNAL FSI COUPLING TEST ### ###################################### # Pitch-plunge NACA 0012 (external FSI coupling) coupled_FSI = TestCase('coupled_FSI') coupled_FSI.cfg_dir = "coupled_fsi/2d_aeroelasticity" coupled_FSI.cfg_file = "FSICoupler_config.cfg" coupled_FSI.test_iter = 1 coupled_FSI.su2_exec = "fsi_computation.py" coupled_FSI.timeout = 1600 coupled_FSI.reference_file = "StructHistory.dat.ref_serial" coupled_FSI.test_file = "StructHistory.dat" pass_list.append(coupled_FSI.run_filediff()) test_list.append(coupled_FSI) # Tests summary print '==================================================================' print 'Summary of the serial tests' for i, test in enumerate(test_list): if (pass_list[i]): print ' passed - %s' % test.tag else: print '* FAILED - %s' % test.tag if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ########################## ### Compressible Euler ### ########################## # Channel channel = TestCase('channel') channel.cfg_dir = "euler/channel" channel.cfg_file = "inv_channel_RK.cfg" channel.test_iter = 100 channel.test_vals = [-3.110240, 2.263506, 0.008686, 0.029098] #last 4 columns channel.su2_exec = "SU2_CFD" channel.timeout = 1600 channel.tol = 0.00001 test_list.append(channel) # NACA0012 naca0012 = TestCase('naca0012') naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe.cfg" naca0012.test_iter = 100 naca0012.test_vals = [-6.191618, -5.592802, 0.334809, 0.022197] #last 4 columns naca0012.su2_exec = "SU2_CFD" naca0012.timeout = 1600 naca0012.tol = 0.00001 test_list.append(naca0012) # Supersonic wedge wedge = TestCase('wedge') wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 100 wedge.test_vals = [-1.769374, 3.848733, -0.252191, 0.044410] #last 4 columns wedge.su2_exec = "SU2_CFD" wedge.timeout = 1600 wedge.tol = 0.00001 test_list.append(wedge) # ONERA M6 Wing oneram6 = TestCase('oneram6') oneram6.cfg_dir = "euler/oneram6" oneram6.cfg_file = "inv_ONERAM6.cfg" oneram6.test_iter = 10 oneram6.test_vals = [-13.393130, -12.928941, 0.282557, 0.012706] #last 4 columns oneram6.su2_exec = "SU2_CFD" oneram6.timeout = 9600 oneram6.tol = 0.00001 test_list.append(oneram6) # Fixed CL NACA0012 fixedCL_naca0012 = TestCase('fixedcl_naca0012') fixedCL_naca0012.cfg_dir = "fixed_cl/naca0012" fixedCL_naca0012.cfg_file = "inv_NACA0012.cfg" fixedCL_naca0012.test_iter = 500 fixedCL_naca0012.test_vals = [-6.707530,-1.319851,0.300017,0.019390] #last 4 columns fixedCL_naca0012.su2_exec = "SU2_CFD" fixedCL_naca0012.timeout = 1600 fixedCL_naca0012.tol = 0.00001 test_list.append(fixedCL_naca0012) # Polar sweep of the inviscid NACA0012 polar_naca0012 = TestCase('polar_naca0012') polar_naca0012.cfg_dir = "polar/naca0012" polar_naca0012.cfg_file = "inv_NACA0012.cfg" polar_naca0012.polar = True polar_naca0012.test_iter = 10 polar_naca0012.test_vals = [-1.319488, 4.112397, 0.011954, 0.009584] #last 4 columns polar_naca0012.su2_exec = "compute_polar.py -n 1 -i 11" polar_naca0012.timeout = 1600 polar_naca0012.tol = 0.00001 test_list.append(polar_naca0012) ########################## ### Compressible N-S ### ########################## # Laminar flat plate flatplate = TestCase('flatplate') flatplate.cfg_dir = "navierstokes/flatplate" flatplate.cfg_file = "lam_flatplate.cfg" flatplate.test_iter = 100 flatplate.test_vals = [-5.231916, 0.261866, -0.166832, 0.012717] #last 4 columns flatplate.su2_exec = "SU2_CFD" flatplate.timeout = 1600 flatplate.tol = 0.00001 test_list.append(flatplate) # Laminar cylinder (steady) cylinder = TestCase('cylinder') cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 cylinder.test_vals = [-6.765426, -1.297422, 0.019496, 0.310082] #last 4 columns cylinder.su2_exec = "SU2_CFD" cylinder.timeout = 1600 cylinder.tol = 0.00001 test_list.append(cylinder) # Laminar cylinder (low Mach correction) cylinder_lowmach = TestCase('cylinder_lowmach') cylinder_lowmach.cfg_dir = "navierstokes/cylinder" cylinder_lowmach.cfg_file = "cylinder_lowmach.cfg" cylinder_lowmach.test_iter = 25 cylinder_lowmach.test_vals = [-6.850123, -1.388088, -0.056090, 108.140177] #last 4 columns cylinder_lowmach.su2_exec = "SU2_CFD" cylinder_lowmach.timeout = 1600 cylinder_lowmach.tol = 0.00001 test_list.append(cylinder_lowmach) ########################## ### Compressible RANS ### ########################## # RAE2822 SA rae2822_sa = TestCase('rae2822_sa') rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 100 rae2822_sa.test_vals = [-3.442524, -5.441383, 0.884279, 0.024730] #last 4 columns rae2822_sa.su2_exec = "SU2_CFD" rae2822_sa.timeout = 1600 rae2822_sa.tol = 0.00001 test_list.append(rae2822_sa) # RAE2822 SST rae2822_sst = TestCase('rae2822_sst') rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 100 rae2822_sst.test_vals = [-1.185243, 4.018464, 0.886786, 0.024927] #last 4 columns rae2822_sst.su2_exec = "SU2_CFD" rae2822_sst.timeout = 1600 rae2822_sst.tol = 0.00001 test_list.append(rae2822_sst) # Flat plate turb_flatplate = TestCase('turb_flatplate') turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 100 turb_flatplate.test_vals = [-5.069447, -7.354601, -0.187187, 0.010831] #last 4 columns turb_flatplate.su2_exec = "SU2_CFD" turb_flatplate.timeout = 1600 turb_flatplate.tol = 0.00001 test_list.append(turb_flatplate) # ONERA M6 Wing turb_oneram6 = TestCase('turb_oneram6') turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 turb_oneram6.test_vals = [-2.327509, -6.563372, 0.230438, 0.155815]#last 4 columns turb_oneram6.su2_exec = "SU2_CFD" turb_oneram6.timeout = 3200 turb_oneram6.tol = 0.00001 test_list.append(turb_oneram6) # NACA0012 (SA, FUN3D results for finest grid: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 10 turb_naca0012_sa.test_vals = [-12.000763, -9.145363, 1.070528, 0.019417] #last 4 columns turb_naca0012_sa.su2_exec = "SU2_CFD" turb_naca0012_sa.timeout = 3200 turb_naca0012_sa.tol = 0.00001 test_list.append(turb_naca0012_sa) # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) turb_naca0012_sst = TestCase('turb_naca0012_sst') 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 = [-15.039675, -7.219913, 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 test_list.append(turb_naca0012_sst) # PROPELLER propeller = TestCase('propeller') propeller.cfg_dir = "rans/propeller" propeller.cfg_file = "propeller.cfg" propeller.test_iter = 10 propeller.test_vals = [-3.380312, -8.129519, 0.000043, 0.056159] #last 4 columns propeller.su2_exec = "SU2_CFD" propeller.timeout = 3200 propeller.tol = 0.00001 test_list.append(propeller) ############################# ### Incompressible Euler ### ############################# # NACA0012 Hydrofoil inc_euler_naca0012 = TestCase('inc_euler_naca0012') inc_euler_naca0012.cfg_dir = "incomp_euler/naca0012" inc_euler_naca0012.cfg_file = "incomp_NACA0012.cfg" inc_euler_naca0012.test_iter = 20 inc_euler_naca0012.test_vals = [-3.590333,-3.151515,0.960192,0.013260] #last 4 columns inc_euler_naca0012.su2_exec = "SU2_CFD" inc_euler_naca0012.timeout = 1600 inc_euler_naca0012.tol = 0.00001 test_list.append(inc_euler_naca0012) ############################ ### Incompressible RANS ### ############################ # NACA0012 inc_turb_naca0012 = TestCase('inc_turb_naca0012') inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 inc_turb_naca0012.test_vals = [-4.710052, -11.007500, -0.000001, 0.210445] #last 4 columns inc_turb_naca0012.su2_exec = "SU2_CFD" inc_turb_naca0012.timeout = 1600 inc_turb_naca0012.tol = 0.00001 test_list.append(inc_turb_naca0012) ######################### ### Transition ### ######################### # Schubauer-Klebanoff Natural Transition schubauer_klebanoff_transition = TestCase('Schubauer_Klebanoff') schubauer_klebanoff_transition.cfg_dir = "transition/Schubauer_Klebanoff" schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg" schubauer_klebanoff_transition.test_iter = 250 schubauer_klebanoff_transition.test_vals = [-9.474452, -15.630834, 0.000520, 0.001062] #last 4 columns schubauer_klebanoff_transition.su2_exec = "SU2_CFD" schubauer_klebanoff_transition.timeout = 1600 schubauer_klebanoff_transition.tol = 0.00001 test_list.append(schubauer_klebanoff_transition) ##################################### ### Cont. adj. compressible Euler ### ##################################### # Inviscid NACA0012 contadj_naca0012 = TestCase('contadj_naca0012') contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" contadj_naca0012.cfg_file = "inv_NACA0012.cfg" contadj_naca0012.test_iter = 5 contadj_naca0012.test_vals = [-9.787554, -15.192510, 0.300920, 0.019552] #last 4 columns contadj_naca0012.su2_exec = "SU2_CFD" contadj_naca0012.timeout = 1600 contadj_naca0012.tol = 0.00001 test_list.append(contadj_naca0012) # Inviscid ONERA M6 contadj_oneram6 = TestCase('contadj_oneram6') contadj_oneram6.cfg_dir = "cont_adj_euler/oneram6" contadj_oneram6.cfg_file = "inv_ONERAM6.cfg" contadj_oneram6.test_iter = 10 contadj_oneram6.test_vals = [-12.133352, -12.707213, 6.8590e-01, 0.007594] #last 4 columns contadj_oneram6.su2_exec = "SU2_CFD" contadj_oneram6.timeout = 1600 contadj_oneram6.tol = 0.00001 test_list.append(contadj_oneram6) # Inviscid WEDGE: tests generalized adjoint contadj_wedge = TestCase('contadj_wedge') contadj_wedge.cfg_dir = "cont_adj_euler/wedge" contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" contadj_wedge.test_iter = 10 contadj_wedge.test_vals = [2.780403, -3.223266, -1448300.000000, -0.000000] #last 4 columns contadj_wedge.su2_exec = "SU2_CFD" contadj_wedge.timeout = 1600 contadj_wedge.tol = 0.00001 test_list.append(contadj_wedge) # Inviscid fixed CL NACA0012 contadj_fixedCL_naca0012 = TestCase('contadj_fixedcl_naca0012') contadj_fixedCL_naca0012.cfg_dir = "fixed_cl/naca0012" contadj_fixedCL_naca0012.cfg_file = "inv_NACA0012_ContAdj.cfg" contadj_fixedCL_naca0012.test_iter = 500 contadj_fixedCL_naca0012.test_vals = [-2.896959, -8.484896, 0.250600, 0.000004] #last 4 columns contadj_fixedCL_naca0012.su2_exec = "SU2_CFD" contadj_fixedCL_naca0012.timeout = 1600 contadj_fixedCL_naca0012.tol = 0.00001 test_list.append(contadj_fixedCL_naca0012) ################################### ### Cont. adj. compressible N-S ### ################################### # Adjoint laminar cylinder contadj_ns_cylinder = TestCase('contadj_ns_cylinder') contadj_ns_cylinder.cfg_dir = "cont_adj_navierstokes/cylinder" contadj_ns_cylinder.cfg_file = "lam_cylinder.cfg" contadj_ns_cylinder.test_iter = 100 contadj_ns_cylinder.test_vals = [-3.677184, -9.141850, 2.056700, -0.000000] #last 4 columns contadj_ns_cylinder.su2_exec = "SU2_CFD" contadj_ns_cylinder.timeout = 1600 contadj_ns_cylinder.tol = 0.00001 test_list.append(contadj_ns_cylinder) # Adjoint laminar naca0012 subsonic contadj_ns_naca0012_sub = TestCase('contadj_ns_naca0012_sub') contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_sub.test_iter = 100 contadj_ns_naca0012_sub.test_vals = [-2.744551, -8.216469, 0.518810, 0.001210] #last 4 columns contadj_ns_naca0012_sub.su2_exec = "SU2_CFD" contadj_ns_naca0012_sub.timeout = 1600 contadj_ns_naca0012_sub.tol = 0.00001 test_list.append(contadj_ns_naca0012_sub) # Adjoint laminar naca0012 transonic contadj_ns_naca0012_trans = TestCase('contadj_ns_naca0012_trans') contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_trans.test_iter = 100 contadj_ns_naca0012_trans.test_vals = [-1.041539, -6.578524, 1.772300, 0.012494] #last 4 columns contadj_ns_naca0012_trans.su2_exec = "SU2_CFD" contadj_ns_naca0012_trans.timeout = 1600 contadj_ns_naca0012_trans.tol = 0.00001 test_list.append(contadj_ns_naca0012_trans) ####################################################### ### Cont. adj. compressible RANS (frozen viscosity) ### ####################################################### # Adjoint turbulent NACA0012 contadj_rans_naca0012 = TestCase('contadj_rans_naca0012') contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" contadj_rans_naca0012.test_iter = 100 contadj_rans_naca0012.test_vals = [-0.814757, -5.726517, 19.169000, -0.000000] #last 4 columns contadj_rans_naca0012.su2_exec = "SU2_CFD" contadj_rans_naca0012.timeout = 1600 contadj_rans_naca0012.tol = 0.00001 test_list.append(contadj_rans_naca0012) # Adjoint turbulent RAE2822 contadj_rans_rae2822 = TestCase('contadj_rans_rae2822') contadj_rans_rae2822.cfg_dir = "cont_adj_rans/rae2822" contadj_rans_rae2822.cfg_file = "turb_SA_RAE2822.cfg" contadj_rans_rae2822.test_iter = 100 contadj_rans_rae2822.test_vals = [-5.377843, -10.882446, -0.212470, 0.005448] #last 4 columns contadj_rans_rae2822.su2_exec = "SU2_CFD" contadj_rans_rae2822.timeout = 1600 contadj_rans_rae2822.tol = 0.00001 test_list.append(contadj_rans_rae2822) ####################################### ### Cont. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 contadj_incomp_NACA0012 = TestCase('contadj_incomp_NACA0012') contadj_incomp_NACA0012.cfg_dir = "cont_adj_incomp_euler/naca0012" contadj_incomp_NACA0012.cfg_file = "incomp_NACA0012.cfg" contadj_incomp_NACA0012.test_iter = 5 contadj_incomp_NACA0012.test_vals = [-11.980272, -12.146779, 1.9399, 0.000000] #last 4 columns contadj_incomp_NACA0012.su2_exec = "SU2_CFD" contadj_incomp_NACA0012.timeout = 1600 contadj_incomp_NACA0012.tol = 0.00001 test_list.append(contadj_incomp_NACA0012) ##################################### ### Cont. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder contadj_incomp_cylinder = TestCase('contadj_incomp_cylinder') contadj_incomp_cylinder.cfg_dir = "cont_adj_incomp_navierstokes/cylinder" contadj_incomp_cylinder.cfg_file = "lam_incomp_cylinder.cfg" contadj_incomp_cylinder.test_iter = 25 contadj_incomp_cylinder.test_vals = [-5.718622, -7.027366, 2.932100, 0.000000] #last 4 columns contadj_incomp_cylinder.su2_exec = "SU2_CFD" contadj_incomp_cylinder.timeout = 1600 contadj_incomp_cylinder.tol = 0.00001 test_list.append(contadj_incomp_cylinder) ###################################### ### Harmonic Balance ### ###################################### # Description of the regression test harmonic_balance = TestCase('harmonic_balance') harmonic_balance.cfg_dir = "harmonic_balance" harmonic_balance.cfg_file = "HB.cfg" harmonic_balance.test_iter = 25 harmonic_balance.test_vals = [-1.569573, 3.941896, 0.008780, 0.079775] #last 4 columns harmonic_balance.su2_exec = "SU2_CFD" harmonic_balance.timeout = 1600 harmonic_balance.tol = 0.00001 test_list.append(harmonic_balance) ###################################### ### Moving Wall ### ###################################### # Lid-driven cavity cavity = TestCase('cavity') cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 cavity.test_vals = [-5.627934, -0.164470, 0.051972, 2.547034] #last 4 columns cavity.su2_exec = "SU2_CFD" cavity.timeout = 1600 cavity.tol = 0.00001 test_list.append(cavity) # Spinning cylinder spinning_cylinder = TestCase('spinning_cylinder') spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 spinning_cylinder.test_vals = [-7.709662, -2.274900, 1.418422, 1.734206] #last 4 columns spinning_cylinder.su2_exec = "SU2_CFD" spinning_cylinder.timeout = 1600 spinning_cylinder.tol = 0.00001 test_list.append(spinning_cylinder) ###################################### ### Unsteady ### ###################################### # Square cylinder square_cylinder = TestCase('square_cylinder') square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 square_cylinder.test_vals = [-1.166406,0.076804,1.398548,2.197047] #last 4 columns square_cylinder.su2_exec = "SU2_CFD" square_cylinder.timeout = 1600 square_cylinder.tol = 0.00001 square_cylinder.unsteady = True test_list.append(square_cylinder) # Gust sine_gust = TestCase('sine_gust') sine_gust.cfg_dir = "gust" sine_gust.cfg_file = "inv_gust_NACA0012.cfg" sine_gust.test_iter = 5 sine_gust.test_vals = [-1.977531, 3.481790, -0.006222, -0.001342] #last 4 columns sine_gust.su2_exec = "SU2_CFD" sine_gust.timeout = 1600 sine_gust.tol = 0.00001 sine_gust.unsteady = True test_list.append(sine_gust) # Aeroelastic aeroelastic = TestCase('aeroelastic') aeroelastic.cfg_dir = "aeroelastic" aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" aeroelastic.test_iter = 2 aeroelastic.test_vals = [0.077106, 0.036449, -1.684916e-03, -1.131735e-04] #last 4 columns aeroelastic.su2_exec = "SU2_CFD" aeroelastic.timeout = 1600 aeroelastic.tol = 0.000001 aeroelastic.unsteady = True test_list.append(aeroelastic) ###################################### ### NICFD ### ###################################### # ls89_sa ls89_sa = TestCase('ls89_sa') ls89_sa.cfg_dir = "nicf/LS89" ls89_sa.cfg_file = "turb_SA_PR.cfg" ls89_sa.test_iter = 100 ls89_sa.test_vals = [-5.062991, -13.374292, 0.128005, 0.323965] #last 4 columns ls89_sa.su2_exec = "SU2_CFD" ls89_sa.timeout = 1600 ls89_sa.tol = 0.00001 test_list.append(ls89_sa) # # ls89_sst # ls89_sst = TestCase('ls89_sst') # ls89_sst.cfg_dir = "nicf/LS89" # ls89_sst.cfg_file = "turb_SST_PR.cfg" # ls89_sst.test_iter = 100 # ls89_sst.test_vals = [-8.548266, -1.449437, 0.067986, 0.151168] #last 4 columns # ls89_sst.su2_exec = "SU2_CFD" # ls89_sst.timeout = 1600 # ls89_sst.tol = 0.00001 # test_list.append(ls89_sst) # Rarefaction shock wave edge_VW edge_VW = TestCase('edge_VW') edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 100 edge_VW.test_vals = [-5.055874, 1.117978, -0.000009, 0.000000] #last 4 columns edge_VW.su2_exec = "SU2_CFD" edge_VW.timeout = 1600 edge_VW.tol = 0.00001 test_list.append(edge_VW) # Rarefaction shock wave edge_PPR edge_PPR = TestCase('edge_PPR') edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 100 edge_PPR.test_vals = [-5.484387, 0.656352, -0.000037, 0.000000] #last 4 columns edge_PPR.su2_exec = "SU2_CFD" edge_PPR.timeout = 1600 edge_PPR.tol = 0.00001 test_list.append(edge_PPR) ###################################### ### turboSU2 ### ###################################### # Mini centrifugal turbine blade centrifugal_blade = TestCase('centrifugal_blade') centrifugal_blade.cfg_dir = "turbomachinery/centrifugal_blade" centrifugal_blade.cfg_file = "centrifugal_blade.cfg" centrifugal_blade.test_iter = 100 centrifugal_blade.test_vals = [-9.106943, -0.460429, 1.069070e+01, 3.396010e-01] #last 4 columns centrifugal_blade.su2_exec = "SU2_CFD" centrifugal_blade.timeout = 1600 centrifugal_blade.tol = 0.000001 test_list.append(centrifugal_blade) # Mini centrifugal turbine stage centrifugal_stage = TestCase('centrifugal_stage') centrifugal_stage.cfg_dir = "turbomachinery/centrifugal_stage" centrifugal_stage.cfg_file = "centrifugal_stage.cfg" centrifugal_stage.test_iter = 100 centrifugal_stage.test_vals = [-10.166628, 1.621134, 22.064950, 0.527107] #last 4 columns centrifugal_stage.su2_exec = "SU2_CFD" centrifugal_stage.timeout = 1600 centrifugal_stage.tol = 0.000001 test_list.append(centrifugal_stage) ###################################### ### Sliding Mesh ### ###################################### # Uniform flow # uniform_flow = TestCase('uniform_flow') # uniform_flow.cfg_dir = "sliding_interface/uniform_flow" # uniform_flow.cfg_file = "uniform_NN.cfg" # uniform_flow.test_iter = 50 # uniform_flow.test_vals = [-0.368836, 5.156090, 0.000000, 0.000000] #last 4 columns # uniform_flow.su2_exec = "SU2_CFD" # uniform_flow.timeout = 1600 # uniform_flow.tol = 0.000001 # uniform_flow.unsteady = True # test_list.append(uniform_flow) # Channel_2D channel_2D = TestCase('channel_2D') channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_NN.cfg" channel_2D.test_iter = 4 channel_2D.test_vals = [-1.498300, 4.541411, 0.000000, 0.000000] #last 4 columns channel_2D.su2_exec = "SU2_CFD" channel_2D.timeout = 100 channel_2D.tol = 0.00001 channel_2D.unsteady = True test_list.append(channel_2D) # Channel_3D channel_3D = TestCase('channel_3D') channel_3D.cfg_dir = "sliding_interface/channel_3D" channel_3D.cfg_file = "channel_3D_NN.cfg" channel_3D.test_iter = 1 channel_3D.test_vals = [-1.899948, 4.032874, 0.000000, 0.000000] #last 4 columns channel_3D.su2_exec = "SU2_CFD" channel_3D.timeout = 1600 channel_3D.tol = 0.00001 channel_3D.unsteady = True test_list.append(channel_3D) # Pipe # pipe = TestCase('pipe') # pipe.cfg_dir = "sliding_interface/pipe" # pipe.cfg_file = "pipe_NN.cfg" # pipe.test_iter = 2 # pipe.test_vals = [-3.503708, 3.194241, 0.000000, 0.000000] #last 4 columns # pipe.su2_exec = "SU2_CFD" # pipe.timeout = 1600 # pipe.tol = 0.00001 # pipe.unsteady = True # test_list.append(pipe) ########################## ### FEA - FSI ### ########################## # Static beam, 3d statbeam3d = TestCase('statbeam3d') statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" statbeam3d.cfg_file = "configBeam_3d.cfg" statbeam3d.test_iter = 0 statbeam3d.test_vals = [-8.498274, -8.230638, -8.123824, 6.4095e+04] #last 4 columns statbeam3d.su2_exec = "SU2_CFD" statbeam3d.timeout = 1600 statbeam3d.tol = 0.00001 test_list.append(statbeam3d) # Dynamic beam, 2d dynbeam2d = TestCase('dynbeam2d') dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.test_iter = 6 dynbeam2d.test_vals = [-9.420640, -5.365872, -12.430382, 6.5210e+04] #last 4 columns dynbeam2d.su2_exec = "SU2_CFD" dynbeam2d.timeout = 1600 dynbeam2d.tol = 0.00001 test_list.append(dynbeam2d) # FSI, 2d fsi2d = TestCase('fsi2d') fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI_2D.cfg" fsi2d.test_iter = 4 fsi2d.test_vals = [2.000000, 0.500000, -7.777916, -1.139835] #last 4 columns fsi2d.su2_exec = "SU2_CFD" fsi2d.timeout = 1600 fsi2d.tol = 0.00001 test_list.append(fsi2d) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ###################################### ### RUN SU2_GEO TESTS ### ###################################### # NACA0012 naca0012_geo = TestCase('naca0012_geo') naca0012_geo.cfg_dir = "optimization_euler/steady_naca0012" naca0012_geo.cfg_file = "inv_NACA0012_adv.cfg" naca0012_geo.test_vals = [0.120011, 0.0816925, 0.0, 1.0] #max thickness, area, twist, chord naca0012_geo.su2_exec = "SU2_GEO" naca0012_geo.timeout = 1600 naca0012_geo.tol = 0.00001 pass_list.append(naca0012_geo.run_geo()) test_list.append(naca0012_geo) ###################################### ### RUN SU2_DEF TESTS ### ###################################### # Inviscid NACA0012 (triangles) naca0012_def = TestCase('naca0012_def') naca0012_def.cfg_dir = "deformation/naca0012" naca0012_def.cfg_file = "def_NACA0012.cfg" naca0012_def.test_iter = 400 naca0012_def.test_vals = [4.30698e-15] #residual naca0012_def.su2_exec = "SU2_DEF" naca0012_def.timeout = 1600 naca0012_def.tol = 1e-15 pass_list.append(naca0012_def.run_def()) test_list.append(naca0012_def) # RAE2822 (mixed tris + quads) rae2822_def = TestCase('rae2822_def') rae2822_def.cfg_dir = "deformation/rae2822" rae2822_def.cfg_file = "def_RAE2822.cfg" rae2822_def.test_iter = 150 rae2822_def.test_vals = [5.59336e-16] #residual rae2822_def.su2_exec = "SU2_DEF" rae2822_def.timeout = 1600 rae2822_def.tol = 1e-16 pass_list.append(rae2822_def.run_def()) test_list.append(rae2822_def) # Turb NACA4412 (quads, wall distance) naca4412_def = TestCase('naca4412_def') naca4412_def.cfg_dir = "deformation/naca4412" naca4412_def.cfg_file = "def_NACA4412.cfg" naca4412_def.test_iter = 300 naca4412_def.test_vals = [3.26428e-15] #residual naca4412_def.su2_exec = "SU2_DEF" naca4412_def.timeout = 1600 naca4412_def.tol = 1e-15 pass_list.append(naca4412_def.run_def()) test_list.append(naca4412_def) # Brick of tets (inverse volume) brick_tets_def = TestCase('brick_tets_def') brick_tets_def.cfg_dir = "deformation/brick_tets" brick_tets_def.cfg_file = "def_brick_tets.cfg" brick_tets_def.test_iter = 50 brick_tets_def.test_vals = [7.34025e-15] #residual brick_tets_def.su2_exec = "SU2_DEF" brick_tets_def.timeout = 1600 brick_tets_def.tol = 1e-15 pass_list.append(brick_tets_def.run_def()) test_list.append(brick_tets_def) # Brick of isotropic hexas (inverse volume) brick_hex_def = TestCase('brick_hex_def') brick_hex_def.cfg_dir = "deformation/brick_hex" brick_hex_def.cfg_file = "def_brick_hex.cfg" brick_hex_def.test_iter = 50 brick_hex_def.test_vals = [1.55154e-15] #residual brick_hex_def.su2_exec = "SU2_DEF" brick_hex_def.timeout = 1600 brick_hex_def.tol = 1e-15 pass_list.append(brick_hex_def.run_def()) test_list.append(brick_hex_def) # Brick with a pyramid layer (inverse volume) brick_pyra_def = TestCase('brick_pyra_def') brick_pyra_def.cfg_dir = "deformation/brick_pyra" brick_pyra_def.cfg_file = "def_brick_pyra.cfg" brick_pyra_def.test_iter = 400 brick_pyra_def.test_vals = [3.79432e-15] #residual brick_pyra_def.su2_exec = "SU2_DEF" brick_pyra_def.timeout = 1600 brick_pyra_def.tol = 1e-15 pass_list.append(brick_pyra_def.run_def()) test_list.append(brick_pyra_def) # Brick of isotropic prisms (inverse volume) brick_prism_def = TestCase('brick_prism_def') brick_prism_def.cfg_dir = "deformation/brick_prism" brick_prism_def.cfg_file = "def_brick_prism.cfg" brick_prism_def.test_iter = 150 brick_prism_def.test_vals = [9.14366e-15] #residual brick_prism_def.su2_exec = "SU2_DEF" brick_prism_def.timeout = 1600 brick_prism_def.tol = 1e-15 pass_list.append(brick_prism_def.run_def()) test_list.append(brick_prism_def) # Brick of prisms with high aspect ratio cells near the wall (wall distance) brick_prism_rans_def = TestCase('brick_prism_rans_def') brick_prism_rans_def.cfg_dir = "deformation/brick_prism_rans" brick_prism_rans_def.cfg_file = "def_brick_prism_rans.cfg" brick_prism_rans_def.test_iter = 100 brick_prism_rans_def.test_vals = [1.64462e-15] #residual brick_prism_rans_def.su2_exec = "SU2_DEF" brick_prism_rans_def.timeout = 1600 brick_prism_rans_def.tol = 1e-15 pass_list.append(brick_prism_rans_def.run_def()) test_list.append(brick_prism_rans_def) # Brick of hexas with high aspect ratio cells near the wall (inverse volume) brick_hex_rans_def = TestCase('brick_hex_rans_def') brick_hex_rans_def.cfg_dir = "deformation/brick_hex_rans" brick_hex_rans_def.cfg_file = "def_brick_hex_rans.cfg" brick_hex_rans_def.test_iter = 50 brick_hex_rans_def.test_vals = [9.26657e-16] #residual brick_hex_rans_def.su2_exec = "SU2_DEF" brick_hex_rans_def.timeout = 1600 brick_hex_rans_def.tol = 1e-16 pass_list.append(brick_hex_rans_def.run_def()) test_list.append(brick_hex_rans_def) # Cylindrical FFD test cylinder_ffd_def = TestCase('cylinder_ffd_def') cylinder_ffd_def.cfg_dir = "deformation/cylindrical_ffd" cylinder_ffd_def.cfg_file = "def_cylindrical.cfg" cylinder_ffd_def.test_iter = 50 cylinder_ffd_def.test_vals = [1.30556e-10] #residual cylinder_ffd_def.su2_exec = "SU2_DEF" cylinder_ffd_def.timeout = 1600 cylinder_ffd_def.tol = 1e-16 pass_list.append(cylinder_ffd_def.run_def()) test_list.append(cylinder_ffd_def) # Spherical FFD test sphere_ffd_def = TestCase('sphere_ffd_def') sphere_ffd_def.cfg_dir = "deformation/spherical_ffd" sphere_ffd_def.cfg_file = "def_spherical.cfg" sphere_ffd_def.test_iter = 50 sphere_ffd_def.test_vals = [1.09326e-10] #residual sphere_ffd_def.su2_exec = "SU2_DEF" sphere_ffd_def.timeout = 1600 sphere_ffd_def.tol = 1e-16 pass_list.append(sphere_ffd_def.run_def()) test_list.append(sphere_ffd_def) # Spherical FFD test using BSplines sphere_ffd_def_bspline = TestCase('sphere_ffd_def_bspline') sphere_ffd_def_bspline.cfg_dir = "deformation/spherical_ffd" sphere_ffd_def_bspline.cfg_file = "def_spherical_bspline.cfg" sphere_ffd_def_bspline.test_iter = 50 sphere_ffd_def_bspline.test_vals = [6.69927e-11] #residual sphere_ffd_def_bspline.su2_exec = "SU2_DEF" sphere_ffd_def_bspline.timeout = 1600 sphere_ffd_def_bspline.tol = 1e-16 pass_list.append(sphere_ffd_def_bspline.run_def()) test_list.append(sphere_ffd_def_bspline) ###################################### ### RUN PYTHON TESTS ### ###################################### # test continuous_adjoint.py contadj_euler_py = TestCase('contadj_euler_py') contadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" contadj_euler_py.cfg_file = "inv_NACA0012.cfg" contadj_euler_py.test_iter = 10 contadj_euler_py.su2_exec = "continuous_adjoint.py" contadj_euler_py.timeout = 1600 contadj_euler_py.reference_file = "of_grad_cd.dat.ref" contadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(contadj_euler_py.run_filediff()) test_list.append(contadj_euler_py) # test finite_difference.py findiff_euler_py = TestCase('findiff_euler_py') findiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" findiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" findiff_euler_py.test_iter = 10 findiff_euler_py.su2_exec = "finite_differences.py" findiff_euler_py.timeout = 1600 findiff_euler_py.reference_file = "of_grad_findiff.dat.ref" findiff_euler_py.test_file = "FINDIFF/of_grad_findiff.dat" pass_list.append(findiff_euler_py.run_filediff()) test_list.append(findiff_euler_py) # test shape_optimization.py shape_opt_euler_py = TestCase('shape_opt_euler_py') shape_opt_euler_py.cfg_dir = "optimization_euler/steady_naca0012" shape_opt_euler_py.cfg_file = "inv_NACA0012_adv.cfg" shape_opt_euler_py.test_iter = 1 shape_opt_euler_py.test_vals = [1, 1, 2.134974E-05, 3.829535E-03] #last 4 columns shape_opt_euler_py.su2_exec = "shape_optimization.py -f" shape_opt_euler_py.timeout = 1600 shape_opt_euler_py.tol = 0.00001 pass_list.append(shape_opt_euler_py.run_opt()) test_list.append(shape_opt_euler_py) # test continuous_adjoint.py, with multiple objectives #contadj_multi_py = TestCase('contadj_multi_py') #contadj_multi_py.cfg_dir = "cont_adj_euler/wedge" #contadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" #contadj_multi_py.test_iter = 10 #contadj_multi_py.su2_exec = "continuous_adjoint.py" #contadj_multi_py.timeout = 1600 #contadj_multi_py.reference_file = "of_grad_combo.dat.ref" #contadj_multi_py.test_file = "of_grad_combo.dat" #pass_list.append(contadj_multi_py.run_filediff()) #test_list.append(contadj_multi_py) ########################## ### Python wrapper ### ########################## # NACA0012 pywrapper_naca0012 = TestCase('pywrapper_naca0012') pywrapper_naca0012.cfg_dir = "euler/naca0012" pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" pywrapper_naca0012.test_iter = 100 pywrapper_naca0012.test_vals = [-6.191618, -5.592802, 0.334809, 0.022197] #last 4 columns pywrapper_naca0012.su2_exec = "SU2_CFD.py -f" pywrapper_naca0012.timeout = 1600 pywrapper_naca0012.tol = 0.00001 test_list.append(pywrapper_naca0012) pass_list.append(pywrapper_naca0012.run_test()) # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) pywrapper_turb_naca0012_sst = TestCase('pywrapper_turb_naca0012_sst') 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 = [-15.039675, -7.219913, 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 test_list.append(pywrapper_turb_naca0012_sst) pass_list.append(pywrapper_turb_naca0012_sst.run_test()) # Square cylinder pywrapper_square_cylinder = TestCase('pywrapper_square_cylinder') 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.166406,0.076804,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 pywrapper_square_cylinder.unsteady = True test_list.append(pywrapper_square_cylinder) pass_list.append(pywrapper_square_cylinder.run_test()) # Aeroelastic pywrapper_aeroelastic = TestCase('pywrapper_aeroelastic') pywrapper_aeroelastic.cfg_dir = "aeroelastic" pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" pywrapper_aeroelastic.test_iter = 2 pywrapper_aeroelastic.test_vals = [0.077106, 0.036449, -1.684916e-03, -1.131735e-04] #last 4 columns pywrapper_aeroelastic.su2_exec = "SU2_CFD.py -f" pywrapper_aeroelastic.timeout = 1600 pywrapper_aeroelastic.tol = 0.000001 pywrapper_aeroelastic.unsteady = True test_list.append(pywrapper_aeroelastic) pass_list.append(pywrapper_aeroelastic.run_test()) # FSI, 2d pywrapper_fsi2d = TestCase('pywrapper_fsi2d') pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI_2D.cfg" pywrapper_fsi2d.test_iter = 4 pywrapper_fsi2d.test_vals = [2.000000, 0.500000, -7.777916, -1.139835] #last 4 columns pywrapper_fsi2d.su2_exec = "SU2_CFD.py --nZone 2 --fsi True -f" pywrapper_fsi2d.timeout = 1600 pywrapper_fsi2d.tol = 0.00001 test_list.append(pywrapper_fsi2d) pass_list.append(pywrapper_fsi2d.run_test()) # Tests summary print '==================================================================' print 'Summary of the serial tests' for i, test in enumerate(test_list): if (pass_list[i]): print ' passed - %s'%test.tag else: print '* FAILED - %s'%test.tag if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.606839, -9.035212, -0.000000, 0.005688] #last 4 columns discadj_naca0012.su2_exec = "SU2_CFD_AD" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.724711, -4.052467, -0.000000, 0.000000] #last 4 columns discadj_cylinder3D.su2_exec = "SU2_CFD_AD" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) # Arina nozzle 2D discadj_arina2k = TestCase('discadj_arina2k') discadj_arina2k.cfg_dir = "disc_adj_euler/arina2k" discadj_arina2k.cfg_file = "Arina2KRS.cfg" discadj_arina2k.test_iter = 20 discadj_arina2k.test_vals = [-0.774805, -0.801209, 3.1979e+02, 0.0000e+00] #last 4 columns discadj_arina2k.su2_exec = "SU2_CFD_AD" discadj_arina2k.timeout = 8400 discadj_arina2k.tol = 0.00001 test_list.append(discadj_arina2k) ####################################################### ### Disc. adj. compressible RANS ### ####################################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [ -1.751962, 0.485751, 0.182121, -0.000018 ] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [ -1.654903, -0.491485, 0.109157, 0.000011 ] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [ -3.633197, -2.544956, 0.000000, 0.000000 ] #last 4 columns discadj_incomp_NACA0012.su2_exec = "SU2_CFD_AD" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder (Heated) discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [ -2.374306, -2.371564, 0.000000, 0.000000 ] #last 4 columns discadj_incomp_cylinder.su2_exec = "SU2_CFD_AD" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 SA discadj_incomp_turb_NACA0012_sa = TestCase( 'discadj_incomp_turb_NACA0012_sa') discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 discadj_incomp_turb_NACA0012_sa.test_vals = [ -3.845979, -1.031094, 0.000000, 0.000000 ] #last 4 columns discadj_incomp_turb_NACA0012_sa.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sa) # Adjoint Incompressible Turbulent NACA 0012 SST discadj_incomp_turb_NACA0012_sst = TestCase( 'discadj_incomp_turb_NACA0012_sst') discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 discadj_incomp_turb_NACA0012_sst.test_vals = [ -3.845759, -2.416668, 0.000000, 0.000000 ] #last 4 columns discadj_incomp_turb_NACA0012_sst.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746904, -1.544886, -0.008345, 0.000014] #last 4 columns discadj_cylinder.su2_exec = "SU2_CFD_AD" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ########################################################################## ### Unsteady Disc. adj. compressible RANS DualTimeStepping 1st order ### ########################################################################## # Turbulent Cylinder discadj_DT_1ST_cylinder = TestCase('unsteady_cylinder_DT_1ST') discadj_DT_1ST_cylinder.cfg_dir = "disc_adj_rans/cylinder_DT_1ST" discadj_DT_1ST_cylinder.cfg_file = "cylinder.cfg" discadj_DT_1ST_cylinder.test_iter = 9 discadj_DT_1ST_cylinder.test_vals = [ 3.698165, -1.607052, -2.2500e-03, 2.7211e-05 ] #last 4 columns discadj_DT_1ST_cylinder.su2_exec = "SU2_CFD_AD" discadj_DT_1ST_cylinder.timeout = 1600 discadj_DT_1ST_cylinder.tol = 0.00001 discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 9 discadj_fea.test_vals = [-6.282767, -6.361594, -3.6413e-04, -8.7087e+00] #last 4 columns discadj_fea.su2_exec = "SU2_CFD_AD" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Disc. adj. heat ### ################################### # Discrete adjoint for heated cylinder discadj_heat = TestCase('discadj_heat') discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 discadj_heat.test_vals = [3.176483, 1.144873, -1040.512028, -3277.663739] #last 4 columns discadj_heat.su2_exec = "SU2_CFD_AD" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 test_list.append(discadj_heat) ################################### ### Coupled FSI Adjoint ### ################################### # Structural model discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "configAD_fsi.cfg" discadj_fsi.test_iter = 3000 discadj_fsi.test_vals = [0.958848, -0.157183, 0.658415, 1.302076] #last 4 columns discadj_fsi.su2_exec = "SU2_CFD_AD" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) ###################################### ### RUN TESTS ### ###################################### pass_list = [test.run_test() for test in test_list] ###################################### ### RUN PYTHON TESTS ### ###################################### # test discrete_adjoint.py discadj_euler_py = TestCase('discadj_euler_py') discadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" discadj_euler_py.cfg_file = "inv_NACA0012.cfg" discadj_euler_py.test_iter = 10 discadj_euler_py.su2_exec = "discrete_adjoint.py" discadj_euler_py.timeout = 1600 discadj_euler_py.reference_file = "of_grad_cd_disc.dat.ref" discadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_euler_py.run_filediff()) test_list.append(discadj_euler_py) # test discrete_adjoint with multiple ffd boxes discadj_multiple_ffd_py = TestCase('discadj_multiple_ffd_py') discadj_multiple_ffd_py.cfg_dir = "multiple_ffd/naca0012" discadj_multiple_ffd_py.cfg_file = "inv_NACA0012_ffd.cfg" discadj_multiple_ffd_py.test_iter = 9 discadj_multiple_ffd_py.su2_exec = "discrete_adjoint.py" discadj_multiple_ffd_py.timeout = 1600 discadj_multiple_ffd_py.reference_file = "of_grad_cd.dat.ref" discadj_multiple_ffd_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_multiple_ffd_py.run_filediff()) test_list.append(discadj_multiple_ffd_py) # test direct_differentiation.py directdiff_euler_py = TestCase('directdiff_euler_py') directdiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" directdiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" directdiff_euler_py.test_iter = 10 directdiff_euler_py.su2_exec = "direct_differentiation.py" directdiff_euler_py.timeout = 1600 directdiff_euler_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_euler_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_euler_py.run_filediff()) test_list.append(directdiff_euler_py) # test direct_differentiation.py with multiple ffd boxes directdiff_multiple_ffd_py = TestCase('directdiff_multiple_ffd_py') directdiff_multiple_ffd_py.cfg_dir = "multiple_ffd/naca0012" directdiff_multiple_ffd_py.cfg_file = "inv_NACA0012_ffd.cfg" directdiff_multiple_ffd_py.test_iter = 9 directdiff_multiple_ffd_py.su2_exec = "direct_differentiation.py" directdiff_multiple_ffd_py.timeout = 1600 directdiff_multiple_ffd_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_multiple_ffd_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_multiple_ffd_py.run_filediff()) test_list.append(directdiff_multiple_ffd_py) # test continuous_adjoint.py, with multiple objectives discadj_multi_py = TestCase('discadj_multi_py') discadj_multi_py.cfg_dir = "cont_adj_euler/wedge" discadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" discadj_multi_py.test_iter = 10 discadj_multi_py.su2_exec = "discrete_adjoint.py" discadj_multi_py.timeout = 1600 discadj_multi_py.reference_file = "of_grad_combo.dat.refdiscrete" discadj_multi_py.test_file = "of_grad_combo.dat" pass_list.append(discadj_multi_py.run_filediff()) test_list.append(discadj_multi_py) # Tests summary print('==================================================================') print('Summary of the serial tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s' % test.tag) else: print('* FAILED - %s' % test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ########################## ### Compressible Euler ### ########################## # Channel channel = TestCase('channel') channel.cfg_dir = "euler/channel" channel.cfg_file = "inv_channel_RK.cfg" channel.test_iter = 100 channel.test_vals = [-3.071007, 2.301191, 0.008562, 0.028922] #last 4 columns channel.su2_exec = "parallel_computation.py -f" channel.timeout = 1600 channel.tol = 0.00001 test_list.append(channel) # NACA0012 naca0012 = TestCase('naca0012') naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe.cfg" naca0012.test_iter = 100 naca0012.test_vals = [-6.237188, -5.641250, 0.334843, 0.022206] #last 4 columns naca0012.su2_exec = "parallel_computation.py -f" naca0012.timeout = 1600 naca0012.tol = 0.00001 test_list.append(naca0012) # Supersonic wedge wedge = TestCase('wedge') wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 100 wedge.test_vals = [-1.690232, 3.924432, -0.252221, 0.044419] #last 4 columns wedge.su2_exec = "parallel_computation.py -f" wedge.timeout = 1600 wedge.tol = 0.00001 test_list.append(wedge) # ONERA M6 Wing oneram6 = TestCase('oneram6') oneram6.cfg_dir = "euler/oneram6" oneram6.cfg_file = "inv_ONERAM6.cfg" oneram6.test_iter = 10 oneram6.test_vals = [-13.400678, -12.932056, 0.282557, 0.012706] #last 4 columns oneram6.su2_exec = "parallel_computation.py -f" oneram6.timeout = 3200 oneram6.tol = 0.00001 test_list.append(oneram6) ########################## ### Compressible N-S ### ########################## # Laminar flat plate flatplate = TestCase('flatplate') flatplate.cfg_dir = "navierstokes/flatplate" flatplate.cfg_file = "lam_flatplate.cfg" flatplate.test_iter = 100 flatplate.test_vals = [-5.231727, 0.261637, -0.166869, 0.012707] #last 4 columns flatplate.su2_exec = "parallel_computation.py -f" flatplate.timeout = 1600 flatplate.tol = 0.00001 test_list.append(flatplate) # Laminar cylinder (steady) cylinder = TestCase('cylinder') cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 cylinder.test_vals = [-6.757291, -1.289309, -0.125948, 0.625438] #last 4 columns cylinder.su2_exec = "parallel_computation.py -f" cylinder.timeout = 1600 cylinder.tol = 0.00001 test_list.append(cylinder) # Laminar cylinder (low Mach correction) cylinder_lowmach = TestCase('cylinder_lowmach') cylinder_lowmach.cfg_dir = "navierstokes/cylinder" cylinder_lowmach.cfg_file = "cylinder_lowmach.cfg" cylinder_lowmach.test_iter = 25 cylinder_lowmach.test_vals = [-6.861860, -1.399846, -1.557250, 110.230719] #last 4 columns cylinder_lowmach.su2_exec = "parallel_computation.py -f" cylinder_lowmach.timeout = 1600 cylinder_lowmach.tol = 0.00001 test_list.append(cylinder_lowmach) ########################## ### Compressible RANS ### ########################## # RAE2822 SA rae2822_sa = TestCase('rae2822_sa') rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 100 rae2822_sa.test_vals = [-3.647743, -5.442583, 0.903159, 0.025800] #last 4 columns rae2822_sa.su2_exec = "parallel_computation.py -f" rae2822_sa.timeout = 1600 rae2822_sa.tol = 0.00001 test_list.append(rae2822_sa) # RAE2822 SST rae2822_sst = TestCase('rae2822_sst') rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 100 rae2822_sst.test_vals = [-1.198777, 4.013989, 0.904265, 0.025941] #last 4 columns rae2822_sst.su2_exec = "parallel_computation.py -f" rae2822_sst.timeout = 1600 rae2822_sst.tol = 0.00001 test_list.append(rae2822_sst) # Flat plate turb_flatplate = TestCase('turb_flatplate') turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 100 turb_flatplate.test_vals = [-5.071289, -7.366446, -0.187145, 0.010957] #last 4 columns turb_flatplate.su2_exec = "parallel_computation.py -f" turb_flatplate.timeout = 1600 turb_flatplate.tol = 0.00001 test_list.append(turb_flatplate) # ONERA M6 Wing turb_oneram6 = TestCase('turb_oneram6') turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 turb_oneram6.test_vals = [-2.327509, -6.563372, 0.230438, 0.155815] #last 4 columns turb_oneram6.su2_exec = "parallel_computation.py -f" turb_oneram6.timeout = 3200 turb_oneram6.tol = 0.00001 test_list.append(turb_oneram6) # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 10 turb_naca0012_sa.test_vals = [-12.000764, -9.145363, 1.070528, 0.019417] #last 4 columns turb_naca0012_sa.su2_exec = "parallel_computation.py -f" turb_naca0012_sa.timeout = 3200 turb_naca0012_sa.tol = 0.00001 test_list.append(turb_naca0012_sa) # NACA0012 (SST, FUN3D finest grid results: CL=1.0840, CD=0.01253) turb_naca0012_sst = TestCase('turb_naca0012_sst') 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 = [-15.039645, -7.220177, 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 test_list.append(turb_naca0012_sst) ############################ ### Incompressible RANS ### ############################ # NACA0012 inc_turb_naca0012 = TestCase('inc_turb_naca0012') inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 inc_turb_naca0012.test_vals = [-4.710048, -11.007498, 0.000002, 0.210441] #last 4 columns inc_turb_naca0012.su2_exec = "parallel_computation.py -f" inc_turb_naca0012.timeout = 1600 inc_turb_naca0012.tol = 0.00001 test_list.append(inc_turb_naca0012) ##################################### ### Cont. adj. compressible Euler ### ##################################### # Inviscid NACA0012 contadj_naca0012 = TestCase('contadj_naca0012') contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" contadj_naca0012.cfg_file = "inv_NACA0012.cfg" contadj_naca0012.test_iter = 5 contadj_naca0012.test_vals = [-9.783712, -15.192812, 0.300920, 0.536870] #last 4 columns contadj_naca0012.su2_exec = "parallel_computation.py -f" contadj_naca0012.timeout = 1600 contadj_naca0012.tol = 0.00001 test_list.append(contadj_naca0012) # Inviscid ONERA M6 contadj_oneram6 = TestCase('contadj_oneram6') contadj_oneram6.cfg_dir = "cont_adj_euler/oneram6" contadj_oneram6.cfg_file = "inv_ONERAM6.cfg" contadj_oneram6.test_iter = 10 contadj_oneram6.test_vals = [-12.131587, -12.703243, 0.685900, 0.140920] #last 4 columns contadj_oneram6.su2_exec = "parallel_computation.py -f" contadj_oneram6.timeout = 1600 contadj_oneram6.tol = 0.00001 test_list.append(contadj_oneram6) # Inviscid WEDGE: generalized adjoint and custom DV contadj_wedge = TestCase('contadj_wedge') contadj_wedge.cfg_dir = "cont_adj_euler/wedge" contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" contadj_wedge.test_iter = 10 contadj_wedge.test_vals = [2.780403, -3.223266, -1448300.000000, -0.000004] #last 4 columns contadj_wedge.su2_exec = "parallel_computation.py -f" contadj_wedge.timeout = 1600 contadj_wedge.tol = 0.00001 test_list.append(contadj_wedge) ################################### ### Cont. adj. compressible N-S ### ################################### # Adjoint laminar cylinder contadj_ns_cylinder = TestCase('contadj_ns_cylinder') contadj_ns_cylinder.cfg_dir = "cont_adj_navierstokes/cylinder" contadj_ns_cylinder.cfg_file = "lam_cylinder.cfg" contadj_ns_cylinder.test_iter = 100 contadj_ns_cylinder.test_vals = [-3.659040, -9.117773, 2.056700, 4.497000] #last 4 columns contadj_ns_cylinder.su2_exec = "parallel_computation.py -f" contadj_ns_cylinder.timeout = 1600 contadj_ns_cylinder.tol = 0.00001 test_list.append(contadj_ns_cylinder) # Adjoint laminar naca0012 subsonic contadj_ns_naca0012_sub = TestCase('contadj_ns_naca0012_sub') contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_sub.test_iter = 100 contadj_ns_naca0012_sub.test_vals = [-2.744551, -8.216469, 0.518810, 0.229160] #last 4 columns contadj_ns_naca0012_sub.su2_exec = "parallel_computation.py -f" contadj_ns_naca0012_sub.timeout = 1600 contadj_ns_naca0012_sub.tol = 0.00001 test_list.append(contadj_ns_naca0012_sub) # Adjoint laminar naca0012 transonic contadj_ns_naca0012_trans = TestCase('contadj_ns_naca0012_trans') contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_trans.test_iter = 100 contadj_ns_naca0012_trans.test_vals = [-1.041539, -6.578524, 1.772300, 0.620880] #last 4 columns contadj_ns_naca0012_trans.su2_exec = "parallel_computation.py -f" contadj_ns_naca0012_trans.timeout = 1600 contadj_ns_naca0012_trans.tol = 0.00001 test_list.append(contadj_ns_naca0012_trans) ####################################################### ### Cont. adj. compressible RANS (frozen viscosity) ### ####################################################### # Adjoint turbulent NACA0012 contadj_rans_naca0012 = TestCase('contadj_rans_naca0012') contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" contadj_rans_naca0012.test_iter = 100 contadj_rans_naca0012.test_vals = [-0.814757, -5.726517, 19.169000, -2.994100] #last 4 columns contadj_rans_naca0012.su2_exec = "parallel_computation.py -f" contadj_rans_naca0012.timeout = 1600 contadj_rans_naca0012.tol = 0.00001 test_list.append(contadj_rans_naca0012) # Adjoint turbulent RAE2822 contadj_rans_rae2822 = TestCase('contadj_rans_rae822') contadj_rans_rae2822.cfg_dir = "cont_adj_rans/rae2822" contadj_rans_rae2822.cfg_file = "turb_SA_RAE2822.cfg" contadj_rans_rae2822.test_iter = 100 contadj_rans_rae2822.test_vals = [-5.380929, -10.886092, -0.212470, 0.269390] #last 4 columns contadj_rans_rae2822.su2_exec = "parallel_computation.py -f" contadj_rans_rae2822.timeout = 1600 contadj_rans_rae2822.tol = 0.00001 test_list.append(contadj_rans_rae2822) ####################################### ### Cont. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 contadj_incomp_NACA0012 = TestCase('contadj_incomp_NACA0012') contadj_incomp_NACA0012.cfg_dir = "cont_adj_incomp_euler/naca0012" contadj_incomp_NACA0012.cfg_file = "incomp_NACA0012.cfg" contadj_incomp_NACA0012.test_iter = 5 contadj_incomp_NACA0012.test_vals = [-11.968536, -12.133235, 1.939900, 0.000000] #last 4 columns contadj_incomp_NACA0012.su2_exec = "parallel_computation.py -f" contadj_incomp_NACA0012.timeout = 1600 contadj_incomp_NACA0012.tol = 0.00001 test_list.append(contadj_incomp_NACA0012) ##################################### ### Cont. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder contadj_incomp_cylinder = TestCase('contadj_incomp_cylinder') contadj_incomp_cylinder.cfg_dir = "cont_adj_incomp_navierstokes/cylinder" contadj_incomp_cylinder.cfg_file = "lam_incomp_cylinder.cfg" contadj_incomp_cylinder.test_iter = 25 contadj_incomp_cylinder.test_vals = [-5.718840, -7.012324, 2.932100, 0.000000] #last 4 columns contadj_incomp_cylinder.su2_exec = "parallel_computation.py -f" contadj_incomp_cylinder.timeout = 1600 contadj_incomp_cylinder.tol = 0.00001 test_list.append(contadj_incomp_cylinder) ###################################### ### Moving Wall ### ###################################### # Lid-driven cavity cavity = TestCase('cavity') cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 cavity.test_vals = [-5.597018, -0.133158, 0.169034, 0.821371] #last 4 columns cavity.su2_exec = "parallel_computation.py -f" cavity.timeout = 1600 cavity.tol = 0.00001 test_list.append(cavity) # Spinning cylinder spinning_cylinder = TestCase('spinning_cylinder') spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 spinning_cylinder.test_vals = [-7.648320, -2.202753, 1.236836, 1.609040] #last 4 columns spinning_cylinder.su2_exec = "parallel_computation.py -f" spinning_cylinder.timeout = 1600 spinning_cylinder.tol = 0.00001 test_list.append(spinning_cylinder) ###################################### ### Unsteady ### ###################################### # Square cylinder square_cylinder = TestCase('square_cylinder') square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 square_cylinder.test_vals = [-1.166422,0.076751,1.398549,2.197047] #last 4 columns square_cylinder.su2_exec = "parallel_computation.py -f" square_cylinder.timeout = 1600 square_cylinder.tol = 0.00001 square_cylinder.unsteady = True test_list.append(square_cylinder) # Gust sine_gust = TestCase('sine_gust') sine_gust.cfg_dir = "gust" sine_gust.cfg_file = "inv_gust_NACA0012.cfg" sine_gust.test_iter = 5 sine_gust.test_vals = [-1.977531, 3.481790, -0.014552, -0.004969] #last 4 columns sine_gust.su2_exec = "parallel_computation.py -f" sine_gust.timeout = 1600 sine_gust.tol = 0.00001 sine_gust.unsteady = True test_list.append(sine_gust) # Aeroelastic aeroelastic = TestCase('aeroelastic') aeroelastic.cfg_dir = "aeroelastic" aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" aeroelastic.test_iter = 2 aeroelastic.test_vals = [0.077169, 0.036452, -0.001685, -0.000113] #last 4 columns aeroelastic.su2_exec = "parallel_computation.py -f" aeroelastic.timeout = 1600 aeroelastic.tol = 0.000001 aeroelastic.unsteady = True test_list.append(aeroelastic) ###################################### ### NICFD ### ###################################### # Rarefaction shock wave edge_VW edge_VW = TestCase('edge_VW') edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 100 edge_VW.test_vals = [-5.058481, 1.115321, -0.000009, 0.000000] #last 4 columns edge_VW.su2_exec = "parallel_computation.py -f" edge_VW.timeout = 1600 edge_VW.tol = 0.00001 test_list.append(edge_VW) # Rarefaction shock wave edge_PPR edge_PPR = TestCase('edge_PPR') edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 100 edge_PPR.test_vals = [-5.486409, 0.654417, -0.000037, 0.000000] #last 4 columns edge_PPR.su2_exec = "parallel_computation.py -f" edge_PPR.timeout = 1600 edge_PPR.tol = 0.00001 test_list.append(edge_PPR) ########################## ### FEA - FSI ### ########################## # Static beam, 3d statbeam3d = TestCase('statbeam3d') statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" statbeam3d.cfg_file = "configBeam_3d.cfg" statbeam3d.test_iter = 0 statbeam3d.test_vals = [-8.520066, -8.069308, -8.062384, 64095.000000] #last 4 columns statbeam3d.su2_exec = "parallel_computation_fsi.py -f" statbeam3d.timeout = 1600 statbeam3d.tol = 0.00001 test_list.append(statbeam3d) # Dynamic beam, 2d dynbeam2d = TestCase('dynbeam2d') dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.test_iter = 6 dynbeam2d.test_vals = [-9.420641, -5.365871, -12.430382, 6.5210e+04] #last 4 columns dynbeam2d.su2_exec = "parallel_computation_fsi.py -f" dynbeam2d.timeout = 1600 dynbeam2d.tol = 0.00001 test_list.append(dynbeam2d) # FSI, 2d fsi2d = TestCase('fsi2d') fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI_2D.cfg" fsi2d.test_iter = 4 fsi2d.test_vals = [2.000000, 0.500000, -7.777910, -1.139830] #last 4 columns fsi2d.su2_exec = "parallel_computation_fsi.py -f" fsi2d.timeout = 1600 fsi2d.tol = 0.00001 test_list.append(fsi2d) ########################## ### Python wrapper ### ########################## # NACA0012 pywrapper_naca0012 = TestCase('pywrapper_naca0012') pywrapper_naca0012.cfg_dir = "euler/naca0012" pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" pywrapper_naca0012.test_iter = 100 pywrapper_naca0012.test_vals = [-6.237188, -5.641250, 0.334843, 0.022206] #last 4 columns pywrapper_naca0012.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py -f" pywrapper_naca0012.timeout = 1600 pywrapper_naca0012.tol = 0.00001 test_list.append(pywrapper_naca0012) # NACA0012 (SST, FUN3D results for finest grid: CL=1.0840, CD=0.01253) pywrapper_turb_naca0012_sst = TestCase('pywrapper_turb_naca0012_sst') 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 = [-15.039645, -7.220177, 1.059622, 0.019138] #last 4 columns pywrapper_turb_naca0012_sst.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py -f" pywrapper_turb_naca0012_sst.timeout = 3200 pywrapper_turb_naca0012_sst.tol = 0.00001 test_list.append(pywrapper_turb_naca0012_sst) # Square cylinder pywrapper_square_cylinder = TestCase('pywrapper_square_cylinder') 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.166422,0.076751,1.398549,2.197047] #last 4 columns pywrapper_square_cylinder.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py -f" pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 pywrapper_square_cylinder.unsteady = True test_list.append(pywrapper_square_cylinder) # Aeroelastic pywrapper_aeroelastic = TestCase('pywrapper_aeroelastic') pywrapper_aeroelastic.cfg_dir = "aeroelastic" pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" pywrapper_aeroelastic.test_iter = 2 pywrapper_aeroelastic.test_vals = [0.077169, 0.036452, -0.001685, -0.000113] #last 4 columns pywrapper_aeroelastic.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py -f" pywrapper_aeroelastic.timeout = 1600 pywrapper_aeroelastic.tol = 0.000001 pywrapper_aeroelastic.unsteady = True test_list.append(pywrapper_aeroelastic) # FSI, 2d pywrapper_fsi2d = TestCase('pywrapper_fsi2d') pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI_2D.cfg" pywrapper_fsi2d.test_iter = 4 pywrapper_fsi2d.test_vals = [2.000000, 0.500000, -7.777910, -1.139830] #last 4 columns pywrapper_fsi2d.su2_exec = "mpirun -np 2 pyWrap_SU2_CFD.py --nZone 2 --fsi True -f" pywrapper_fsi2d.timeout = 1600 pywrapper_fsi2d.tol = 0.00001 test_list.append(pywrapper_fsi2d) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ###################################### ### RUN SU2_DEF TESTS ### ###################################### # Inviscid NACA0012 (triangles) naca0012_def = TestCase('naca0012_def') naca0012_def.cfg_dir = "deformation/naca0012" naca0012_def.cfg_file = "def_NACA0012.cfg" naca0012_def.test_iter = 250 naca0012_def.test_vals = [5.44754e-15] #residual naca0012_def.su2_exec = "mpirun -n 2 SU2_DEF" naca0012_def.timeout = 1600 naca0012_def.tol = 1e-15 pass_list.append(naca0012_def.run_def()) test_list.append(naca0012_def) # RAE2822 (mixed tris + quads) rae2822_def = TestCase('rae2822_def') rae2822_def.cfg_dir = "deformation/rae2822" rae2822_def.cfg_file = "def_RAE2822.cfg" rae2822_def.test_iter = 150 rae2822_def.test_vals = [1.47076e-15] #residual rae2822_def.su2_exec = "mpirun -n 2 SU2_DEF" rae2822_def.timeout = 1600 rae2822_def.tol = 1e-16 pass_list.append(rae2822_def.run_def()) test_list.append(rae2822_def) # Turb NACA4412 (quads, wall distance) naca4412_def = TestCase('naca4412_def') naca4412_def.cfg_dir = "deformation/naca4412" naca4412_def.cfg_file = "def_NACA4412.cfg" naca4412_def.test_iter = 300 naca4412_def.test_vals = [4.46129e-15] #residual naca4412_def.su2_exec = "mpirun -n 2 SU2_DEF" naca4412_def.timeout = 1600 naca4412_def.tol = 1e-15 pass_list.append(naca4412_def.run_def()) test_list.append(naca4412_def) # Brick of tets (inverse volume) brick_tets_def = TestCase('brick_tets_def') brick_tets_def.cfg_dir = "deformation/brick_tets" brick_tets_def.cfg_file = "def_brick_tets.cfg" brick_tets_def.test_iter = 1000 brick_tets_def.test_vals = [9.35558e-16] #residual brick_tets_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_tets_def.timeout = 1600 brick_tets_def.tol = 1e-15 pass_list.append(brick_tets_def.run_def()) test_list.append(brick_tets_def) # Brick of isotropic hexas (inverse volume) brick_hex_def = TestCase('brick_hex_def') brick_hex_def.cfg_dir = "deformation/brick_hex" brick_hex_def.cfg_file = "def_brick_hex.cfg" brick_hex_def.test_iter = 1000 brick_hex_def.test_vals = [1.46423e-15] #residual brick_hex_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_hex_def.timeout = 1600 brick_hex_def.tol = 1e-15 pass_list.append(brick_hex_def.run_def()) test_list.append(brick_hex_def) # Brick with a pyramid layer (inverse volume) brick_pyra_def = TestCase('brick_pyra_def') brick_pyra_def.cfg_dir = "deformation/brick_pyra" brick_pyra_def.cfg_file = "def_brick_pyra.cfg" brick_pyra_def.test_iter = 100 brick_pyra_def.test_vals = [5.97202e-15] #residual brick_pyra_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_pyra_def.timeout = 1600 brick_pyra_def.tol = 1e-15 pass_list.append(brick_pyra_def.run_def()) test_list.append(brick_pyra_def) # Brick of isotropic prisms (inverse volume) brick_prism_def = TestCase('brick_prism_def') brick_prism_def.cfg_dir = "deformation/brick_prism" brick_prism_def.cfg_file = "def_brick_prism.cfg" brick_prism_def.test_iter = 100 brick_prism_def.test_vals = [2.80867e-14] #residual brick_prism_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_prism_def.timeout = 1600 brick_prism_def.tol = 1e-15 pass_list.append(brick_prism_def.run_def()) test_list.append(brick_prism_def) # Brick of prisms with high aspect ratio cells near the wall (wall distance) brick_prism_rans_def = TestCase('brick_prism_rans_def') brick_prism_rans_def.cfg_dir = "deformation/brick_prism_rans" brick_prism_rans_def.cfg_file = "def_brick_prism_rans.cfg" brick_prism_rans_def.test_iter = 50 brick_prism_rans_def.test_vals = [3.5265e-15] #residual brick_prism_rans_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_prism_rans_def.timeout = 1600 brick_prism_rans_def.tol = 1e-15 pass_list.append(brick_prism_rans_def.run_def()) test_list.append(brick_prism_rans_def) # Brick of hexas with high aspect ratio cells near the wall (inverse volume) brick_hex_rans_def = TestCase('brick_hex_rans_def') brick_hex_rans_def.cfg_dir = "deformation/brick_hex_rans" brick_hex_rans_def.cfg_file = "def_brick_hex_rans.cfg" brick_hex_rans_def.test_iter = 600 brick_hex_rans_def.test_vals = [2.75292e-14] #residual brick_hex_rans_def.su2_exec = "mpirun -n 2 SU2_DEF" brick_hex_rans_def.timeout = 1600 brick_hex_rans_def.tol = 1e-16 pass_list.append(brick_hex_rans_def.run_def()) test_list.append(brick_hex_rans_def) ###################################### ### RUN EXTERNAL FSI COUPLING TEST ### ###################################### # Pitch-plunge NACA 0012 (external FSI coupling) coupled_FSI = TestCase('coupled_FSI') coupled_FSI.cfg_dir = "coupled_fsi/2d_aeroelasticity" coupled_FSI.cfg_file = "FSICoupler_config.cfg" coupled_FSI.test_iter = 1 coupled_FSI.su2_exec = "mpirun -np 2 fsi_computation.py" coupled_FSI.timeout = 1600 coupled_FSI.reference_file = "StructHistory.dat.ref_parallel" coupled_FSI.test_file = "StructHistory.dat" pass_list.append(coupled_FSI.run_filediff()) test_list.append(coupled_FSI) # Tests summary print '==================================================================' print 'Summary of the parallel tests' for i, test in enumerate(test_list): if (pass_list[i]): print ' passed - %s'%test.tag else: print '* FAILED - %s'%test.tag if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.606839, -9.035212, -0.000000, 0.005688] #last 4 columns discadj_naca0012.su2_exec = "SU2_CFD_AD" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.724711, -4.052467, -0.000000, 0.000000] #last 4 columns discadj_cylinder3D.su2_exec = "SU2_CFD_AD" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) # Arina nozzle 2D discadj_arina2k = TestCase('discadj_arina2k') discadj_arina2k.cfg_dir = "disc_adj_euler/arina2k" discadj_arina2k.cfg_file = "Arina2KRS.cfg" discadj_arina2k.test_iter = 20 discadj_arina2k.test_vals = [-0.774805, -0.801209, 3.1979e+02, 0.0000e+00] #last 4 columns discadj_arina2k.su2_exec = "SU2_CFD_AD" discadj_arina2k.timeout = 8400 discadj_arina2k.tol = 0.00001 test_list.append(discadj_arina2k) ####################################################### ### Disc. adj. compressible RANS ### ####################################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [-1.751962, 0.485751, 0.182121, -0.000018] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [-1.654903, -0.491485, 0.109157, 0.000011] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [-3.633197, -2.544956, 0.000000, 0.000000] #last 4 columns discadj_incomp_NACA0012.su2_exec = "SU2_CFD_AD" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder (Heated) discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [-2.374306, -2.371564, 0.000000, 0.000000] #last 4 columns discadj_incomp_cylinder.su2_exec = "SU2_CFD_AD" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 SA discadj_incomp_turb_NACA0012_sa = TestCase('discadj_incomp_turb_NACA0012_sa') discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 discadj_incomp_turb_NACA0012_sa.test_vals = [-3.845979, -1.031094, 0.000000, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sa.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sa) # Adjoint Incompressible Turbulent NACA 0012 SST discadj_incomp_turb_NACA0012_sst = TestCase('discadj_incomp_turb_NACA0012_sst') discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845759, -2.416668, 0.000000, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sst.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746904, -1.544886, -0.008345, 0.000014] #last 4 columns discadj_cylinder.su2_exec = "SU2_CFD_AD" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ########################################################################## ### Unsteady Disc. adj. compressible RANS DualTimeStepping 1st order ### ########################################################################## # Turbulent Cylinder discadj_DT_1ST_cylinder = TestCase('unsteady_cylinder_DT_1ST') discadj_DT_1ST_cylinder.cfg_dir = "disc_adj_rans/cylinder_DT_1ST" discadj_DT_1ST_cylinder.cfg_file = "cylinder.cfg" discadj_DT_1ST_cylinder.test_iter = 9 discadj_DT_1ST_cylinder.test_vals = [3.698165, -1.607052, -2.2500e-03, 2.7211e-05] #last 4 columns discadj_DT_1ST_cylinder.su2_exec = "SU2_CFD_AD" discadj_DT_1ST_cylinder.timeout = 1600 discadj_DT_1ST_cylinder.tol = 0.00001 discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 9 discadj_fea.test_vals = [-6.282767, -6.361594, -3.6413e-04, -8.7087e+00] #last 4 columns discadj_fea.su2_exec = "SU2_CFD_AD" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Disc. adj. heat ### ################################### # Discrete adjoint for heated cylinder discadj_heat = TestCase('discadj_heat') discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 discadj_heat.test_vals = [3.176483, 1.144873, -1040.512028, -3277.663739] #last 4 columns discadj_heat.su2_exec = "SU2_CFD_AD" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 test_list.append(discadj_heat) ################################### ### Coupled FSI Adjoint ### ################################### # Structural model discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "configAD_fsi.cfg" discadj_fsi.test_iter = 3000 discadj_fsi.test_vals = [0.958848,-0.157183,0.658415,1.302076] #last 4 columns discadj_fsi.su2_exec = "SU2_CFD_AD" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ###################################### ### RUN PYTHON TESTS ### ###################################### # test discrete_adjoint.py discadj_euler_py = TestCase('discadj_euler_py') discadj_euler_py.cfg_dir = "cont_adj_euler/naca0012" discadj_euler_py.cfg_file = "inv_NACA0012.cfg" discadj_euler_py.test_iter = 10 discadj_euler_py.su2_exec = "discrete_adjoint.py" discadj_euler_py.timeout = 1600 discadj_euler_py.reference_file = "of_grad_cd_disc.dat.ref" discadj_euler_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_euler_py.run_filediff()) test_list.append(discadj_euler_py) # test discrete_adjoint with multiple ffd boxes discadj_multiple_ffd_py = TestCase('discadj_multiple_ffd_py') discadj_multiple_ffd_py.cfg_dir = "multiple_ffd/naca0012" discadj_multiple_ffd_py.cfg_file = "inv_NACA0012_ffd.cfg" discadj_multiple_ffd_py.test_iter = 9 discadj_multiple_ffd_py.su2_exec = "discrete_adjoint.py" discadj_multiple_ffd_py.timeout = 1600 discadj_multiple_ffd_py.reference_file = "of_grad_cd.dat.ref" discadj_multiple_ffd_py.test_file = "of_grad_cd.dat" pass_list.append(discadj_multiple_ffd_py.run_filediff()) test_list.append(discadj_multiple_ffd_py) # test direct_differentiation.py directdiff_euler_py = TestCase('directdiff_euler_py') directdiff_euler_py.cfg_dir = "cont_adj_euler/naca0012" directdiff_euler_py.cfg_file = "inv_NACA0012_FD.cfg" directdiff_euler_py.test_iter = 10 directdiff_euler_py.su2_exec = "direct_differentiation.py" directdiff_euler_py.timeout = 1600 directdiff_euler_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_euler_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_euler_py.run_filediff()) test_list.append(directdiff_euler_py) # test direct_differentiation.py with multiple ffd boxes directdiff_multiple_ffd_py = TestCase('directdiff_multiple_ffd_py') directdiff_multiple_ffd_py.cfg_dir = "multiple_ffd/naca0012" directdiff_multiple_ffd_py.cfg_file = "inv_NACA0012_ffd.cfg" directdiff_multiple_ffd_py.test_iter = 9 directdiff_multiple_ffd_py.su2_exec = "direct_differentiation.py" directdiff_multiple_ffd_py.timeout = 1600 directdiff_multiple_ffd_py.reference_file = "of_grad_directdiff.dat.ref" directdiff_multiple_ffd_py.test_file = "DIRECTDIFF/of_grad_directdiff.dat" pass_list.append(directdiff_multiple_ffd_py.run_filediff()) test_list.append(directdiff_multiple_ffd_py) # test continuous_adjoint.py, with multiple objectives discadj_multi_py = TestCase('discadj_multi_py') discadj_multi_py.cfg_dir = "cont_adj_euler/wedge" discadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" discadj_multi_py.test_iter = 10 discadj_multi_py.su2_exec = "discrete_adjoint.py" discadj_multi_py.timeout = 1600 discadj_multi_py.reference_file = "of_grad_combo.dat.refdiscrete" discadj_multi_py.test_file = "of_grad_combo.dat" pass_list.append(discadj_multi_py.run_filediff()) test_list.append(discadj_multi_py) # Tests summary print('==================================================================') print('Summary of the serial tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s'%test.tag) else: print('* FAILED - %s'%test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)
def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' test_list = [] ##################################### ### Disc. adj. compressible Euler ### ##################################### # Inviscid NACA0012 discadj_naca0012 = TestCase('discadj_naca0012') discadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" discadj_naca0012.cfg_file = "inv_NACA0012_discadj.cfg" discadj_naca0012.test_iter = 100 discadj_naca0012.test_vals = [-3.606841, -9.035214, -0.000000, 0.005688] #last 4 columns discadj_naca0012.su2_exec = "parallel_computation.py -f" discadj_naca0012.timeout = 1600 discadj_naca0012.tol = 0.00001 test_list.append(discadj_naca0012) # Inviscid Cylinder 3D (multiple markers) discadj_cylinder3D = TestCase('discadj_cylinder3D') discadj_cylinder3D.cfg_dir = "disc_adj_euler/cylinder3D" discadj_cylinder3D.cfg_file = "inv_cylinder3D.cfg" discadj_cylinder3D.test_iter = 5 discadj_cylinder3D.test_vals = [-3.719306, -4.038129, 0.000000, 0.000000] #last 4 columns discadj_cylinder3D.su2_exec = "parallel_computation.py -f" discadj_cylinder3D.timeout = 1600 discadj_cylinder3D.tol = 0.00001 test_list.append(discadj_cylinder3D) # Arina nozzle 2D discadj_arina2k = TestCase('discadj_arina2k') discadj_arina2k.cfg_dir = "disc_adj_euler/arina2k" discadj_arina2k.cfg_file = "Arina2KRS.cfg" discadj_arina2k.test_iter = 20 discadj_arina2k.test_vals = [2.229071, 1.716910, 4.7258e+04, 0.0000e+00] #last 4 columns discadj_arina2k.su2_exec = "parallel_computation.py -f" discadj_arina2k.timeout = 8400 discadj_arina2k.tol = 0.00001 test_list.append(discadj_arina2k) #################################### ### Disc. adj. compressible RANS ### #################################### # Adjoint turbulent NACA0012 SA discadj_rans_naca0012_sa = TestCase('discadj_rans_naca0012_sa') discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 discadj_rans_naca0012_sa.test_vals = [-1.751966, 0.485717, 0.183154, -0.000018] #last 4 columns discadj_rans_naca0012_sa.su2_exec = "parallel_computation.py -f" discadj_rans_naca0012_sa.timeout = 1600 discadj_rans_naca0012_sa.tol = 0.00001 test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST discadj_rans_naca0012_sst = TestCase('discadj_rans_naca0012_sst') discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 discadj_rans_naca0012_sst.test_vals = [-1.654042, -0.500718, 0.154704, -0.000022] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "parallel_computation.py -f" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 test_list.append(discadj_rans_naca0012_sst) ####################################### ### Disc. adj. incompressible Euler ### ####################################### # Adjoint Incompressible Inviscid NACA0012 discadj_incomp_NACA0012 = TestCase('discadj_incomp_NACA0012') discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 discadj_incomp_NACA0012.test_vals = [-3.595580, -2.549720, 0.000000, 0.000000] #last 4 columns discadj_incomp_NACA0012.su2_exec = "parallel_computation.py -f" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 test_list.append(discadj_incomp_NACA0012) ##################################### ### Disc. adj. incompressible N-S ### ##################################### # Adjoint Incompressible Viscous Cylinder (Heated) discadj_incomp_cylinder = TestCase('discadj_incomp_cylinder') discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 discadj_incomp_cylinder.test_vals = [-2.104640, -2.004547, 0.0000e+00, 0.0000e+00] #last 4 columns discadj_incomp_cylinder.su2_exec = "parallel_computation.py -f" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 test_list.append(discadj_incomp_cylinder) ###################################### ### Disc. adj. incompressible RANS ### ###################################### # Adjoint Incompressible Turbulent NACA 0012 SA discadj_incomp_turb_NACA0012_sa = TestCase('discadj_incomp_turb_NACA0012_sa') discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 discadj_incomp_turb_NACA0012_sa.test_vals = [-3.846036, -1.031071, 0.000000, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sa.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sa) # Adjoint Incompressible Turbulent NACA 0012 SST discadj_incomp_turb_NACA0012_sst = TestCase('discadj_incomp_turb_NACA0012_sst') discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845805, -2.416675, 0.000000, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sst.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 test_list.append(discadj_incomp_turb_NACA0012_sst) ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### # Turbulent Cylinder discadj_cylinder = TestCase('unsteady_cylinder') discadj_cylinder.cfg_dir = "disc_adj_rans/cylinder" discadj_cylinder.cfg_file = "cylinder.cfg" discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746900, -1.544893, -8.3447e-03, 1.3808e-05] #last 4 columns discadj_cylinder.su2_exec = "parallel_computation.py -f" discadj_cylinder.timeout = 1600 discadj_cylinder.tol = 0.00001 discadj_cylinder.unsteady = True test_list.append(discadj_cylinder) ########################################################################## ### Unsteady Disc. adj. compressible RANS DualTimeStepping 1st order ### ########################################################################## # Turbulent Cylinder discadj_DT_1ST_cylinder = TestCase('unsteady_cylinder_DT_1ST') discadj_DT_1ST_cylinder.cfg_dir = "disc_adj_rans/cylinder_DT_1ST" discadj_DT_1ST_cylinder.cfg_file = "cylinder.cfg" discadj_DT_1ST_cylinder.test_iter = 9 discadj_DT_1ST_cylinder.test_vals = [3.698165, -1.607052, -2.2503e-03, 2.7212e-05] #last 4 columns discadj_DT_1ST_cylinder.su2_exec = "parallel_computation.py -f" discadj_DT_1ST_cylinder.timeout = 1600 discadj_DT_1ST_cylinder.tol = 0.00001 discadj_DT_1ST_cylinder.unsteady = True test_list.append(discadj_DT_1ST_cylinder) ####################################################### ### Disc. adj. turbomachinery ### ####################################################### # Transonic Stator 2D discadj_trans_stator = TestCase('transonic_stator') 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 = [-2.001082, -2.115018, -0.450986, -15.778292] #last 4 columns discadj_trans_stator.su2_exec = "parallel_computation.py -f" discadj_trans_stator.timeout = 1600 discadj_trans_stator.tol = 0.00001 test_list.append(discadj_trans_stator) ################################### ### Structural Adjoint ### ################################### # Structural model discadj_fea = TestCase('discadj_fea') discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 9 discadj_fea.test_vals = [-4.751576, -4.692029, -0.000364, -8.708700] #last 4 columns discadj_fea.su2_exec = "parallel_computation.py -f" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 test_list.append(discadj_fea) ################################### ### Disc. adj. heat ### ################################### # Discrete adjoint for heated cylinder discadj_heat = TestCase('discadj_heat') discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 discadj_heat.test_vals = [3.162960, 0.923834, -223.148728, -3562.233908] #last 4 columns discadj_heat.su2_exec = "parallel_computation.py -f" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 test_list.append(discadj_heat) ################################### ### Coupled FSI Adjoint ### ################################### # Structural model discadj_fsi = TestCase('discadj_fsi') discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "configAD_fsi.cfg" discadj_fsi.test_iter = 3000 discadj_fsi.test_vals = [0.958848,-0.157183,0.658415,1.302076] #last 4 columns discadj_fsi.su2_exec = "parallel_computation.py -f" discadj_fsi.timeout = 1600 discadj_fsi.tol = 0.00001 test_list.append(discadj_fsi) ###################################### ### RUN TESTS ### ###################################### pass_list = [ test.run_test() for test in test_list ] ################################################## ### Structural Adjoint - Topology Optimization ### ################################################## # test discrete_adjoint.py discadj_topol_optim = TestCase('discadj_topol_optim') discadj_topol_optim.cfg_dir = "fea_topology" discadj_topol_optim.cfg_file = "config.cfg" discadj_topol_optim.test_iter = 0 discadj_topol_optim.su2_exec = "parallel_computation.py" discadj_topol_optim.timeout = 1600 discadj_topol_optim.reference_file = "grad_ref_node.dat.ref" discadj_topol_optim.test_file = "grad_ref_node.dat" pass_list.append(discadj_topol_optim.run_filediff()) test_list.append(discadj_topol_optim) ################################### ### Coupled FSI Adjoint ### ################################### discadj_fsi2 = TestCase('discadj_fsi_airfoil') discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" discadj_fsi2.cfg_file = "config.cfg" discadj_fsi2.test_iter = 0 discadj_fsi2.su2_exec = "parallel_computation.py" discadj_fsi2.timeout = 1600 discadj_fsi2.reference_file = "grad_young.opt.ref" discadj_fsi2.test_file = "grad_young.opt" pass_list.append(discadj_fsi2.run_filediff()) test_list.append(discadj_fsi2) # Tests summary print('==================================================================') print('Summary of the parallel tests') print('python version:', sys.version) for i, test in enumerate(test_list): if (pass_list[i]): print(' passed - %s'%test.tag) else: print('* FAILED - %s'%test.tag) if all(pass_list): sys.exit(0) else: sys.exit(1)