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

(fix) Fixed onera validation case

parent 3941c1bb
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
# @author Paul Dechamps
# @date 2023
# Test the blast implementation on the 3D ONERA M6 wing.
# Test the blaster implementation on the 3D ONERA M6 wing.
# Imports.
......@@ -70,32 +70,43 @@ def cfgInviscid(nthrds, verb):
'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' : 50 # solver maximum number of iterations
'Max_it' : 20 # solver maximum number of iterations
}
def cfgBlast(verb):
return {
'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
'sections' : np.linspace(0.026, 1.15, 20),
'writeSections': [0.20, 0.44, 0.80],
'Sym':[0.],
'span':1.196,
'interpolator': 'Rbf',
'rbftype': 'linear',
'smoothing': 1e-8,
'degree': 0,
'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
# General problem definition
'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
'xtrF' : [0.01, 0.01], # Forced transition location
'spans': [1.196], # Span of the wing
# Post-processing options
'writeSections': [0.20, 0.44, 0.80], # Spanwise locations of the sections to write the solution
'saveTag': 5, # wing tag number to save the solution
# Sections generation
'sections' : [np.linspace(0.026, 1.15, 20)], # Section spanwise locations
'genSections': 'file', # Section generation type ['auto', 'file', 'vtk]
'nPoints': 300, # Number of points on the section
# Each section will have nPoints+1
# points because of the duplicate TE
# Solution interpolation
'interpolator': 'Rbf', # Interpolator type
'rbftype': 'linear', # Kernel RBF interpolator
'smoothing': 1e-8, # Smoothing factor of the RBF interpolator
'degree': 0, # Degree of the interpolator polynomial
'neighbors': 10, # Number of neighbors for the RBF interpolator
'Sym': [0.], # List of symmetry planes
# Coupling parameters
'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.
}
def main():
......@@ -107,9 +118,10 @@ def main():
icfg = cfgInviscid(args.k, args.verb)
vcfg = cfgBlast(args.verb)
# Create the viscous mesh.
parsViscous = {'nLe': 20, 'nTe': 8, 'nMid': 40, 'nSpan': 60, 'nWake': 20}
vMsh = vutils.mesh(os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + '/models/dart/onera_visc.geo', parsViscous)
vcfg['vMsh'] = vMsh
vcfg['vMsh'] = [vMsh]
tms['pre'].start()
coupler, isol, vsol = vutils.initBlast(icfg, vcfg)
......@@ -126,7 +138,7 @@ def main():
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}'.format(vcfg['Re']/1e6, isol.getMinf(), isol.getAoA()*180/math.pi, isol.getCl(), vsol.Cdt, vsol.Cdp, vsol.Cdf, isol.getCm()))
# Write results to file.
vSolution = vutils.getSolution(isol.sec, write=True, toW='all', sfx='onera')
vSolution = vutils.getSolution(vsol.bodies[0].sections, write=True, toW='all')[0]
# Save pressure coefficient
isol.save(sfx='_viscous')
......@@ -142,9 +154,9 @@ def main():
print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
tests = CTests()
tests.add(CTest('Cl', isol.getCl(), 0.283, 5e-2))
tests.add(CTest('Cd wake', vsol.Cdt, 0.0062, 1e-3, forceabs=True))
tests.add(CTest('Cd int', isol.getCd() + vsol.Cdf, 0.0156, 1e-3, forceabs=True))
tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 14, 0, forceabs=True))
tests.add(CTest('Cd wake', vsol.Cdt, 0.0138, 1e-3, forceabs=True))
tests.add(CTest('Cd int', isol.getCd() + vsol.Cdf, 0.0212, 1e-3, forceabs=True))
tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 13, 0, forceabs=True))
tests.run()
# eof
......
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