This is an old revision of the document!
The FlowField class represents vector-valued fields of the form
and also scalar and tensor fields with appropriate changes in the dimensionality of the coefficients. The barred T function is a Chebyshev polynomial scaled to fit the domain y ∈ [a,b]. 1) The spatial domain of a FlowField is Ω = [0,Lx] x [a,b] x [0,Lz], with periodicity in x and z.
In channelflow programming, fields such as velocity, pressure, stress tensors, vorticity, etc. are stored as variables of type FlowField. The main functionality of the FlowField class is
FlowFields are initialized with gridsize and cellsize parameters, read from disk, or assigned from computations. Examples:
FlowField f; // null value, 0-d field on 0x0x0 grid FlowField u(Nx, Ny, Nz, Nd, Lx, Lz, a, b); // Nd-dim field on Nx x Ny x Nz grid, [0,Lx]x[a,b]x[0,Lz] FlowField g(Nx, Ny, Nz, Nd, 2, Lx, Lz, a, b); // Nd-dim 2-tensor FlowField h("h"); // read from file "h.ff" FlowField omega = curl(u);
Assume f,g,h etc. are FlowField variables with compatible cell and grid sizes. Examples of possible operations
f += g; // f = f + g f = curl(g); f = lapl(g); f = div(g); f = diff(g, j, n); // f_i = d^n g_i /dx_j f = grad(g); // f_ij = dg_i / dx_j f = cross(g,h); f *= 2.7; // f = 2.7*f Real c = L2IP(f,g); // L2 inner product of f,g Real n = L2Norm(u); Real D = dissipation(u); Real E = energy(u); Real I = wallshear(u);
The latter functions are defined as