Incompressible fluid model (Karman)

This program simulates Karman vortex sheets in a two-dimensional, non-divergent fluid.

See the detail including the formulation in the manual documentation.

To evaluate the spacial derivation, a finite difference method is used.

Time integration is only performed for vorticity, and horizontal wind velocities are diagnosed throughout a stream function which is given by a non-divergent relation.

Files

solver.f90 -> main program.

Running the program

Depend

  • STPK library (math library for time integration)
  • NetCDF library (data format library for output data)
  • gtool5 library (wrapper library for NetCDF library)

In order to draw the result, you can use any drawing tools supporing the NetCDF format.

Edit Mkinclude

  • Edit Mkinclude file in the parent directory, depending your system environment.

Edit colum.txt (for configuration of a non-calculating region)

To simulate Karman vortex sheets, you must set a non-fluid region in the internal domain. Because Karman vortex sheets is produced by forcings on the boundary of the non-fluid region.

You must set the region in a text file (colum.txt).

  • How to edit
    • The first array is dummy (comment) in colum.txt.
    • The value of the second array and first column corresponds to the grid point at left and bottom boundary in the model.
      • The value of the second array and last column corresponds to the grid point at right and bottom boundary in the model.
      • ... last array and first column -> left and top boundary.
      • ... last array and last column -> right and top boundary.
    • each single character corresponds to each grid point.

      "0" : calculating grid point, 
      "-" : non-calculating grid point,
      otherwise : the internal boundary between calculating and non-calculating grid points.
      • "0" must not be close to "-".
    • a certain single digit to set some boundary condition corresponds in the internal boundary point.
      • The digit is identical to the digit of boundary condition in all routines to solve Poisson equation in the Alge_Solv module.

The following is an example for the setting.

grid number in the model : x = 20, y = 10
grid number of the non-calc. region : x = 2, y = 2 (square)
position of the region in the model : 4th grid point from the left boundary of the model
                                      4th grid point from the bottom boundary of the model
boundary condition on the non-calc. region : Fixed condition (Diriclet type).

In this case, you must edit the colum.txt such as the following:

|--- 10 ---||--- 20 ---|
000000000000000000000000
000000000000000000000000
001111000000000000000000
001--1000000000000000000
001--1000000000000000000
001111000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000

Make the executable program

$ make      # Karman (main program) is made.

Edit namelist file

namelist.nml : a configuration file to integrate. it is used in Karman program.

nx = 400    ! X-coordinate grid number
ny = 100    ! Y-coordinate grid number
nt = 100000 ! calculating time step
xmin = 0.0  ! X-coordinate original point
ymin = 0.0  ! Y-coordinate original point
dx = 0.1    ! X-coordinate grid interval [m]
dy = 0.1    ! Y-coordinate grid interval [m]
dt = 0.001  ! time interval [s]
dmpstp = 1000  ! dumping time step
            ! dumping time interval is equal to "dmpstp * dt"
finame = "" ! initial data file name.
            ! if there is no, automatically,
            ! being made by the program.
foname = "result.nc"      ! result data
inner_file = 'colum.txt'  ! inner boundary file
time_flag = '1'  ! time scheme :
                 ! [1] = 4th order's Runge-Kutta
                 ! [2] = Leap Frog
                 ! [3] = 1th Explicit Euler
undef = -999.0   ! undefined value
init_type = 'psi'  ! the tpe of initial value.
                   ! 'psi' = strem line, 'omg' = vorticity.
ubar = 1.0         ! mean flow [m/s]
eps = 1.0e-4       ! convergent condition for poisson solver
nu = 0.01          ! diffusion coefficient

もし, finame が設定されていない場合は, ソルバプログラムが自動的に colum.txt を読み込んで適切な初期値を用意する.

Running

$ export OMP_NUM_THREADS=[number]  # (if any,) you can use OpenMP.
$ ./Karman < namelist.nml          # starting time integration.

The result of time integration is output in a file which is set in "foname" variable in namelist.nml

  • demo animation
    • Color and contour denote relative vorticity and stream function, respectively.
    • The configuration shown in the above is used in this calculation..


Return