Skip to content
Snippets Groups Projects
Verified Commit 727915b8 authored by Paul Dechamps's avatar Paul Dechamps :speech_balloon:
Browse files

(refactor) Refactor RAE 3D case

parent c6e5a3d1
No related branches found
No related tags found
1 merge request!1BLASTER v1.0
...@@ -18,23 +18,13 @@ ...@@ -18,23 +18,13 @@
# @author Paul Dechamps # @author Paul Dechamps
# @date 2022 # @date 2022
# Test the blast implementation. The test case is a compressible attached transitional flow. # Test the blaster 3D implementation.
# Tested functionalities; # Tested functionalities;
# - Time integration. # - Fully turbulent 3D compressible flow.
# - 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.
# Imports. # Imports.
import blast.utils as viscUtils import blast.utils as vutils
import numpy as np import numpy as np
import os.path import os.path
...@@ -66,7 +56,6 @@ def cfgInviscid(nthrds, verb): ...@@ -66,7 +56,6 @@ def cfgInviscid(nthrds, verb):
'WakeTips' : ['wakeTip'], # LIST of names of physical group containing the edge of the wake '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 'Tes' : ['te'], # LIST of names of physical group containing the trailing edge
'Symmetry': 'symmetry', # name of physical group containing the symmetry BC 'Symmetry': 'symmetry', # name of physical group containing the symmetry BC
'dbc' : True,
'Upstream' : 'upstream', 'Upstream' : 'upstream',
# Freestream # Freestream
'M_inf' : 0.8, # freestream Mach number 'M_inf' : 0.8, # freestream Mach number
...@@ -93,24 +82,23 @@ def cfgBlast(verb): ...@@ -93,24 +82,23 @@ def cfgBlast(verb):
'Minf' : 0.8, # Freestream Mach number (used for the computation of the time step only) 'Minf' : 0.8, # Freestream Mach number (used for the computation of the time step only)
'CFL0' : 1, # Inital CFL number of the calculation 'CFL0' : 1, # Inital CFL number of the calculation
'sections' : np.linspace(0.01, 0.95, 3), 'sections' : np.linspace(0.01, 0.95, 3), # Sections on the wing
'writeSections': [0.2, 0.4, 0.6, 0.8, 1.0], 'writeSections': [0.2, 0.4, 0.6, 0.8, 1.0], # Spanwise locations to write the solution
'Sym':[0.], 'Sym':[0.], # Symmetry plane
'span': 1., 'span': 1., # Span of the wing
'interpolator': 'Rbf', 'interpolator': 'Rbf', # Interpolator type
'rbftype': 'linear', 'rbftype': 'linear', # Radial basis function (rbf) type
'smoothing': 1e-8, 'smoothing': 1e-8, # rbf smoothing factor
'degree': 0, 'degree': 0, # Degree of the interpolator
'neighbors': 10, 'neighbors': 10, # Number of neighbors for the interpolator
'saveTag': 4, 'saveTag': 4, # Tag to save the solution with VTK
'Verb': verb, # Verbosity level of the solver '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 'couplTol' : 5e-2, # Tolerance of the VII methodology
'iterPrint': 1, # int, number of iterations between outputs 'iterPrint': 1, # int, number of iterations between outputs
'resetInv' : False, # bool, flag to reset the inviscid calculation at every iteration. 'resetInv' : False, # bool, flag to reset the inviscid calculation at every iteration.
'xtrF' : [0., 0.], # Forced transition location 'xtrF' : [0., 0.], # Forced transition locations
'nDim' : 3
} }
def main(): def main():
...@@ -127,11 +115,11 @@ def main(): ...@@ -127,11 +115,11 @@ def main():
'progLe': 1.1, 'progMid': 1.0, 'progTe': 1.0, 'progSpan': 1.0, 'progWake': 1.15} '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')) 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 vcfg['vMsh'] = vMsh
tms['pre'].start() tms['pre'].start()
coupler, isol, vsol = viscUtils.initBlast(icfg, vcfg) coupler, isol, vsol = vutils.initBlast(icfg, vcfg)
tms['pre'].stop() tms['pre'].stop()
print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET) print(ccolors.ANSI_BLUE + 'PySolving...' + ccolors.ANSI_RESET)
...@@ -144,9 +132,6 @@ def main(): ...@@ -144,9 +132,6 @@ def main():
print(' Re M alpha Cl Cd Cd_wake Cdp Cdf Cm') 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())) 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 # Save results
isol.save(sfx='_viscous') isol.save(sfx='_viscous')
tms['total'].stop() tms['total'].stop()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment