From 727915b87f68272cf18430a6634f8bb5e1abd874 Mon Sep 17 00:00:00 2001 From: Paul Dechamps <paul.dechamps@uliege.be> Date: Tue, 7 Jan 2025 17:39:14 +0100 Subject: [PATCH] (refactor) Refactor RAE 3D case --- blast/tests/dart/rae2822_3D.py | 49 ++++++++++++---------------------- 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/blast/tests/dart/rae2822_3D.py b/blast/tests/dart/rae2822_3D.py index 61167b6..52ee476 100644 --- a/blast/tests/dart/rae2822_3D.py +++ b/blast/tests/dart/rae2822_3D.py @@ -18,23 +18,13 @@ # @author Paul Dechamps # @date 2022 -# Test the blast implementation. The test case is a compressible attached transitional flow. +# Test the blaster 3D implementation. # Tested functionalities; -# - Time integration. -# - Two time-marching techniques (agressive and safe). -# - Transition routines. -# - Forced transition. -# - Compressible flow routines. -# - Laminar and turbulent flow. -# -# Untested functionalities. -# - Separation routines. -# - Multiple failure case at one iteration. -# - Response to unconverged inviscid solver. +# - Fully turbulent 3D compressible flow. # Imports. -import blast.utils as viscUtils +import blast.utils as vutils import numpy as np import os.path @@ -66,7 +56,6 @@ def cfgInviscid(nthrds, verb): 'WakeTips' : ['wakeTip'], # LIST of names of physical group containing the edge of the wake 'Tes' : ['te'], # LIST of names of physical group containing the trailing edge 'Symmetry': 'symmetry', # name of physical group containing the symmetry BC - 'dbc' : True, 'Upstream' : 'upstream', # Freestream 'M_inf' : 0.8, # freestream Mach number @@ -93,24 +82,23 @@ def cfgBlast(verb): 'Minf' : 0.8, # Freestream Mach number (used for the computation of the time step only) 'CFL0' : 1, # Inital CFL number of the calculation - 'sections' : np.linspace(0.01, 0.95, 3), - 'writeSections': [0.2, 0.4, 0.6, 0.8, 1.0], - 'Sym':[0.], - 'span': 1., - 'interpolator': 'Rbf', - 'rbftype': 'linear', - 'smoothing': 1e-8, - 'degree': 0, - 'neighbors': 10, - 'saveTag': 4, + 'sections' : np.linspace(0.01, 0.95, 3), # Sections on the wing + 'writeSections': [0.2, 0.4, 0.6, 0.8, 1.0], # Spanwise locations to write the solution + 'Sym':[0.], # Symmetry plane + 'span': 1., # Span of the wing + 'interpolator': 'Rbf', # Interpolator type + 'rbftype': 'linear', # Radial basis function (rbf) type + 'smoothing': 1e-8, # rbf smoothing factor + 'degree': 0, # Degree of the interpolator + 'neighbors': 10, # Number of neighbors for the interpolator + 'saveTag': 4, # Tag to save the solution with VTK 'Verb': verb, # Verbosity level of the solver - 'couplIter': 5, # Maximum number of iterations + 'couplIter': 5, # Maximum number of iterations 'couplTol' : 5e-2, # Tolerance of the VII methodology 'iterPrint': 1, # int, number of iterations between outputs 'resetInv' : False, # bool, flag to reset the inviscid calculation at every iteration. - 'xtrF' : [0., 0.], # Forced transition location - 'nDim' : 3 + 'xtrF' : [0., 0.], # Forced transition locations } def main(): @@ -127,11 +115,11 @@ def main(): 'progLe': 1.1, 'progMid': 1.0, 'progTe': 1.0, 'progSpan': 1.0, 'progWake': 1.15} vMeshFile = os.path.abspath(os.path.join(os.path.abspath(__file__), '../../../models/dart/rae_3_visc.geo')) - vMsh = viscUtils.mesh(vMeshFile, parsViscous) + vMsh = vutils.mesh(vMeshFile, parsViscous) vcfg['vMsh'] = vMsh tms['pre'].start() - coupler, isol, vsol = viscUtils.initBlast(icfg, vcfg) + coupler, isol, vsol = vutils.initBlast(icfg, vcfg) tms['pre'].stop() print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) @@ -144,9 +132,6 @@ def main(): print(' Re M alpha Cl Cd Cd_wake Cdp Cdf Cm') print('{0:6.1f}e6 {1:8.2f} {2:8.1f} {3:8.4f} {4:8.4f} {5:8.4f} {6:8.4f} {7:8.4f} {8:8.4f}'.format(vcfg['Re']/1e6, isol.getMinf(), isol.getAoA()*180/math.pi, isol.getCl(), vsol.Cdf + isol.getCd(), vsol.Cdt, vsol.Cdp, vsol.Cdf, isol.getCm())) - # Write results to file. - vSolution = viscUtils.getSolution(isol.sec, write=True, toW='all') - # Save results isol.save(sfx='_viscous') tms['total'].stop() -- GitLab