CERFACS CFD - Combustion Supervisors : Dr Gabriel Staffelbach - Dr Olivier Vermorel VALIDATION OF A NUMERICAL TOOL: AVBP USE OF AVBP AND SETUP OF AUTOMATIC ELEMENTARY TEST CASES TO VALIDATE NEW DEVELOPMENTS 2 nd year work experience s report Simon AYACHE From June to September 2007 Ref : WN/CFD/07/84 Fluid Mechanics Department ENSEEIHT
Abstract AVBP is a parallel CFD code that solves the three-dimensional compressible Navier-Stokes equations on unstructured and hybrid grids. Initially conceived for steady state flows of aerodynamics, today the main area of application is the simulation of unsteady reacting flows in combustor configurations. The main aim of this work experience was to set up a series of automatical tests in order to check and validate AVBP s new developments. This work has been done by writing a code in FORTRAN. Several tutorials have also been processed with AVBP, such as a Poiseuille 2D flow and a 3D cold flow. Their results have been analyzed using the software ENSIGHT and some tools associated with AVBP. During the last part of the work experience, an introduction to theoretical combustion has been proceeded thanks to CERFACS ressources. Keywords: CFD, UNIX, CODE VALIDATION, FORTRAN, MATLAB, COMBUSTION, AVBP
Contents List of figures vii Introduction 1 CERFACS overview............................................ 1 Work experience aims........................................... 1 A quick glance at Combustion....................................... 2 1 Modelisation of turbulent combustion 5 1.1 Basic Equations............................................ 5 1.2 Computational approaches for turbulent combustion....................... 6 2 Use of AVBP 9 2.1 AVBP................................................. 9 2.2 A first run: Poiseuille 2D...................................... 9 2.2.1 Presentation of Poiseuille flow................................ 9 2.2.2 Analyze of results...................................... 10 2.3 A 3D cold flow calculation...................................... 10 3 Setup of a series of Automatic Elementary Test Cases (CTEA) 15 3.1 CTEA interest and improvements expected during the work experience............ 15 3.2 User manual of CTEA........................................ 15 3.3 The work of avbp ctea code..................................... 17 Conclusion 19 Appendix 20 A An example of a ctea_report.dat document 21 B Part of avbp_ctea code (1) 23 C Part of avbp_ctea code (2) 27 Bibliography 33 v
vi Table of contents
List of Figures 1 Two types of flame.......................................... 2 2 Sketch of Turbomachine....................................... 3 1.1 Numerical simulations examples : on the left DNS (all the scales are resolved), in the middle LES (large scales are resolved and small scales are modeled), on the right RANS (all the scales are modeled) - [Courtesy of Dr. Laurent Gicquel]........................ 7 2.1 Sketch of the Poiseuille 2D configuration.............................. 9 2.2 Boundary condition: inlet profile versus Y compared with theoretical steady profile...... 10 2.3 Velocity magnitude versus X (Y=0)................................ 11 2.4 Velocity versus Y in the middle of the section........................... 11 2.5 Differences between analytical and numerical results (X-velocity) in the middle of the section 12 2.6 3D cold flow configuration: the injector is on the left and the box on the right simulates the atmosphere.............................................. 12 2.7 Mesh of the 3D cold flow configuration (injector + atmosphere)................. 13 2.8 Velocity fields from t=60 ms to t=75 ms.............................. 14 3.1 An example of a run.dat file..................................... 16 A.1 An example of a ctea_report.dat file................................ 22 vii
viii List of figures
Introduction 1. CERFACS overview CERFACS is a research organization that aims to develop advanced methods for the numerical simulation and algorithmic solutions of large scientific and technological problems of interest for research as well as industry, and that requires access to powerful computers. Thus, the laboratory has recently received a new supercomputer: IBM Blue Gene (2048 processors rack). CERFACS has six shareholders (CNES, the French Space Agency; EADS France, European Aeronautic and Defence Space Company; EDF, Electricite de France; Meteo-France, the French meteorological service; ONERA, the French Aerospace Lab; SAFRAN, Societe Nationale d Etude et de Construction de Moteurs d Aviation). CERFACS hosts interdisciplinary teams, both for research and advanced training that are comprised of physicists, applied mathematicians, numerical analysts, and software engineers. Approximately 100 people work at CERFACS, including about 90 researchers and engineers, coming from 10 differents countries. Several interns can also be found in the laboratory. CERFACS researchers work on specific projects in six main research areas: Parallel Algorithms ; Electromagnetism ; Aviation and Environment ; Climate Modelling And Global Change ; Computational Fluid Dynamics. This last area is divided into two teams: the Aeronautics team and the Combustion team, where my work experience took place. 2. Work experience aims The main aim of my CERFACS work experience has been to improve my knowledge in informatics, especially in UNIX and FORTRAN. It has also allowed me to have an introduction to CFD, both in theory and practice. Here is the progress of my internship: Rediscovery of UNIX ; Discovery of CERFACS combustion code: AVBP. First runs (Poiseuille 2D...) ; Detailed use of AVBP thanks to tutorials (3D cold flow, 1D flame) ; Analysis of results using the software ENSIGHT and AVBP s tools ; Setup of a series of automatic tests in order to check and validate AVBP new developments. Development of a FORTRAN code called avbp_ctea ; 1
2 Introduction Validation of the FORTRAN code avbp_ctea. Run of series of calculations on one of CERFACS s supercomputers ; Writing the user manual for the FORTRAN code avbp_ctea ; Learning L A TEX2ε for the intership report [Oetiker et al., 2001] and [D. and Charpentier, 2006] ; Documentation on combustion s basic principles [Poinsot and Veynante, 2001] and [Champion and Borghi, 2000] ; 3. A quick glance at Combustion The Combustion side of the CFD team develops new methods to compute turbulent reactive flows. Combustion is a sequence of chemical reactions, globally exothermic, between a fuel and an oxidizer. The phenomenon productes heat but also light in the form of either a glow or flames. The fuel is in a gas form but it can be stored in solid or liquid form and evaporated for the reactions. Most of the time, the reaction s oxidizer is the oxygen (O 2 ) in air. The reaction is ignited after the threshold energy has been attained, coming from an ignite (spark plug, laser depots...). Combustion can lead to a flame s formation, which can be either a premixed flame or a diffusion flame: In a diffusion flame, oxidizer and fuel are separated by the flame front. A common example is the candle s flame which is a diffusion flame. The wax, which corresponds to the fuel, goes up along the wick by capillarity then vaporises. It is well separated from the oxidizer, the air. Another example is given on the figure 1a. It describes a diffusion flame between two flows. Fuel and oxidizer are injected separately. The flame is located at the flows border. In a premixed flame (cf figure 1b), fuel and oxidizer are mixed before igniting. The flame moves from burned gas to cold gas. (a) Diffusion flame (b) Premixed flame Figure 1: Two types of flame
3 These two kinds of flames can be found in both turbulent and laminar flows. Thus, the study of combustion can be divided into four fields according to the flame type (premixed or diffusion flame) and the flow type (laminar or turbulent). However, most practical combustion systems are turbulent. For instance, turbulent combustion is encountered in rockets, internal combustion or aircraft engines, and industrial burner (figure 2). In such cases, an interaction appears between turbulence and combustion. Vortices tend to wrinkle the flame front and to increase the flame surface. Consequently, the combustion rate is increased. Figure 2: Sketch of Turbomachine
4 Introduction
Chapter 1 Modelisation of turbulent combustion 1.1 Basic Equations The set of conservation equations for reacting flows in the case of an irreversible chemical reaction: reactants } {{ } fuel+oxidizer products are: Mass ρ t + x i (ρu i ) = 0 (1.1) Species (ρy k ) t + (ρy k u i ) = ( ) Y k ρd k + ω k (1.2) x i x j x j Momentum (with i = 1, 2, 3) ρu i t + x j (ρu i u j ) + p x i = τ ij x j (1.3) Total Energy ρe t t + x i [(ρe t + p)u i ] = x j (u i τ ij ) q i x i + Q + ω (1.4) with : ρ the volumic mass, Y k the mass fraction of the k th species, ρu i the momentum in the i direction and e t the total energy, sum of kinetic and internal energy: e t = 1 2 3 u 2 k + e (1.5) k=1 The internal energy is relied to the pression thanks to e = CpdT p ρ [Poinsot and Veynante, 2001]. Thanks to perfect gas hypothesis P = ρrt, Cp can be written Cp = γr γ 1 so internal energy becomes: e = P ρ(1 γ) (1.6) 5
6 1. MODELISATION OF TURBULENT COMBUSTION τ ij is the tensor of viscous strains: τ ij = µ ( ui + u j 2 x j x i 3 δ ij ) u k x k (1.7) Y The term D k k x j of equation (1.2) is obtained thanks to the Fick s law, which is written with V k,j, the diffusion velocity of species k in the direction j: V k,j Y k = D k Y k x j (1.8) Q in equation (1.4) is the external heat source term. ω is the Fuel reaction rate. The heat flux density q i in the direction x i is given by the Fourier s law: q i = λ T x i (1.9) 1.2 Computational approaches for turbulent combustion Three levels of turbulent reacting flow computations are distinguished [Poinsot and Veynante, 2001] : RANS (Reynolds Averaged Navier Stokes): RANS techniques solve the mean values of all quantities. The balance equations for Reynolds averaged quantities are obtained by averaging the instantaneous balance equations. However, the averaged equations require closure rules. Consequently, a turbulence model to deal with the flow dynamics and a turbulent combustion model (TCM) to describe chemical species conversion and heat release are used. The results obtained correspond to averages over time for stationary mean flows or averages over different realizations (or cycles) for periodic flows (for example piston engines). LES (Large Eddy Simulation): at this level, the turbulent large scales are explicitly calculated whereas the effects of smaller ones are modeled using subgrid closure rules. The balance equations for Large Eddy Simulations are obtained by filtering the instantaneous balance equations. A subgrid model is required to take into account the effects of small turbulent scales on combustion. DNS (Direct Numerical Simulation): at this last level, the full instantaneous Navier-Stokes equations are solved. All turbulence scales are explicitly determined and their effects on combustion are captured by the simulations. The table 1.1 compares the avantages and drawbacks of RANS, LES and DNS approaches for numerical simulations of turbulent combustion [Poinsot and Veynante, 2001]. Approach Avantages Drawbacks - "coarse" numerical grid - only mean flow field RANS - geometrical simplification - models required (2D flows, symmetry...) - "reduced" numerical costs - unsteady features - models required LES - reduced modeling impact - 3D simulations required (compared to RANS) - needs precise codes - numerical costs - no models needed for - prohibitive numerical costs DNS turbulence/combustion interaction (fine grids, precise codes) - tool to study models - limited to academic problems Table 1.1: Comparison between RANS, LES and DNS approaches for numerical simulations of turbulent combustion. [Poinsot and Veynante, 2001] Figure 1.1 presents three simulations obtained thanks to the three methods:
7 Using RANS method, the predicted temperature for a given point of the jet corresponds to the mean temperature at this point. LES can capture only the low-frequency variations of temperature. DNS predicts all temperature time variations of the jet flame. Figure 1.1: Numerical simulations examples : on the left DNS (all the scales are resolved), in the middle LES (large scales are resolved and small scales are modeled), on the right RANS (all the scales are modeled) - [Courtesy of Dr. Laurent Gicquel]
8 Chapter 1
Chapter 2 Use of AVBP 2.1 AVBP The AVBP project started in 1993. Since then, under the leadership of Thierry Poinsot, the project grew rapidly. Today, AVBP represents an advanced CFD tools for the numerical simulation of unsteady turbulent reacting flows. AVBP is used both for research and industry. AVBP is a parallel CFD code that solves the three-dimensional compressible Navier-Stokes equations on unstructured and hybrid (both structured and unstructured) grids. Initially conceived for steady state flows of aerodynamics, today it is mostly used for the simulation of unsteady reacting flows in combustor configurations. The prediction of these unsteady turbulent flows is based on the Large Eddy Simulation (LES) approach. An Arrhenius law (2.1) is used to model chemistry (with k: Velocity constant ; E a : Threshold energy ; R: Gas constant ; T: Temperature): k = A exp( E a T). (2.1) R 2.2 A first run: Poiseuille 2D 2.2.1 Presentation of Poiseuille flow This study presents a simulation of Poiseuille flow with one species (N 2 ), in 2 dimensions. N 2 flows between two plane plates. Figure (2.1) represents the set up. Figure 2.1: Sketch of the Poiseuille 2D configuration When the flow becomes steady, the pressure gradient is in the (Ox) direction. Thus, velocity direction is 9
10 2. USE OF AVBP (Ox): V = V ux (2.2) Consequently, after solving the Navier-Stockes equations, the equation of velocity found is [Chassaing, 2000] (with h: the channel width) : V (x, y, z) = V (y) = V max (1 4 y2 h 2 ) (2.3) The curve on figure (2.2) represents the theoretical plot of velocity obtained using Matlab. The well know parabolic profil of Poiseuille flow can be recognized. 2.2.2 Analyze of results On the same figure (2.2), some values of inlet velocity profile used by AVBP have been ploted ("+"). Here the inlet velocity condition is: V (y) = V 0 cos( Pi 2 (2 y 1)) (2.4) h 1.5 Velocity vs Y (transverse section X=0) initial condition parabolic profile 1 Velocity (m/s) 0.5 0 1.5 1 0.5 0 0.5 1 1.5 Y (m) x 10 4 Figure 2.2: Boundary condition: inlet profile versus Y compared with theoretical steady profile Step by step, the velocity profile transforms itself into parabolic profile. This process is showed on the figure (2.3), which represents the velocity magnitude versus X-coordinate. Consequently, it can be admitted that the flow becomes steady after X=0,9.10e-3. Figure (2.4) shows the velocity profile at X=2,43.10e-3 m. It can be checked that the values obtained thanks to AVBP fit in well with the theoretical profile. Figure (2.5) presents the differences between theoretical and AVBP values. This curve shows that the differences between analytic solution for Poiseuille 2D and results obtained with AVBP remains below 10 e-2 m/s. These differences are due to the domain discretization (i.e the mesh). 2.3 A 3D cold flow calculation This calculation aims to perform a three dimensional LES for a turbulent non-reactive flow (so called cold flow). The mesh on the figure (2.7) represents an injector. The athmosphere has been taken into account.
11 1.5 Velocity magnitude vs X (Y=0) AVBP 1.45 1.4 Velocity (m/s) 1.35 1.3 1.25 1.2 1.15 1.1 0 1 2 3 X (m) 4 5 6 x 10 3 Figure 2.3: Velocity magnitude versus X (Y=0) 1.4 1.2 Velocity vs Y (transverse section X=2.43e 03) AVBP Theory 1 Velocity (m/s) 0.8 0.6 0.4 0.2 0 1.5 1 0.5 0 0.5 1 1.5 Y (m) x 10 4 Figure 2.4: Velocity versus Y in the middle of the section Thus, the burner exit is encapsulated in a box which represents the atmosphere (figure 2.6). The idea is to have a stable flow on the outlet boundary. All the walls are set as adiabatic impermeable walls with a zero tangential velocity at the wall. The imposed boundary conditions for the calculation are given in table 2.1. Figure (2.8) presents results obtained during the process of this tutorial. This experiment is observed during a period of 15 ms.
12 Chapter 2 0 x 10 3 Velocity discrepancies vs Y (X=2.43e 03) 1 2 Velocity discrepancies 3 4 5 6 1.5 1 0.5 0 0.5 1 1.5 Y (m) x 10 4 Figure 2.5: Differences between analytical and numerical results (X-velocity) in the middle of the section Figure 2.6: 3D cold flow configuration: the injector is on the left and the box on the right simulates the atmosphere INLET OUTLET - Axial velocity: 26.15 m/s - Temperature: 300 K - Nitrogen mass fraction: 1.0 - Pressure: 101 325 Pa Table 2.1: Boundary conditions of the 3D cold flow calculation
Figure 2.7: Mesh of the 3D cold flow configuration (injector + atmosphere) 13
14 Chapter 2 (a) 60 ms (b) 65 ms (c) 75 ms Figure 2.8: Velocity fields from t=60 ms to t=75 ms
Chapter 3 Setup of a series of Automatic Elementary Test Cases (CTEA) 3.1 CTEA interest and improvements expected during the work experience CTEA are elementary test cases used to ensure the non-regression of the code i.e to validate the AVBP new developments. The CPU time required to process all the CTEA, i.e to check a new AVBP version, needs to be limited. That is why CTEA are really simple tests. Before my work experience at CERFACS, a FORTRAN code already existed to compare two instantaneous solution files. Nevertheless, it must be known that AVBP is designed to save many solution s file during a run, both instantaneous and average solutions. Consequently, the code must be improved in order to compare a series of solutions (both instantaneous and average solutions). In addition, the expected code must check that the compared solution files have been obtained from the same numerical case (which is mainly determined by an input file named run.dat). In order to do it, it must compare the two run.dat files of the two runs. An example of a run.dat is given on figure 3.1. Nevertheless, other checks are done such as the reading of input_premix.dat files. In this way, the code checks that the same chemical species have been used during the two runs. The last improvement expected was to develop new CTEA. First, the procedures to run CTEA by using the new code are described. Second, it is explained how this code works. 3.2 User manual of CTEA The next paragraph is a CTEA user manual. It describes the procedure to use CTEA thanks to the new code avbp_ctea. Here are the steps that users have to follow in order to valid the lastest developments of AVBP. Note that users must know AVBP to totally understand this manual. Indicate the properties for the CTEA computations (number of processors, batch queue...) in the run_batch file. It is located in a main CTEA folder (i.e a folder containing all the CTEA that must be computed). This run_batch file is machine dependent and is used to launch the jobs ; Run the script launch_ctea, which must be located in a main CTEA folder. Computations corresponding to all the run.dat files in the main folder will be performed. The run_batch file of the main folder is copied and used by all the CTEA located in the main folder ; When calculations have been performed, use the script make_complete_list_all. It can be found in the CTEA folder, which is located in the parent directory of main folders. This script creates the avbp_ctea.choices file which is the input file for the FORTRAN program avbp_ctea. This file contains 15
16 3. SETUP OF A SERIES OF AUTOMATIC ELEMENTARY TEST CASES (CTEA) '../MESH/mesh'! Mesh file '../MESH/mesh.asciiBound'! Ascii Boundary file './dummy.asciibound'! TPF Ascii Boundary file './solut_bnd_file_neqbnd=0'! Boundary solution file './sol_0000000'! inital solution './SOLUT/sol'! output files './SOLUT/'! temporal evolution directory 1.0d0! Reference length scales coordinates X by X/reflen 10000! Number of iterations 100! Number of elements per group (typically of order 100) 1! Preprocessor: skip (0), use (1) & write (2) & stop (3) 1! Interactive details of convergence (1) or not (0) 5! Prints convergence every x iterations 2! Stores solution in separate files (1) or not (0) 1.d-3! Final physical time 1.0d-3! storage time interval 1! Euler (0) or Navier-Stokes (1) calculation 0! RANS 1! Chemistry 0! LES 0! TPF 1! Artificial viscosity 1! Steady state (0) or unsteady (1) calculation 1 0 0 0 0! Scheme specification 1! Number of Runge-Kutta stages 1.0d0 0.49d0! Runge-Kutta coefficients type 'avbphelp' 0.7d0! CFL parameter for complete update 0.005d0! 4th order artificial viscosity coeff. 0.01d0! 2nd order artificial viscosity coeff. 0.1d0! Fourier parameter for viscous time-step Figure 3.1: An example of a run.dat file the list of CTEA that have to be checked. To perform it, type the instruction: > make complete list all CTEA V 60 proc 2 CTEA V 60 proc 3 } {{ } Two main folders nouns which contain the runs that must be compared In the CTEA folder (where there is the avbp_ctea.choices file), run the avbp_ctea program by typing the command avbp_ctea in the shell (if the alias is installed) ; The code avbp_ctea creates three files: ctea_output.dat saves the informations displayed on the screen during the program process. ctea_solution_diff_report.dat is the report of the solution_diff subroutine execution. This subroutine is used by the main program avbp_ctea. ctea_report.dat is the main report of the avbp_ctea code. In this file, there is the list of checked CTEA. For each test, it is displayed whether the test is validated or not. If some test s results are negative, the discrepancies observed during each test are displayed. The two avbp_ctea outputs (ctea_output.dat and ctea_solution_diff_report.dat) must be used only if problems appear during the program run. If the run of avbp_ctea seems normal, the document ctea_report.dat is the only one that must be used. It contains all useful data. An example of such a document is given in the Appendix A.
3.3. THE WORK OF AVBP CTEA CODE 17 3.3 The work of avbp ctea code The FORTRAN code avbp_ctea is divided into four files: avbp_ctea.f : it contains the main program avbp_ctea and two subroutines which are find_and_compare_solutionfiles and find_and_compare_averages. solution_diff_ctea.f : it contains the subroutines solution_diff_ctea and compare, then the subroutines solution_diff_print and compare_print. solution_diff_ctea_average.f : it contains the subroutines solution_diff_average and solution_diff_print_average. makefile: the makefile is used to create the executable file from the source files. The full avbp_ctea.f code contains 3339 lines. Due to its size, only small parts have been copied in Appendix B and Appendix C: In Appendix B, it is checked that the run.dat files used during the two computations are the same ones, i.e that the two solution files compared come from the same numerical experiment. In particular, these lines check that the numerical schemes used during the two runs are the same ones. In Appendix C, the copied part of avbp_ctea code is the subroutine find_and_compare_solutionfiles. It is used by the code to find all the instantaneous solution files created by AVBP during the run, by using informations of run.dat file. Then, this subroutine launches the subroutine solution_diff_instant in order to compare the solution files of two different AVBP versions. If discrepancies are detected, the avbp_ctea program will launch the subroutine solution_diff_print to display the differences on the output files. Here is the role of each subroutine of the code: avbp_ctea: the main program checks that the two runs which are compared compute the same numerical experiment. find_and_compare_solutionfiles and find_and_compare_averages: these two subroutines are used by the main program in order to find the solution files, respectively instantaneous and average solutions. Then, each subroutine launches respectively the subroutines solution_diff_instant and solution_diff_average to begin the comparison of all the solution files. solution_diff_instant and solution_diff_average: by using the subroutine compare, these two subroutines are able to proceed the comparison between each solution file and check whether there are discrepancies between the two runs. solution_diff_print and solution_diff_print_average are used by the main program in order to write in the output files the discrepancies between two solution files (only if discrepancies are detected). They both use the subroutine compare_print.
18 Chapter 3
Conclusion My three months work experience at CERFACS has allowed me to prepare myself for keeping on studying on CFD (Computational Fluid Dynamics) field. I have been able to understand how a CFD code works then use it. In fact, during my work experience, I have been allowed to use the combustion code of CERFACS. AVBP is a powerful CFD tool for the numerical simulation of unsteady turbulent reacting flows. Thanks to tutorials, I have performed a 1D flame and a 3D cold flow. In addition, my work experience required that I performed some elementary computations such as Poiseuille 2D and Elementary Test Cases (CTEA). Thus, I enjoyed runing several computations on a supercomputer. However, runing a computation is not as simple as a click on a button. You have to define the boundary conditions, choose the numerical scheme, the number of iterations, the number of processors which will compute your calculation... I have also improved my knowledge in computing. Indeed, during my work experience, I have no choice but to use UNIX. Consequently, I have reached a good level in this Operating System. Even though UNIX can appear more difficult to use than Windows, it begins quickly a powerful Operating System, much stable than Windows. Besides, my work experience subject required that I write a large FORTRAN code in order to check the non-regression of AVBP after each new development. Thus, I have improved my computer skills by learning new methods of programing. I have also learned some combustion theoretical basis by using CERFACS resources and by asking CERFACS people questions. In this way, I have improved my knowledge in the combustion field. Furthermore, my work experience at CERFACS has allowed me to discover life in a laboratory. Thanks to several seminars and PhD presentations, I have been able to develop a better understanding of the research world as well as improving knowledge in the Computational Fluid Dynamics field. Consequently, I enjoyed my three months internship at CERFACS. It has convinced myself to keep on studing in the Computational Fluid Dynamics field. In fact, it seems to me that it is a good way to combine my knowledge in both Computer Programming and Fluid Mechanics. Furthermore, I am especially attracted by numerical simulation in turbulent reactive flows. 19
20 Conclusion
Appendix A An example of a ctea_report.dat document ctea_report.dat is the main report of the avbp_ctea code. In this file, there is the list of checked CTEA. For each test, it is displayed whether the test is validated or not. If some test results are negative, the discrepancies observed during each test are displayed. On the next page, a part of such a document has been reproduced. 21
22 A. AN EXAMPLE OF A CTEA_REPORT.DAT DOCUMENT +++SNAPSHOT CHECK+++ CTEA family CTEA name run.dat files Solution file Check CTEA_THI RUN1./CTEA_V60_proc_3/./CTEA_THI/RUN1/ _0000001.h5 Pb./CTEA_V60_proc_4/./CTEA_THI/RUN1/ Parameters: niter1= 982 dtsum1=0.300080673756490e+00 Differences: < rho> niter2= 982 dtsum2=0.300080673756491e+00 ABS: 0.148769885299771E-13 REL: 0.654835480361766E-14 <rhou> ABS: 0.385469434149854E-12 REL: 0.379395587733726E-11 <rhov> ABS: 0.223820961764432E-12 REL: 0.174430265949890E-11 <rhow> ABS: 0.170308211977499E-12 REL: 0.620650386321792E-11 <rhoe> ABS: 0.116415321826935E-09 REL: 0.229126297980879E-15 < N2> ABS: 0.148769885299771E-13 REL: 0.654835480361766E-14 CTEA_THI RUN1./CTEA_V60_proc_3/./CTEA_THI/RUN1/ _0000002.h5 Pb./CTEA_V60_proc_4/./CTEA_THI/RUN1/ Parameters: niter1= 1945 dtsum1=0.600247213562983e+00 Differences: < rho> niter2= 1945 dtsum2=0.600247213562983e+00 ABS: 0.295319324550292E-13 REL: 0.132377622062228E-13 <rhou> ABS: 0.689226453687297E-12 REL: 0.159397259381878E-09 <rhov> ABS: 0.442312853010662E-12 REL: 0.307230071236171E-10 <rhow> ABS: 0.246025422256935E-12 REL: 0.109316432199261E-10 <rhoe> ABS: 0.145519152283669E-09 REL: 0.285956029974127E-15 < N2> Figure A.1: An example of a ctea_report.dat file
Appendix B Part of avbp_ctea code (1) avbp_ctea code contains 3339 lines. Due to its size, only a small part has been copied in Appendix B. This part allows to check that the run.dat files used during the two computations are the same ones, i.e that the two compared solution files describe the same numerical experiments. In particular, these lines check that the numerical schemes used for the two runs are the sames ones. c--------------------------------------check : RUN.DAT write(*,*) write(*,*) ----------CHECK SCHEME : RUN.DAT---------- write(*,*) write(*,*) Looking for the first file : write(*,*) write(446,*) write(446,*) ----------CHECK SCHEME : RUN.DAT---------- write(446,*) write(446,*) Looking for the first file : write(446,*) rundatfile=rundatfile1! Inpout of readrundat call readrundat rundat_solutfile1=rundat_solutfile rundat_ischeme1=rundat_ischeme! Output of readrundat if (rundat_itexists) then else write(*,*) File //rundatfile1// not found write(446,*) File //rundatfile1// not found write(445,300) ctea_family,ctea_name,rundatfile1 + (1:len_trim(rundatfile1)-7) 300 format( *,1x,A15,2x,A15,2x,A61,2x,15x,14x, File run.dat 1 23
24 B. PART OF AVBP_CTEA CODE (1) + not found ) goto 100 endif c------------ write(*,*) write(*,*) Looking for the second file : write(*,*) write(446,*) write(446,*) Looking for the second file : write(446,*) rundatfile=rundatfile2! Input of readrundat call readrundat rundat_solutfile2=rundat_solutfile rundat_ischeme2=rundat_ischeme! Output of readrundat if (rundat_itexists) then else write(*,*) File, rundatfile2, not found write(446,*) File, rundatfile2, not found write(445,301) ctea_family,ctea_name,rundatfile2 + (1:len_trim(rundatfile1)-7) 301 format( *,1x,A15,2x,A15,2x,A61,2x,15x,14x, File run.dat 2 + not found ) goto 100 endif c------------conclusion if (rundat_ischeme1(1).ne.rundat_ischeme2(1).or. + rundat_ischeme1(2).ne.rundat_ischeme2(2).or. + rundat_ischeme1(2).ne.rundat_ischeme2(2).or. + rundat_ischeme1(2).ne.rundat_ischeme2(2) ) then write(*,*) write(*,*) WARNING : results from different schemes!!! write(*,*) write(*,*) ischeme file 1 =, (rundat_ischeme1(n),b=1,5) write(*,*) ischeme file 2 =, (rundat_ischeme2(n),b=1,5) write(446,*) write(446,*) WARNING : results from different schemes!!! write(446,*)
25 write(446,*) ischeme file 1 =, (rundat_ischeme1(n),b=1,5) write(446,*) ischeme file 2 =, (rundat_ischeme2(n),b=1,5) write(445,302) ctea_family,ctea_name,rundatfile1 + (1:len_trim(rundatfile1)-7) 302 format( *,1x,A15,2x,A15,2x,A61,2x,15x,14x, + Different schemes!!! ) write(445,350) rundatfile2 + (1:len_trim(rundatfile2)-7) 350 format(36x,a61) goto 100 else write(*,*) write(*,*) Schemes OK... write(*,*) write(*,*) ischeme,(rundat_ischeme(b),b=1,5) write(446,*) write(446,*) Schemes OK... write(446,*) write(446,*) ischeme,(rundat_ischeme(b),b=1,5) endif c--------------------------------------end CHECK : RUN.DAT
26 B. PART OF AVBP_CTEA CODE (1)
Appendix C Part of avbp_ctea code (2) avbp_ctea code contains 3339 lines. Due to its size, only a small part has been copied in Appendix C. This part of avbp_ctea code is the subroutine find_and_compare_solutionfiles. It is used by the code to find all the instantaneous solution files created by AVBP during the run, by using informations of run.dat file. Then, this subroutine launches the subroutine solution_diff_instant in order to compare the solution files of two different AVBP versions. If discrepancies are detected, the avbp_ctea program will launch the subroutine solution_diff_print to display the differences on the output files. c+++++++++++++++++++++++++++!!! FOR INSTANTANEOUS SOLUTIONS!!!++++++++++++++++ c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ subroutine find_and_compare_solutionfiles( ctea_family_sub, + ctea_name_sub,suffixe_sub, + rundatfile_sub1,rundatfile_sub2,rundat_solutfile_sub1, + rundat_solutfile_sub2,solut_print_sub ) use avbp_rundat use avbp_premix use solution_diff_ctea character(len=80) :: ctea_family_sub, ctea_name_sub integer ctea_number_sub, h, p, wd1, wd2 integer suffixe_sub character(len=8) :: char8 character(len=7) :: char7 character(len=6) :: char6 character(len=5) :: char5 character(len=4) :: char4 character(len=3) :: char3 character(len=2) :: char2 character(len=1) :: char1 character(len=80) :: rundatfile_sub1 character(len=80) :: rundatfile_sub2 character(len=80) :: solutionfile_sub1 character(len=80) :: solutionfile_sub2 character(len=80) :: solut_print_sub character*80 rundat_solutfile_sub1 character*80 rundat_solutfile_sub2 character*180 :: solutfile_sub1 character*180 :: solutfile_sub2 27
28 C. PART OF AVBP_CTEA CODE (2) h = len_trim(rundatfile_sub1) p = len_trim(rundatfile_sub2) solutionfile_sub1 = rundat_solutfile_sub1 + (3:len_trim(rundat_solutfile_sub1)) solutionfile_sub2 = rundat_solutfile_sub2 + (3:len_trim(rundat_solutfile_sub2)) wd1 = len_trim(solutionfile_sub1) wd2 = len_trim(solutionfile_sub2) if (suffixe_sub.lt.10) then solutfile_sub1(1:h-7) = rundatfile_sub1(1:h-7) solutfile_sub1(h-6:h-6+wd1-1) = solutionfile_sub1 solutfile_sub1(h-6+wd1:h-6+wd1+6) = _000000 write(char1, (1i1) ) suffixe_sub solutfile_sub1(h-6+wd1+7:h-6+wd1+7) = char1 solutfile_sub1(h-6+wd1+8:) =.h5 solutfile_sub2(1:p-7) = rundatfile_sub2(1:p-7) solutfile_sub2(p-6:p-6+wd2-1) = solutionfile_sub2 solutfile_sub2(p-6+wd2:p-6+wd2+6) = _000000 write(char1, (1i1) ) suffixe_sub solutfile_sub2(p-6+wd2+7:p-6+wd2+7) = char1 solutfile_sub2(p-6+wd2+8:) =.h5 else if (suffixe_sub.lt.100) then solutfile_sub1(1:h-7) = rundatfile_sub1(1:h-7) solutfile_sub1(h-6:h-6+wd1-1) = solutionfile_sub1 solutfile_sub1(h-6+wd1:h-6+wd1+5) = _00000 write(char2, (1i2) ) suffixe_sub solutfile_sub1(h-6+wd1+6:h-6+wd1+7) = char2 solutfile_sub1(h-6+wd1+8:) =.h5 solutfile_sub2(1:p-7) = rundatfile_sub2(1:p-7) solutfile_sub2(p-6:p-6+wd2-1) = solutionfile_sub2 solutfile_sub2(p-6+wd2:p-6+wd2+5) = _00000 write(char2, (1i2) ) suffixe_sub solutfile_sub2(p-6+wd2+6:p-6+wd2+7) = char2 solutfile_sub2(p-6+wd2+8:) =.h5 else if (suffixe_sub.lt.1000) then solutfile_sub1(1:h-7) = rundatfile_sub1(1:h-7) solutfile_sub1(h-6:h-6+wd1-1) = solutionfile_sub1 solutfile_sub1(h-6+wd1:h-6+wd1+4) = _0000 write(char3, (1i3) ) suffixe_sub solutfile_sub1(h-6+wd1+5:h-6+wd1+7) = char3 solutfile_sub1(h-6+wd1+8:) =.h5
29 solutfile_sub2(1:p-7) = rundatfile_sub2(1:p-7) solutfile_sub2(p-6:p-6+wd2-1) = solutionfile_sub2 solutfile_sub2(p-6+wd2:p-6+wd2+4) = _0000 write(char3, (1i3) ) suffixe_sub solutfile_sub2(p-6+wd2+5:p-6+wd2+7) = char3 solutfile_sub2(p-6+wd2+8:) =.h5 else if (suffixe_sub.lt.10000) then solutfile_sub1(1:h-7) = rundatfile_sub1(1:h-7) solutfile_sub1(h-6:h-6+wd1-1) = solutionfile_sub1 solutfile_sub1(h-6+wd1:h-6+wd1+3) = _000 write(char4, (1i4) ) suffixe_sub solutfile_sub1(h-6+wd1+4:h-6+wd1+7) = char4 solutfile_sub1(h-6+wd1+8:) =.h5 solutfile_sub2(1:p-7) = rundatfile_sub2(1:p-7) solutfile_sub2(p-6:p-6+wd2-1) = solutionfile_sub2 solutfile_sub2(p-6+wd2:p-6+wd2+3) = _000 write(char4, (1i4) ) suffixe_sub solutfile_sub2(p-6+wd2+4:p-6+wd2+7) = char4 solutfile_sub2(p-6+wd2+8:) =.h5 else if (suffixe_sub.lt.100000) then solutfile_sub1(1:h-7) = rundatfile_sub1(1:h-7) solutfile_sub1(h-6:h-6+wd1-1) = solutionfile_sub1 solutfile_sub1(h-6+wd1:h-6+wd1+2) = _00 write(char5, (1i5) ) suffixe_sub solutfile_sub1(h-6+wd1+3:h-6+wd1+7) = char5 solutfile_sub1(h-6+wd1+8:) =.h5 solutfile_sub2(1:p-7) = rundatfile_sub2(1:p-7) solutfile_sub2(p-6:p-6+wd2-1) = solutionfile_sub2 solutfile_sub2(p-6+wd2:p-6+wd2+2) = _00 write(char5, (1i5) ) suffixe_sub solutfile_sub2(p-6+wd2+3:p-6+wd2+7) = char5 solutfile_sub2(p-6+wd2+8:) =.h5 else if (suffixe_sub.lt.1000000) then solutfile_sub1(1:h-7) = rundatfile_sub1(1:h-7) solutfile_sub1(h-6:h-6+wd1-1) = solutionfile_sub1 solutfile_sub1(h-6+wd1:h-6+wd1+1) = _0 write(char6, (1i6) ) suffixe_sub solutfile_sub1(h-6+wd1+2:h-6+wd1+7) = char6 solutfile_sub1(h-6+wd1+8:) =.h5 solutfile_sub2(1:p-7) = rundatfile_sub2(1:p-7) solutfile_sub2(p-6:p-6+wd2-1) = solutionfile_sub2
30 C. PART OF AVBP_CTEA CODE (2) else if (suffixe_sub.lt.10000000) then endif endif endif endif endif endif solutfile_sub2(p-6+wd2:p-6+wd2+1) = _0 write(char6, (1i6) ) suffixe_sub solutfile_sub2(p-6+wd2+2:p-6+wd2+7) = char6 solutfile_sub2(p-6+wd2+8:) =.h5 endif solutfile1=solutfile_sub1 solutfile2=solutfile_sub2 solutfile_sub1(1:h-7) = rundatfile_sub1(1:h-7) solutfile_sub1(h-6:h-6+wd1-1)=solutionfile_sub1 solutfile_sub1(h-6+wd1:h-6+wd1) = _ write(char7, (1i7) ) suffixe_sub solutfile_sub1(h-6+wd1+1:h-6+wd1+7) = char7 solutfile_sub1(h-6+wd1+8:) =.h5 solutfile_sub2(1:p-7) = rundatfile_sub2(1:p-7) solutfile_sub2(p-6:p-6+wd2-1)=solutionfile_sub2 solutfile_sub2(p-6+wd2:p-6+wd2) = _ write(char7, (1i7) ) suffixe_sub solutfile_sub2(p-6+wd2+1:p-6+wd2+7) = char7 solutfile_sub2(p-6+wd2+8:) =.h5 solut_print_sub=solutfile1(h-6+wd1:h-6+wd1+10) write(*,*) Looking for solution files... write(*,*) write(446,*) Looking for solution files... write(446,*) write(*,11) solutfile1(1:len_trim(solutfile1)) 11 format(/, Solutfile1 :,80A) write(*,12) solutfile2(1:len_trim(solutfile2)) 12 format(/, Solutfile2 :,80A) write(*,*)
31 write(446,*) call solution_diff_instant write(*,*) ctea_family_sub(1:len_trim(ctea_family_sub)) write(*,*) ctea_name_sub(1:len_trim(ctea_name_sub)) write(*,*) solutfile1(h-6:h-6+wd1+10) write(*,*) if ( nnode_diff ) then else write(*,*)...at this iteration or time write(*,*) write(*,*) *** write(*,*) endif write(446,*) ctea_family_sub(1:len_trim(ctea_family_sub)) write(446,*) ctea_name_sub(1:len_trim(ctea_name_sub)) write(446,*) solutfile1(h-6:h-6+wd1+10) write(446,*) if ( nnode_diff ) then else write(446,*)...at this iteration or time write(446,*) write(446,*) *** write(446,*) endif end subroutine find_and_compare_solutionfiles
Bibliography M. Champion and R. Borghi. Modélisation et théorie des flammes. 2000. P. Chassaing. Mécanique des fluides, Éléments d un premier parcours. Cépaduès-Éditions, 2000. Bitouzé D. and J-C. Charpentier. LaTeX, 2006. T. Oetiker, H. Partl, I. Hyna, and E. Schlegl. Une courte (?) introduction à L A TEX2ε. http://www.laas.fr/ matthieu/cours/latex2e/, Novembre 2001. T. Poinsot and D. Veynante. Theoretical and Numerical Combustion. Edwards, 2001. 33