print("Extracting 2d data in wall-parallel plane at y+ =", (1 - r[k]) * ReTau) uz2d = u_z[k, :, :] uzF2d = u_zF[k, :, :] omegaZ2d = omegaZ[k, :, :] pi2d = pi[k, :, :] # isolate forward/backward flux events in the 2d velocity subset pip2d = np.where(pi2d > 0, pi2d, 0) # only positive, zero elsewhere pin2d = np.where(pi2d < 0, pi2d, 0) # only negative, zero elsewhere # compute correlations and sum up temporal (ensemble) statistics tcorr = timeit.default_timer() print('Computing 2d correlations... ', end='', flush=True) import crossCorrelation as c acUz = acUz + c.corr2d(uz2d, uz2d) # auto-correlations acUzF = acUzF + c.corr2d(uzF2d, uzF2d) acOmegaZ = acOmegaZ + c.corr2d(omegaZ2d, omegaZ2d) acPi = acPi + c.corr2d(pi2d, pi2d) ccUzPi = ccUzPi + c.corr2d(uz2d, pi2d) # cross-correlations full flux ccUzFPi = ccUzFPi + c.corr2d(uzF2d, pi2d) ccOmegaZPi = ccOmegaZPi + c.corr2d(omegaZ2d, pi2d) ccUzPip = ccUzPip + c.corr2d(uz2d, pip2d) # cross-correlations forward flux ccUzFPip = ccUzFPip + c.corr2d(uzF2d, pip2d) ccOmegaZPip = ccOmegaZPip + c.corr2d(omegaZ2d, pip2d) ccUzPin = ccUzPin + c.corr2d(uz2d, pin2d) # cross-correlations full flux ccUzFPin = ccUzFPin + c.corr2d(uzF2d, pin2d) ccOmegaZPin = ccOmegaZPin + c.corr2d(omegaZ2d, pin2d) print('Time elapsed:', '{:3.1f}'.format(timeit.default_timer() - tcorr), 'seconds')
j, i] # inward interaction: low-speed fluid towards wall if (uz2d[j, i] > 0) and (ur2d[j, i] > 0): q4[j, i] = ur2d[j, i] * uz2d[ j, i] # sweep event: high-speed fluid towards wall ioi = q1 - q3 # unify inward interactions (Q3 being negativ) and outward interactions (Q1 being positive) in one array see = q2 - q4 # unify sweep events (Q4 being negativ) and ejection events (Q2 being positiv) in one array print('Time elapsed:', '{:3.1f}'.format(timeit.default_timer() - tqs), 'seconds') # compute correlations and sum up temporal (ensemble) statistics tcorr = timeit.default_timer() print('Computing 2d correlations... ', end='', flush=True) import crossCorrelation as c acQ1 = acQ1 + c.corr2d(q1, q1) # auto-correlations acQ2 = acQ2 + c.corr2d(q2, q2) acQ3 = acQ3 + c.corr2d(q3, q3) acQ4 = acQ4 + c.corr2d(q4, q4) acPi = acPi + c.corr2d(pi2d, pi2d) ccQ1Pi = ccQ1Pi + c.corr2d(q1, pi2d) # cross-correlations ccQ2Pi = ccQ2Pi + c.corr2d(q2, pi2d) ccQ3Pi = ccQ3Pi + c.corr2d(q3, pi2d) ccQ4Pi = ccQ4Pi + c.corr2d(q4, pi2d) print('Time elapsed:', '{:3.1f}'.format(timeit.default_timer() - tcorr), 'seconds') # sum up first and second statistical moments in time and (homogeneous) theta and z direction for normalisation q11 = q11 + np.sum(np.sum(q1, axis=1), axis=0) # sum over all elements of 2d data sub set q12 = q12 + np.sum(np.sum(q1**2, axis=1), axis=0)