Lesson 2.3 — grid.txt

All parameters considered for solving the governing equations in Users’ Guide are specified in grid.txt. In grid.txt, all lines except line separators consist of 3 blocks. For example, first three lines of grid.txt look something like this:

---------- Control File for Flowsquare ver 4.0 (Use SI Unit) ----------
------------------------- General Control Data ------------------------
01:cmode 0 // Simulation mode,....

The first two lines are separators. Like the third line, all lines except separators consist of 3 blocks. The first block (01:cmode) denotes a name of each parameters (often similar name to the notation used in the Users’ Guide). The second block (“0″ in above example) is the number you specify for each parameter. Then the third block (// Simulation mode, …) is just a comment, and nothing to do with simulations. These three blocks have to be separated by space(s), and no space should be inserted in each block.

Some of the parameters in grid.txt are related with B.C. (bc.bmp) and/or I.C. (ic.bmp). Here is a list of all the parameters specified in grid.txt and their descriptions.

  1. ———- Control File for Flowsquare ver 4.0 (Use SI Unit) ———-
  2. ————————- General Control Data ————————
  3. 01:cmode
    Mode of simulation, where
    • cmode=0: Non-reacting flow simulation
    • cmode=1: Reacting (premixed) flow simulation
    • cmode=2: Reacting (non-premixed) flow simulation
    • cmode=3: Sub/supersonic flow simulation
  4. 02:nx
    Number of grid points in x (horizontal) direction for discretisation.
  5. 03:ny
    Number of grid points in y (vertical) direction for discretisation.
  6. 04:lx
    Physical domain size (m) in x (horizontal) direction.
  7. 05:ly
    Physical domain size (m) in y (vertical) direction.
  8. 06:sts
    Start or restart time step of the simulation. New simulation always starts from sts=0. You can restart the simulation from the point you output the simulation results in dump folder.
  9. 07:latts
    Last time step of the simulation. (You can restart the simulation.)
  10. 08:cflfac
    Factor for time step (dt: physical time increment during the simulation). In Flowsquare, dt=lx/(nx-1)/u_max/cflfac, where u_max is defined as:
    • 1. maximum of speeds defined in grid.txt for cmode=0–2, or
    • 2. speed of sound for cmode=3.

    Typically cflfac=10~20 is preferred.

  11. —————- Numerical Scheme, Smoothing & Accuracy —————
  12. 09:iorder
    Numerical scheme used in the simulation. You can use a number from 0 to 3 for iorder, and each number means
    • iorder=0: Low order scheme (2nd order difference, 1st order time integral)
    • iorder=1: High order scheme (4th order difference, 3rd order time integral)
    • iorder=2: 2nd order difference and Lax-Wendroff time marching (2nd order)
    • iorder=3: 4th order difference and Lax-Wendroff time marching (2nd order)
  13. 10:nfil
    Interval time steps of spatial filtering procedure.
  14. 11:wfil
    Relaxation parameter for the spatial filtering (see Section 4.4 of the Users’ Guide).
  15. 12:omega
    Relevant for cmode=0–2. Relaxation parameter for Poisson’s equation. 1.8 is usually best for quick convergence, but smaller omega can be used for complexed flow geometry or reactive flows with heat release (see Section 4.3 of the Users’ Guide).
  16. 13:peps
    Relevant for cmode=0–2. Tolerance of convergence for Poisson’s equation (see Section 4.3 of the Users’ Guide).
  17. 14:loopmax
    Relevant for cmode=0–2. Maximum number of iteration. Loopmax is prioritised over peps (see Section 4.3 of the Users’ Guide).
  18. 15:wdrho
    Relevant for cmode=1 and 2. wdrho=1 is correct and usually this number should be used. But during initial transient, smaller value may be used for convergence. 0<=wdrho<=1. See Eq. (6) of the Users’ Guide.
  19. —————— General BC and Global IC (White) ——————-
  20. 16:perikey
    Specifies periodic boundaries and their direction.
    • perikey=0: No periodic boundary is used.
    • perikey=1: x (horizontal) direction is periodic.
    • perikey=2: y (vertical) direction is periodic.
    • perikey=3: Both x and y directions are periodic.
  21. 17:pres0
    In (Pa). See Lesson 2.2 — ic.bmp
  22. 18:uin0
    In (m/s).
  23. 19:vin0
    In (m/s).
  24. 20:rho0
    In (kg/m^3).
  25. 21:temp0
    In (K).
  26. 22:scalar0
  27. —————— BLUE Local BC and/or IC (optional) —————–
  28. 23:uin1
    In (m/s). See Lesson 2.1 — bc.bmp
  29. 24:vin1
    In (m/s).
  30. 25:rho1
    In (kg/m^3).
  31. 26:temp1
    In (K).
  32. 27:scalar1
  33. —————— RED Local BC and/or IC (optional) ——————
  34. 28:uin2
    In (m/s). See Lesson 2.1 — bc.bmp
  35. 29:vin2
    In (m/s).
  36. 30:rho2
    In (kg/m^3).
  37. 31:temp2
    In (K).
  38. 32:scalar2
  39. ———- PINK Local BC and/or IC (pure air flow, optional) ———-
  40. 33:uin3
    In (m/s). See Lesson 2.1 — bc.bmp
  41. 34:vin3
    In (m/s).
  42. 35:temp3
    In (K).
  43. ————— BLACK Wall Boundary Condition (optional) ————–
  44. 36:tempw
    In (K). See Lesson 2.1 — bc.bmp
  45. ————– GREEN Moving Boundary Condition (optional) ————-
  46. 37:imb
    See Lesson 2.1 — bc.bmp
  47. 38:umb
    In (m/s).
  48. 39:vmb
    In (m/s).
  49. 40:tempmb In (K).
  50. ————- YELLOW Scalar Boundary Condition (optional) ————-
  51. 41:scalarT
    In (K). See Lesson 2.1 — bc.bmp
  52. ———- Transport Properties & Thermochemical Conditions ———–
  53. 42:mu
    Dynamic viscosity of the mixture. In (kg/m s). Water@300K: 8.94E-4, Air@300K: 18.6E-6. Relevant for cmode=0–2.
  54. 43:R
    Specific gas constant in (J/kg K). Air: 286.9. Relevant to cmode=1 and 2.
  55. 44:diff
    Mass diffusivity of mixture in (m^2/s). If unity Schmidt number is assumed, diff~mu/rho and Air@300K: 20.0E-6. Relevant to cmode=1, 2 and when yellow B.C. is used.
  56. 45:Tu
    Unburnt temperature in (K). Relevant to cmode=1.
  57. 46:Tb
    Burnt temperature in (K). Relevant to cmode=1 and 2.
  58. ——————- Chemical Reaction (for cmode=1) ——————-
  59. 47:krate
    Pre-exponential constant for a single step chemical mechanism. See Eq. (13) of the Users’ Guide.
  60. 48:Trate
    Activation temperature in (K).
  61. 49:nrate
    A constant for a single step chemical mechanism.
  62. 50:cF
    Progress variable at which flame locates (~0.5, just for visualisation purposes).
  63. ————— Non-Premixed Reacting Flow (for cmode=2) ————–
  64. 51:Xst
    Stoichiometric mixture fraction at which flame locates (~0.5).
  65. 52:sigma
    Relaxation parameter for density change. 0<=sigma<=1 and 1 is exact. See Eq. (28) of the Users’ Guide.
  66. ————————– Display & Output —————————
  67. 53:box
    Pixel size of each grid point displayed on the screen. Typically nx * nbox is less than the screen size.
  68. 54:nfig
    Interval time steps for figure output (0: no figure is generated).
  69. 55:nfile
    Interval time steps for instantaneous simulation result output (0: no simulation data is generated).
  70. 56:bcdisp
    • bcdisp=0: Wall boundaries are not overlaid.
    • bcdisp=1: Wall boundaries are overlaid.
  71. 57:idisp
    Quantity displayed in colour.
    • idisp=0: off
    • idisp=1: Density.
    • idisp=2: Velocity component in x (horizontal) direction, u.
    • idisp=3: Velocity component in y (vertical) direction, v.
    • idisp=4: Speed (sqrt(u*u+v*v)).
    • idisp=5: Vorticity
    • idisp=6: T
    • idisp=7: Reaction rate (for cmode=1)
    • idisp=8: Progress variable for cmode=1, mixture fraction for cmode=2, general scalar for cmode=0, 3.
    • idisp=9: Pressure (minus pres0)
    • idisp=10: Mixture fraction of air and progress variable (cmode=1), E/rho (J/kg) (cmode=3).
  72. 58:cmax
    Maximum value of the colour bar for the given idisp variable (put 0 for auto scaling.)
  73. 59:cmin
    Minimum value of the colour bar for the given idisp variable (put 0 for auto scaling.)
  74. 60:icolor
    Colour map.
    • icolor=0: Jet
    • icolor=1: Rainbow
    • icolor=2: Nishiki
    • icolor=3: Grey
    • icolor=4: Grey (inverse)
    • icolor=5: Hot
    • icolor=6: Sea
    • icolor=7: Leaf
  75. 61:icont
    Contour line on the reaction front (cmode=1 and 2).
    • icont=0: off
    • icont=1: Black
    • icont=2: Red
    • icont=3: Green
    • icont=4: Blue
    • icont=5: White
  76. 62:linewidth
    Line width of the reaction front contour line.
    • linewidth=1: 1 pixel
    • linewidth=3: 3 pixels
    • linewidth=5: 5 pixels
    • linewidth=7: 7 pixels
  77. 63:ivec
    Velocity vectors and their colour.
    • ivec=0: off
    • ivec=1: Black
    • ivec=2: Red
    • ivec=3: Green
    • ivec=4: Blue
    • ivec=5: White
  78. 64:ndiv
    Interval grid points between displayed velocity vectors (0: auto adjust).
  79. 65:vecsize
    Pixel size of vector arrow (0: auto adjust).
  80. —————— Lagrangian Trajectory (optional) ——————-
  81. 66:lagkey
    Lagrangian trajectory.
    • lagkey=0: off
    • lagkey=1: Particles are fed from left boundary.
    • lagkey=2: Particles are fed from bottom boundary.
    • lagkey=3: Particles are fed from left and right boundaries.
    • lagkey=4: Particles are fed from top and bottom boundaries.
  82. 67:lagcolor
    Colour of Lagrangian particles. 0: black and 1: white.
  83. 68:lagsize
    Pixel size of particles.
  84. 69:nlagra
    Interval time steps of initialise Lagrangian particles (>=100).
  85. 70:npart
    Number of Lagrangian particles (>=1000).
  86. ———————— Body Force (optional) ————————
  87. 71:gfx
    Body force in the x (horizontal) direction due to the density difference in (m/s^2).
  88. 72:gfy
    Body force in the y (vertical) direction due to the density difference in (m/s^2).
  89. 73:dref
    Reference density.
    • dref=1: Maximum of densities calculated from grid.txt.
    • dref=2: Middle value of densities calculated from grid.txt.
    • dref=3: Minimum of densities calculated from grid.txt.
  90. ——————- Initial Perturbation (optional) ——————-
  91. 74:pmode
    Initial perturbation switch. See Section 4.6 of the Users’ Guide.
    • pmode=0: off
    • pmode=1: single mode
    • pmode=2: multi modes
    • pmode=3: multi modes (random amplitude)
  92. 75:umag
    Amplitude of velocity perturbation in (m/s).
  93. 76:nwave
    Number of waves in x (horizontal) direction.
  94. ——————————– Others ——————————-
  95. 77:nwait
    Wait time (usually 0 for fastest computational speed).
  96. ———————————————————————–
  97. #End of file