CHEMKIN入门指南.doc
- 格式:doc
- 大小:721.04 KB
- 文档页数:18
CHEMKIN入门指南《燃烧学》辅助教程上篇基础知识、核心程序、化学平衡(EQUIL)、全混反应(AURORA)如果文中有任何错误,请不吝指出,以便不断改进2004.3第一章CHEMKIN简介本章介绍CHEMKIN的主要功能和求解过程。
第一节安装CHEMKINChemkin最早的版本始于1980,由美国Sandia实验室的Kee RJ等人编写,经过多年的不断发展日趋完善。
后来由Reaction Design公司收购并继续开发,目前最新版为3.7.1。
由于学习和科研需要,我们花费2000$向ReactionDesign公司订购了一套最新版本的CHEMKIN 3.7.1,其中包括20个网络教学许可证,用于《燃烧学》课程的学习。
[安装] 请从ftp://combustion:combustion@166.111.56.202的“CHEMKIN软件”目录内下载安装程序chemkin371_pc_setup.exe,执行安装程序。
安装完后会自动在桌面及开始菜单建立快捷方式。
[运行许可证书] 教学用的CHEMKIN采用网络认证,故电脑必须联网(校内)。
当程序计算(Run)时,系统会提示选择license,选择“Specify license server”,然后next,在下一画面填入“166.111.56.202”即可。
第二节CHEMKIN介绍CHEMKIN是一种非常强大的求解复杂化学反应问题的软件包,常用于对燃烧过程、催化过程、化学气相沉积、等离子体及其他化学反应的模拟。
CHEMKIN包括“核心程序(Core Utilities)”和“应用程序(Application)”两级程序包。
以气相反应、表面反应、传递过程这三个核心软件包为基础,CHEMKIN提供了对12种常见化学过程模拟的软件包及后处理程序。
CHEMKIN的三个核心程序模块:1) 气相动力学(Gas-PhaseKinetics):是所有程序计算的基础,提供气相成分组成、热力学数据、化学反应等信息。
CHEMKIN 4.0.1入门指南——《燃烧学1》辅助教程文中如有任何错误,敬请指出,以便不断改进;如有任何问题,欢迎提出,共同探讨助教博士生:联系方式:一、CHEMKIN的安装和简介1-1 安装CHEMKINChemkin最早的版本始于1980,由美国Sandia实验室的Kee RJ等人编写,经过多年的不断发展日趋完善。
后来由Reaction Design公司收购并继续开发,目前最新版为4.0.1。
由于学习和科研需要,我们花费12000$向ReactionDesign公司订购了一套最新版本的CHEMKIN 4.0.1,其中包括可供20人同时在线计算的license,用于《燃烧学》课程的学习。
【安装】请登录ftp://combustion:combustion@166.111.56.155 下载相关文件,其中chemkin401_pc_setup.exe为CHEMKIN的安装程序,chemkin.lic为网络认证文件,详细的安装信息可以参看ftp上的“安装说明.txt”文件。
安装完后会自动在桌面及开始菜单建立快捷方式。
【注意】1、本套教学用的CHEMKIN软件采用网络认证的方式,请确保电脑已经联网(校内),否则无法计算。
2、建议采用1024×768的分辨率,否则某些界面将无法完全显示。
1-2 CHEMKIN简介CHEMKIN是一种非常强大的求解复杂化学反应问题的软件包,常用于对燃烧过程、催化过程、化学气相沉积、等离子体及其他化学反应的模拟。
CHEMKIN以气相动力学、表面动力学、传递过程这三个核心软件包为基础,提供了对21种常见化学反应模型及后处理程序。
三个核心程序模块为:1) 气相动力学(Gas-Phase Kinetics):是所有程序计算的基础,包括气相成分组成、气相化学反应与相关的Arrhenius数据等信息。
2) 表面动力学(Surface Kinetics)。
很多反应过程包括多相反应,如催化反应、化学气相沉积、固体腐蚀等。
How to use Chemkin-II(Summary and condensed instructions for using the Chemkin-II and transport property databases, subroutine libraries, and application codes on the HP workstations)Submitted to:Dr. Thomas FletcherBy:Jeffrey E. DavidsonSeptember 18, 1996Table of ContentsTitle Page (i)Table of Contents (ii)Introduction (1)Introduction to the HP Work Stations (3)The Tool Bar (3)Essential UNIX Commands (5)Other useful commands and tricks in Unix (8)Equilibrium Calculations using Chemkin-II (10)Instructions for using the Chemkin Equilibrium Solver (10)Example Problems for Chemkin Equilibrium Program (13)Laminar, Pre-mixed, One-dimensioned Flame Calculations (14)Setting up a Premixed Flame Problem (14)Example Problems for Premixed Laminar Flame (20)Perfectly Stirred Reactor Calculations (22)Setting up a PSR problem (22)Example Problems for the Perfectly Stirred Reactor (27)Extracting Transport Data from Chemkin (28)Instructions for Extracting Transport Properties (28)Transferring data from the HP workstations to a PC (31)Programing using Chemkin-II (32)Calculations using Global Mechanisms (36)Calculations Using Global Mechanisms (37)Installing the Chemkin Programs into your Directory (38)References (39)Appendix (40)How to use Chemkin-IIIntroductionChemkin-II is a collection of data bases and subroutines written in text files and in FORTRAN code for solving problems involving gas-phase kinetics, equilibrium and transport properties. There are many different types of problems that can be solved using the Chemkin subroutines. Driver programs (programs that direct the subroutines and control the input/output files) have been written for the following types of problems:1. Adiabatic flame temperatures.2. Equilibrium concentrations for a gas mixtures.3. Species mole fractions as a function of time in laminar, steady state, premixed flames when temperature profile in known.4. Flame speed, species mole fractions and temperature profile as a function of time in laminar, steady-state, premixed flames.5. Mole fractions and temperature of product stream from a perfectly stirred reactor.6. Determination of transport properties of gas mixtures as a function of composition, temperature and pressure.This is just a small sampling of the numerous driver programs that have been written. The number and type of computer programs which incorporate Chemkin subroutines are constantly increaseing.To use these programs, the user must modify several input files. As will be explained in detail below, each of the input files is in a Unix-shell file and the user will only need to modify the shell file. In order for the subroutines to work, the user must tell Chemkin about the gas mixture and the gas phase reactions. This is done in the file named mech . The user must name each of the elements and each of the species which are in the gas mixture. The user must also enter the elementary steps of the chemical reactions being considered with their respective Arrhenius rate coefficients for the equation: k = AT β exp ER T ⎛ ⎝ ⎫ ⎭ ⎪ (1)The user must also specify the problem by modifying the inp file. This file generally contains information such as initial temperature of the gas mixture, mole fractions of thereactants, and initial pressure. Depending of the program and the nature of the problem, the user will need to include other keywords which control the program. As these are specific toeach of the programs, they will be discussed separately below. Once the inp and the mech files have been properly modified, the program can be run by executing the shell file.For each of the types of problems discussed here, the application code has already been written. The user must only supply the reaction description and the application input. The application input varies from application to application and each will be discussed individually below. The Chemkin applications have been setup and modified to run the HP workstations called the STATES located in room 308 CB. An introduction to these machines will be discussed before the discussion of the applications.Introduction to the HP Work StationsThe HP work stations are powerful computers which operate much faster than the typical PCs. (Some of these programs would require a few days to run on a PC or MAC). All of the STATES are large enough that multiple users can be logged onto the same state.For example, if you sit down at either the TEXAS or the DALLAS terminal, you will be automatically logged into the TEXAS computer. It is possible to login to UTAH from TEXAS or from a PC or Macintosh via TELNET (a communication software package) or by using the command rlogin state from another workstation, but the graphical interface will not be available.These machines use HP-UNIX for an operating system which incorporates both text and graphical interfaces. When you sit down at one of the terminals, if the screen is blank, move the mouse. The login screen will appear and ask for your user's name and password. After you enter both of these correctly, the screen will be blank except for a border and a tool bar.The Tool BarMail- If you have new or unread E-mail, this button will show a couple of envelopes. Press this button and a listing the mail stored in your mail box will appear. You can use this program to read and send mail.CPU Load- This figure shows the load on that state’s CPU. As the load increases th e area plot increases. Horizontal lines mean that the scale on the original screen had to be reduced. If the computer has more than 3 or 4 horizontal lines it might be wise to find another computer that does not have quite the work load.One, Two, Three, Four, Five, Six- These are multiple screens from which you can access your files. If the first screen (One) gets too cluttered with windows, you can switch back and forth between the other screens with these buttons.Printer- Text files can be sent to the laser printer in the next room by clicking the file in the file manager screen with the middle button on the mouse and then dragging the file to this button. Clicking the left mouse button while the mouse is on the printer button will display the printer status.Text Editor- This button looks like pencil on a piece of paper. When this button is pressed, a window containing the text editor is opened. This editor behaves much like the MS-DOS text editor or Edit on the Macintosh.X-Term- Text user interface. When you press this button, a screen will pop up with a cursor. From this screen, the user can enter commands to copy, delete, rename and run various files. It is similar to a DOS screen on a PC. The commands are discussed below.Style Manager- The attributes (colors, background, etc.) of the graphical interface can be changed using the options under this button.Rename Workspace- Allows you to give names to the One, Two, Three, Four, Five, Six screens discussed above.? - This is the help button which contains a more detailed explanation of the HP work station environment.File Manager- This button (looks like a file cabinet) puts a window on the screen which displays all the files in the current directory. If you double-click on a text file in this window, the text editor will pop up with the contents of the file.Trash- Drag files that you want to erase from your directories on to this button and they will be erased when you logout.Exit - Press this button to logout. The computer will then ask for conformation.Essential UNIX CommandsIn this section, only the most essential UNIX commands will be presented. This presentation is not intended to be detailed but should be sufficient to survive in HP-UNIX. Other commands and further detail can be found in the books found in the computer laboratory. Several of the commands presented here can also be done using the graphical interface although I have found the text interface to have more options and be more useful. The information for the different commands will be described in terms of function and format or will be presented in a tutorial format.To begin, press the X-Term text interface button with the left-hand button on the mouse. If you were logged-on to TEXAS, a screen would pop-up with the prompt:texas$HelpHP-UNIX has an on-line help program which has a very detailed description of the use and options of the UNIX commands. To access the help program type:man command [Enter]Where command would be the name of the command for which you had a question. For example, if you typed:man pwd [Enter]a help screen will pop up and describe the pwd command. To scroll down in help use the space bar and to exit help press q.DirectoriesFiles can be stored in tree-like directories. That is, any directory can have sub-directories. To find out which directory path you are in, type pwd [Enter]. The p rintw orking d irectory command will show you the absolute path name of the working directory. Whenever you start a new text interface, you will automatically be placed in your main directory. The output for the pwd command should be:cheme/usernameAll your files should be kept within this directory or sub-directories of username. To see what files or sub-directories you have in this directory type ls [Enter] for List files. The command ls -l (l is a lowercase L) will provide more information about the files and sub-directories.To make a sub-directory use the mkdir directoryname command. For example at the prompt, type mkdir junk [Enter].Now type ls to see the directory that you created.To move down to that directory, type cd junk [Enter]. The c hange d irectory command can be used to move up and down in the directory tree. To see in which directory you are working, type pwd [Enter]. The result should read:cheme/username/junkNow, to move back to your main directory, use the move-up- one-directory command, cd .. [Enter]. The two periods mean the parent directory or the directory directly above the current directory. Type pwd [Enter] to make sure you are now in your main directory.To remove the junk directory, type rmdir junk [Enter]. In order to remove a directory, the directory must be empty of all files and sub-directories.Note: Every time you call up a text interface screen, it will automatically open to your main directory. In order to access any of your programs or files in other directories, you must first change to the directory in which the files are located.FilesThere are three basic types of files used by Chemkin. Text files can be edited by the text editor. They cannot be executed unless they are a program source code and are first compiled. Shell files are denoted with the .sh extension are similar to .bat file in MS-DOS. They are text files which can be executed and will direct the compilation of FORTRAN codes, direct a sequence of program calls, and direct file input and file output. They can be edited by the text editor and executed by typing:sh shellname.shIf the .sh file is already in the execute attribute (see File...Properties in graphical interface File Manager) then the shell file can be executed by:shellname.shFor the Chemkin programs for which shell files have been written, you will not need to do any programming in FORTRAN but will need to modify the shell files.The third type of file is an non-text executable file. These files are created by compilers and cannot be edited by a simple text editor. Since all the compilation of the FORTRAN source code will be directed by the shell files, you do not need to directly run these programs.There are several commands which are very useful in manipulating files. To make a copy of a file use the cp command. When using the format cp file1 file2, the computer will make a copy of file1 and call it file2. This will not destroy file1, but will destroy any old copies of file2. To copy a file into another directoryuse the format cp file1 path/directoryname. This will place a second copy of file1 into directoryname. To copy all the files in one directory to another use cp *path/directoryname.To move or rename files and directories use the mv command. This has the same format as the cp command except, the original file is destroyed. For example, if you typed mv file1 file2, file2 would be a copy of file1 and file1 would be erased.To erase a file using the text screen, use rm filename. If you use rm -i filename, the computer will request conformation before a file is deleted.Other than using the text editor, text files can be viewed using the more command. (Format more filename). This command will display the contents of a text file to the screen and will pause before scrolling. Because the more command only allows you to scroll down, it is often better to use the text editor to view files.Other useful commands and tricks in UnixTo change your password, type passwd at the prompt.To run a program in the background add an “&” to th e end of the file name. When a program is running in background, you can log-off the system and the program will keep going. To execute the premixed flame shell in the background, you would type:sh premix.sh &If the program is already running but not in the background, press [ctrl]-[z] to pause the program, and type bg at the prompt to put the program in the background.Once a file is running in the background, you can follow its progress by a number of ways. It is often necessary to follow some of the Chemkin programs, because they tend to crash if the initial guesses are far from the true solution. To see if it is still running type jobs -l (lower case L) at the prompt. This will list all the programs currently being executed from that window. To list all the programs currently being executed on that computer type ps -e. (Sometimes this list can be long so to control the screen output use ps -e | more. The | will pipe the output from the ps command through the more command.) Both the ps and the jobs commands will list a number associated each program in execution. This number can be used to stop the execution of the program with the kill command. For example, if you want to kill program number 1, type kill %1.The contents of the output file can be followed as the file is being generated by using the tail command. For example, to follow the output from the premixed flame shell program, type tail -f premix.out. To exit the tail command press [ctrl]-[c]. When shell files are executed, their progress is written to the file .log. To follow the .log file, use tail -f .log.If your program stops running but the output file is empty, look at the files ckout and tpout(in the text editor) and they will tell you if there are any errors in your mech or inp files.If your workstation should freeze, press [shift]-[ctrl]-[reset]. This will reset your computer. These buttons are on the left side of the keyboard. Any files that were not previously saved will probably be lost.To print files, you can either use the text editor or use the lp command. The format is lp filename. This will print two pages per piece of paper. This command and the printing from the text editor will truncate any line which is over 80 columns. To print files that are wider than 80 columns do the following:1. psf -1sc 150 <filename>junk2. lp junkBe careful when you are printing some of the .out files because they can be quite long and can contain a lot of unnecessary information. In most cases it will be better to first erase the unwanted information by using the text editor and then printing the file.Also be careful not to send non-text files to the printer or hundreds of pages could be wasted.From certain STATES or terminals a file cannot be directly printed. If your file does not print after sending it to the printer you will need to rlogin on ALASKA and print from that machine. Do the following on a X-term window of any machine in the room:1. rlogin alaska2. cd to directory where your file is located. (You can use pwd find out in which directory you are located.3. lp filename4. logoutThere are many other commands available in UNIX. Please refer to a manual to learn other commands.Equilibrium Calculations using Chemkin-IIThe Chemkin equilibrium software is easy to use but is not as powerful as other equilibrium programs like the NASA-LEWIS code or the EDCONV code. The latter two programs, will search their data bases to determine what species should be considered in an equilibrium calculation. The Chemkin code requires that the user input all the species which are to be considered. In the example of methane combustion in air, NO and NO2 formation will not be considered unless those two species are entered into the program. CO will not even be considered unless it is input into the program.Instructions for using the Chemkin Equilibrium Solver1. Login to an HP workstation.2. Open the Text Editor.3. Under the File pull-down menu, select Open...4. Open equil.sh (you may need to change directories)5. Scroll down to the line below “cat << EOF > mech”.6. After the word “ELEMENTS” enter the symbols of every elem ent that will be in any species that should be considered in the equilibrium calculation. Isotopes can be considered if their atomic weight follows their symbol in slashes “/”. Lines beginning with an exclamation mark are ignored. Conclude the elements section with the word “END”. Example:ELEMENTSNH! Define DeuteriumD /2.014/OENDAlso Acceptable is:ELEMENTS N H D /2.014/ O END7. After the word “SPECIES”, enter the symbols of every species that should be considered. The format is similar to the elements section. Example:SPECIES H2 O2 H O OH HO2 N2 N NO ENDIf species which are not contained in the thermodynamic data base need to be considered, check out the manual entitled Chemkin-II: A FORTRAN Chemical Kinetics Package for the Analysis of Gas Phase Chemical Kinetics. This manual will provide more detail on extra features of the Chemkin software package. Thermal dynamic data for numerous hydrocarboncombustion species are available in the correct format for the database in Combustion Chemistry, edited by William C. Gardiner or from the NASA-LEWIS equilibrium code data file.8. Scroll past the driver program to the line: “cat << EOF > inp”9. The shell file generates a file named inp that contains the keyword inputs to specify the problem for the equilibrium program.10. The following keyword inputs are allowed in any order:REAC - Specifics the reactants and their molar quantity or mole fraction. Format: REAC H2 2CONH - Constant enthalpy can be used in conjunction with constant volume or pressure, but not with constant temperature, entropy or internal energy.CONP - Constant pressure can be used with constant temperature, volume, enthalpy or entropy, but not with constant internal energy.CONT - Constant temperature can be used with constant pressure, volume or entropy but not with enthalpy, and constant internal energy.CONV - Constant volume can be used with constant temperature, pressure, internal energy, enthalpy or entropy.CONU - Constant internal energy can be used with constant volume only.CONS - Constant entropy can be used with constant temperature, pressure or volume, not with constant internal energy or enthalpy.CONX - Constant mole fractionCHAP - Chapman-Jouguet- cancels all the above specification except REAC. This keyword causes the detonation-wave velocities to be calculated.TEMP - Required input for the starting temperature in K. Format: TEMP 298TEST - Estimate equilibrium temperature in K.Format: TEST 2500PRES - Starting pressure in atmospheres. Format: PRES 1PEST - Estimate of equilibrium pressure in atmospheres.Format: PEST 1.5CNTN- Tells the computer to look for an additional problem after the keyword END.END - End of keyword input.An example of a input file inp to calculate the equilibrium concentrations of a stoichiometric hydrogen flame in air and a fuel rich hydrogen flame is:REAC H2 2REAC O2 1REAC N2 3.76CONHCONPTEMP 300TEST 2000PRES 1CNTNEND/ This is the second problem.REAC H2 3REAC O2 1REAC N2 3.76END11. If you would like to customize the output file name, you must edit the file name on the second to last line in the shell file.Example:Before:make equile; equile < inp > equil.outAfter:make equile; equile < inp > filename12. Under the File pull-down menu of the text editor, select the Save or Save as.. command.13. Open a text interface window by clicking on the X-term button on the tool bar.14. Change the directory to the directory where the Chemkin files are located using the cd command.15. Run the shell program by typing: sh equil.sh16. When the cursor reappears, the program is completed and the output file can be viewed and printed via the text editor.Example Problems for Chemkin Equilibrium Program1. Calculate the adiabatic flame temperature and equilibrium composition of CO in air with equivalence ratios of 0.5, 1,2. (Do not consider NO x formation). (Feed conditions- 300 K, 1 atm). Consider using the CNTN keyword to save some time.2. Repeat problem 1 but consider NO x formation.3. Repeat problem 2, but make the inlet feed contain 10 percent H2.4. Compare the results from problem 3 with either the EDCONV program or the NASA-LEWIS code. If you forgot a significant species in problem 3 as determined by one of the other two programs, repeat problems 3 and 4 again. What are two reasons for using the Chemkin equilibrium program, if one of the other equilibrium codes is available?Laminar, Pre-mixed, One-dimensioned Flame Calculations“Many practical combustors, such as internal combustion engines, rely on pre-mixed flame propagation. Moreover, burner-stabilized laminar premixed flames are very often used to study chemical kinetics in a combustion environment. Such flames are effectively one-dimensional and can be made very steady, thus facilitating detailed experimental measurements of temperature and species profiles. Also, laminar flame speed is often used to characterize the combustion of various fuel-oxidizer combinations. Therefore, the ability to model chemical kinetics and transport processes in these flames in critical to interpreting flame experiments and to understanding the combustion process itself.” (Kee, 1992)The Chemkin premixed flame code is designed to handle a variety of problems. The calculations involve solving systems of non-linear mass balances, energy equations, and transport relations. There are two major divisions in the types of problems that the premixed code will solve. The burner stabilized problem requires a known mass flow rate, and the temperature profile can either be specified or calculated from energy equations. Often it is better to specify the temperature profile if it can be experimentally determined because heat loses from a flame can be difficult to quantify. Problems where the temperature is specified are relatively easy to solve compared to the second type of problem. The second type of problem involves an adiabatic freely propagating flame. From the input, the flame speed, temperature profile, and concentration profile are calculated. This type of problem is very difficult to converge and solving them requires some skill, experience and a lot of patience. The code is currently configured for a burner diameter of 1.0 cm2.Setting up a Premixed Flame Problem1. Login to an HP workstation.2. Open the Text Editor.3. Under the File pull-down menu, select Open...4. Open premix.sh5. Scroll down to the line below “cat << EOF > mech”.6. After the word “ELEMENTS” enter the symbols of every element that will be in any species that should be considered in the equilibrium calculation. Isotopes can be considered if their atomic weight follows their symbol in slashes “/”. Lines beginning with and exclamation mark are ignored. Conclude the elements section with the word “END”. Example:ELEMENTSNH! Define DeuteriumD /2.014/OENDAlso Acceptable is:ELEMENTS N H D /2.014/ O END7. After the word “SPECIES”, enter the symbols of every species that should be considered. The format is similar to the elements section. Example:SPECIES H2 O2 H O OH HO2 N2 N NO ENDIf species which are not contained in the thermodynamic data base need to be considered, check out the manual entitled Chemkin-II: A FORTRAN Chemical Kinetics Package for the Analysis of Gas Phase Chemical Kinetics. This manual will provide more detail on extra features of the Chemkin software package. Thermodynamic data for numerous hydrocarbon combustion species are available in the correct format for the database in Combustion Chemistry, edited by William C. Gardiner. Transport property data may also need to be added to the transport property data base.a. This section must begin with the word REACTIONS. The default units for the Arrhenius rate coefficients are cal/mole for the activation energy and the units of A are in terms of cm, sec, K, and moles. Equation 1 is shown here again: k = AT β exp ER T ⎛ ⎝ ⎫ ⎭ ⎪ (1)These default units of the activation energy can be changed by adding the words CAL/MOLE, KCAL/MOLE, JOULES/MOLE or KELVINS after the word REACTIONS. The default units for A can be changed by adding MOLECULES so that the units of A are in terms of cm, sec, K, and molecules.b. The information of the reaction is fairly free from format but certainconventions must be observed. At the beginning of the line the reaction mechanism must be symbolically written. No more than 3 molecules can be on either side of the equality. All coefficients of reactants must be integers. A plus sign (+) is used to separate the reactants from the reactants and the products from the products. There are two symbols used to separate the reactants from the products. The equals sign (=) is used to represent a reversible reaction. When this symbol is used, the reverse reaction is considered and calculated using the equilibrium constant. When the symbol => is used, the reaction is assumed to be irreversible and the reverse reaction is not considered. Third body reactions can be considered by using thesymbol M as both a reactant and product. The M species does not need to be declared in the SPECIES section. On both sides of the equation, M must be the last species. The defaultthird body efficiency is one, but this can be modified as shown in the example elementary step. The three Arrhenius coefficients (in order of A, , and E) are on the same line as the reaction and must be separated by at least one space. (Multiple spaces or tabs are acceptable for separating the data on a line.) Exclamation marks (!) signify that information following the ! is to be ignored. An example elementary step is:H + O2 + M = HO2 + M 0.361E18 -0.72 0.0H2O/18.6/ H2/2.86/ N2/1.26/ ! 3rd body efficienciesRefer to the manual, Chemkin-II: A FORTRAN Chemical Kinetics Package for the Analysis of Gas Phase Chemical Kinetics for details on handling photo-chemical reactions, pressure-dependent fall-off reactions and Landau-Teller formulation of rate expressions.c. End the mechanism description with the word END.8. Scroll down to the line: “cat << EOF > inp”9. The shell file generates a file named inp that contains the keyword inputs to specify the problem for the premixed laminar flame program. In the Appendix there are several pages directly from the manual and explain all the possible keyword inputs. Some of the most important keywords will be discussed here.BURN - A required keyword for burner-stabilized flame problems.FREE - Required for adiabatic freely propagating flame. (Note: either BURN or FREE must be specified by not both but this can be changed on continuation (CNTN) or restart (RSTR).)TGIV - For burner-stabilized flames, the species equations will be solved using the user-specified temperature profile.ENRG - The temperature profile will be calculated using the energy equations, but the user must enter initial guesses for a temperature profile using the TEMP keyword. (Note: Either TGIV or ENRG must be specified for BURN type problems.)MOLE or MASS - Used to specify that answers and inputs are in either mole or mass fractions.PRES - Pressure of the flame in atmospheres. Format: PRES 1.0.FLRT - Specified flow rate for burner stabilized flames or initial guess for adiabatic freely propagating flames. Units are in g/cm2-sec. Format: FLRT 0.04.REAC - used to specify initial reactant mole or mass fractions.INTM - used to give the computer initial guesses of intermediate species mole fractions.PROD - used to give the computer initial guesses of product species mole fractions。
CHEMKIN 使用方法1打开CHEMKIN窗口1)登陆Athena2)在Athena界面上输入athena% add chemkinathena% chemkin3)接下来软件窗口打开图1.Chemkin软件窗口4)可以从Chemkin窗口选取需要应用的运行程序。
可利用的功能和可运用程序描述如下:● Aurara: 完全混合反应模拟器● Creslaf: 通道流体模拟器● Equil: 平衡状态模拟器● Oppdif: 两个对立喷嘴之间的火焰传播● Plug: 化学反应器中的柱塞流模拟● Premix: 稳态的,层流,一维预混合火焰模拟● Senkin: 预测封闭系统中均相气态化学机理的敏感性分析● Shock: 预测产物在入射激波和反射激波后的状态● Spin: 模拟一维旋转反应器● Surftherm: 分析气相和表面化学反应机理中和热力化学和动力学数据在下一个部分我们将描述如何使用Equil应用程序。
其他应用程序可以以相类似的方法使用。
然而,Equil和其它的应用程序有一个本质的区别。
Equil应用程序不利用机理数据,而其它应用程序使用到。
2.如何使用Equil应用程序Equil计算理想气体和溶液混合物的化学平衡状态1)在Chemkin窗口中点击Equil按钮2)窗口如图2所示图2.Equil应用程序窗口3)为了计算平衡状态,需要产生两个输入文件:chem.inp 和gas_equuil.inp。
4)如果你点击气相化学文件的编辑按钮,你可以看到和编辑的化学输入文件如图3所示。
化学输入文件包括元素和组分数据。
图3.化学输入文件5)你可以创建你自己的文件和文件名来取代原有的默认的文件形式。
但是文件是在指定的路径中。
为了生成输入文件,或者使用文本编辑器在Athena和个人电脑上编辑和通过FTP 发送到Athena上。
6)接下来,你需要产生气相平衡输入文件。
当你点击Equil的编辑按钮,你将会见到图4图4.气体平衡应用程序输入文件图4中各个参数含义如下:● REAC 代表反应物;由一个化学符号代表一种反应物和他们在混合物中的摩尔数。
软件版本:Reaction.Design.Chemkin.v4.1.WiNNT2K-oDDiTy一、安装很简单:1.setup.exe2.复制crack中的reaction.lic文件到安装路径下的Reaction\licenses目录下3.重启电脑XP和Windows 7 32bit(兼容模式)运行都没问题,但是windows 7 64bit不能用。
提示:ERROR: setPlatform(): Did not find a setting for Windows NT (unknown)^6.1解决方法:找到安装目录下:Reaction\chemkin41_pc\data文件夹,修改OSName_Map.properties文件,其中添加:Windows\ NT\ (unknown)^*=WINNT即将文件修改为:###################### Java OSName and OSVersion Strings #################################################################################################### OSName ^ OSVersion = Platform Number####### Any whitespace must be "escaped" with \ character####### * matches any OSVersion####### File is NOT searched in Order Listed Below; Ordering is Random########################################################################### Windows\ NT^4.0=WINNTWindows\ 2000^*=WINNTWindows\ 2003^*=WINNTWindows\ XP^*=WINNTWindows\ NT\ (unknown)^*=WINNTAIX^*=AIXIrix^*=SGIIrix64^*=SGISunOS^*=SUNHP-UX^B.11.00=HP11HP-UX^B.11.11=HP11HP-UX^B.11.20=HP11iHP-UX^B.11.22=HP11iCompaq's\ Digital\ UNIX^*=ALPHAOSF1^*=ALPHALinux^*=LINUX###########################################################################保存后便可打开CHEMKIN软件,注:WIN7是在兼容模式下运行的。
ChemKin4.0 操作入门安装:运行setup.exe。
然后把carck文件夹中的chemkin.lic文件拷到安装目录下的licenses文件夹中。
一、新算例设置的基本操作1、建立新工程2、设定反应器模型在左侧models面板双击所需反应器模型,如PSR模型,则反应器模型出现在右边的Diagram View面板,下角Update project按钮变成黄色。
当设定好模型后,点击该黄色按钮确定,按键变成灰色,方可进入下一步反应机理设定。
3、设定反应机理在左侧,Open Projects面板,双击Pre-Processing。
进入机理设置界面。
Working Dir 是所有计算结果,包括工程文件的存储位置,自行设定。
点击New Chemistry Set,设定机理文件,必须设定Gas Phase Kinetic File—后缀为.inp;Thermodynamic Data File――后缀为.dat,都通过设定路径来设定。
设好后Save As…,确定,就变成下面的样子,点Run Pre Processor。
运行成功则View Results….变成黑色,Cluster变成黑色,没有跳出任何消息框。
运行成功方可进行计算的初始参数设定。
在cluster中,●properties选求解Gas Energy Equation,●C1表示反应器,在reactor physical properties中设置停留时间、温度、压力、体积、热损失等项。
注意单位。
表面项和传输项设置留待诸位研究设置方法。
在species specific data 中设置反应器中原有的物质组分,要各组分的fraction加起来=1。
这一项我的计算中不需要设置。
注意,此处设置的温度为牛顿迭代计算的初值,默认条件下等于入流温度。
●R1表示入流。
入流可以有多个,比如我的先进再燃就有5个入流,入流再多也应该没有关系,进去就都一样了,看设置参数的方便而定。
(整理)Chemkin模型学习读书笔记.Chemkin模型学习读书笔记⼀、模型总体介绍⼤型⽓相动⼒学计算软件包Chemkin(chemical kinetics)可以⽤来解决带有化学反应的流动问题,是燃烧领域中普遍使⽤的⼀个模拟计算⼯具。
该软件是1980 年美国Sandia 国家实验室Kee R. J. 等⼈开发并推出的,经⼏次完善发展,⾄今已开发出了第6个版本CHEMKIN 4.0.2。
chemkin有多种针对不同模型的应⽤程序,在4.0版本中共有23种计算模型,分6⼤类:○1封闭的0维反应器:包括封闭的内燃发动机模型(closed internal combustion engine simulator),封闭的同质反应器(closed homogeneous batch reactor),封闭的部分搅拌反应器(closed partially stirred reactor)和封闭的等离⼦反应器(closed plasma reactor)。
顾名思义,此类模型没有出⼊反应流,只根据反应器的初状态计算其末状态的参数。
○2开放的0维反应器:包括良搅拌反应器PSR(perfectly stirred reactor),等离⼦良搅拌反应器(plasma PSR)和部分搅拌反应器(partially stirred reactor)。
此类模型需要定义⼊流的流量、种类和温度等信息,计算后会给出出⼝的状态参数。
○3流动反应器:包括栓塞流反应器(plug-flow reactor)、等离⼦栓塞流反应器(plasma plug-flow reactor)、平⾯层流反应器(planar shear flow reactor)、圆柱形通道内的层流反应器(cylindrical shear flow reactor)和蜂窝整料反应器(honeycomb monolith reactor)。
此类模型考虑流动中的化学反应,主要是表⾯反应。
CHEMKIN 4.0.1入门指南——《燃烧学1》辅助教程文中如有任何错误,敬请指出,以便不断改进;如有任何问题,欢迎提出,共同探讨助教博士生:联系方式:一、CHEMKIN的安装和简介1-1 安装CHEMKINChemkin最早的版本始于1980,由美国Sandia实验室的Kee RJ等人编写,经过多年的不断发展日趋完善。
后来由Reaction Design公司收购并继续开发,目前最新版为4.0.1。
由于学习和科研需要,我们花费12000$向ReactionDesign公司订购了一套最新版本的CHEMKIN 4.0.1,其中包括可供20人同时在线计算的license,用于《燃烧学》课程的学习。
【安装】请登录ftp://combustion:combustion@166.111.56.155 下载相关文件,其中chemkin401_pc_setup.exe为CHEMKIN的安装程序,chemkin.lic为网络认证文件,详细的安装信息可以参看ftp上的“安装说明.txt”文件。
安装完后会自动在桌面及开始菜单建立快捷方式。
【注意】1、本套教学用的CHEMKIN软件采用网络认证的方式,请确保电脑已经联网(校内),否则无法计算。
2、建议采用1024×768的分辨率,否则某些界面将无法完全显示。
1-2 CHEMKIN简介CHEMKIN是一种非常强大的求解复杂化学反应问题的软件包,常用于对燃烧过程、催化过程、化学气相沉积、等离子体及其他化学反应的模拟。
CHEMKIN以气相动力学、表面动力学、传递过程这三个核心软件包为基础,提供了对21种常见化学反应模型及后处理程序。
三个核心程序模块为:1) 气相动力学(Gas-Phase Kinetics):是所有程序计算的基础,包括气相成分组成、气相化学反应与相关的Arrhenius数据等信息。
2) 表面动力学(Surface Kinetics)。
很多反应过程包括多相反应,如催化反应、化学气相沉积、固体腐蚀等。
在这些反应里,Surface Kinetics提供两相反应所需的各种信息,如表面结构、表面和体内的成分组成及热力学数据、表面化学反应等。
3) 传递(Transport)。
提供气相多组分粘度、热传导系数、扩散系数和热扩散系数等。
其中Surface Kinetics和Transport必须以Gas-Phase Kinetics为基础,因为它们中出现的成分都必须在Gas-Phase Kinetics中已定义。
Gas-Phase Kinetics、Surface Kinetics和Transport提供了化学反应的基本信息,生成动态链接库供后续程序调用。
用户可以自己编写程序调用它们来实现指定的功能,但最方便的是使用CHEMKIN自带的反应模型,共分7类,包括21个反应模型和2个应用程序,将在下一节介绍。
二、CHEMKIN的简单使用入门2-1 CHEMKIN的用户界面CHEMKIN的用户界面如图1所示。
除了传统的Windows菜单和按钮以外,CHEMKIN 的工作界面分为任务栏、窗口栏、消息栏三部分。
图1 CHEMKIN 4.0.1的用户界面其中任务栏包括Open Projects和Models两个选项卡,Models选项卡中列出了CHEMKIN 提供的21种反应模型和2种应用程序,分7类排列,如表1所示。
有关Open Projects选项卡的使用将在下文的例子中介绍。
表1 CHEMKIN提供的7类21种反应器与2种应用程序Miscellaneous (杂项)External Source of Inlet Gas,添加入口气体源,一般在有多路气体输入时才使用Non-Reactive Gas Mixer,计算不反应气体组分的混合过程Chemical and Phase Equilibrium Calculation,计算化学平衡和相平衡Mechanism Analyser,分析气相和表面化学反应系统中的热化学、传递及动力学数据Closed 0-D Reactors (封闭0维反应器)Closed Internal Combustion Engine Simulator,模拟封闭的内燃机内的燃烧情况Closed Homogenous Batch Reactor,模拟封闭的全混同性反应器,包括定压、定容反应器Closed Partially Stirred Reactor(PaSR),模拟封闭的部分混合的反应器Closed Plasma Reactor,模拟封闭的等离子体反应器Open 0-D Reactors (开口0维反应器)Perfectly Stirred Reactor(PSR),模拟稳态及瞬态的充分混合反应器Plasma PSR,模拟充分混合等离子体反应器。
Partially Stirred Reactor(PaSR),模拟部分混合反应器Flow Reactors (流动反应器)Plug Flow Reactor,一维柱塞流反应器Plasma Plug Flow Reactor,等离子体一维柱塞流反应器Planar Shear Flow Reactor,平板层流反应器Cylindrical Shear Flow Reactor,圆柱层流反应器Honeycomb Monolith Reactor,蜂窝结构反应器Flame Simulators (火焰模拟)Premixed Laminar Burner-stabilized Flame,模拟层流预混的稳态火焰Premixed Laminar Flame-speed Calculation,层流预混火焰传播速度的计算Diffusion or Premixed Opposed-flow Flame,模拟扩散或预混的对冲火焰CVD Reactors (化学气相沉积反应器)Stagnation Flow CVD Reactor,模拟用于化学气相沉积的滞流反应器Rotating Disk CVD Reactor,模拟用于化学气相沉积的转盘流反应器Shock Tube Reactors (激波管道反应器)Normal Incident Shock,模拟入射激波的化学动力学Normal Reflected Shock,模拟反射激波的化学动力学2-2 CHEMKIN的求解过程1、Gas Phase Kinetics(气相动力学)的处理Gas Phase Kinetics的前处理器(Pre-processor)读取用户编写的气相动力学输入文件和自带的热力学数据库(therm.dat),生成包含元素、组分、热力学数据反应信息的Gas-Phase Kinetics连接文件。
Gas-Phase Kinetics提供子程序库处理该连接文件。
2、Surface Kinetics(表面动力学)和Transport(传递过程)的处理如果化学反应包含表面反应或传递过程,则需要相应地执行这两个核心程序块。
Surface Kinetics的前处理器读取用户编写的表面动力学输入文件,生成包含表面反应信息的Surface Kinetics连接文件,Surface Kinetics提供子程序库处理该连接文件。
Transport的前处理器根据Gas-phase Kinetics连接文件中的信息,自动从CHEMKIN自带的传递数据库(tran.dat)读取相应的数据,然后生成包含传递信息的Transport连接文件,Transport提供子程序库处理该连接文件。
3、反应模型求解根据问题需要,CHEMKIN读取模型输入文件确定求解方法。
在 4.0及其以上版本的CHEMKIN中,新加入了通过相应的模型设置窗口中设置模型的参数的功能。
用户设置完成后点击Create Input File即可生成模型输入文件,然后用户可以通过View Input File按钮查看输入文件的内容。
而对于4.0以前的版本,用户需要通过手动编辑模型输入文件。
但对于文件的内容,都是相同的,都是采用关键字的形式声明模型的功能调用和参数设置。
有关常用的平衡计算模型和全混反应器模型的关键字列于附录2、3。
完成所有设置后,即可Run Model进行计算,CHEMKIN会自动调用上述Gas-Phase Kinetics、Surface Kinetics、Transport各自的子程序来读取反应信息,调用模型输入文件控制模型求解过程。
程序计算结束后,会生成一数据文件xxxxxx.out供用户查阅数据,以及一动态连接文件XMLdata.zip供后处理(绘图)使用。
4、后处理(Post-Process)CHEMKIN提供了统一的后处理器,用于对应用程序的结果进行分析和绘图。
2-3 CHEMKIN的用户操作步骤下面结合实际例子介绍用户操作的步骤。
【例1】计算化学当量的H2与空气的定压绝热燃烧温度。
1.运行CHEMKIN,点击菜单Project->New,输入项目名称,这里我们定为H2-air。
2. 决定问题的性质,选择适当的反应模型。
由于绝热燃烧温度的计算是一个相平衡过程,不涉及具体的反应过程,于是我们很容易地想到用Chemical and Phase Equilibrium Calculation模型。
点击任务栏中的model选项卡,点击Chemical and Phase Equilibrium Calculation图标,此时在窗口栏的Diagram View窗口中将看到新加入一个相平衡计算的模型,最后点击窗口右下角黄色的Update Project按钮,如下图所示。
通常情况下,一般的化学反应问题通过适当的假设和简化,都可以对应到某一种CHEMKIN包含的反应模型,有时一个问题还可以有多种选择。
选择恰当的应用程序是求解问题的第一步。
但是如果实在不幸没有一种模型可以很好的解决你的问题,或者你想要更完美地解决一些问题,就只有自己编写程序,调用CHEMKIN里的子程序库进行计算了。
3.此时左侧任务栏会自动切换至Open Projects选项卡,双击Pre-Processing,窗口栏出现Pre-Processing的参数窗口。
在窗口中的Working Dir一项中填入你希望的保存路径,或者通过右侧的Browse按钮点击选取。
然后按New Chemistry Set按钮,点击Gas-Phase Kinetics Files项右端的编辑按钮,如下图所示。
在弹出的窗口中选择刚才的工作路径,输入文件名chem.inp,按Open/Create按钮后即可开始编辑气相动力学输入文件了。
↓--------------------------------------【CHEMKIN的文件规则】--------------------------------------↓CHEMKIN的输入文件有它自己的规则,用户在编辑输入文件的时候应该遵守这些规则。