Code_Saturne : EDF s general purpose CFD software goes Open Source 1
Why CFD (Computational Fluid Dynamics) at EDF? Production Improve competitivity, reliability and safety of EDF power plants (nuclear or not) Maintenance optimisation, lifetime management Response to specific situations (flood, heat wave, incidents) Preparation of the future New technologies for power generation Innovative and renewable energies Influence of climate changes Promotion of sustainable development Help customers improve their energy consumption Global challenges Evaluation of environmental impact, waste management Development of future simulation tools 2
1 General elements on Code_Saturne 3
Code_Saturne: general features Technology Co-located finite volume, arbitrary unstructured meshes, predictor-corrector method 500 000 lines of code, 49% FORTRAN, 41% C, 10% Python Development 1998: Prototype (long time EDF in-house experience, ESTET-ASTRID, N3S,...) 2000: version 1.0 (basic modelling, wide range of meshes) 2001: Qualification for single phase nuclear thermal-hydraulic applications 2004: Version 1.1 (complex physics, LES, parallel computing) 2006: Version 1.2 (state of the art turbulence models, gui) 2008: Scheduled release of version 1.3 (massively parallel, ALE, code coupling,...) Released as open source (GPL licence) Beta versions (1.3.f and following) pre-released Broad validation range for each version ~ 30 cases, 1 to 15 simulations per case Academic to industrial cases (4 to 2 000 000 cells, 0,04 s to 12 days CPU time) Linux (workstations, clusters), Solaris, Irix64, Fujitsu VPP, Tru64 (AlphaServer), Blue Gene/L, PowerPC 4 and 5 Qualification for single phase nuclear applications Best practice guidelines in specific and critical domain Usual real life industrial studies (500 000 to 3 000 000 cells) 4
Code_Saturne: main capabilities Physical modelling Laminar and turbulent flows: k-ε, k-ω SST, v2f, RSM, LES Radiative heat transfer (DOM, P-1) Combustion coal, fuel, gas (EBU, pdf, LWP) Electric arc and Joule effect Lagrangian module for dispersed particle tracking Compressible flow ALE method for deformable meshes Conjugate heat transfer (Syrthes & 1D) Specific engineering modules for nuclear waste surface storage and cooling towers Derived version for atmospheric flows (Mercure_Saturne) Derived version for eulerian multiphase flows Flexibility Portability (UNIX and Linux) GUI (Python TkTix, Xml format) Parallel on distributed memory machines Periodic boundaries (parallel, arbitrary interfaces) Wide range of unstructured meshes with arbitrary interfaces Code coupling capabilities (Code_Saturne/Code_Saturne, Code_Saturne/Code_Aster,...) 5
2 Basic software architecture characteristics of Code_Saturne 6
Code_Saturne elements Meshes External libraries (EDF, LGPL): BFT: Base Functions and Types FVM: Finite Volume Mesh Code_Saturne Pre-processor (Envelope) mesh import mesh pasting domain decomposition Parallel Kernel ghost cells creation periodicity CFD Solver FVM library parallel mesh management BFT library I/O memory management code coupling parallel treatment Code_Saturne Syrthes Code_Aster Salome platform... Restart files Xml data file GUI Postprocessing output 7
Classical domain splitting for parallelism (using MPI) General Finite Volume discretisation Equations written as fluxes through faces sparse matrix For the equation on cell i, the only necessary values are those of cell i and its neighbours (cells sharing a face with cell i) synchronised ghost cells Some algorithms require an extended neighbourhood (cells sharing a vertex) Implemented using MPI_Isend, MPI_Irecv, MPI_Waitall and MPI_Allreduce Proc. 2 Proc. 1 Proc. 1 Proc. 2 PWR lower plenum decomposition (Metis) 8
Parallelism/periodicity Translation: same treatment as for parallelism Initial mesh Domain partitioning Mesh Periodicity Data exchange Parallel treatment Ghost cells Periodic treatment Data exchange Rotation is treated similarly, but implementation is more complex Vectors and tensors require rotation (component coupling) explicit 9 Parallelism and periodicity can be combined Domaine de calcul distribué sur 4 processeurs With periodic boundaries Champ de vitesse sur le domaine complet
Environment and documentation Environment Pre-requisite: compilers C (cc, gcc, xlc, icc,...) FORTRAN (f77, g77, gfortran, frt, f90, xlf, ifort,...) Pre-requisite for parallel computing: MPI: lam, openmpi, MPICH2 Metis or Scotch for better load balancing (optional; linked with the Preprocessor) Pre-requisite for Graphical User Interface: Python Tcl/Tk, Tix Xml2 Optional data exchange libraries: MED, HDF5 CGNS Misc.: Zlib Documentation Quality Assurance, GUI Online user and programmer s guides Support hot-line : (no waranty) Internet home page under construction : 10
3 General capabilities of Code_Saturne 11
Supported meshes Mesh generators Formats Simail: easy-to-use, with command file, but no CAD I-DEAS Master Series: powerful, CAD, no Linux version ICEM-CFD, GAMBIT IGG-HEXA (NUMECA), Comet-Design (STAR-CCM), Harpoon, GMSH Above mentioned mesh generators + MED, CGNS, EnSight Gold Cells: arbitrary arrangement of polyhedra of any type For example: tetrahedra, hexahedra, prisms, pyramids, n-faced polyhedra,... Arbitrary interfaces: «any type of mesh / format» + «any type of mesh / format» Meshes may be contained in one single file or in several separate files Order of meshes has no influence Arbitrary interfaces can be selected by mesh references Expertise may be required if arbitrary interfaces are used: in critical regions with LES with very different mesh refinements on curved CAD surfaces 12
Mesh examples Example of mesh with stretched cells and hanging nodes PWR lower plenum Example of composite mesh 3D polyedral cells 13
Advanced post-processing capabilities (FVM library) FVM library capabilities fully parallel treatment post-processing files written while calculation is running optional discard of non-standard polygons or polyhedra optional tessellation of non-standard polygons or polyhedra adaptation to format or post-processing tool features User-defined, time dependent, post-processing meshes and variables Helium injection trail C>0.05 Stratified T junction Velocity field at the boundary of the zone where T<T0 14
Arbitrary Lagrangian Eulerian method (ALE) Deformable meshes mesh deformation estimated from boundary conditions possibility for the user to specify the movement of any node internal coupling with user-defined moving structures (frictional spring law) external coupling with the structure mechanics tool Code_Aster Channel flow with two moving cylinders defined as independent structure with internal coupling (mesh viscosity = 1 (blue) or 10 10 (red)) 15
Double cylinder flow with ALE internal coupling 16
Large Eddy Simulation (unsteady turbulence modelling) Application example: thermal fatigue Contrary to classical RANS approaches, Large Eddy Simulation allows to represent the large structures of the flow, and, by thermal coupling with the structure, to determine the wall thermal loading. Fluid temperature Code_Saturne Wall refinement with hanging nodes Time Wall temperature (Syrthes) Synthetic turbulence method at inlet Dynamic model (with filter requiring no homogeneous direction) Wall treatment: refinement with hanging nodes or wall functions Synthetic turbulence (for inlet and coupling with RANS) 17
Specific physics capabilities Lagrangian method Stochastic modelling with 2-way coupling (momentum, heat, mass) transport & deposit of droplets, ashes, coal, corrosion products, radioactive particles, chemical forces,... Gas combustion EBU, pdf modelling (LWP: mean, variance and covariance of mixing rate & fuel mass fraction) combustion turbines (optimisation, pollutants ) Coal combustion Homogeneous Eulerian approach (granulometric classes, Kobayashi for devolatilisation) pulverized coal furnaces (optimisation, slagging, pollutants) Semi-transparent radiative heat transfer Discrete Ordinate Method and P-1 (L 0,q i ) model for optically thick media coal furnaces, electric arc Joule effect and electric arc Electromagnetism and coupling (momentum and heat transfer) glass furnace, plasma, electric transformers Compressible flow Density, momentum, total energy electric transformers, turbines Syrthes coupling for conjugate heat transfer and transparent radiative heat transfer Independent FE solver with tetrahedral mesh and arbitrary fluid-solid interface thermal shock, striping, fatigue Fuel combustion, ionic mobility under development 18
Lagrangian modelling for multi-phase flows Generally used to obtain refined statistics on a dispersed phase Stochastic modelling with 2-way coupling (momentum, heat, mass) Some applications: particle trajectories in cyclone separators resident times and combustion in polydispersed pulverised coal furnaces impact phenomena (turbine blades) deposit, slagging and fouling (PWR heat exchangers, coal furnaces ) 19
Porcheville French plant Separator efficiency Gas inlet Primary cells % vol. 6 5 4 3 2 Gas outlet 1 0 0.1 1 10 100 1000 µm Secondary cells Gas inlet 1016 mm 300 mm Ashes D 50 = 40µm Air Primary cell Unburned fuel D = 2mm 20
Pollutant prediction in Gas Turbine Rio-Bravo 495 MW Turbine constructor data measurements CFD complements or replaces data that turn out to be difficult to obtain 3D computation Film cooling, swirled inlet EBU combustion model Refined chemical analysis In zones defined from T and f Pollutant prediction (Nox) 21
Pulverised coal combustion Nox, slagging and fouling, flame stability, temperature peaks 3D modelling + refined chemical analysis optimization of maintenance and performance Towards recuperator and smoke treatment Cyclone Coal Limestone Water Primary air Ashes Secondary air Simplified and partial sketch of a pulverized coal combustion boiler 22
Glass furnace Joule effect Use of constant complex potential to account for tri-phase alternating current Offset effect accounted for Strongly variable physical properties, especially viscosity Specific pressure-velocity coupling to support large time steps Joule W/m 3 (vert., log.) temperature Re(Pot) V (horiz.) 23
Electric arcs applications Applications Temperature peak in electric transformers Combustion/Vitrification of radioactive waste (medium activity, long life) Arc default effect in closed posts Phenomena Joule effect and Laplace forces Radiative heat transfer Difficulties Strong source terms: 28 MJ on tube 1,7 m long and 10 cm diameter Unsteady phenomena: 2 arcs 20kA, 1300 V during 500 ms Variable physical properties: temperature from 300 to 30000 K Oil Paper & Copper Simulation Experiment Effect of arc default 24
Thermal fluide-structure interaction Conjugate heat transfer, radiative transfer Coupling with thermal code Syrthes Storage design expertise Valve numerical qualification thermal shock experiments PWR vessel life time (LOCA) refined and local thermalhydraulic coupled approach 25
Matisse engineering module Numerical tool for the design of nuclear waste storage facilities Integrated Code_Saturne module aimed at engineering needs No user subroutine needed Parametric mesh creation controlled by GUI (generic shape) with Simail tool Homogeneous approach for the calculation of the flow temperature field 26
Cooling towers engineering module Plumes natural convection Fans and packing turbulence, head losses, forced convection Rain-zones and frost 2-phase flows with heat and mass transfer 27
Mercure_Saturne for atmospheric flows Specific models boundary conditions atmospheric boundary layer hydrostatic pressure radiative source terms micro-physics and chemistry of pollutants External derived version based on Code_Saturne currently being transfered in the standard version of Code_Saturne 28
Coupling of Code_Saturne with itself (under development) Objective: coupling of several overlapping computational domains RANS/LES coupling for turbulence averaged RANS method in most part of the domain and unsteady LES zoom in specific areas Fluid/structure interaction with large displacement (unreachable to ALE) Two kinds of communications needed Data exchange at the boundaries Volumic forcing on the intersecting domains Main issues to be tackled Optimised fully parallel localisation already efficient but improvement still possible Conservativity at the interfaces Physical coupling when different physical models in each domain 29
Chimera method: FSI for tube bundle configuration 30
RANS/LES coupling LES region normal coupling tangential coupling 31
4 Parallel performance of Code_Saturne 32
High Performance Computing with Code_Saturne For research and production (in addition to local resources: small clusters): EDF s Blue Gene (8000 procs) CCRT (Computing Centre for Research and Technology) Mare Nostrum B.S.C. For benchmark : IBM Power PC 5 Cluster / Myrinet IBM Computing On Demand 33
Parallel Performance - FATHER test case FATHER LES case (thermal fatigue in a T-junction) 1M cells In 2003, a full run required 63 days using one vector processor on EDF's Fujitsu VPP 5000 computer for ten physical seconds simulated (50 000 iterations). In 2004, the same run required 10 days on 32 processors of an HP AlphaServer (CCRT) Now on Blue Gene EDF Machine: will require less than 1 day on 512 processors 34
Parallel Performance HyPi test case HYPI LES case (isothermal T-junction) 10 Million cells The full run required 22 days using 400 processors on an IBM Power PC 5 cluster (DCCoD) 35
Current frontier with Code_Saturne Calculation under way with 100 million cells PWR assembly mixing grid calculation on 4 000 to 8 000 procs major lock due to mesh generation fuel rods 36
Current frontier with Code_Saturne 37
5 Validation and qualification of Code_Saturne 38
Validation Academic and industrial test-cases N Case Dimension Steady/ Unsteady Laminar/ Turbulent 1 Wake of a circular cylinder 2 U L 2 Lid driven cavity 2 S L 3 Channel flow Re*=1655 1 & 3 S T 4 Dune 2 S T 5 Asymmetric diffuser 2 S T 6 Tube bundle (Fedora) 2 S T 7 Head losses 2 S T 8 180 circular tube bend 3 S T 9 Simplified car body 3 S T 10 Homogeneous Isotropic Turbulence 3 U T 11 Mixed convection 2 S T 12 Betts' cavity (natural convection) 2 S T 13 Impinging jet 2axi S T 14 Jet in pool with thermal fluctuations 2axi S T 15 Stratified flow in pipe (Supernimbus) 3 S T 16 Multi species mixing in pipe (Echo) 3 S T 17 Thermal mixing zone (Rra) 3 S T 18 Thermal shock (Creare) 3 U T 19 Premixed flame (Oracles) 2 S T 20 Diffusion flame 2axi S T 21 Coal combustion (Cerchar) 3 S T 22 2-phase flow jet (lagrangian) 2axi S T 23 Shock tube 1 U L 24 Axisymmetric arc (Pfender) 2axi & 3S T 25 Radiative heat transfer (Selçuk) 3 S 26 Syrthes coupling 2 S T 27 Foo 3 S T 28 MED format 3 29 2-phase flow, lagragian (Hishida) 2a et 3 S T 30 Reverse hot jet (mixed convection) 2 S T 31 Oscillating channel 2 U T 39
Qualification for nuclear thermal-hydraulics Quality and trust important for nuclear safety Complements standard validation for a specific domain of application comparing to reliable data determining the limitations of the results edicting best practice guidelines temperature 40
6 Users and partners around Code_Saturne 41
Current users and partners EDF R&D (70 users) Nuclear thermal-hydraulic applications Combustion (coal furnaces, gaz turbines ) Thermal loading Fluid-structure interaction Valves Acoustic EDF DIN SEPTEN EDF Basic Design Department: fossil-fired furnaces and nuclear plants Cooling towers Heat pumps Aeraulics (health and safety, environment ) Atmospheric environment Salome project Electric arc, plasma, ionic transport Glass furnace Outside EDF [France, UK, Poland, China, Algeria] CEA le Ripault (arc and plasma) CEA Saclay, CEA Grenoble CEREA (atmospheric) CETIM (algorithm) CS-SI (code coupling) ENSTA, ENPC(teaching) ENSIL (arc and plasma) IMF Toulouse (multiphase, FSI) LCD Poitiers (combustion) LEA, LET Poitiers (turbulence) LMM Paris 6 (LES, atmospheric) ONERA (electric arcs) TPRI China (combustion) TREFLE, U. Bordeaux (algorithm) U. Manchester UK (turbulence) UST Lille (FSI) UST Oran Algeria (turbulence, LES, FSI) UT Gliwice Poland (combustion) Valeo (acoustic) 42
Why go open source? Ease up the collaboration process No contract, collaboration agreement, nor non-disclosure-agreement to sign before giving the sources Simplicity for any potential partner to test Code_Saturne Enlarge the user community and the range of applications Better national and international recognition of Code_Saturne Larger feedback and better validation of Code_Saturne Provide industry with a open software Enlarge the developer community Capitalise in Code_Saturne the work and knowledge of partners External involvement in the Code_Saturne support External developers to support the EDF development team External developers to provide their own developments on their own applications Coherent with EDF s open source strategy Code_Aster, Salome platform, OpenTurns,... 43
Code_Saturne open source practical info Distribution of Code_Saturne GPL licence, auxiliary libraries (BFT and FVM) under LGPL licence Download page (temporary page but permanent address) Downloadable versions: 1.3.f beta version currently available 1.3.0 frozen non fully validated version in august 2007 1.3.2 fully validated version in january 2008 Contact and support around Code_Saturne Contact and support address (no warranty on availability of support) User s Club meeting November 26-27 2007 in Chatou (78) To appear in the mailing list Initial training sessions in march and november (but not for free!) External development integration Any useful external contribution welcome For easier licence management, any contribution given for integration will be under EDF s copyright Contributors will be clearly mentioned in the author s list Code_Saturne is a trademark property of EDF 44