Closed jrwrigh closed 3 years ago
I will probably want to flip this into something more flexible. ie.
vpt.Profile
and output boundary layer statistics. One function per statistic (unless it makes sense otherwise)def BL99(profile):
# Compute delta
return 'delta_99', delta
def BL_momentum(profile):
# Compute Momentum delta
return 'delta_mom', delta
def computeBLStats(wall, functions):
for pnt in wall:
profile = getProfile(dataBlock, pnt)
for deltafunc in functions:
deltaName, delta = deltafunc(profile)
This would allow for easy extension in the future while also allowing "on-the-fly" BL stats to be computed easily. This should also generalize to 3D as well.... maybe.
Quick speed comparison between sampling all the points up front ("New BL heights") and sampling profiles one at a time ('Get Boundary layer heights'):
In[1]: %timeit runcell('Get Boundary layer heights', '/projects/tools/Models/BoeingBump/DNS/FlatPlate/Post/CRS_4d_HexWedgeCompare.py')
Out[1]: 23.3 s +/- 39.2 ms per loop (mean +/- std. dev. of 7 runs, 1 loop each)
In[2]: %timeit runcell('New BL heights', '/projects/tools/Models/BoeingBump/DNS/FlatPlate/Post/CRS_4d_HexWedgeCompare.py')
Out[2]: 2.91 s +/- 78 ms per loop (mean +/- std. dev. of 7 runs, 1 loop each)
Also confirmed that the results are identical (wall
is from the original method, vortInt
is from the new method):
In[79]: np.allclose(wall['delta_displace'], vortInt['delta_displace'])
Out[79]: True
In[80]: np.allclose(wall['delta_momentum'], vortInt['delta_momentum'])
Out[80]: True
master
branch, but moved to separate branch until it's completed.