step = f['grid'].attrs.__getitem__('step') timeIn = f['grid'].attrs.__getitem__('time') Re = f['setup'].attrs.__getitem__('Re') f.close() print(' with data structure u', u_z.shape) # subtract mean velocity profile (1d) to obtain full (3d) fluctuating velocity field u_z = u_z - np.tile(u_zM, (nz, nth, 1)).T # filter velocity field print('Filtering velocity components and mixed terms... ', end='', flush=True) tfilter = timeit.default_timer() import filter2d as f2 u_rF = f2.gauss2d(u_r, lambdaTh, lambdaZ, r, th, z) u_thF = f2.gauss2d(u_th, lambdaTh, lambdaZ, r, th, z) u_zF = f2.gauss2d(u_z, lambdaTh, lambdaZ, r, th, z) u_rRF = f2.gauss2d(u_r * u_r, lambdaTh, lambdaZ, r, th, z) u_rThF = f2.gauss2d(u_r * u_th, lambdaTh, lambdaZ, r, th, z) u_rZF = f2.gauss2d(u_r * u_z, lambdaTh, lambdaZ, r, th, z) u_thThF = f2.gauss2d(u_th * u_th, lambdaTh, lambdaZ, r, th, z) u_thZF = f2.gauss2d(u_th * u_z, lambdaTh, lambdaZ, r, th, z) u_zZF = f2.gauss2d(u_z * u_z, lambdaTh, lambdaZ, r, th, z) print('Time elapsed:', '{:3.1f}'.format(timeit.default_timer() - tfilter), 'seconds') # compute instantaneous energy flux tflux = timeit.default_timer() print('Computing energy flux... ', end='', flush=True) import eFlux
p = np.array(f['fields/pressure']).transpose( 0, 2, 1) # filter functions were made for u[r,th,z] step = f['grid'].attrs.__getitem__('step') timeIn = f['grid'].attrs.__getitem__('time') Re = f['setup'].attrs.__getitem__('Re') f.close() print(' with data structure u', u_z.shape) # subtract mean velocity profile (1d) to obtain full (3d) fluctuating velocity field u_z = u_z - np.tile(u_zM, (nz, nth, 1)).T # filter velocity field print('Filtering velocity components and pressure... ', end='', flush=True) t1 = timeit.default_timer() import filter2d as f2 u_rF = f2.gauss2d(u_r, lambdaTh, lambdaZ, r, th, z) u_thF = f2.gauss2d(u_th, lambdaTh, lambdaZ, r, th, z) u_zF = f2.gauss2d(u_z, lambdaTh, lambdaZ, r, th, z) pF = f2.gauss2d(p, lambdaTh, lambdaZ, r, th, z) print('Time elapsed:', '{:3.1f}'.format(timeit.default_timer() - t1), 'seconds') # store result as individual HDF5 file fnam = 'filteredFieldGauss2d_pipe0002_' + '{:08d}'.format(iFile) + '.h5' out = h5py.File(fnam, 'w') # open HDF5 file for writing fields = out.create_group("fields") scale = out.create_group("scale") scale.attrs.create("deltaTh", data=lambdaTh) scale.attrs.create("deltaZ", data=lambdaZ) grid = out.create_group("grid") grid.create_dataset("r", data=r)