节点文献

Matlab和VBA混合编程实现大气化学模式瞬态物种动力学的数值模拟

【作者】 王竹青

【导师】 齐斌;

【作者基本信息】 陕西师范大学 , 材料学, 2008, 硕士

【摘要】 大气是一个非常复杂的化学体系,其中化学物种多,反应数量大,瞬态物种如自由基等反应速率快,寿命短,实验上难以实时在线连续地跟踪测定。采用模式数值计算方法模拟大气瞬态物种化学行为及其动力学是大气化学中一种重要的研究方法。本文利用Matlab与VBA混合编程技术,借助VBA宏工具,以Excel表单作为输入输出界面,编写了计算程序,用于实现大气化学模式中瞬态物种的浓度及其日变化的数值模拟。VBA程序通过读入Excel表单中的模式信息(包括反应物种、反应方程系数、反应物初始浓度、反应速率常数、基元反应等),按照Matlab的命令格式,建立两个m文件。一个m文件是函数文件,包含文件的函数名,根据模式所建立的常微分方程组的维数以及按照每个反应物种所建立的常微分方程。另一个是指令文件,用于在Matlab中求解前边的函数文件。用VBA程序启用Matlab ActiveX自动化服务功能,并用Execute方法执行指令文件,然后将Matlab的运算结果传输至VBA程序中的相应变量,进一步处理后输出至Excel表单中的相应位置。该程序界面简单,操作简便,运行速度快。采用建立的模式及程序分别计算了C2H4-O3体系过氧自由基动力学曲线及HO2自由基化学放大水效应曲线,结果与实验测定的曲线完全一致。另外,该程序还内置了灵敏度分析功能,可以用于分析单变量及双变量对模拟结果的影响。用于灵敏度分析的数据样本分别采用了正态分布与均匀分布。模拟结果显示正态分布所产生的数据样本更适合于灵敏度分析。采用单变量灵敏度方法分析了C2H4-O3体系中HO2和有机过氧自由基RO2对各基元反应速率常数的灵敏度,确定了对反应产物最敏感的动力学参数。利用双变量灵敏度方法,确定引起水效应的基元反应的速率常数的变化范围,以及单萜烯和NO对大气臭氧生成速率P(O3)的影响。建立了基于计数物种法的贡献度分析方法,用于分析机理中各基元反应对生成和消耗目标自由基的贡献。采用蒙特卡罗方法,利用随机数函数生成正态分布数据样本,用于模式计算时的误差传递分析,分析了C2H4-O3体系中,当所有物种初始浓度、速率常数等参数均引入确定误差时,对模拟结果所造成的误差。尝试建立了模式机理自动生成方法并编写了实现这一方法的程序。该程序可以实现包含C、H、O三种元素体系的模式自动建立。发生反应的条件必须同时满足反应的吉布斯自由能判据及已有的反应规则。通过程序自动建立了反应体系中所有可能发生的反应。应用该方法于C2H4-O3体系,所得到的机理与文献报道的基本一致。借助于有向图方法实现了对化学模式的结构分析,并通过该有向图初步分析了各反应物种在机理中的重要程度。利用程序计算得到了作有向图所需要的数据,并实现了自动作图,提出了反应物等级概念。在RACM(区域大气化学模式)模式基础上,加入了部分萜烯烃与O3的反应,建立了可用于对流层大气瞬态物种的数值模拟的模式。该模式共有79个模式物种,239个基元反应。利用建立的模式及其程序分别计算了位于日本海的Rishiri岛及广州清远后花园大气中重要瞬态物种HO和HO2自由基浓度及其日变化。对模式计算结果和观测数据进行了统计分析,结果表明模式计算得到的HO与HO2浓度及其日变化与实测结果高度相关,模式计算与实验测定结果在方法误差范围内基本一致。

【Abstract】 The atmosphere is a very complex system. It contains a great number of chemical species and reations.The transient species such as free radicals, is of faster reaction rate and short life. Numerical simulation was an important research method in atmospheric chemistry. It was used to calculate the concentration of transient species and simulate dynamics of atmospheric chemistry.With VBA and Matlab mix programming technology, used Excel forms as the input and output contact surface, compiled computational procedure, and used it in simulating the concentration and the diurnalvariation of the atmospheric transient state species. VBA procedure read the reaction mechanism information (including response species, response equation coefficient, reactant initial density, constant of action, elementary reaction and so on) in the Excel form, and established two m files. One m file is the function file. It included the function name, the ODEs’ dimension and the ordinary differential equation. Another is the command file. It was used to solve the function file. And used VBA langues to begin the ActiveX automation service function of Matlab, and used the Execute method to execute order document. Then Matlab operation result was transmited to VBA variable, and output to the Excel form. Calculated the dynamics curve of peroxy radical and the water effect curve of HO2 radical in C2H4-O3 system, the results was consistent with the experiment. Program had been built-in function of sensitivity analysis; it can be used to analyze the influence of single variable and double variant to the analogue results. The data sample insensitivity analysis had been used normal distribution and uniform distribution separately. The analogue results showed that normal distribution was more suitable for insensitivity analysis. We used the single variable sensitivity analysis to analyze the sensitivity of various elementary reactions’ rate constant to HO2 and RO2 in C2H4-O3 system, and Ascertained variation range of the elementary reaction that caused water effect with double variant insensitivity analysis. Simultaneously ascertained the influence of monoterpenes and NO to the atmospheric ozone production speed P(O3). Established contribution analysis method which based on the counting species method, used it in analyzing various elements reactions’ production and consumption contribution to peroxy radical species. Using the Monte Carlo method and random number function, established error transmits analysis method, and analyzed that the error of analogue result when all parameters such as species initial concentration, rate constant were of 10% errors in the C2H4-O3 system.Established the method of chemical reaction mechanism’s computer auxiliary establishment, and compiled the corresponding program. The program can be used to establish the mechanism which contained only three elements ( C、H、O ). Used it in the C2H4-O3 system and obtained a mechanism what was consistent with the literature result.With the aid of oriented graph, established the method to the chemical reaction mechanism’s structure analysis, and analyzed each species’ weightiness through this oriented graph; obtained all data which the oriented graph needed, and realized the automatic drawing; and put forward the concept of reactant rank..This article added the reactions of monoterpenes and O3 in RACM (regional atmospheric chemistry mechanism), and established a box model which can be used in numerical simulation of the troposphere atmosphere transient state species. The model altogether had 79 model species, 239 elementary reactions. Simulated HO and HO2 radical concentration and the diurnalvariation in clean atmospheric and pollution atmosphere separately, and analyzed the result using statistical analysis methods such as the relevant analysis, the analogue results and the actual results were of linear correlation, and the relevance was remarkable. The model results was consistent with the experiment results.

【关键词】 大气化学模式模拟瞬态物种MatlabVBA
【Key words】 Atmospheremodelsimulationtransient speciesMatlabVBA
节点文献中: 

本文链接的文献网络图示:

本文的引文网络