Вы находитесь на странице: 1из 14

Flowsquare 3.

1 Users Guide
Yuki Minamoto (http://www.FLOWSQUARE.com) 18th January 2012 Introduction to owsquare 3.1 Flowsquare is a 2D computational uid dynamics software for reactive/non-reactive uid simulations. The heat release effect on the uid eld is included based on a low-Mach number assumption. This documentation includes all numerical aspects as well as the interface are explained. However, I suggest that users visit http://www.owsquare.com to nd several sample cases from which users develop their own case les. User may want to consult these two books [1, 2]. 1 Governing equations In owsquare, the incompressible governing equations are solved based on the low-Mach number assumption. Under the assumption, the mixture density changes due to the heat release (temperature rise), while the uid effect on the density is assumed as negligible. Therefore, the continuity equation is written in terms of conservative form as: (ui ) = 0, + t xi (1) two steps. For rst step, the equation is solved without pressure term as: ij (ui uj ) + (uj ) = t xi xi +( )gj .

(4)

Then, the pressure term is included so that the mass conservation is taken into account in the second time integration: p (uj ) = . t xj (5)

where and ui are respectively the mixture density and i-component of velocity. The temporal change of density is neglected due to the above assumption. The governing equation for momentum is: p ij (ui uj ) = + (uj ) + t xi xj xi +( )gj , (2) where p is pressure, and gj is the acceleration of gravity. The term, ( )gj , represents the external force due to the buoyancy and is the reference density. ij is the viscossstrain given by: ui uj 2 uk ij + + , (3) ij = 3 xk xj xi where is the dynamic viscosity and ij is the Kronecker delta. Equation (2) is solved in 1

Equation (5) is solved using the Poissons equation in terms of u i and the correction of pressure, p , as: 2 p = x2 i (ui ) 1 + wd , xj t t (6)

where, t is the time step and wd is user dened parameter typically unity. Once the corrected pressure eld is obtained, the corrected velocity in the next time step is written as: ui = (ui ) p t. xj (7)

Now the velocity eld satises the continuity equation (Eq. 1) is obtained from Eq. (7) in the conservative form. 1.1 Governing equations for scalars

For reactive ow eld, the conservation equations for species mass fraction, Yi , and energy

need to be solved, and meybe written with appropreate assumptions as: Yi + i , xj (8) T T (T ) + (uj T ) = + , t xj xj cp xj cp (9) where the energy equation is written in terms of temperature, T . Di , and cp denote the molecular diffusivity of species i, thermal conductivity and specic heat capacity of the mixture. Species and heat source are denoted as i and T . Therefore, for the simplest reaction systems, in which the fuel, F , and oxidizer, O, react to produce products, P , as: Di F + O P, (10) (Yi ) + (uj Yi ) = t xj xj

which shows the extent of reaction progress in premixed combustion systems. Although there are several denition for the progress variables, in owsquare, following denitions are used: cYF/O = 1 YF/O YP or cYP = YF/O,u YP ,b cT = (11)

the total number of equations for Eqs. (8) and (9) is four. In owsquare, in order to reduce the number of equations to be solved, the progress variable and the mixture fraction are introduced. The progress variable is used for premixed reaction, while mixture fraction is used in non-premixed reaction. These two modes of reaction and the reduced equation are explained next subsections. 1.1.1 Premixed reacting ow

T Tu , (12) Tb Tu where the subscripts, u and b denote unburnt and burnt mixture, and F, O and P denote fuel, oxidiser and product, respectively. Therefore, progress variable is 0 in the unburnt mixture and 1 in the fully burnt mixture. Figure 1 (b) shows the progress variable variation of one-dimensional premixed ame. Flame front is often dened as the iso-surface of c = 0.3 0.6. Lewis number, Le, is dened as the ratio of thermal diffusivity to mass diffusivity. If unity Lewis numbers, constant pressure, adiabatic conditions and c = cYF/O = cYP = cT are assumed, Eqs. (8) and (9) are reduced to one equation of progress variable conservation as: c (ui c) = D (c) + t xi xi xi + c ,

Reaction is called premixed reaction when all species are fully mixed before the reaction takes place. For example, premixed reaction (combustion) can be observed in traditional gas stobe and heater burners. In the case of premixed combustion, fuel and oxidizer are well mixed so the unburnt mixture is uniform and homogeneous. One of important features of this premixed combustion is that ame (reaction front) can freely propagate toward unburnt mixture (Fig. 1 a), or mixture can ignite at any locations if there is enough activation energy. This is not the case in non-premixed mode as explained in the next subsection. For premixed mixture, reaction can be expressed by using reaction progress variables. The progress variable, c, is a normalized scalar 2

(13) where c is the reaction rate of c, and D is the diffusivity of progress variable (with above assumption, it can be either diffusivity of temperature or mixture). Therefore, once progress variable eld is obtained, temperature eld and species mass fraction elds can be obtained using Eqs. (11) and (12). The rate of reaction of c is modelled as follows: c = k exp Ta T n (1 c)c , T (14)

where k , Ta and n are all constant for the single step reaction explained in Eq. (10).c in Eq. (14) is the mixture fraction between the fuel-air mixture and air. The mixture fraction is explained in the next section. At c = 1, the mixture consists of only fuel-air mixture and at c = 0, the mixture is only air. By multiplying c to the reaction rate, reaction at pure air is avoided. In Sec. 6.2, how to set pure

(a) Unburnt

Burnt

1.1.2

Non-premixed reacting ow

Propagation (Fuel + Oxidizer) (Products) 1

Progress variable

(b)

In contrast to premixed reaction, nonpremixed reaction does not require mixing of fuel and oxidizer before reaction. A schematic gure for typical non-premixed ame is shown in Fig 2 (a). There are fuel and oxidizer stream and reaction takes place only at the locations where fuel and oxidizer meet. With the given reaction, Eq. (10), the mass production rate of fuel, oxidizer, product, and heat release are related as: F = O P T = = , s 1+s Q (15)

Figure 1: Schematic of premixed ame (a) and one-dimensional variation of progress variable (b).

where Q is the heating value of fuel and s is the mass of oxidizer required per unit mass of fuel, dened as s = WO /WF , where Wi is the molar weight for species, i. If the unity Lewis number is assumed, the conserved scalar, , is dened from any pair of variables as: F,O = sYF YO , (16) (17) (18) (19) (20)

(a) Fuel stream

(b)

F,P = YF +
st

YP , 1+s YP , 1+s cp T , Q scp T . Q

Oxidizer stream (c) Tb YO


0

O,P = YO + F,T = YF + O,T = YO +

Mixture fraction 0

YF0

0 (Oxidizer stream)

Mixture fraction

st

1 (fuel stream)

Figure 2: Schematic of non-premixed ame (a), one-dimensional variation of mixture fraction (b), and temperature and mass fraction variations as a function of mixture fraction (c).

is called conserved scalar, because if one considers the conservation equation for one of conserved scalars, the source term does not appear. For instance, for above F,O , the conservation equations of s YF and YO are written as: (sYF ) (uj sYF ) = + t xj sYF D xj xj (YO ) + (uj YO ) = t xj xj

+ sF ,

(21)

air stream is explained. If there is no pure air stream in the domain, c is automatically set as 1. 3

YO +O . xj (22)

By using Eq. (15) and by combining Eqs. (21) and (22) , it is clear that the source terms are cancelled and following equation is obtained: F,O (ui F,O ) = D , (F,O )+ t xi xi xi (23) is called conserved scalar because there is no source term in Eq. (23). Once a conserved scalar is dened, a normalized conserved scalar, , is also dened. This normalized conserved scalar is called mixture fraction, and dened as: = O , F O (24)

, st 0 YP = (1 s)YF , 0 0 T = (Tb TO ) + TO , st 0 for > st : YF = YF , 1 st YO = 0, 0 1 YP = (1 s)YF , 1 st 0 Tb TF T 0 st Tb T = + F , st 1 st 1


0 1 YO = YO

(27)

where the subscripts F and O mean a fuel and an oxidizer stream, respectively. Figure 2 (b) shows one-dimensional mixture fraction variation for the ame in Fig. 2 (a). With above denition of mixture fraction, = 1 corresponds to fuel stream and = 0 corresponds to oxidizer stream. As shown in Fig. 2 (b), ame location in non-premixed systems is often assumed as the location where = st . Here st is called stoichiometric mixture fraction, at which there are the exact amount of fuel and oxidizer to convert a unit quantity of fuel into product. The stoichiometric mixture fraction is calculated by: O . st = F O (25)

where Tb is the adiabatic ame temperature, 0 0 and YO are respectively fuel and oxidizer YF 0 0 and TO mass fraction at each stream, and TF are temperatures at fuel and oxidizerstream, respectively. 1.1.3 Others

In premixed mode, owsquare solves Eqs. (1) , (2) and (13). Equation (26) is solved in premixed mode only if you set a pure-air stream. In non-premixed mode, Eqs. (1) , (2) and (26) are solved. Temperature is calculated using either progress variable or mixture fraction elds. Density eld is obtained based on the classical ideal gas law: p = RT, (28)

The mixture fraction also satises Eq. (23). Therefore, for the simulation of reactive nonpremixed systems, the equations of energy and the species conservations are reduced to one equation for mixture fraction as: ( ) + (ui ) = D , t xi xi xi (26) Once mixture fraction eld is obtained, temperature and species mass fraction elds can be estimated using relations between temperature/mass fraction and mixture fraction for innitely fast chemistry shown in Fig. 2 (c). These relations are directly obtained from Eq. (26), but only results are shown here. for < st : YF = 0, 4

where R is the specic gas constant (J/kg K) calculated as R = 8.31/W . W (kg/mol) is molar weight of the mixture. In owsquare, all thermodynamic and transport properties are assumed as constant. 2 Numerical methods In owsquare, relatively low-order numerical methods are used. This is something to do with the concept of this software, and to achieve as short computational time as possible. 2.1 Differentiations

The second-order central nite difference scheme is used for spatial differentiation. On the boundaries, this second-order scheme is replaced by the rst-order one-sided difference. For time integration, the Euler method

is used which is rst-order scheme. The formulations of these differentiations are well explained at Wikipedia [3, 4]. 2.2 Poissons equation

2.4

Spatial ltering

Poissons equation is solved to obtained pressure as in Eq. (6). Poissons equation is written as: (29) 2 = f, 2 where denotes the Laplace operator. If one applies second-order central differentiation to above equation, it is now written as: i+1,j 2i,j + i1,j x2 i,j +1 2i,j + i,j 1 + = fi,j . (30) y 2 Therefore, the Poissons equation can be reduced to n linear equations with unknown . In owsquare, Poissons equation is iteratively solve using successive over-relaxation (SOR) method [5]. (n + 1)-th intterative solution is calculated from (n)-th iterative solution as:
+1 n n i,j = (1 )i,j +

Spatial ltering is sometimes needed to stabilize the calculations. In owsquare, the second-order lter is used with a relaxation parameter as follows. f i,j = (1 )fi,j + (fi+1,j + fi1,j + fi,j +1 +fi,j 1 + 4fi,j )/8,

(32)

), the where ltered value is shown as hat (f subscripts show the i, j location, and is the relaxation parameter rages from 0 to 1. Its always better to use the minimum possible relaxation parameter. 3 Visualizations In owsquare, real time visualizations are performed so that users can see the simulation results during calculation. Several visualizations are implemented. 1. Colour: Mixture density, two velocity components (u and v ), uid speed ( u2 + v 2 ), vorticity, temperature, reaction rate (premixed mode), scalar (inc. c and ), and pressure can be displayed in color with a colorbar. 2. Vector: Fluid velocity can also be displayed as velocity vectors. The number of vectors, arrow size and color are set by users. 3. Contour line: Contour lines are implemented for scalars (but for only one value). Colour can be set by users. 4. Particle: Lagrangian trajectory of particles can be displayed. The number of particles is set arbitrary by users. 5. Background picture: A picture can be displayed as background. Details of the background image are explained Sec. 6.3. These display types, colours and their on/off can be changed during a simulation. 5

n i+1,j

+1 + n i1,j x2

n i,j +1

+1 + n i,j 1 y 2

fi,j

x2 y 2 ,(31) 2(x2 + y 2 ) where is the relaxation parameter. Values of > 1 are used to speed up convergence while < 1 are used to help converge solutions of a diverging iterative process. Typically = 1.6 1.8 are used for both better results and fast convergence. The iteration calculation is continued until n+1 n < P . Here, P is tolerance and specied in grid.txt. See Sec. 7. 2.3 Boundary conditions

Three types of boundary conditions are implemented in owsquare: inow; outow; and moving boundaries. Fluid mixture is fed at inow boundaries with specied velocity, temperature, etc... On the other hand, on the outow boundaries, the gradient of all quantities are set to be zero. The moving boundaries move at the specied velocity. This boundaries can move periodically or only once, depending on the users setting. These boundaries are explained in Sec. 6.

4 Dump data le format The dump les consist of u, v , , scalar (inc. c and ), T and p. The data is output as binary of NX NY sized double oat data, where NX and NY are the number of grids for each direction as follows.
fwrite( DATA,NX*NY*sizeof(double),1,fp);

Figure 3: bc1.bmp. 64 32 pixels.

Therefore, the dump les can easily be read for post-processing. Using C language, the data can be read as follows.
fp=fopen("filepath","rb"); fread( DATA,NX*NY*sizeof(double),1,fp);

For Fortran, following code can read the data.


real(8) DATA(NX,NY) character fp*(150) fp="filepath" open(10,file=fp,form="binary") read(10) DATA

Figure 4: bc2.bmp. 64 32 pixels.

For MATLAB, following code reads and displays a picture.


fid = fopen(filepath,r); A = fread(fid, [NX,NY],double); surf(A);

5 Directories and les In the main directory, there are owsquare.exe, grid.txt, bc1.bmp and bc2.bmp. bg.bmp is in the main directory if background picture is needed. Control les are always read from the main directory. Once user executes owsquare.exe, user is asked to input a new/existing project name. Once it is entered, project directories is automatically created. At the same time, directories - bkup, dump and gs - are created under the project directory and in the bkup directory, bc1.bmp, bc2.bmp, bg.bmp and grid.txt are copied as back up data. The following chart shows directories and data locations. 6

+ [main directory] |- flowsquare.exe |- grid.txt |- bc1.bmp, bc2.bmp, (bg.bmp) |- [project] |- [bkup] | |- back up files |- [dump] | |- dump files (binary) |- [figs] | |- figures | |-log.dat

6 Boundary les -bc1.bmp and bc2.bmp In owsquare, boundary conditions are controlled by Bitmap le: bc1.bmp and bc2.bmp. Also there is the other Bitmap le for a background picture: bg.bmp. These les are shown for a sample case in Figs. 3, 4 and 5. Each color in these gure have specic meanings. Detail of each le is explained in following subsections. Here, black is RGB(0,0,0), blue is RGB(0,0,255), red is

premixed case), depending on your reacting mode. 1. Fixed: At boundaries with blue and red colours, scalar value and/or temperatures are xed during simulations. Blue corresponds to scalar1 and red is scalar2 values specied in grid.txt. Typically, scalar1=0 corresponds to unburnt mixture (premixed mode) or oxidiser stream (non-premixed mode), and scalar2=1 corresponds to burnt mixture (premixed mode) or fuel stream (nonpremixed mode). Contrary to bc1.bmp, these blue and red boundaries in bc2.bmp can be set any locations inside the domain. 2. Transient: At black boundary, scalar and/or temperature are initially set as scalar2 values specied in grid.txt. This boundary might be used as ignition forr example. 3. pure air stream: Pure air stream can be set as green color on the edges of the computational domain (pure air stream is used only in premixed mode). All others are initially set as scalar1 value. 6.3 bg.bmp (Fig. 5)

Figure 5: bg.bmp. (64 box) (32 box) pixels.

RGB(255,0,0), green is RGB(0,255,0), and pink is RGB(255,0,255). 6.1 bc1.bmp (Fig. 3)

bc1.bmp controls the velocity boundary. The size of bc1.bmp must be nx ny pixels, where nx and ny are number of grid points for each direction specied in grid.txt. There are four types of boundary condition in owsquare. 1. Wall BC: At wall boundary, velocity and reaction rate set to be zero during simulation. Wall boundary is specied by black color. 2. Inow BC: Velocity at inlet boundaries is set to be inlet velocity specied in grid.txt. Up to two different inlet boundaries can be specied with blue and red colours. These red blue and red boundaries can be set at the edges of the domain (neglected otherwise). 3. Moving BC: Moving boundary is used to express wall moving at a constant velocity and with/without constant temperature, which are specied in grid.txt. Green. 4. Outow BC: All other boundaries are treated as outow boundaries. 6.2 bc2.bmp (Fig. 4)

If user wants to display a picture as background of a simulation, bg.bmp should be prepared before the simulation. Pink color (RGB:255, 0, 255) is used to create window section in the background gure, in which background picture becomes transparent. The size of bg.bmp should be (nx box) (ny box) pixels, where box is specied in grid.txt. 7 Control le - grid.txt In control le, user species parameters which are for numerical schemes, for visualizations, for outputs, for computational time, and for many others! Thus, it is important to understand the contents of this le. Appendix 1 shows the control le grid.txt. All numerical parameters are specied in this le. The control le consists of 56 lines of parameter, 13 separator lines, and 7

bc2.bmp controls the boundaries for scalar (including c and ) and temperature. The scalar used in owsquare can be mass fraction (cold ow case), progress variable, c (premixed case), and mixture fraction, (non-

#End of le line. Each parameter line has three blocks divided by blank(s). For example, the rst parameter line of grid.txt in Appendix 1 is:
01:nx 64 // no. grid points

9. nl: Interval time steps of spatial ltering procedure (see Sec. 2.4). 10. wl: Relaxation parameter for the spatial ltering (see Sec. 2.4). 0 wl 1. 11. perikey: Species periodic If no periodic BC is used, 1 if x-direction is periodic. direction is periodic. Set 3 tions are periodic. boundaries. put 0. Put Set 2 if y if all direc-

In this line, the rst block is 01:nx, which shows the number of parameter and its name (used during coding). This block must not be changed. The second block is 64. User species parameters in this second block for each line. The third block is // no. grid points. The third block can be used for some comments and edited by users. However, the third block must start from //. The separators between some of parameter lines must not be removed. Full explanations for parameters in grid.txt. Note that SI units (m, s, kg, J, K) are used. 1. nx: No. of grid points in the x-direction. 2. ny: No. of grid points in the y -direction (the maximum possible computational domain size depends on RAM size of your computer). 3. box: Pixel size of each grid point displayed on the screen. 4. lx: Physical domain size in the xdirection (m). 5. ly: Physical domain size in the y direction (m). 6. sts: Start/Restart time step. New simulation always start from sts=0. 7. latts: Last time step. 8. cfac: Factor for t. CFL condition connes the upper limit of t. Under this condition, t < lx/(nx 1)/umax , where umax is the maximum uid speed. In owsquare, the time-stepping is dened as t < lx/(nx 1)/uin /cfac, instead of calculating the max. speed. Here uin is the maximum between inow1, inow2 or speed of moving boundary. Typically cfac=10-20 are used. 8

12. pin: Reference pressure of the system. Usually 1.0E+05 [Pa]. 13. uin1: Inlet velocity component in the x-direction for inow1 (blue coloured boundary, see Sec. 6.1. Put 0 when unused). 14. vin1: Inlet velocity component in the y -direction for inow1 (blue coloured boundary, see Sec. 6.1. Put 0 when unused). 15. uin2: Inlet velocity component in the x-direction for inow2 (red coloured boundary, see Sec. 6.1. Put 0 when unused). 16. vin2: Inlet velocity component in the y -direction for inow2 (red coloured boundary, see Sec. 6.1. Put 0 when unused). 17. scalar1: Inlet scalar value for scalar inow1 (blue coloured boundary, see Sec. 6.2). 0 < scalar1 < 1 for reacting mode. This scalar can be either mass fraction (non-reacting case), progress variable, c (premixed case), and mixture fraction, (non-premixed case). Put 0 when premixed mode (scalar1 value is automatically calculated from temper1). When premixed / nonpremixed mode, this inow may be unburnt mixture (c = 0) / oxidizer stream ( = 0), respectively. Scalar1 is used as the scalar at initial eld. 18. temper1: Temperature for scalar inow1. When premixed mode, Tu < temper1 < Tb.

19. scalar2: Inlet scalar value for scalar inow2 (red coloured boundary, see Sec. 6.2). 0 < scalar2 < 1 for reacting mode. This scalar can be mass fraction (nonreacting case), progress variable, c (premixed case), and mixture fraction, (non-premixed case). Put 0 when premixed mode (inlet scalar value is automatically calculated from temper2). When non-premixed mode, this inow may be fuel stream ( = 1). 20. temper2: Temperature for scalar inow2. When premixed mode, Tu < temper2 < Tb. 21. imv: Cycle of moving boundary. 0: once (once the boundary go out from the domain, thats it). 1: repeatedly (once the boundary go out from the domain, the boundary come in from the other side of the domain). 22. mbu: Velocity component in the xdirection of moving boundary. 23. mbv: Velocity component in the y direction of moving boundary. 24. mbt: Temperature of moving boundary. Put 0, if the temperature of the boundary is subject to change due to uid. 25. gfx: Body force in the x-direction due to the density difference (unit: m/s2 ) 26. gfy: Body force in the y -direction due to the density difference (unit: m/s2 ). e.g. Put gfx = 0, gfy = 9.8 if youd like to include gravity effect. 27. dref: Reference density, . 1:max, 2:middle, 3:min density is set as reference density. 28. mu: Dynamic viscosity of mixture, (Unit: kg/m s). e.g. Water@300 K: 8.94E-4, and Air@300 K: 18.6E-6. 29. R: Specic gas constant (Unit: J/kg K). e.g. Air:286.9. 9

30. diff: Mass diffusivity (or temperature, but they are assumed as equal sometimes, Le = 1, unit: m2 /s). If unity Schmidt number is assumed, di /. e.g. Mass in the air@300K: 20.0E-6, Mass in the water@300K: 2.0E-910.0E-9. 31. Tu: Unburnt mixture temperature (only for premixed mode. Put 0 when the other modes). 32. Tb: Burnt (adiabatic ame) temperature. For stoichiometric hydrocarbon ame, Tu 2000. 33. cmode: 0: non-reactive ow with constant density and temperature, 1: premixed mode, 2: non-premixed mode. 34. k: Constant for a single step mechanism (See. Eq. (14)) 35. Ta: Constant for a single step mechanism (See. Eq. (14)) 36. n: Constant for a single step mechanism (See. Eq. (14)) 37. cF: Iso-value of progress variable for ame location (typically 0.5 may be used). 38. dummy Dummy line (not in use) 39. Xst: Iso-value of mixture fraction for ame location (typically stoichiometric mixture fraction, st , used. See Eq. (25)). 40. sigma: Relaxation parameter for temperature integration. Ideally 1 is used, but typically 0.2-0.5 is good to maintain simulation when spatial resolution is not enough. 0 sigma 1. 41. ng: Interval time steps for gure output. 42. nle: Interval time steps for dump le (restart data) output. 43. bcdisp: 0: not display wall boundaries. 1: display wall boundaries.

44. idisp: Quantity displayed in color. 0: none/background picture (see Sec. 6.3), 1: , 2: u, 3: v , 4: |u|, 5: vorticity, 6: temperature, 7: reaction rate, 8: scalar, 9: pressure. 45. cmax: Maximum value for color bar for the given idisp variable (put 0 for auto adjust.) 46. cmin: Minimum value for color bar for the given idisp variable (put 0 for auto adjust.) 47. icolor: Color table. 0: Jet, 1: Rainbow, 2: Nishiki, 3: Gray, 4: Gray (inverted), 5: Hot. 48. icont: Display contour line and its colour. 0: off, 1: black, 2: red, 3: green, 4: blue, 5: white. 49. linewidth: Line width of contour line. (1, 3, 5, 7 pixels) 50. ivec: Display velocity vectors and their colour. 0: off, 1: black, 2: red, 3: green, 4: blue, 5: white. 51. ndiv: Interval grid points between displayed vectors (ndiv>= 1). 52. vecsize: Size of vector arrow (pixels). 53. lagkey: Lagrangian trajectory switch. 0: off, 1c: particles are fed from left, 2c: fed from bottom, 3c, fed from both left & right, 4c: fed from up & bottom. c=0: black, 1: white. e.g. lagkey=10, if the particle colour is black and fed from left hand side. 54. nlagra: Interval time steps of restart Lagrangian trajectory. Always >= 1. 55. npart: Number o particles. Always >= 1. 56. omega: Relaxation parameter for Poissons equation. 1.8 is best for quick convergence, but for complexed ow geometry or reactive ows with heat release, smaller omega can achieve the convergence. See Sec. 2.2. 10

57. wdrho: wd shown in Eq. (6). Typically, wd = 1. However in initial transients of a simulation, smaller value makes simulation smooth. 0 wdrho 1. 58. peps: Tolerance for convergence. See Sec. 2.2. 59. loopmax: Maximum number of iteration. See Sec. 2.2. loopmax is prioritized over peps. 60. wait: Wait timer for some of heavy routines. Typically 0 is used. Put more than 0 to give the computer some rest (but computational time will be signicant ly long). 8 Keyboard operation Following list shows how to use keyboard shortcut. 1: Display . 2: Display u. 4: Display speed ( u2 + v 2 ). 5: Display vorticity. 6: Display temperature. 7: Display reaction rate (available only in premixed mode). 8: Display scalar eld (mass fraction in incompressible mode, progress variable in premixed mode and mixture fraction in non-premixed mode). 9: Display pressure. 0: Display black colour or background image specied in bg.bmp. Note that previously-selected quantity is displayed from the window section specied as purple colour. For example, if you display pressure rst, then press 0, the pressure is displayed in the window section and bg.bmp is shown in other area (See Sec. 6.3). 3: Display v .

Figure 6: Flowsquare display during simulation.

k: Change the vector colour to Black. r: Change the vector colour to Red. g: Change the vector colour to Green. b: Change the vector colour to Blue. w: Change the vector colour to White. Shift + k: Change colour of the contour line to Black. Shift + r: Change colour of the contour line to Red. Shift + g: Change colour of the contour line to Green. Shift + b: Change colour of the contour line to Blue. Shift + w: Change colour of the contour line to White. : Display velocity vectors. : Hide velocity vectors. 11

: Display the contour line. : Hide the contour line. Shift + : Display tracer particles. Shift + : Hide tracer particles. Shift + : Change colour of the particles to Black. Shift + : Change colour of the particles to White. Shift + 0 : Change colour table to Jet (blue-red; default) Shift + 1 : Change colour table to Rainbow (purple-red) Shift + 2 : Change colour table to Nishiki (blue-white-red) Shift + 3 : Change colour table to Gray Shift + 4 : Change colour table to Gray (inverted)

Shift + 5 : Change colour table to Hot (black-red-yellow-white) Shift + 6 : Change colour table to Sea (black-blue-light blue-white) Shift + 7 : Change colour table to Leaf (black-green-yellow-white) ESC : Pause/Resume simulation. 9 Display Figure 6 shows the display of owsquare during a simulation. Three numbers attached to the color bar are minimum, middle, maximum value of displayed quantity. If you specify non-zero numbers in cmin and cmax in grid.txt, these numbers equal to cmin, (cmin+cmac)/2, and cmax. The displayed quantity is conrmed by the characters next to the color bar. Current time step and physical time (time step t) are also shown. eps shows the maximum of n+1 n in Poissons equation (See Sec. 2.2). Current simulation mode is also shown as incomprs, premixed and non-prmx for incompressible, premixed and non-premixed modes respectively. References [1] Poinsot, T. and Veynante, D. (2005) Theoretical and numerical combustion . R.T. Edwards, Inc. [2] Cant, R. S. and Mastorakos, E. (2008) An introduction to turbulent reacting ow. Imperial College Press. [3] Wikipedia, Finite difference coefcient, http://en.wikipedia.org/wiki/ Finite difference coefficients [4] Wikipedia, Euler method, http://en.wikipedia.org/wiki/ Euler method [5] Wikipedia, Successive over-relaxation, http://en.wikipedia.org/wiki/ Successive over-relaxation

12

Appendix 1 An example of control le - grid.txt ----------- Control file for flowsquare ver 3.1 ------------------------------ General Control Data ------------------01:nx 128 // No. grid points 02:ny 64 // No. grid points 03:box 4 // Pixel size of one grid point 04:lx 0.20 // Domain x-size 05:ly 0.10 // Domain y-size 06:sts 0 // Start time step (new simulation starts from 0) 07:latts 30000 // End time step 08:cflfac 20.0 // Delta t factor (typically 10-20) 09:nfil 1 // Interval time steps for filtering (typically 1) 10:wfil 0.05 // Relaxation parameter for filtering (less is better) ------------------ General Boundary Data ------------------11:perikey 0 // 0: no peri, 1: x-peri, 2: y-peri, 3: all peri 12:pin 1.0E+05 // Pressure (1 bar = 1.0E+05 Pa) 13:uin1 5.0 // u for inlet1 (blue) 14:vin1 0.0 // v for inlet1 15:uin2 5.0 // u for inlet2 (red) 16:vin2 0.0 // v for inlet2 ------------------- Scalar Boundary Data ------------------17:scalar1 0.0 // Scalar1 (blue, 0.0 for cmode=1) 18:temper1 700.0 // Scalar1 temperature 19:scalar2 0.0 // Scalar2 (red, 0.0 for cmode=1) 20:temper2 2000.0 // Scalar2 temperature --------------------- Moving Boundary ---------------------21:imv 0 // 0:off,1:periodic 22:mbu 0.0 // u of moving boundary 23:mbv 0.0 // v of moving boundary 24:mbt 0.0 // Temperature of moving boundary, (0: free) ------------------------ Body Force -----------------------25:gfx 0.0 // x-body force 26:gfy 0.0 // y-body force 27:dref 1 // Reference density. 1:max, 2:middle, 3:min density as ref ------------------ Trans, Thermo, Chemical ----------------28:mu 2.0E-05 // Dynamic viscosity of mixture 29:R 286.9 // Specific gas constant 30:diff 4.0E-04 // Diffusivity of mixture 31:Tu 700.0 // Unburnt temperature (for premix) 32:Tb 2000.0 // Burnt temperature 33:cmode 1 // Reaction mode, 0: non-reac, 1:premixed, 2:non-premixed

13

------------- Premixed Reacting Flow (cmode=1) ------------34:k 6.0E+07 // Rate onstant 35:Ta 10000.0 // Activation temperature 36:n -0.5 // Rate = rho*k*exp(-Ta/T)*Tn 37:cF 0.5 // Flame location (c base) 38:dummy 0 // Dummy, not in use ----------- Non-Premixed Reacting Flow (cmode=2) ----------39:Xst 0.0 // Stoichiometric mixture fraction 40:sigma 0.0 // Relaxation parameter for temperature calculation --------------------- Display & Output --------------------41:nfig 500 // Interval time steps for figure output 42:nfile 1000 // Interval time steps for dump file output 43:bcdisp 1 // Display wall boundary (0:off, 1:on) 44:idisp 6 // 0:off,1:rho,2:u,3:v,4:spd,5:vrt,6:T,7:rate,8:c/xi,9:P 45:cmax 0.0 // Scale (max) 0.0 for auto 46:cmin 0.0 // Scale (min) 0.0 for auto 47:icolor 0 // 0:Jet,1:Rainbow,2:Nishiki,3:Gray,4:Gray(inv),5:Hot 48:icont 1 // Contour line (0:off,1:blck,2:red,3:grn,4:bl,5:wht) 49:linewidth 5 // Line width of contour line (1, 3, 5 or 7) 50:ivec 1 // Velocity vector (0:off,1:blck,2:red,3:grn,4:bl,5:wht) 51:ndiv 3 // Interval grid points between displayed vectors (>=1) 52:vecsize 2 // Pixel size of vector arrow ------------------ Lagrangian Trajectory ------------------53:lagkey 0 //0:off,1c:x, 2c:y,3c:x-x,4c:y-y,c=0:black, 1:white. 54:nlagra 40000 // Interval time steps of restart (>=1) 55:npart 10000 // No. particle (>=1) --------------------- Poisson Equation --------------------56:omega 0.1 // Relaxation parameter 57:wdrho 1.0 // Factor for d(rho)/dt (0<=wdrho<=1.0) 58:peps 1.0E-4 // Convergence limit 59:loopmax 500 // Maximum no. of iteration -------------------------- Others -------------------------60:wait 0 // Wait time -----------------------------------------------------------#End of file

14

Вам также может понравиться