User Tools

Site Tools


docs:utils:field2ascii

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

docs:utils:field2ascii [2010/02/02 07:55]
docs:utils:field2ascii [2010/02/02 07:55] (current)
Line 1: Line 1:
 +====== field2ascii ======
  
 +convert a binary flowfield file (.ff) to an ascii data file (.asc)
 +
 +===== options =====
 +
 +<​code>​
 +
 +  -p        --padding ​                 save full Nx x Ny x Nz grid rather eliminating padded modes
 +  -g        --gridpoints ​              write x.asc, y.asc, z.asc gridpoint files
 +  <​fieldname> ​     (trailing arg 2)    flowfield input file
 +  <​asciifile> ​     (trailing arg 1)    ascii output file
 +</​code>​
 +
 +===== usage =====
 +
 +<​code>​
 +  field2ascii u.ff u.asc  ​
 +</​code>​
 +
 +ASCII files are stored as physical values of components of the field at the gridpoints (i.e. not spectral
 +coefficients). Fields with 2/3-style padding for dealiasing are saved on reduced grids (Nx,Nz -> 2Nx/3, 2Nz/3), unless the -p option is used. 
 +
 +
 +===== ASCII velocity fields =====
 +
 +The gzipped ASCII velocity files store gridpoint values of the field in x,y,z,i order using the following C++ code
 +
 +  os << setprecision(16);​
 +  for (int nx=0; nx<Nx ++nx)
 +    for (int ny=0; ny<Ny ++ny)
 +      for (int nz=0; nz<Nz ++nz)
 +        for (int i=0; i<Nd ++i)
 +          os << u(nx,​ny,​nz,​i) << '​\n';​
 +
 +The value u(nx,​ny,​nz,​i) is the ith component of the Nd-dimensional field at the gridpoint (nx,ny,nz).
 +The (nx,​ny,​nz)th gridpoint has spatial coordinates (nx Lx/Nx, cos(ny pi/(Ny-1)), nz Lz/Nz).
 +For 3D velocity fields, the (u,v,w) components are i=0,1,2.
 +
 +===== ASCII geometry and discretization =====
 +
 +Geometrical and discretization parameters are stored as ASCII in *.geom files as follows
 +<​code>​
 +  32                      %Nx
 +  35                      %Ny
 +  32                      %Nz
 +  3                       %Nd
 +  5.511566058929462 ​      %Lx
 +  2.513274122871834 ​      %Lz
 +  0.8771929824561405 ​     %lx=Lx/​(2pi)
 +  0.4                     ​%lz=Lz/​(2pi)
 +  1.14                    %alpha=2pi/​Lx
 +  2.5                     ​%gamma=2pi/​Lz
 +</​code>​
 +
 +In channelflow,​ Lx and Lz are the canonical geometry specifications. The .geom files provide
 +lx,lz and alpha,gamma for human convenience.
docs/utils/field2ascii.txt ยท Last modified: 2010/02/02 07:55 (external edit)