Skip to content

Non dimensional

weymouth edited this page Mar 15, 2015 · 3 revisions

LilyPad Understanding non-dimensional parameters

Introduction

In Lily Pad, the solid and fluid mechanical governing equations are used in their non-dimensional form. Because the dimensions (size, speed, and time scales) of a problem are defined by the user, these cannot be "hard-wired" into the governing equations. Instead, the grid size h and uniform flow velocity U are used. This makes certain grid-based parameters easy to compute, but means any engineering coefficients will require some scaling.

This document reviews the basics of non-dimensionalization for the Navier-Stokes equation, and gives a few examples. For a more detailed discussion of nondimensionalization in physics, you can check out wikipedia's [general] (http://en.wikipedia.org/wiki/Nondimensionalization) & Navier-Stokes specific pages, or classics texts such as Bachelor 1967 or Newman 1977.

Navier Stokes Equation

The Navier-Stokes equations governing the dynamics of a simple fluid with uniform material properties is:

  • rho D/Dt(u) = -d/dx(p)+mu d^2/dx^2(u)

where u is the local fluid velocity vector, and p is the local pressure of the fluid. The properties rho and mu are the fluid density and viscosity. The operators D/Dt, d/dx, and d^2/dx^2 are the material derivative, gradient and laplacian, respectively.

These variables have dimensions of mass, length, and time, and need to be scaled by characteristic values in the flow. As discussed above, the values typically chosen by engineers (such as the length or mass of a body) are defined by the user, and therefore cannot be hard-wired into the solver. Additionally, because Lily Pad allows for multi-body problems there may be any number of length and velocity scales to choose from for a given simulations.

Instead the code is scaled by the fixed numerical parameters; the grid cell dimension h, the uniform flow velocity U, and the fluid density rho. The non-dimensional variables are then:

  • u = u / U
  • p = p / ( rho U^2^ )
  • x = x / h
  • t = t U / h

where x and t are non-dimensional distances and times used in operators. The Navier-Stokes equation is then:

  • D/Dt(u) = -d/dx(p)+nu d^2/dx^2(u)

where the non-dimensional kinematic viscosity is

  • nu = mu / ( rho U h )

Example

Because the equations have been nondimensionalized using h and U, it is most appropriate to use these variables when setting up the engineering problem of interest.

For example, consider simulating the flow around a cylinder moving with imposed harmonic motion. The size and location of the body, and amplitude of the motion is expressed in units of h. The frequency is expressed in units of U/h and the velocity in units of U. The code to place this body is then:

CircleBody body;
float t=0;                // initialize non-dim time at zero
void setup(){
  size(400,400);          // display size in pixels

  int n=64+2;             // number of grid cells in each direction
  float x  = 32, y = 32;  // circle center is located at grid center
  float diam = 20;        // diameter is 20h

  // define the geometry (the `Window' sizes the circle to the display) 
  body = new CircleBody( x, y, diam, new Window(n,n) );
}
void draw(){
  t += 0.1;               // increment time by 0.1 h/U
  float amp = 20, cen=32; // amplitude of motion is 20h
  float omega = PI/6.;    // frequency is pi/6 U/h

  // displacement is desired location - current location
  float dy = cen+amp*sin(omega*t)-body.xc.y;

  // apply translation
  body.translate(0,dy);   
  body.update();

  // draw background and current position of body
  background(0);
  body.display();

  // write the velocity to screen (displacement/time per step)
  println("velocity: "+body.dxc.y/0.1);
}

Copy and paste this code into Lily Pad to try it out. What is the magnitude of the velocity printed to the output? Does it match your expectations given the defined frequency and amplitude?

Engineering Implications

The above discussion and example state that h,U, and rho are the fundamental scales in Lily Pad. This has implication for working with the code:

  • As in the previous section, the problem of interest should be set up in terms of these units.
  • In addition to size and velocities, the viscosity must also be scaled. To achieve a Reynolds number based on length of, Re = rho U L / mu, then the non-dimensional kinematic viscosity should be set to nu=L /Re. Where L=L / h as above.
  • In general the output will need to be converted into engineering scales as well. For instance to a force F from Lily Pad corresponds to a two-dimensional drag coefficient of C[D]=2F / (rho U^2^ L ) = 2 F/ L.

= Numerical Implications =

However, many numerical parameters of interest are easier to work with in Lily Pad's non-dimensional form:

  • The non-dimensional length _ L = L/h _ is the body resolution, giving the number of grid points along the body. This is a heuristic for how well resolved the simulation will be.
  • The non-dimensional time step _dt = dt U / h _ is the global Courant number, specifying what fraction of a grid cell is traveled by the flow in a time step. This is important for the numerical stability of the method.
  • The non-dimensional viscosity _ nu = mu / ( rho U h )_ is one over the grid-based Reynolds number. This indicates how well resolved the viscous stresses will be. Setting _ nu << 1_ will under-resolve those forces. Increasing the body resolution L will allow you to match a given Re without an excessively small nu.