diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d071ba1fb1eb1e62acc25b1cb9aba685645fa75b..fa9868acfff199976a56f80a84ba42a152e2513e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,15 +79,19 @@ cvalidation: stage: validation script: - set +e - - python3 run.py blast/validation/raeValidation.py -v; RAE_STATUS=$? - - python3 run.py blast/validation/oneraValidation.py -v; ONERA_STATUS=$? - - python3 run.py blast/validation/lannValidation.py -v; LANN_STATUS=$? + - python3 run.py blast/validation/highlift_2D.py -v; HIGHLIFT_STATUS=$? + - python3 run.py blast/validation/rae2822_2D.py -v; RAE_STATUS=$? + - python3 run.py blast/validation/oneraM6_3D.py -v; ONERA_STATUS=$? + - python3 run.py blast/validation/lann_3D.py -v; LANN_STATUS=$? + - python3 run.py blast/validation/agard_3D.py -v; AGARD_STATUS=$? - set -e - | + echo "HIGHLIFT Validation Status: $HIGHLIFT_STATUS" echo "RAE Validation Status: $RAE_STATUS" echo "ONERA Validation Status: $ONERA_STATUS" echo "LANN Validation Status: $LANN_STATUS" - - if [ $RAE_STATUS -ne 0 ] || [ $ONERA_STATUS -ne 0 ] || [ $LANN_STATUS -ne 0 ]; then exit 1; fi + echo "AGARD Validation Status: $AGARD_STATUS" + - if [ $HIGHLIFT_STATUS -ne 0 ] || [ $RAE_STATUS -ne 0 ] || [ $ONERA_STATUS -ne 0 ] || [ $LANN_STATUS -ne 0 ] || [ $AGARD_STATUS -ne 0 ]; then exit 1; fi dependencies: - build when: manual diff --git a/blast/coupler.py b/blast/coupler.py index 4d7cfa0654096a393fdddf07cd475dfe882abfa6..b6410728f8f5c2467d149769f8091ced51eac18c 100644 --- a/blast/coupler.py +++ b/blast/coupler.py @@ -120,10 +120,10 @@ class Coupler: return aeroCoeffs cdPrev = cd - if couplIter == 0: + if couplIter == 0 or (self.isol.getVerbose() > 0 and couplIter % self.iterPrint == 0): print('') print('{:>5s}| {:>7s} {:>7s} {:>7s} | {:>6s} {:>6s} | {:>5s} {:>5s} | {:>6s}'.format('It', 'Cl', 'Cd', 'Cdwake', 'xtrT', 'xtrB', 'iOut', 'vOut', 'Error')) - print(' ----------------------------------------------------------') + print(' --------------------------------------------------------------------') if couplIter % self.iterPrint == 0: print(' {:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>6.4f} | {:>5.0f} {:>5.0f} | {:>6.3f}'.format(couplIter, self.isol.getCl(), self.isol.getCd()+self.vsol.Cdf, self.vsol.Cdt, self.vsol.getAverageTransition(0), self.vsol.getAverageTransition(1), iEc, vEc, np.log10(error))) if self.isol.getVerbose() != 0 or self.vsol.verbose != 0: @@ -133,7 +133,7 @@ class Coupler: print(ccolors.ANSI_RED, 'Maximum number of {:<.0f} coupling iterations reached'.format(self.maxIter), ccolors.ANSI_RESET) print('') print('{:>5s}| {:>7s} {:>7s} {:>7s} | {:>6s} {:>8s} | {:>6s}'.format('It', 'Cl', 'Cd', 'Cdwake', 'xtrT', 'xtrB', 'Error')) - print(' ----------------------------------------------------------') + print(' --------------------------------------------------------------------') print(ccolors.ANSI_RED, '{:>4.0f}| {:>7.5f} {:>7.5f} {:>7.5f} | {:>6.4f} {:>7.4f} | {:>6.3f}\n'.format(couplIter-1, self.isol.getCl(), self.isol.getCd()+self.vsol.Cdf, self.vsol.Cdt, self.vsol.getAverageTransition(0), self.vsol.getAverageTransition(1), np.log10(error)), ccolors.ANSI_RESET) if write: self.isol.writeCp(sfx='_viscous'+self.filesfx) diff --git a/blast/validation/agard_3D.py b/blast/validation/agard_3D.py index 6308e83fbfaa80510eecab0288a95c65688d54e7..64748ff3125183a69193b617f9986a891e4f13e5 100644 --- a/blast/validation/agard_3D.py +++ b/blast/validation/agard_3D.py @@ -55,29 +55,29 @@ def cfgInviscid(nthrds, verb): 'Tes' : ['te'], # LIST of names of physical group containing the trailing edge 'Upstream' : 'upstream', # Freestream - 'M_inf' : 0.96, # freestream Mach number - 'AoA' : 0., # freestream angle of attack + 'M_inf' : 0.96, # freestream Mach number + 'AoA' : 0., # freestream angle of attack # Geometry - 'S_ref' : 0.35, # reference surface length - 'c_ref' : 0.47, # reference chord length - 'x_ref' : 0.0, # reference point for moment computation (x) - 'y_ref' : 0.0, # reference point for moment computation (y) - 'z_ref' : 0.0, # reference point for moment computation (z) + 'S_ref' : 0.35, # reference surface length + 'c_ref' : 0.47, # reference chord length + 'x_ref' : 0.0, # reference point for moment computation (x) + 'y_ref' : 0.0, # reference point for moment computation (y) + 'z_ref' : 0.0, # reference point for moment computation (z) # Numerical - 'LSolver' : 'GMRES', # inner solver (Pardiso, MUMPS or GMRES) - 'G_fill' : 2, # fill-in factor for GMRES preconditioner - 'G_tol' : 1e-5, # tolerance for GMRES - 'G_restart' : 50, # restart for GMRES - 'Rel_tol' : 1e-6, # relative tolerance on solver residual - 'Abs_tol' : 1e-8, # absolute tolerance on solver residual - 'Max_it' : 75 # solver maximum number of iterations + 'LSolver' : 'PARDISO', # inner solver (Pardiso, MUMPS or GMRES) + 'G_fill' : 2, # fill-in factor for GMRES preconditioner + 'G_tol' : 1e-5, # tolerance for GMRES + 'G_restart' : 50, # restart for GMRES + 'Rel_tol' : 1e-6, # relative tolerance on solver residual + 'Abs_tol' : 1e-8, # absolute tolerance on solver residual + 'Max_it' : 75 # solver maximum number of iterations } def cfgBlast(verb): return { - 'Re' : 5.96e5, # Freestream Reynolds number - 'Minf' : 0.96, # Freestream Mach number (used for the computation of the time step only) - 'CFL0' : 1, # Inital CFL number of the calculation + 'Re' : 5.96e5, # Freestream Reynolds number + 'Minf' : 0.96, # Freestream Mach number (used for the computation of the time step only) + 'CFL0' : 1, # Inital CFL number of the calculation 'sections' : np.linspace(0.026, 0.73, 15), 'writeSections': np.linspace(0.01, 0.76, 15), @@ -95,8 +95,7 @@ def cfgBlast(verb): 'couplTol' : 1e-3, # Tolerance of the VII methodology 'iterPrint': 1, # int, number of iterations between outputs 'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration. - 'xtrF' : [0., 0.], # Forced transition location - 'nDim' : 3 + 'xtrF' : [0., 0.] # Forced transition location } def main(): @@ -109,6 +108,13 @@ def main(): icfg = cfgInviscid(args.k, args.verb) vcfg = cfgBlast(args.verb) + try: + import tbox + _ = tbox.Pardiso() + except: + print('PARDISO not found, using GMRES') + icfg['LSolver'] = 'GMRES' + #AoAVec = [-.01, 0.0, .01] #sfxVec = ['_a1-', '_a0', '_a1'] AoAVec = [0.0] @@ -150,7 +156,7 @@ def main(): cps_i = [] import os # Get file dir - dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/workspace/blast_validation_agardValidation/' + dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + '/workspace/blast_validation_agard_3D/' for s in sfxVec: cps_s_v = [] @@ -165,9 +171,9 @@ def main(): for i in range(len(vcfg['writeSections'])): plt.figure(i) for j in range(len(sfxVec)): - plt.plot(cps_i[j][i][:,3], cps_i[j][i][:,4], label=sfxVec[j].replace('_', ' ')+'_invicid') + plt.plot(cps_i[j][i][:,0], cps_i[j][i][:,2], label=sfxVec[j].replace('_', ' ')+'_invicid') for j in range(len(sfxVec)): - plt.plot(cps_v[j][i][:,3], cps_v[j][i][:,4], label=sfxVec[j].replace('_', ' ')+'_viscous') + plt.plot(cps_v[j][i][:,0], cps_v[j][i][:,2], label=sfxVec[j].replace('_', ' ')+'_viscous') plt.legend() plt.gca().invert_yaxis() plt.title('Section ' + str(i)) @@ -180,8 +186,8 @@ def main(): print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) tests = CTests() tests.add(CTest('Cl', isol.getCl(), 0.0, 1e-3)) - tests.add(CTest('Cd', isol.getCd()+vsol.Cdf, 0.00564, 1e-3, forceabs=True)) - tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 5, 0, forceabs=True)) + tests.add(CTest('Cd', isol.getCd()+vsol.Cdf, 0.0057, 1e-3, forceabs=True)) + tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 4, 1, forceabs=True)) tests.run() # eof diff --git a/blast/validation/highlift_2D.py b/blast/validation/highlift_2D.py index c4b391b5d9a2575c824d0a5e7d937d9df9e1124c..1d71dacaafbd4f975b28b22810d9f50ff96954e7 100644 --- a/blast/validation/highlift_2D.py +++ b/blast/validation/highlift_2D.py @@ -63,10 +63,10 @@ def cfgInviscid(nthrds, verb): 'y_ref' : 0.0, # reference point for moment computation (y) 'z_ref' : 0.0, # reference point for moment computation (z) # Numerical - 'LSolver' : 'SparseLU', # inner solver (Pardiso, MUMPS or GMRES) - 'Rel_tol' : 1e-8, # relative tolerance on solver residual - 'Abs_tol' : 1e-6, # absolute tolerance on solver residual - 'Max_it' : 30 # solver maximum number of iterations + 'LSolver' : 'PARDISO', # inner solver (Pardiso, MUMPS or GMRES) + 'Rel_tol' : 1e-8, # relative tolerance on solver residual + 'Abs_tol' : 1e-6, # absolute tolerance on solver residual + 'Max_it' : 30 # solver maximum number of iterations } def cfgBlast(verb): @@ -93,6 +93,13 @@ def main(): icfg = cfgInviscid(args.k, args.verb) vcfg = cfgBlast(args.verb) + try: + import tbox + _ = tbox.Pardiso() + except: + print('PARDISO not found, using SparseLu') + icfg['LSolver'] = 'SparseLU' + tms['pre'].start() coupler, isol, vsol = vutils.initBlast(icfg, vcfg) tms['pre'].stop() @@ -120,14 +127,14 @@ def main(): # Test solution print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) tests = CTests() - tests.add(CTest('Cl', isol.getCl(), 0.230, 5e-2)) # XFOIL 0.2325 - tests.add(CTest('Cd wake', vsol.Cdt, 0.0057, 1e-3, forceabs=True)) # XFOIL 0.00531 - tests.add(CTest('Cd integral', vsol.Cdf + isol.getCd(), 0.0058, 1e-3, forceabs=True)) # XFOIL 0.00531 - tests.add(CTest('Cdf', vsol.Cdf, 0.0047, 1e-3, forceabs=True)) # XFOIL 0.00084, Cdf = 0.00447 - tests.add(CTest('xtr_top', vsol.getAverageTransition(0), 0.196, 0.03, forceabs=True)) # XFOIL 0.1877 - tests.add(CTest('xtr_bot', vsol.getAverageTransition(1), 0.40, 0.01, forceabs=True)) # XFOIL 0.4998 - tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 20, 0, forceabs=True)) - #tests.run() + tests.add(CTest('Cl', isol.getCl(), 1.634, 5e-2)) + tests.add(CTest('Cd wake', vsol.Cdt, 0.0166, 1e-3, forceabs=True)) + tests.add(CTest('Cd integral', vsol.Cdf + isol.getCd(), 0.0212, 1e-3, forceabs=True)) + tests.add(CTest('Cdf', vsol.Cdf, 0.0043, 1e-3, forceabs=True)) + tests.add(CTest('xtr_top', vsol.getAverageTransition(0), 0.0084, 0.002, forceabs=True)) + tests.add(CTest('xtr_bot', vsol.getAverageTransition(1), 1.0, 0.01, forceabs=True)) + tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 33, 0, forceabs=True)) + tests.run() # Plot results if not args.nogui: diff --git a/blast/validation/lann_3D.py b/blast/validation/lann_3D.py index c0c48155552133cbf084f5c2d7aecd030564ce1a..58debc77e2ed6e40c3e3f08674b55d7bad152cea 100644 --- a/blast/validation/lann_3D.py +++ b/blast/validation/lann_3D.py @@ -90,13 +90,12 @@ def cfgBlast(verb): 'neighbors': 10, 'saveTag': 1, - 'Verb': verb, # Verbosity level of the solver - 'couplIter': 100, # Maximum number of iterations - 'couplTol' : 1e-3, # Tolerance of the VII methodology - 'iterPrint': 1, # int, number of iterations between outputs - 'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration. - 'xtrF' : [0.05, 0.05],# Forced transition location - 'nDim' : 3 + 'Verb': verb, # Verbosity level of the solver + 'couplIter': 100, # Maximum number of iterations + 'couplTol' : 1e-3, # Tolerance of the VII methodology + 'iterPrint': 1, # int, number of iterations between outputs + 'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration. + 'xtrF' : [0.05, 0.05] # Forced transition location } def main(): diff --git a/blast/validation/oneraM6_3D.py b/blast/validation/oneraM6_3D.py index 260aaf3e7a23cb0b957d274497e3ff0a4d96f258..0a8f1049b5233b3f8c3c3028c4752ce3ca8d2dd8 100644 --- a/blast/validation/oneraM6_3D.py +++ b/blast/validation/oneraM6_3D.py @@ -75,7 +75,7 @@ def cfgInviscid(nthrds, verb): def cfgBlast(verb): return { - 'Re' : 11.72*10e6, # Freestream Reynolds number + 'Re' : 11.72e6, # Freestream Reynolds number 'Minf' : 0.839, # Freestream Mach number (used for the computation of the time step only) 'CFL0' : 1, # Inital CFL number of the calculation @@ -90,13 +90,12 @@ def cfgBlast(verb): 'neighbors': 10, 'saveTag': 5, - 'Verb': verb, # Verbosity level of the solver - 'couplIter': 50, # Maximum number of iterations - 'couplTol' : 5e-4, # Tolerance of the VII methodology - 'iterPrint': 5, # int, number of iterations between outputs - 'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration. - 'xtrF' : [0.01, 0.01],# Forced transition location - 'nDim' : 3 + 'Verb': verb, # Verbosity level of the solver + 'couplIter': 50, # Maximum number of iterations + 'couplTol' : 5e-4, # Tolerance of the VII methodology + 'iterPrint': 5, # int, number of iterations between outputs + 'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration. + 'xtrF' : [0.01, 0.01], # Forced transition location } def main(): @@ -142,10 +141,10 @@ def main(): # Test solution print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) tests = CTests() - tests.add(CTest('Cl', isol.getCl(), 0.279, 5e-2)) - tests.add(CTest('Cd wake', vsol.Cdt, 0.00471, 1e-3, forceabs=True)) - tests.add(CTest('Cd int', isol.getCd() + vsol.Cdf, 0.01519, 1e-3, forceabs=True)) - tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 13, 0, forceabs=True)) + tests.add(CTest('Cl', isol.getCl(), 0.283, 5e-2)) + tests.add(CTest('Cd wake', vsol.Cdt, 0.00640, 1e-3, forceabs=True)) + tests.add(CTest('Cd int', isol.getCd() + vsol.Cdf, 0.0167, 1e-3, forceabs=True)) + tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 14, 0, forceabs=True)) tests.run() # eof diff --git a/blast/validation/rae2822_2D.py b/blast/validation/rae2822_2D.py index 581ed753bff6ce5bfbd5bc07334e88680103eae6..0a629d75a79b329582118a1921cbe6ce55494fb7 100644 --- a/blast/validation/rae2822_2D.py +++ b/blast/validation/rae2822_2D.py @@ -30,7 +30,6 @@ import fwk from fwk.testing import * from fwk.coloring import ccolors import os.path -import tbox import math @@ -100,6 +99,7 @@ def main(): vcfg = cfgBlast(args.verb) try: + import tbox _ = tbox.Pardiso() except: print('PARDISO not found, using SparseLu') @@ -137,7 +137,7 @@ def main(): tests.add(CTest('Cd integral', isol.getCd() + vsol.Cdf, 0.0126, 1e-3, forceabs=True)) tests.add(CTest('Cdf', vsol.Cdf, 0.0067, 1e-3, forceabs=True)) tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 34, 0, forceabs=True)) - #tests.run() + tests.run() # Plot results if not args.nogui: