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

(tests) Updated tests, renamed reference results and updated naca0012 mesh

There geo file for naca 0012 was updated by adding the growth ratio as input parameter instead of the farfield mesh size.
parent 4914b197
No related branches found
No related tags found
1 merge request!1BLASTER v1.0
Pipeline #50744 passed with warnings
This diff is collapsed.
0.9938 -0.1432
0.9875 -0.1318
0.9750 -0.1082
0.9500 -0.0592
0.9250 -0.0115
0.9000 0.0365
0.8750 0.0808
0.8500 0.1296
0.8250 0.1746
0.8000 0.2186
0.7750 0.2702
0.7500 0.3029
0.7000 0.3913
0.6771 0.4263
0.6500 0.4778
0.6196 0.5361
0.6000 0.5798
0.5750 0.6769
0.5500 0.9137
0.5250 1.2201
0.5000 1.2164
0.4750 1.2038
0.4500 1.1940
0.4250 1.1819
0.4000 1.1601
0.3750 1.1490
0.3500 1.1273
0.3250 1.1168
0.3000 1.1091
0.2800 1.1010
0.2500 1.0736
0.2208 1.0456
0.2000 1.0433
0.1500 1.0096
0.1000 0.9886
0.0750 1.0432
0.0625 1.0730
0.0500 1.0923
0.0375 1.0820
0.0271 1.0435
0.0187 1.0362
0.0146 0.9204
0.0125 0.8680
0.0104 0.8041
0.0087 0.7658
0.0073 0.7250
0.0060 0.6269
0.0048 0.5309
0.0036 0.4667
0.0026 0.2746
0.0016 0.0521
0.0008 -0.1042
0.0002 0.4219
0.0000 -0.8328
0.0002 -1.0396
0.0008 -1.1053
0.0016 -1.1338
0.0026 -1.1223
0.0036 -1.0823
0.0048 -1.0273
0.0060 -0.9736
0.0073 -0.9148
0.0087 -0.8703
0.0104 -0.8148
0.0125 -0.7537
0.0146 -0.6980
0.0186 -0.6159
0.0271 -0.5444
0.0375 -0.4040
0.0500 -0.3088
0.0625 -0.2454
0.0750 -0.1926
0.1000 -0.1042
0.1500 0.0081
0.2000 0.0940
0.2500 0.1754
0.3000 0.2506
0.3250 0.2904
0.3500 0.3214
0.3750 0.3406
0.4000 0.3403
0.4250 0.3194
0.4500 0.2881
0.4750 0.2469
0.5000 0.2079
0.5250 0.1657
0.5500 0.1169
0.5750 0.0731
0.6000 0.0301
0.6196 0.0003
0.6500 -0.0431
0.6771 -0.0836
0.7000 -0.1134
0.7500 -0.1731
0.7750 -0.1988
0.8500 -0.2618
0.8750 -0.2778
0.9000 -0.2907
0.9250 -0.2972
0.9500 -0.2937
0.9750 -0.2676
0.9875 -0.2396
0.9938 -0.2146
This diff is collapsed.
# x Cp
1.00000 0.06409
0.99168 0.06341
0.98037 0.06335
0.96727 0.06438
0.95272 0.06147
0.93720 0.05363
0.92112 0.04327
0.90474 0.03046
0.88821 0.01532
0.87160 -0.00197
0.85494 -0.02124
0.83827 -0.04226
0.82158 -0.06484
0.80488 -0.08877
0.78817 -0.11385
0.77146 -0.13991
0.75475 -0.16679
0.73803 -0.19437
0.72132 -0.22255
0.70460 -0.25127
0.68789 -0.28048
0.67118 -0.31016
0.65447 -0.34032
0.63777 -0.37097
0.62108 -0.40216
0.60440 -0.43392
0.58772 -0.46632
0.57106 -0.49941
0.55441 -0.53327
0.53778 -0.56798
0.52116 -0.60363
0.50456 -0.64032
0.48798 -0.67814
0.47143 -0.71720
0.45489 -0.75763
0.43839 -0.79956
0.42191 -0.84313
0.40546 -0.88850
0.38905 -0.93585
0.37268 -0.98538
0.35635 -1.03732
0.34007 -1.09191
0.32383 -1.14947
0.30766 -1.21031
0.29154 -1.27485
0.27550 -1.34355
0.25953 -1.41696
0.24366 -1.49574
0.22788 -1.58067
0.21222 -1.67271
0.19670 -1.77304
0.18135 -1.88307
0.16619 -2.00454
0.15127 -2.13958
0.13666 -2.29069
0.12246 -2.46080
0.10877 -2.65307
0.09575 -2.87057
0.08358 -3.11582
0.07242 -3.39022
0.06239 -3.69388
0.05354 -4.02598
0.04581 -4.38553
0.03910 -4.77195
0.03329 -5.18542
0.02826 -5.62621
0.02387 -6.09376
0.02003 -6.58479
0.01666 -7.09375
0.01369 -7.64011
0.01108 -8.56467
0.00879 -9.98873
0.00678 -10.19397
0.00505 -10.49975
0.00358 -10.96190
0.00236 -11.41435
0.00140 -11.63227
0.00070 -11.51073
0.00024 -11.01337
0.00003 -10.19141
0.00003 -9.17861
0.00024 -7.98896
0.00070 -6.65939
0.00140 -5.31083
0.00236 -4.05006
0.00358 -2.94610
0.00505 -2.02396
0.00678 -1.27816
0.00879 -0.68764
0.01108 -0.22686
0.01369 0.12886
0.01666 0.40031
0.02003 0.60497
0.02387 0.75591
0.02826 0.86407
0.03329 0.93713
0.03910 0.98173
0.04581 1.00266
0.05354 1.00425
0.06239 0.99025
0.07242 0.96440
0.08358 0.93016
0.09575 0.89098
0.10877 0.84939
0.12246 0.80761
0.13666 0.76677
0.15127 0.72775
0.16619 0.69086
0.18135 0.65625
0.19670 0.62393
0.21222 0.59379
0.22788 0.56572
0.24366 0.53959
0.25953 0.51524
0.27550 0.49254
0.29154 0.47136
0.30766 0.45156
0.32383 0.43305
0.34007 0.41570
0.35635 0.39942
0.37268 0.38412
0.38905 0.36972
0.40546 0.35615
0.42191 0.34332
0.43839 0.33118
0.45489 0.31967
0.47143 0.30874
0.48798 0.29833
0.50456 0.28840
0.52116 0.27891
0.53778 0.26982
0.55441 0.26110
0.57106 0.25270
0.58772 0.24461
0.60440 0.23679
0.62108 0.22923
0.63777 0.22189
0.65447 0.21476
0.67118 0.20782
0.68789 0.20105
0.70460 0.19444
0.72132 0.18797
0.73803 0.18163
0.75475 0.17541
0.77146 0.16930
0.78817 0.16329
0.80488 0.15738
0.82158 0.15156
0.83827 0.14581
0.85494 0.14014
0.87160 0.13452
0.88821 0.12897
0.90474 0.12345
0.92112 0.11797
0.93720 0.11250
0.95272 0.10703
0.96727 0.10168
0.98037 0.09572
0.99168 0.09294
1.00000 0.06409
......@@ -22,7 +22,7 @@
# Imports.
import blast.utils as viscUtils
import blast.utils as vutils
import blast
import numpy as np
......@@ -47,7 +47,7 @@ def cfgInviscid(nthrds, verb):
'Verb' : verb, # verbosity
# Model (geometry or mesh)
'File' : os.path.dirname(os.path.abspath(__file__)) + '/../../models/dart/n0012.geo', # Input file containing the model
'Pars' : {'xLgt' : 5, 'yLgt' : 5, 'msF' : 3, 'msTe' : 0.1, 'msLe' : 0.1}, # parameters for input file model
'Pars' : {'xLgt' : 5, 'yLgt' : 5, 'growthRatio' : 2., 'msTe' : 0.1, 'msLe' : 0.1}, # parameters for input file model
'Dim' : 2, # problem dimension
'Format' : 'gmsh', # save format (vtk or gmsh)
# Markers
......@@ -57,7 +57,6 @@ def cfgInviscid(nthrds, verb):
'Wake' : 'wake', # LIST of names of physical group containing the wake
'WakeTip' : 'wakeTip', # LIST of names of physical group containing the edge of the wake
'Te' : 'te', # LIST of names of physical group containing the trailing edge
'dbc' : False,
'Upstream' : 'upstream',
# Freestream
'M_inf' : 0.2, # freestream Mach number
......@@ -69,7 +68,7 @@ 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)
'LSolver' : 'SparseLU', # 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
......@@ -85,11 +84,11 @@ def cfgBlast(verb):
'CFL0' : 1, # Inital CFL number of the calculation
'Verb': verb, # Verbosity level of the solver
'couplIter': 100, # Maximum number of iterations
'couplTol' : 1e-10, # Tolerance of the VII methodology
'couplTol' : 1e-10, # Tolerance of the VII methodology
'iterPrint': 20, # int, number of iterations between outputs
'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration.
'sections' : [0], # List of sections for boundary layer calculation
'xtrF' : [0.2, 0.2], # Forced transition location
'xtrF' : [0.2, 0.2], # Forced transition locations
'interpolator' : 'Matching', # Interpolator for the coupling
}
......@@ -106,7 +105,7 @@ def main():
dalpha = 1e-6 * np.pi/180
daoa = [alpha - dalpha, alpha + dalpha]
coupler, isol, vsol = viscUtils.initBlast(icfg, vcfg)
coupler, isol, vsol = vutils.initBlast(icfg, vcfg)
morpher = isol.iobj['mrf']
# Adjoint objects
......
......@@ -34,7 +34,7 @@
# Imports.
import blast.utils as viscUtils
import blast.utils as vutils
import numpy as np
from fwk.wutils import parseargs
......@@ -55,7 +55,7 @@ def cfgInviscid(nthrds, verb):
'Verb' : verb, # verbosity
# Model (geometry or mesh)
'File' : os.path.dirname(os.path.abspath(__file__)) + '/../../models/dart/n0012.geo', # Input file containing the model
'Pars' : {'xLgt' : 50, 'yLgt' : 50, 'msF' : 8.33, 'msTe' : 0.01, 'msLe' : 0.001}, # parameters for input file model
'Pars' : {'xLgt' : 50, 'yLgt' : 50, 'growthRatio': 1.2, 'msTe' : 0.01, 'msLe' : 0.001}, # parameters for input file model
'Dim' : 2, # problem dimension
'Format' : 'gmsh', # save format (vtk or gmsh)
# Markers
......@@ -65,7 +65,6 @@ def cfgInviscid(nthrds, verb):
'Wake' : 'wake', # LIST of names of physical group containing the wake
'WakeTip' : 'wakeTip', # LIST of names of physical group containing the edge of the wake
'Te' : 'te', # LIST of names of physical group containing the trailing edge
'dbc' : True,
'Upstream' : 'upstream',
# Freestream
'M_inf' : 0.2, # freestream Mach number
......@@ -97,7 +96,7 @@ def cfgBlast(verb):
'iterPrint': 5, # int, number of iterations between outputs
'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration.
'sections' : [0], # List of sections for boundary layer calculation
'xtrF' : [None, 0.4], # Forced transition location
'xtrF' : [None, 0.4], # Forced transition locations
'interpolator' : 'Matching' # Interpolator for the coupling
}
......@@ -111,7 +110,7 @@ def main():
vcfg = cfgBlast(args.verb)
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)
......@@ -123,9 +122,6 @@ def main():
print(ccolors.ANSI_BLUE + 'PyRes...' + ccolors.ANSI_RESET)
print(' Re M alpha Cl Cd 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}'.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 = viscUtils.getSolution(isol.sec, write=True, toW='all')
tms['total'].stop()
print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET)
......@@ -133,6 +129,8 @@ def main():
print(tms)
print('SOLVERS statistics')
print(coupler.tms)
bl_solution = vutils.getSolution(isol.sec, write=False)[0]
# Test solution
print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET)
......@@ -143,47 +141,40 @@ def main():
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('error dStar', np.linalg.norm(vSolution[0]['deltaStar'] - vSolution[0]['theta']*vSolution[0]['H']), 0., 0., forceabs=True))
tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 19, 0, forceabs=True))
tests.add(CTest('error dStar', np.linalg.norm(bl_solution['deltaStar'] - bl_solution['theta']*bl_solution['H']), 0., 0., forceabs=True))
tests.add(CTest('Iterations', len(aeroCoeffs['Cl']), 20, 0, forceabs=True))
tests.run()
# Show results
# Plot results
if not args.nogui:
iCp = viscUtils.read('Cp_inviscid.dat')
vCp = viscUtils.read('Cp_viscous.dat')
xfoilCp = viscUtils.read('../../blast/models/references/cpXfoil_n0012.dat', delim=None, skip = 1)
xfoilCpInv = viscUtils.read('../../blast/models/references/cpXfoilInv_n0012.dat', delim=None, skip = 1)
plotcp = {'curves': [np.column_stack((vCp[:,0], vCp[:,3])),
np.column_stack((xfoilCp[:,0], xfoilCp[:,1])),
np.column_stack((iCp[:,0], iCp[:,3])),
np.column_stack((xfoilCpInv[:,0], xfoilCpInv[:,1]))],
'labels': ['Blaster (VII)', 'XFOIL (VII)', 'DART (inviscid)', 'XFOIL (inviscid)'],
'lw': [3, 3, 2, 2],
'color': ['firebrick', 'darkblue', 'firebrick', 'darkblue'],
'ls': ['-', '-', '--', '--'],
'reverse': True,
'xlim':[0, 1],
'yreverse': True,
'legend': True,
'xlabel': '$x/c$',
'ylabel': '$c_p$'
}
viscUtils.plot(plotcp)
xfoilBl = viscUtils.read('../../blast/models/references/blXfoil_n0012.dat', delim=None, skip = 1)
plotcf = {'curves': [np.column_stack((vSolution[0]['x'], vSolution[0]['cf']*vSolution[0]['ue']*vSolution[0]['ue'])),
np.column_stack((xfoilBl[:,1], xfoilBl[:,6]))],
'labels': ['Blaster', 'XFOIL'],
'lw': [3, 3],
'color': ['firebrick', 'darkblue'],
'ls': ['-', '-'],
'reverse': True,
'xlim':[0, 1],
'legend': True,
'xlabel': '$x/c$',
'ylabel': '$c_f$'
}
viscUtils.plot(plotcf)
cpv = np.loadtxt('Cp_viscous.dat', skiprows=1, delimiter=',')
cpi = np.loadtxt('Cp_inviscid.dat', skiprows=1, delimiter=',')
cpv_xf = np.loadtxt('/'.join(__file__.split('/')[:-3])+'/models/references/n0012_2deg_xf_cpVisc.dat', skiprows=1)
cpi_xf = np.loadtxt('/'.join(__file__.split('/')[:-3])+'/models/references/n0012_2deg_xf_cpInv.dat', skiprows=1)
bl_xf = np.loadtxt('/'.join(__file__.split('/')[:-3])+'/models/references/n0012_2deg_xf_bl.dat', skiprows=1)
from matplotlib import pyplot as plt
plt.figure()
plt.plot(cpv[:, 0], cpv[:, 3], color='firebrick', lw=2, label='BLASTER - viscous')
plt.plot(cpv_xf[:, 0], cpv_xf[:, 1], color='royalblue', lw=2, label='XFOIL - viscous')
plt.plot(cpi[:, 0], cpi[:, 3], color='firebrick', lw=1, label='BLASTER - inviscid', linestyle='--')
plt.plot(cpi_xf[:, 0], cpi_xf[:, 1], color='royalblue', lw=1, label='XFOIL - inviscid', linestyle='--')
plt.gca().invert_yaxis()
plt.legend(frameon=False)
plt.xlabel('$x/c$')
plt.ylabel('$c_p$')
plt.draw()
plt.figure()
plt.plot(bl_solution['x'], bl_solution['cf']*bl_solution['ue']*bl_solution['ue'], color='firebrick', lw=2, label='BLASTER')
plt.plot(bl_xf[:, 1], bl_xf[:, 6], color='royalblue', lw=2, label='XFOIL')
plt.legend(frameon=False)
plt.xlim([0, 1])
plt.xlabel('$x/c$')
plt.ylabel('$c_f$')
plt.draw()
plt.show()
# eof
print('')
......
......@@ -36,7 +36,7 @@ import os
from matplotlib import pyplot as plt
from blast.api.blaster_api import init_blaster
import blast.utils as viscUtils
import blast.utils as vutils
def cfgInviscid(nthrds, verb):
import os.path
......@@ -59,7 +59,6 @@ def cfgInviscid(nthrds, verb):
'Wake' : 'wake', # LIST of names of physical group containing the wake
'WakeTip' : 'wakeTip', # LIST of names of physical group containing the edge of the wake
'Te' : 'te', # LIST of names of physical group containing the trailing edge
'dbc' : False,
'Upstream' : 'upstream',
# Freestream
'M_inf' : 0.2, # freestream Mach number
......@@ -71,7 +70,7 @@ 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)
'LSolver' : 'SparseLU', # 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
......@@ -91,7 +90,7 @@ def cfgBlast(verb):
'iterPrint': 20, # int, number of iterations between outputs
'resetInv' : True, # bool, flag to reset the inviscid calculation at every iteration.
'sections' : [0], # List of sections for boundary layer calculation
'xtrF' : [-1, -1], # Forced transition location
'xtrF' : [-1, -1], # Forced transition locations
'interpolator' : 'Matching', # Interpolator for the coupling
}
......@@ -118,9 +117,6 @@ def main():
# Adjoint problem
isol.adjointSolver.run()
adj.run()
vSolution = viscUtils.getSolution(isol.sec, write=False)[0]
#plotSolution(vSolution)
tms['total'].stop()
# Make the api crash
......@@ -157,39 +153,5 @@ def main():
# eof
print('')
def plotSolution(vSolution):
plt.figure()
plt.plot(vSolution['x'], vSolution['cf'], label='$c_f$')
plt.xlim([0, 1])
plt.xlabel('x/c')
plt.ylabel('$c_f$')
plt.legend()
plt.grid()
plt.savefig('cf.png')
plt.draw()
plt.figure()
plt.plot(vSolution['x'], vSolution['ctEq'], label='$ctEq$')
plt.xlim([0, 1])
plt.xlabel('x/c')
plt.ylabel('$ctEq$')
plt.legend()
plt.grid()
plt.savefig('cf.png')
plt.draw()
plt.figure()
plt.plot(vSolution['x'], vSolution['theta'], label='$\theta$')
plt.plot(vSolution['x'], vSolution['deltaStar'], label='$\delta^*$')
plt.plot(vSolution['x'], vSolution['theta']*vSolution['H'], label='$\delta^*from$')
plt.xlim([0, 1])
plt.xlabel('x/c')
plt.ylabel('$\delta^*$')
plt.legend()
plt.grid()
plt.savefig('cf.png')
plt.draw()
if __name__ == '__main__':
main()
\ No newline at end of file
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