Codesaturne Practical User's Guide
Total Page:16
File Type:pdf, Size:1020Kb
EDF R&D Fluid Dynamics, Power Generation and Environment Department Single Phase Thermal-Hydraulics Group 6, quai Watier F-78401 Chatou Cedex Tel: 33 1 30 87 75 40 Fax: 33 1 30 87 79 16 JUNE 2017 Code Saturne documentation Code Saturne version 5.0.0 practical user's guide contact: [email protected] http://code-saturne.org/ c EDF 2017 Code Saturne EDF R&D Code Saturne version 5.0.0 practical user's documentation guide Page 1/142 ABSTRACT Code Saturne is a system designed to solve the Navier-Stokes equations in the cases of 2D, 2D ax- isymmetric or 3D flows. Its main module is designed for the simulation of flows which may be steady or unsteady, laminar or turbulent, incompressible or potentially dilatable, isothermal or not. Scalars and turbulent fluctuations of scalars can be taken into account. The code includes specific modules, referred to as \specific physics", for the treatment of Lagrangian particle tracking, semi-transparent radiative transfer, gas combustion, pulverised coal combustion, electricity effects (Joule effect and elec- tric arcs) and compressible flows. Code Saturne relies on a finite volume discretisation and allows the use of various mesh types which may be hybrid (containing several kinds of elements) and may have structural non-conformities (hanging nodes). The present document is a practical user's guide for Code Saturne version 5.0.0. It is the result of the joint effort of all the members in the development team. It presents all the necessary elements to run a calculation with Code Saturne version 5.0.0. It then lists all the variables of the code which may be useful for more advanced utilisation. The user subroutines of all the modules within the code are then documented. Eventually, for each key word and user-modifiable parameter in the code, their definition, allowed values, default values and conditions for use are given. These key words and parameters are grouped under headings based on their function. An alphabetical index list is also given at the end of the document for easier consultation. Code Saturne is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Code Saturne is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Code Saturne EDF R&D Code Saturne version 5.0.0 practical user's documentation guide Page 2/142 Code Saturne EDF R&D Code Saturne version 5.0.0 practical user's documentation guide Page 3/142 TABLE OF CONTENTS 1 Introduction....................................... 9 2 Quick start....................................... 10 2.1 How to use the Doxygen documentation?.................... 10 2.2 Running a calculation................................ 10 2.3 Troubleshooting.................................... 11 3 Practical information about Code Saturne ..................... 12 3.1 System Environment for Code Saturne ....................... 12 3.1.1 Preliminary settings............................. 12 3.1.2 Configuration file.............................. 12 3.1.3 Standard directory hierarchy....................... 13 3.1.4 Code Saturne Kernel library files...................... 15 3.2 Setting up and running a calculation...................... 15 3.2.1 Step by step calculation.......................... 15 3.2.2 Temporary execution directory...................... 17 3.2.3 Execution modes............................... 17 3.2.4 Environment variables............................ 18 3.2.5 Interactive modification of selected parameters........... 19 3.3 Case preparer..................................... 20 3.4 Supported mesh and post-processing output formats............. 20 3.4.1 Formats supported for input........................ 21 3.4.2 Formats supported for input or output................. 23 3.4.3 Formats supported for output only................... 26 3.4.4 Meshing tools and associated formats.................. 27 3.4.5 Meshing remarks............................... 27 3.5 Preprocessor command line options........................ 27 3.6 Kernel command line options............................ 27 3.7 Launch scripts..................................... 29 3.8 Graphical User Interface.............................. 29 3.9 User subroutines................................... 31 3.9.1 Preliminary comments............................ 31 3.9.2 Example routines............................... 31 3.9.3 Main variables................................. 31 3.9.4 Using selection criteria in user subroutines.............. 40 3.10 Face and cell mesh-defined properties and selection............. 42 4 Importing and preprocessing meshes........................ 44 Code Saturne EDF R&D Code Saturne version 5.0.0 practical user's documentation guide Page 4/142 4.1 Preprocessor options................................. 44 4.1.1 Mesh selection................................. 45 4.1.2 Post-processing output........................... 45 4.1.3 Element orientation correction...................... 45 4.2 Environment variables................................ 45 4.2.1 System environment variables....................... 46 4.3 Optional functionality............................... 46 4.4 General remarks................................... 46 4.5 Files passed to the Kernel............................. 47 4.6 Mesh preprocessing.................................. 47 4.6.1 Joining of non-conforming meshes..................... 47 4.6.2 Periodicity................................... 48 4.6.3 Parameters for conforming or non-conforming mesh joinings... 48 4.6.4 Parameters for periodicity......................... 51 4.6.5 Modification of the mesh geometry.................... 51 4.7 Mesh smoothing utilities............................... 52 4.7.1 Fix by feature................................. 52 4.7.2 Warped faces smoother........................... 52 5 Partitioning for parallel runs............................. 52 5.1 Partitioning stages.................................. 53 5.2 Partitioner choice.................................. 53 5.3 Effect of periodicity................................. 53 6 Basic modelling setup................................. 54 6.1 Initialisation of the main parameters....................... 54 6.2 Selection of mesh inputs: cs user mesh input ................... 58 6.3 Non-default variables initialisation........................ 59 6.4 Manage boundary conditions............................ 63 6.4.1 Coding of standard boundary conditions................ 65 6.4.2 Coding of non-standard boundary conditions.............. 67 6.4.3 Checking of the boundary conditions.................. 69 6.4.4 Sorting of the boundary faces....................... 69 6.4.5 Boundary conditions with LES....................... 70 6.5 Manage the variable physical properties.................... 74 6.5.1 Basic variable physical properties.................... 74 6.5.2 Modification of the turbulent viscosity................ 76 6.5.3 Modification of the variable C of the dynamic LES model..... 76 6.6 User source terms................................... 77 Code Saturne EDF R&D Code Saturne version 5.0.0 practical user's documentation guide Page 5/142 6.6.1 In Navier-Stokes............................... 78 6.6.2 For k and " ................................... 78 6.6.3 For Rij and " .................................. 79 6.6.4 For ' and f ................................... 79 6.6.5 For k and ! ................................... 79 6.6.6 For ν~t ...................................... 80 6.6.7 For user scalars............................... 80 6.7 Pressure drops (head losses) and porosity................... 80 6.7.1 Head losses................................... 80 6.7.2 Porosity.................................... 81 6.8 Management of the mass sources......................... 81 6.9 User law editor of the GUI............................. 82 6.10 Modification of the variables at the end of a time step........... 84 7 Advanced modelling setup.............................. 85 7.1 Use of a specific physics............................... 85 7.2 Pulverised coal and gas combustion module.................. 91 7.2.1 Boundary conditions............................. 93 7.2.2 Initialisation of the options of the variables............. 96 7.3 Heavy fuel oil combustion module......................... 99 7.3.1 Initialisation of transported variables................. 99 7.3.2 Boundary conditions............................. 99 7.4 Radiative thermal transfers in semi-transparent gray media........ 100 7.4.1 Initialisation of the radiation main parameters............ 100 7.4.2 Radiative transfers boundary conditions................ 100 7.4.3 Absorption coefficient of the medium, boundary conditions for the luminance and calculation of the net radiative flux...... 103 7.4.4 Input of radiative transfer parameters................. 104 7.5 Conjugate heat transfer.............................. 104 7.5.1 Thermal module in a 1D wall....................... 104 7.5.2 Fluid-Thermal coupling with SYRTHES................. 105 7.6 Particle-tracking (Lagrangian) Module..................... 106 7.6.1 General information............................. 106 7.6.2 Activating the particle-tracking module................ 106 7.6.3 Basic guidelines for standard simulations................ 107 7.6.4 Prescribing the main modelling parameters (GUI