# divide by total number of spatio-temporal samples compute mean & normalizing by RMS acUz = acUz/(nz*nt) acUzF = acUzF/(nz*nt) acPi = acPi/(nz*nt) acOmgZ = acOmgZ/(nz*nt) print('-------------------------------------------------------------------------') print('Total elapsed wall-clock time:', '{:3.1f}'.format(timeit.default_timer()-t0), 'seconds') #============================================================================================= # write correlation coefficient in ascii file dth = th - (th[-1]-th[0])/2.0 # Why? fnam = 'autoCorr1dBoxTh'+'{:08d}'.format(iFirst)+'to'+'{:08d}'.format(iLast)+'nt'+'{:04d}'.format(nt)+'.dat' print('-------------------------------------------------------------------------') print('Writing cross-correlation to file', fnam) f = open(fnam, 'w') f.write('# One-dimensional two-point auto-correlations in azimuthal (Th) direction\n') f.write('# For Uz, Uz(Box Filtered), eFlux and axial vorticity component.\n') f.write("# At wall-normal location r = %f -> y+ = %f\n" % (r[k], (1-r[k])*180.4)) f.write('# Python post-processing on data set nsPipe/pipe0002 generated in a DNS using nsPipe\n') f.write('# Temporal (ensemble) averaging over %d samples\n' % (nt)) f.write("# First snapshot: %08d\n" % (iFirst)) f.write("# Last snapshot: %08d\n" % (iLast)) f.write("# Additional averaging in theta direction over %d points\n" % (nth)) f.write("# 01st column: axial separation dz in units of pipe radii (R)\n") f.write("# 02nd column: Uz correlation in units of RMS\n") f.write("# 03rd column: UzF correlation in units of RMS\n") f.write("# 04th column: eFlux correlation in units of RMS\n") f.write("# 05th column: OmgZ correlation in units of RMS\n") for i in range(nth-1): f.write("%23.16e %23.16e %23.16e %23.16e %23.16e\n" % (dth[i], acUz[i], acUzF[i], acPi[i], acOmgZ[i])) f.close()
piRms = np.sqrt(pi2 - pi1**2) piSkew = (pi3 - 3.0 * pi2 * pi1 + 2.0 * pi1**3) / piRms**3 piFlat = (pi4 - 4.0 * pi3 * pi1 + 6.0 * pi2 * pi1**2 - 3.0 * pi1**4) / piRms**4 print( '-------------------------------------------------------------------------' ) print('Total elapsed wall-clock time:', '{:3.1f}'.format(timeit.default_timer() - t0), 'seconds') #============================================================================================= # write energy flux statistics to ascii file fnam = 'piStatFourier2d' + '{:08d}'.format(iFirst) + 'to' + '{:08d}'.format( iLast) + 'nt' + '{:04d}'.format(nt) + '.dat' f = open(fnam, 'w') f.write( '# First to fourth order one-point statistics (mean, rms, skewness, flatness) for the\n' ) f.write( '# Inter-scale energy flux Pi^l based on a 2d Fourier space cut-off filter)\n' ) f.write( '# Python post-processing on data set nsPipe/pipe0003 generated in a DNS using nsPipe\n' ) f.write('# Temporal (ensemble) averaging over %d samples\n' % (nt)) f.write( '# Filter width in r: lambdaR+ =%6.1f viscous units, lambdaR =%7.5f in R.}' % (lambdaRp, lambdaR)) f.write( '# Filter width in th: lambdaTh+ =%6.1f viscous units, lambdaTh =%7.5f in R.}' % (lambdaThp, lambdaTh)) f.write(
) print('Total elapsed wall-clock time:', '{:3.1f}'.format(timeit.default_timer() - t0), 'seconds') #============================================================================================= # write correlation coefficient in ascii file dz = z - (z[-1] - z[0]) / 2.0 rdth = (th - (th[-1] - th[0]) / 2.0) * r[k] fnam = 'crossCorr2dBox' + '{:08d}'.format(iFirst) + 'to' + '{:08d}'.format( iLast) + 'nt' + '{:04d}'.format(nt) + '.dat' print( '-------------------------------------------------------------------------' ) print('Writing 2D cross-correlation to file', fnam) f = open(fnam, 'w') f.write('# Two-dimensional two-point cross-correlations in theta-z\n') f.write('# For Uz, Uz(Box Filtered), eFlux and axial vorticity component.\n') f.write("# At wall-normal location r = %f -> y+ = %f\n" % (r[k], (1 - r[k]) * 180.4)) f.write( '# Python post-processing on data set nsPipe/pipe0002 generated in a DNS using nsPipe\n' ) f.write('# Temporal (ensemble) averaging over %d samples\n' % (nt)) f.write("# First snapshot: %08d\n" % (iFirst)) f.write("# Last snapshot: %08d\n" % (iLast)) f.write("# Additional averaging in theta and axial direction") f.write( "# 01st column: arclength separation rdth in units of pipe radii (R)\n") f.write("# 02nd column: axial separation dz in units of pipe radii (R)\n") f.write("# 03rd column: Uz correlation\n") f.write("# 04th column: UzF correlation\n")
print('Total elapsed wall-clock time:', '{:3.1f}'.format(timeit.default_timer() - t0), 'seconds') #============================================================================================= # write correlation coefficient in ascii file dz = z - (z[-1] - z[0]) / 2.0 # Why? fnam = 'crosscorreFluxBoxQ2Q4event1d' + '{:08d}'.format( iFirst) + 'to' + '{:08d}'.format(iLast) + 'nt' + '{:04d}'.format( nt) + '.dat' print( '-------------------------------------------------------------------------' ) print('Writing cross-correlation to file', fnam) f = open(fnam, 'w') f.write( '# One-dimensional two-point auto-correlations in axial (z) direction\n') f.write('# between eFlux and Q2 & Q4 events\n') f.write("# At wall-normal location r = %f -> y+ = %f\n" % (r[k], (1 - r[k]) * 180.4)) f.write( '# Python post-processing on data set nsPipe/pipe0002 generated in a DNS using nsPipe\n' ) f.write('# Temporal (ensemble) averaging over %d samples\n' % (nt)) f.write("# First snapshot: %08d\n" % (iFirst)) f.write("# Last snapshot: %08d\n" % (iLast)) f.write("# Additional averaging in theta direction over %d points\n" % (nth)) f.write("# 01st column: axial separation dz in units of pipe radii (R)\n") f.write("# 02nd column: eFlux-Q2 correlation\n") f.write("# 03rd column: eFlux-Q4 correlation\n") for i in range(nz - 1):