This may be the most important aspect of using UNICORN. Understanding each line of the input will save hours of computation and the potential for false results. Below is an example of an actual input file used to simulate a partially premixed ethylene flame with an N2co-flow (This is an input that models the Hencken burner as closely as possible). Take the time to review each line and what each variable represents, you may even learn something you need to worry about.
After you have reviewed all the variables used, you can build an input file using the MatLab wrapper function "Build_Unicorn_Input_Files.m"
Example input.
This is the input file for modeling the 1" Hencken burner with a 0.25" co-flow (if the burner was round) flowing an ethylene/air mixture at a rate of 2 m/s with a Φ = 1.1 fuel-to-air ratio.
Line-by-line breakdown.
Here each line is broken down into its variables, pointing out what each does and what variables are most important. Each variable is color coded to its description.
Wherever possible, pictures have been provided to aid in the understanding of what each variable does.
1,- C2H4-Air Premixed Flame Phi 1.1 (Hencken Burner) - (Global & Finite Rate Chemistry Model)- This line is simply the file name line. Change this to reflect the flame you are setting
up to help keep things organized. Remember, you can not change the actual name of the file (this will always be input.uni) so its important to keep a unique name here.
1,0,0/ ISYM,IREAD,IGNIT
Here we define whether the flame is axisymmetric or a 2D flow as well as some information the code uses to start.
ISYM
0 for 2D flows;
1 for an axisymmetric flow
*For most laminar flame research, axisymmetric will be the best setting. Using the axisymmetric setting means the calculations will only be performed from flame center outward with the assumption of a mirrored boundary at flame center. Also the calculations will only be performed in a plane, this greatly speed up the calculations.
IREAD
0 will start the calculation from scratch with no inputs needed
1 will start the calculation from a provided file titled "FLAME.DATA" however the grid system used will still be the one specified in the input file
the "FLAME.DATA" onto the one specified point-by-point irrespective of the coordinates.
* If a file "FLAME.DATA" is available it is best to keep this setting at 1. However if you have generated a brand new flame, "FLAME.DATA" may not exist yet so 0 is needed here. Note that this may add to computation time because the code has no good starting guess. If you have already run the code for a wile and you would like to start up again where the code last left off, be sure to copy the output results stored in "FLAMEA.DATA" to "FLAME.DATA".
IGNIT
This variable allows the user to define an ignition source. This is needed when starting the code without a "FLAME.DATA" file. This input does not include an example of ignition but one is provided below.
1,0,0.01,0.0625,0.001,-40.0,0,4*0.0/ISTDY,INOISE,(X,Y,A,F of noise)
This line sets the steadiness of the flame and the addition of artificial sources of noise.
ISTDY
1 for steady-state simulations 0 for unsteady simulations
* In all cases where starting from initial guesses it is best to have this set to 1. This will allow the code to come to a steady-state solution quickly, providing a good starting point for an unsteady calculation. If you know the flame is unsteady, run the steady-state code for 1000 or so iterations and start the code up again from the steady-state solution with this now set to 0. Again this requires replacing the input results stored in "FLAME.DATA" with the results from "FLAMEA.DATA"
INOISE
0 for no artificial noise
*This value will turn on artificially introduced noise, i.e. a speaker putting waves into the fuel stream. This level of complication is most likely not something AFIT will need and so this value should be left 0.
ALL OTHERS
This will adjust the artificial noise’s position, frequency and amplitude. Because the previous value is left to 0, these values are inactive.
0.00,0.0500,0.250/ RTIN, RTOT,ALENG
This line sets the dimensions of the calculation domain
(x,y,z) = (0,0,0) x y z
ALENG
RTOT
RTIN
Caclulation Domain RTIN0.00 - inner line (or plane) of the computational domain,[m]
* If the flame is defined above to be axisymmetric, this value should be kept 0. There is no need to do calculations outside of a singe plane because it would add no unique solutions.
RTOT
0.05 - width of the computational domain,[m]
* Here the value is set to 5 cm but this value should be changed to accommodate each flame AND enough space around the flame for any ambient air around it that may be affected. Remember, if the flame is axisymmetric the calculation domain only needs to accommodate half the flame width. If the flame is closely surrounded by an encasement, the width of the encasement should be used.
ALENG
0.25 - height of the computational domain,[m]
* The height setting is more open to change depending on the desired results. It should be set to as high a value as possible as this will provide the maximum information in the results. The tradeoff however is a decrease in spatial resolution if the number of grid points used are fixed, or an increase in calculation time if more grid points are added. It is, therefor, prudent to understand how high of a flame calculation you will NEED and not go much further than that. The height of the calculation domain does not directly affect the flame chemistry, just the window of results you will get.
In this line the reference values for some of the physical constants are set. Also the fuel(s) used in the setup are defined.
Velocity
1.0 - Reference velocity for the system U,[m/s]
* This value does not set the flow velocity of the fuel, but is rather a reference value. For most flames, a value between 1 m/s and 10 m/s is recommended. Note, though, if the code does not run and the U-RESID value shown in the terminal window is very large, say 1E100+ then the reference value is set improperly. Temperature
294.0 (Room temperature)- Temperature of the ambient air,[K]
* Set this value to the measured atmospheric conditions measured in the experi- ment you are comparing against. Otherwise keep fixed at room temperature. Pressure
10133D+05 (Atmospheric pressure) - Pressure of the system p, [Pa]
* Set this value to the measured atmospheric conditions measured in the experi- ment you are comparing against. Otherwise keep fixed at standard pressure.
Density
1.225 (Density of air at sea level) - Reference density of the system ρ, in[kg/m3] * Set this value to the density of the free-stream conditions measured in the exper- iment you are comparing against. Otherwise keep fixed at standard density. Turbulence kinetic energy
1.0 - Reference turbulence kinetic energy value k in units of energy/mass, [J/kg]
* Turbulence kinetic energy is defined as12〈u · u〉 where 〈u · u〉 is the trace of the Reynolds stress tensor. This value is not active for laminar flames.
Turbulence kinetic energy dissipation rate
10.0 - Reference turbulence kinetic energy dissipation rate ε,[m2/s3]
* Turbulence kinetic energy dissipation rate is defined as ε = ν〈si , jsi , j〉 where ν is the kinematic viscosity and si , j is the fluctuating rate-of-strain tensor. This value is not active for laminar flames.
Oxygen
0.233 (mass fraction of oxygen in air) - Reference oxygen MASS fraction, no units
* This sets the mass fraction of oxygen in the ambient air conditions Primary Fuel
5 - Ethylene is set as the primary fuel by putting the number 5 here.
* To change the primary fuel, simply replace 5 with one of these preset fuel choices:
C———————————————————————–
C FUEL: 1 - H2, 2–CH4, 3–CH3OH, 4–C2H2, 5–C2H4, 6–C2H6, C 7–C3H8, 8–C3H6, 9–CH2O, 10–CO, 11–C7H16
C———————————————————————–
Additions to the primary fuel
07, 08, 09 - This example shows the possible addition of HCO, CO2, and CO
* Note here that the numbering convention of the primary fuel above and the additional chemicals is not the same. Also note that all additions put in here DO NOT need to be used in the calculation. They will be ignored in the calculation if their mass fraction is set to 0 in a later line. The chemicals to choose from are:
1,0, 1, 1, 1, 1/ IFLOW,ISWIRL,ITHRM,ICHEM,IPROP,IGRAV
This line is very important even though most of it will likely remain unchanged. Here is where a turbulent or a laminar calculation is chosen
IFLOW
0 - Does no flow calculation
1 - Does a laminar-flow calculation 2 - Does a turbulent-flow calculation
* The functionality of this value is straightforward. Check a calculation of your flame’s Reynolds number to see if it falls into the laminar or turbulent category. Reynolds numbers∼< 2000
ISWIRL
1 - Includes a swirl component to the velocity in the calculations
* Here swirl is defined as a deliberate swirl to the fluid flow before ignition, i.e. if the pipe flowing the chemicals has a swirling device. This will probably never be the case so this value should remain 0.
ITHRM
0 - Does not perform temperature calculations 1 - Does perform temperature calculations
* Temperature calculations should always remain on
ICHEM
0 - Does not perform species transport calculations 1 - Does perform species transport calculations
* Species transport calculations should always remain on
IPROP
0 - Transport properties will be held constant
1 - Transport properties will be a function of concentrations and temperature
* This should always remain on
IGRAV
0 - Gravity is not included in the calculation
n - Gravity is included in the calculation. If n > 0 then the gravitational constant used will be n∗ g , where g = 9.8 m/s2. If n < 0 then the gravitational constant used will be g /n
* Unless we are working on the moon, this should always remain 1
This value sets the number of lines, immediately following, that describe the bound- aries of the system. There is a minimum of 4 because you must at least define the top, bottom, left and right side of the calculation domain. For an axisymmetric flame with no co-flow this value should be set to 5 (top, bottom, left and right side of the domain and one more for the edge of the fuel pipe). In this example, the flame is axisymmetric and has a co-flow so 6 lines are needed. Additional examples of various flame setups are provided in Section 2.5.
1,2,0.2500,0.0,11*0.0/ J=1 Axis 2,0,0.2500,0.0,0.01000, 0.0, 0.0,300.0,1.0,10.0,0.000000,0.231371,0.0005,0.00,0.00/J=1 ambient air 3,0,0.0125,1.0,2.00000, 0.0, 0.0,300.0,1.0,10.0,0.069697,0.215258,0.0005,0.00,0.00/J=1 FuelJet 3,0,0.0189,0.0,0.25000, 0.0, 0.0,300.0,1.0,10.0,0.000000,0.000000,0.0000,0.00,0.00/J=1 N2 Jet 3,0,0.0500,0.0,0.01000, 0.0, 0.0,300.0,1.0,10.0,0.000000,0.231371,0.0005,0.00,0.00/J=1 ambient air 4,3,0.0500,0.8,11*0.0/ I=LI Exit
These lines are the most important of the entire input file. Here is where the flame size, flow rates and starting conditions are defined.
ISIDE
1 - Bottom side of the grid system 2 - Top side of the grid system 3 - Left side of the grid system 4 - Right side of the grid system
ITYPE
0 - Specified flow boundary 1 - A wall boundary
2 - An axis of symmetry boundary 3 - A free flow boundary
* The bottom of the system should be set to an axis of symmetry. If the flame was previously defined as axisymmetric, the program will automatically treat the far left side (the first line with ISIDE = 3) of the system as the point of symmetry for the calculation. If the flame is in a small enclosure (small enough to where the flame flow-field would be affected by the walls) then a value of 1 may be needed for the right and top sides. Additional examples of various flame setups are provided in Section 2.5.
LENGTH
Length of boundary,[m]
*Set the length of each boundary with this value. If the boundary is the bottom or top, the length should match the value specified in ALENG above. If the boundary is the right side of the grid the length should match the value specified in RTOT above. The length of all the specified "left" boundaries should add to match RTOT as well. In this example a 2.5 cm flame is surrounded by a 0.64 cm co-flow. Because the flame has been set to axisymmetric we only need to specify half the flame width, thats why the third line here has a length of 0.0125m. This means that from x = 0 to x = 0.0125 the system is described by the flow settings in the third line. Line 4 has a length of 0.0189 because the length of this section adds to the end of the previous section, i.e. 0.0189 = 0.0125 + 0.0064. Lastly, line 5 shows that the remainder of the calculation domain (from 0.0189 to 0.05) is defined by the flow settings in the 5th line.
AL1
An extrapolation constant or a profile definition depending on what ITYPE is If ITYPE is 2, or 4 then this should be a value between 0 and 2. Values closer to 0 represent an extrapolation that is more stable but less accurate. Values closer to 2 are more accurate but can be unstable. A value of 1.2 to 0.8 is usually ok.
If ITYPE is 3, then this value describes the exit velocity profile. 0 is a top hat exit velocity profile. 1 is a perfect parabolic exit profile and any value in between is somewhere between a top hat and a parabola.
Flow velocity
(u, v, w) - Velocity of the fluid in each direction,[m/s]
* This is where the pipe exit velocity is set. In the cases where you have knowledge of the fuel flow rates in units of volume/time, you will need to divide out the area of the pipe exit to get to m/s. Note also that this example has a small velocity value for the "top" line. This is intended to mimic a hood vent used in the experimental setup. A velocity of 0 is okay if no vent is used.
The v and w components of the velocity should be 0 for most flames if the pipe is vertically placed.
Temperature
300 - Temperature of the flow described in that line,[K].
* This should match the ambient air temperatures measured during experimenta- tion if you are trying to match a laboratory test.
k and ε
1.0 - k value for this boundary,[J/kg] 10.0 - ε value for this boundary in[m2/s3]
* These values only represent starting guesses and need not be changed. Again they are inactive for laminar flames
Fuel mass fraction
0.069 - Fraction of the flow that is the primary fuel by mass Oxygen mass fraction
0.215 - Fraction of the flow that is oxygen (O2) by mass
Fuel addition mass fractions
0.0065 - Fraction of the flow that is each of the additions to the primary fuel by mass
ALENG = 0.25 m
RTOT = 0.05 m Top of grid system
2, 0, 0.25, 0.0,0.01,0,0,300, 1,10,0,0.231,0.007,0,0
Bottom of grid system
1, 2, 0.25, 0.0, 11*0
Right of grid system I 4,
3, 0.05, 0.8, 11 *0 The Flame 3, 0, 0.0125, 1,2! 0,0,300,1,10,0.069,! 0.2150.007,0,0 The co-flow 3, 0, 0.0189, 0,0.25! 0,0,300,1,10,! 0,0,0,0,0 Air 2, 0, 0.25, 0.0,
!
0.01,0,0,300, 1,10,! 0,0.231,0.007,0,0Example mass fraction calculations. The Flame
In this input example, the flame was set up to be aΦ = 1.11 ethylene/air pre-mixed flame. This means the fuel and air flow in together in a ratio of fuel to oxygen of 1.1 compared to the stoichiometric ratio. There are any number of ways to achieve thisΦ valaue but in this example the air needed to have a flow rate of 12.2 SLM. Given this it is straightforward to calculate the needed fuel flow rate. First, start with the balanced reaction equation:
C2H4+ 3O2→ 2CO2+ 2H2O
From this we can see that there is a 3/1 oxygen to fuel ratio for a perfect stoichio- metric reaction to occur. In other words, if aΦ = 1 flame was desired, the fuel flow rate would need to be12.2∗0.213 = 0.86 SLM, where here we account for the fact that air is only 21% oxygen by volume. With this value it is easy to get to the needed flow rate of anyΦ value desired:
Fuel Flow Rate =Air Flow Rate3 ∗ 0.21∗ Φ = 0.85 ∗ Φ And so for aΦ = 1.1 flow we see we need about 0.95 SLM of fuel.
To get from flow rates to the values seen in the input files requires a bit more math. Remember, the values in the input are total flow MASS fractions, not volume fractions. Because of this, we first need to calculate the total mass of the flow. The molecular mass of ethylene is 28 and the molecular mass of air is roughly 28.97
so, given the flow rates, the molecular mass of the total flow is: 0.95
0.95 + 12.2∗ 28 +
12.2
0.95 + 12.2∗ 28.97 → 28.9
With this value we can finally get the mass fractions needed for the input file. First the fuel:
0.95 0.95 + 12.2∗
28
28.97 → 0.069
or in words, its the fraction of the total flow that has a mass of 28. The total mass that is oxygen:
12.2
0.95 + 12.2∗ 0.21 ∗ 32
28.9 → 0.21
This example has the addition of CO2in the flow. This is added just to account for the presence of atmospheric CO2. Its mass fraction is calculated in the same way as the oxygen, knowing that the atmosphere is about 0.04% CO2.
12.2
0.95 + 12.2∗ 0.0004 ∗ 44
28.9 → 0.0005
The Co-Flow
The co-flow is a pure flow of N2making it very easy to describe. UNICORN is setup in such a way that the fraction of flow that is not specifically described by the fuel, O2, or additions is automatically set to N2. That means, to get a pure N2 flow you need simply set all mass fraction values to 0.
The Ambient Air
describe this using the standard mass fractions of the components of air. Note that the top of the grid system and the ambient air usually have the same setup.
0/NBODY
0/ NFINJ
These two lines will most likely not be needed. NBODYsets the number of "bodies" that will be in the calculation domain. If this value is greater than 0, additional lines below 0/NBODY and before 0/NFINJ will be needed. These bodies are things such as the fuel pipe if you want the calculation domain to extend below the bottom, or an object in or above the flame. Most flames will be perfectly described without the fuel pipe included in the calculation. Only when flame liftoff is a possibility is this truly needed. An example of a fuel pipe body is provided in Sec. 2.5.
NFINJ
This should remain 0.
7,20,0.002,50,0.0070,50,0.0120,50,0.0200,50,0.0350,50,0.0700,20,0.0600/NI,I,X
Here is where the axial component of the grid system is setup. Grid sampling should be thought out carefully to maximize resolution in areas where combustion events are most prevalent.
NI
7 - Number of sections to divide the grid into along the axial direction
* Note here that in this example 7 sections are chosen and so there are 7 pairs of numbers that follow.
I
* Note that the total number of grid points available in the axial direction is fixed to 500 in the code.
X
0.002 - length of this grid section,[m].
* Note that the total length of all sections needs to be equal to or less than the total width of the system RTOT. If the sum of all grid sections equals RTOT then the sum of all grid numbers, I, should equal 500 also. IfPX < RTOT andPI < 500, the remaining grid points will be distributed exponentially over the remaining distance.
3,62,0.0248,10,0.0050,10,0.0090,/NJ,J,Y
Here is where the vertical component of the grid system is setup. Again, grid sam- pling should be thought out carefully.
NJ
3 - Number of sections to divide the grid into along the vertical direction
* Note here that in this example 3 sections are chosen and so there are 3 pairs of numbers that follow.
I
62 - Number of grid points to be used in this section.
* Note that the total number of grid points available in the vertical direction is fixed to 200 in the code.
Y
0.0248 - length of this grid section,[m].