This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.



Similar documents
OpenFOAM Workshop. Yağmur Gülkanat Res.Assist.

HPC Deployment of OpenFOAM in an Industrial Setting

Self Financed One Week Training

Modeling of Earth Surface Dynamics and Related Problems Using OpenFOAM

Open Source CFD Solver - OpenFOAM

CastNet: Modelling platform for open source solver technology

CastNet: GUI environment for OpenFOAM

How To Run A Steady Case On A Creeper

OpenFOAM Opensource and CFD

OpenFOAM Optimization Tools

OpenFOAM open source CFD on ANSELM

Open Source Computational Fluid Dynamics

A simplefoam tutorial

Quality and Reliability in CFD

This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

CFD: What is it good for?

ME6130 An introduction to CFD 1-1

Express Introductory Training in ANSYS Fluent Lecture 1 Introduction to the CFD Methodology

OpenFOAM: Introduction, Capabilities and HPC Needs

Customer Training Material. Lecture 2. Introduction to. Methodology ANSYS FLUENT. ANSYS, Inc. Proprietary 2010 ANSYS, Inc. All rights reserved.

OpenFOAM: Open source CFD in research and industry

Pre-processing in openfoam, mesh generation. OpenFOAM kurs 2013 Håkan Nilsson Olivier Petit

THE CFD SIMULATION OF THE FLOW AROUND THE AIRCRAFT USING OPENFOAM AND ANSA

Design and Optimization of OpenFOAM-based CFD Applications for Hybrid and Heterogeneous HPC Platforms

POLITECNICO DI MILANO Department of Energy

Adaptation and validation of OpenFOAM CFD-solvers for nuclear safety related flow simulations

CCTech TM. ICEM-CFD & FLUENT Software Training. Course Brochure. Simulation is The Future

STCE. Outline. Introduction. Applications. Ongoing work. Summary. STCE RWTH-Aachen, Industrial Applications of discrete adjoint OpenFOAM, EuroAD 2014

Draft Version. For personal use. c Copyright Máté Márton LOHÁSZ. Tutorial for Channel Flow by LES using Open Source CFD

OpenFOAM postprocessing and advanced running options

CFD modelling of floating body response to regular waves

NUMERICAL SIMULATION OF REGULAR WAVES RUN-UP OVER SLOPPING BEACH BY OPEN FOAM

Solver Development in OpenFOAM

CFD Simulation of Subcooled Flow Boiling using OpenFOAM

OpenFOAM. The Open Source CFD Toolbox. User Guide

Model of a flow in intersecting microchannels. Denis Semyonov

O.F.Wind Wind Site Assessment Simulation in complex terrain based on OpenFOAM. Darmstadt,

Introduction to CFD Analysis

Investigation of the influence of turbine-to-turbine interaction on their performance using OpenFOAM

Which strategy to move the mesh in the Computational Fluid Dynamic code OpenFOAM

Dynamic Process Modeling. Process Dynamics and Control

Computational Modeling of Wind Turbines in OpenFOAM

bluecape s Official Website

Multiphase Flow - Appendices

Open source Computational Fluid Dynamics using OpenFOAM

Moving boundary in openfoam

HPC enabling of OpenFOAM R for CFD applications

Aerodynamic Department Institute of Aviation. Adam Dziubiński CFD group FLUENT

Differential Relations for Fluid Flow. Acceleration field of a fluid. The differential equation of mass conservation

Introduction to CFD Analysis

CONVERGE Features, Capabilities and Applications

Set up and solve a transient problem using the pressure-based solver and VOF model.

Current Development Work in OpenFOAM

OPEN-SOURCE CFD ANALYSIS OF MULTI-DOMAIN UNSTEADY HEATING WITH NATURAL CONVECTION

The Multiphase Capabilities of the CFD Toolbox OpenFOAM for Hydraulic Engineering Applications

OPTIMISE TANK DESIGN USING CFD. Lisa Brown. Parsons Brinckerhoff

Advanced discretisation techniques (a collection of first and second order schemes); Innovative algorithms and robust solvers for fast convergence.

Simulation of Fluid-Structure Interactions in Aeronautical Applications

TVM 4155 Numerical modelling and hydraulics 10. March OpenFOAM homework

Eu-NORSEWInD - Assessment of Viability of Open Source CFD Code for the Wind Industry

CFD Applications using CFD++ Paul Batten & Vedat Akdag

Computational Fluid Dynamics in Automotive Applications

NUMERICAL ANALYSIS OF THE EFFECTS OF WIND ON BUILDING STRUCTURES

Numerical Calculation of Laminar Flame Propagation with Parallelism Assignment ZERO, CS 267, UC Berkeley, Spring 2015

Coupling micro-scale CFD simulations to meso-scale models

Recent Developments in OpenFOAM

CFD with OpenSource software

Lecture 6 - Boundary Conditions. Applied Computational Fluid Dynamics

3. Prescribe boundary conditions at all boundary Zones:

Lecture 16 - Free Surface Flows. Applied Computational Fluid Dynamics

STUDY OF MESH DEFORMATION FEATURES OF AN OPEN SOURCE CFD PACKAGE AND APPLICATION TO A GEAR PUMP SIMULATION

Evaluation of the CMT and SCRAM Software Configuration, Build and Release Management Tools

Experts in Computational Fluid Dynamics

Fire Simulations in Civil Engineering

A comparison of CFD Software packages to find the. suitable one for numerical modeling of gasification. process

Computational Fluid Dynamics (CFD) and Multiphase Flow Modelling. Associate Professor Britt M. Halvorsen (Dr. Ing) Amaranath S.

Supported platforms & compilers Required software Where to download the packages Geant4 toolkit installation (release 9.6)

A Guide to the free mesh program Discretizer with OpenFOAM for CFD (Computational Fluid Dynamics)

Course Outline for the Masters Programme in Computational Engineering

Overview on Salome-Meca and Code_Aster. Code_Aster, Salome-Meca course material GNU FDL licence (

LSCFD: Meshing Tools for Open Source CFD A Practical Point of View

OpenFOAM at FM LTH. Erdzan Hodzic. FM Seminars: 16-march Division of Fluid Mechanics, Department of Energy Sciences, Lund University

Titelmasterformat durch Klicken bearbeiten

Vista: A Multi-field Object Oriented CFD-package

CFD SIMULATION OF NATURAL GAS COMBUSTION AND IST APPLICATION TO TUNNEL KILN FIRING

Advanced Computational Software

This tutorial provides a recipe for simulating L

Interactive simulation of an ash cloud of the volcano Grímsvötn

Customer Training Material. Lecture 5. Solver Settings ANSYS FLUENT. ANSYS, Inc. Proprietary 2010 ANSYS, Inc. All rights reserved.

Laminar Flow in a Baffled Stirred Mixer

2013 Code_Saturne User Group Meeting. EDF R&D Chatou, France. 9 th April 2013

Design and Analysis of Engine Cooling Fan

Introduction. 1.1 Motivation. Chapter 1

ADVANCED COMPUTATIONAL TOOLS FOR EDUCATION IN CHEMICAL AND BIOMEDICAL ENGINEERING ANALYSIS

Computational Fluid Dynamic Modeling Applications

WebPublish User s Manual

CBE 6333, R. Levicky 1 Review of Fluid Mechanics Terminology

Thermo-Mechanical Coupled Simulation with LS-DYNA

MECH 479: Computational Fluid Dynamics

Transcription:

Disclaimer This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

Introductory OpenFOAM Course From 14 th to 18 th July, 2014 University of Genoa, DICCA Dipartimento di Ingegneria Civile, Chimica e Ambientale

Your Lecturer Joel GUERRERO joel.guerrero@unige.it guerrero@wolfdynamics.com

Today s lecture 1. What is OpenFOAM? Brief overview 2. OpenFOAM directory organization 3. Directory structure of an application/utility 4. Applications/utilities in OpenFOAM 5. Directory structure of an OpenFOAM case This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

Today s lecture 1. What is OpenFOAM? Brief overview 2. OpenFOAM directory organization 3. Directory structure of an application/utility 4. Applications/utilities in OpenFOAM 5. Directory structure of an OpenFOAM case This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

What is OpenFOAM? Brief overview General description: OpenFOAM stands for Open Source Field Operation and Manipulation. OpenFOAM is first and foremost a C++ library used to solve partial differential equations (PDEs), and ordinary differential equations (ODEs). It comes with several ready-to-use or out-of-the-box solvers, pre-processing utilities and post-processing utilities. It is licensed under the GNU General Public License (GPL). That means it is freely available and distributed with the source code.

What is OpenFOAM? Brief overview General description: It has extensive multiphysics capabilities (computational fluid dynamics, conjugate heat transfer, mass transfer, stress analysis, fluid-structure interaction, chemical reactions, combustion, acoustics, electromagnetics, lagragian particles, rigid body motion, etc). It can be use in massively parallel computers. No need to pay for separate licenses. It is under active development, its capabilities mirror those of commercial CFD applications. It counts with a wide-spread community around the world (industry, academia and research labs).

What is OpenFOAM? Brief overview OpenFOAM is an excellent piece of C++ and software engineering. Decent piece of CFD code. H. Jasak

What is OpenFOAM? Brief overview Brief overview Description and implementation: Finite Volume Method (FVM) based solver. Collocated polyhedral unstructured meshes. Second order accuracy in space and time. Many discretization schemes available. Pressure-velocity coupling via segregated methods (SIMPLE and PISO). Particle methods (DEM, DSMC, MD) and lagragian particle tracking. Dynamic mesh handling, 6 DOF solvers, and adaptive mesh refinement. Massive parallelism through domain decomposition. All components implemented in library form for easy re-use.

What is OpenFOAM? Brief overview Brief overview Physical models: Physical modeling library: Thermophysical models and physical properties for liquids and gases. Transport/rheology models. Newtonian and non-newtonian viscosity models. Combustion, flame speed, chemical reactions, porous media, etc. Extensive turbulence modeling capabilities (RANS, SRS, DES and LES). Lagragian particle methods (DSMC, MD). Discrete particle modeling (DPM, MP-PIC).

What is OpenFOAM? Brief overview Brief overview Solvers: OpenFOAM comes with several ready-to-use or out-of-thebox solvers: Basic solvers: Laplace, potential flow, passive scalar transport. Incompressible and compressible flows: segregated pressure-based algorithms (SIMPLE and PISO). Heat transfer modeling capabilities: buoyancy-driven flows, conjugate heat transfer. Multiphase flows: Euler-Euler, VOF for free surfaces, multiple phases, cavitation, phase change. Stress analysis, electromagnetics, combustion, acoustics, MHD, fluid-structure interaction, etc.

What is OpenFOAM? Brief overview Brief overview Solvers: And if this is not enough for you, you can implement your own solvers. OpenFOAM is designed to be a flexible and programmable environment for numerical simulations by having top-level code that is a direct representation of the equations being solved. New solvers can be easily implemented through equation mimicking, e.g.:

What is OpenFOAM? Brief overview Brief overview Solvers and equation mimicking: The equation, @ U @t + r U r µru = rp can be written in OpenFOAM as follows, solve ( ); fvm::ddt(rho,u) + fvm::div(phi,u) - fvm::laplacian(mu,u) == - fvc::grad(p) Correspondence between the implementation and the original equation is clear.

What is OpenFOAM? Brief overview Brief overview Customizing solvers and equation mimicking: Equation mimicking syntax, achieved through the use of object oriented programming, enables users to create custom solvers with relative ease. Users have total freedom to modify existing solvers or use them as the starting point for new solvers. OpenFOAM design encourages code and libraries re-use. As solvers can be tailored by a user for a specific need, OpenFOAM is ideal for research and development. Top level solvers are written in few 100s lines of code, and are optimized for efficiency.

What is OpenFOAM? Brief overview Brief overview General structure: OpenFOAM is assembled from components: foundations libraries (vectors and tensors algebra, mesh handling, discretization, boundary conditions, linear solvers, etc.), physical modeling libraries, utilities and solvers. All applications and utilities, are compiled using common functionality in the collection of libraries distributed with OpenFOAM. This ensures consistency across the whole of the OpenFOAM distribution, rather than having a suite of packages compiled from entirely separate source code. Transparent solution algorithms which can be viewed by the user, encouraging better understanding of the underlying physics.

Today s lecture 1. What is OpenFOAM? Brief overview 2. OpenFOAM directory organization 3. Directory structure of an application/utility 4. Applications/utilities in OpenFOAM 5. Directory structure of an OpenFOAM case This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

OpenFOAM directory organization $WM_PROJECT_DIR applications bin doc etc platforms src tutorials wmake Allwmake If you installed OpenFOAM in the default location, the directory $WM_PROJECT_DIR should be: $HOME/OpenFOAM/OpenFOAM-2.3.x In this directory you will find all the directories containing OpenFOAM installation. In this directory you will also find additional files (such as README.org, COPYING, etc.), but the most important one is Allwmake, which compiles OpenFOAM. Typing wcleanall will search all the directories below the current one and will delete all the compiled files. So if you type wcleanall in $WM_PROJECT_DIR, it will delete all the compiled files in your OpenFOAM installation.

OpenFOAM directory organization $WM_PROJECT_DIR applications bin doc etc platforms src tutorials wmake By the way, as I use OpenFOAM version 2.3.x, the environment variable $WM_PROJECT_DIR points to: $HOME/OpenFOAM/OpenFOAM-2.3.x If you use OpenFOAM version 2.3.0, the environment variable $WM_PROJECT_DIR will point to $HOME/OpenFOAM/OpenFOAM-2.3.0 Allwmake

OpenFOAM directory organization $WM_PROJECT_DIR applications bin doc etc platforms src tutorials wmake Allwmake By the way, you can go to any of these directories by using the predefined aliases set by OpenFOAM (see $WM_PROJECT_DIR/etc/config/alias.sh). For example: alias foam='cd $WM_PROJECT_DIR' alias app='cd $FOAM_APP' alias src='cd $FOAM_SRC' alias tut='cd $FOAM_TUTORIALS For a complete list type alias in the terminal. The entries starting with the symbol $ are environment variables. You can find out the value of an environment variable by echoing its value, for example: echo $WM_PROJECT_DIR will give you the following output on the terminal $HOME/OpenFOAM/OpenFOAM-2.3.x To see all the environment variables type env.

OpenFOAM directory organization Let us now study the applications folder

OpenFOAM directory organization $WM_PROJECT_DIR applications solvers test utilities Let us visit applications directory. Type app or cd $WM_PROJECT_DIR/ applications. Here you will find the following sub-directories: solvers, which contains the source code for the distributed solvers. test, which contains the source code of several test cases that show the usage of some of the OpenFOAM classes. utilities, which contains the source code for the distributed utilities. There is also an Allwmake script, which will compile all the content of solvers and utilities. To compile the test cases in test go to the desired test case directory and compile it by typing wmake.

OpenFOAM directory organization Let us now study the bin folder

OpenFOAM directory organization $WM_PROJECT_DIR bin Let us visit the bin directory: The bin directory contains shell scripts, such as parafoam, foamnew, foamlog, foamjob, etc.

OpenFOAM directory organization Let us now study the doc folder

OpenFOAM directory organization $WM_PROJECT_DIR doc Let us visit the doc directory: The doc directory contains the documentation of OpenFOAM, namely; user guide, programmer s guide and Doxygen generated documentation in html format. The Doxygen documentation needs to be compiled by typing Allwmake doc in $WM_PROJECT_DIR. You can also access the Doxygen documentation from internet. http://www.openfoam.org/docs/cpp/

OpenFOAM directory organization $WM_PROJECT_DIR doc Documentation usage: acroread $WM_PROJECT_DIR/doc/Guides-a4/UserGuide.pdf acroread $WM_PROJECT_DIR/doc/Guides-a4/ProgrammersGuide.pdf firefox file://$wm_project_dir/doc/doxygen/html/index.html

OpenFOAM directory organization Let us now study the etc folder

OpenFOAM directory organization $WM_PROJECT_DIR etc Let us visit the etc directory: The etc directory contains the environment files, global OpenFOAM instructions, and the default thermochemical database thermodata/ thermodata. It also contains the super dictionary controldict, where you can set several debug flags and the defaults units.

OpenFOAM directory organization Let us now study the platforms folder

OpenFOAM directory organization $WM_PROJECT_DIR platforms linux64gccdpopt bin lib Let us visit platforms directory. Type cd $WM_PROJECT_DIR/platforms. This directory contains the binaries generated when compiling the applications directory (after compilation the binaries will be located in the directory $WM_PROJECT_DIR/platforms/linux64GccDPOpt/bin) and the libraries generated by compiling the source code in the src directory (after compilation, the libraries will be located in the directory $WM_PROJECT_DIR/platforms/ linux64gccdpopt/lib). If you installed OpenFOAM following the default instructions, you compiled the 64 bits version, using the gcc compiler, with double precision, and optimized version. This is reflected in the name of the directory linux64gccdpopt.

OpenFOAM directory organization Let us now study the src folder

OpenFOAM directory organization $WM_PROJECT_DIR src/ Let us visit src directory. Type src or cd $WM_PROJECT_DIR/src. This directory contains the source code for all the foundation libraries. It is divided in different subdirectories and each of them can contain several libraries. The most relevant are: finitevolume. This library provides all the classes needed for the finite volume discretization, such as mesh handling, finite volume discretization operators (divergence, laplacian, gradient, fvc/fvm and so on), and boundary conditions (fields/fvpatchfields). In lninclude you also find the very important file fvcfd.h, which is included in most applications. OpenFOAM. This core library includes the definitions of the containers used for the operations, the field definitions, the declaration of the mesh and mesh features such as zones and sets. turbulencemodels, which contains many turbulence models.

OpenFOAM directory organization $WM_PROJECT_DIR src/ Let us visit src directory. Type src or cd $WM_PROJECT_DIR/src. There is also an Allwmake script, which will compile all the content of the src directory. To compile a specific library, go to the desired directory and compile it by typing wmake.

OpenFOAM directory organization Let us now study the tutorials folder

OpenFOAM directory organization $WM_PROJECT_DIR tutorials Let us visit the tutorials directory: The tutorials directory contains example cases for each solver. These are the tutorials distributed with OpenFOAM.

OpenFOAM directory organization Let us now study the wmake folder

OpenFOAM directory organization $WM_PROJECT_DIR wmake Let us visit the wmake directory. OpenFOAM uses a special make command: wmake. wmake understands the file structure in OpenFOAM and has some default compiler directives that are set in the wmake directory. There is also a command, wclean, that cleans up the output from the wmake command. If you add a new compiler name in the bashrc file, you should also tell wmake how to interpret that name. In wmake/rules you will find the default settings for the available compilers. You can also find a few scripts that are useful when organizing your files for compilation, or for cleaning up.

OpenFOAM directory organization We just studied the directory WM_PROJECT_DIR, which contains the original installation of OpenFOAM. Any modification you add to the source code in WM_PROJECT_DIR, will affect the whole library. Tip of day,

OpenFOAM directory organization Unless you know what are you doing, do not modify anything in the original installation ($WM_PROJECT_DIR), except for updates!

OpenFOAM directory organization Let us now study the OpenFOAM user directory

OpenFOAM directory organization $HOME/OpenFOAM $WM_PROJECT_DIR $WM_PROJECT_USER_DIR User directory $WM_PROJECT_USER_DIR (USER_NAME-2.3.x) In $WM_PROJECT_USER_DIR directory, all user files are located. If you are going to develop applications of your own, it is recommended to put the source code in $WM_PROJECT_USER_DIR following the same structure as in $WM_PROJECT_DIR/applications. It is recommended to create two more directories: $WM_PROJECT_USER_DIR/run and $WM_PROJECT_USER_DIR/src Place user developed library source code in $WM_PROJECT_USER_DIR/src directory, with the same directory structure as in $FOAM_SRC, and case files in the $WM_PROJECT_USER_DIR/run directory (which has the alias run). In $WM_PROJECT_USER_DIR/platforms/linux64GccDPOpt/bin, the binaries of the user developed applications will be located; whereas, in $WM_PROJECT_USER_DIR/platforms/linux64GccDPOpt/ lib, the binaries of the user developed libraries will be located. This is done so you do not modify anything in the original installation, except for updates!

OpenFOAM directory organization Remember, you can do all the modifications you want in your user directory ($WM_PROJECT_USER_DIR). By proceeding in this way, you do not mess around with the original installation.

OpenFOAM directory organization Environment variables Remember, OpenFOAM uses its own environment variables. OpenFOAM environment settings are contained in the OpenFOAM-2.3.x/etc directory. If you installed OpenFOAM in the default location, they should be in: $HOME/OpenFOAM/OpenFOAM-2.3.x/etc

OpenFOAM directory organization Environment variables If you are running bash or ksh (if in doubt type echo $SHELL), you sourced the $WM_PROJECT_DIR/etc/bashrc file by adding the following line to your $HOME/.bashrc file: source $HOME/OpenFOAM/OpenFOAM-2.3.x/etc/ bashrc source $HOME/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc By sourcing the file $WM_PROJECT_DIR/etc/bashrc, we start to use OpenFOAM environment variables. By default, OpenFOAM uses the system compiler and its own MPI compiler.

OpenFOAM directory organization WARNING Remember, when you use OpenFOAM you are using its environment settings, that is, path to libraries and compilers. So if you are developing your own software or compiling applications, and you are having compilation problems due to conflicting libraries or missing compilers, try to unload OpenFOAM environment variables

Today s lecture 1. What is OpenFOAM? Brief overview 2. OpenFOAM directory organization 3. Directory structure of an application/utility 4. Applications/utilities in OpenFOAM 5. Directory structure of an OpenFOAM case This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

Directory structure of an OpenFOAM solver Directory structure of an OpenFOAM solver

Directory structure of an OpenFOAM solver $WM_PROJECT_DIR/applications/solvers appname appname.c createfields.h Make files options The appname directory contains the source code. The Make directory contains compilation instructions. appname/appname.c: is the actual source code. appname/createfields.h: declares all the field variables and initializes the solution. Make/files: names all the source files (.C). Specifies the appname name and location of the output file. Make/options: specifies directories to search for include files and libraries to link the solver against.

Directory structure of an OpenFOAM solver $WM_PROJECT_USER_DIR /applications/solvers appname appname.c createfields.h Make files options REMEMBER For your own applications, it is recommended to put the source code in $WM_PROJECT_USER_DIR following the same structure as in $WM_PROJECT_DIR/ applications. Also, you will need to modify Make/files and Make/options to show the new name and location of the compiled binaries and libraries to link the solver against. This is done so you do not modify anything in the original installation, except for updates!. You can do anything you want to your own copies, so you do not risk messing things up.

Directory structure of an OpenFOAM utility Directory structure of an OpenFOAM utility

Directory structure of an OpenFOAM utility $WM_PROJECT_DIR/applications/utilities appname appname.c header_files(.h) Make files options The appname directory contains the source code. The Make directory contains compilation instructions. appname/appname.c: is the actual source code. appname/header_files (.H): header files needed to compile the utility. Make/files: names all the source files (.C). Specifies the appname name and location of the output file. Make/options: specifies directories to search for include files and libraries to link the utility against.

Directory structure of an OpenFOAM utility $WM_PROJECT_USER_DIR /applications/utilities appname appname.c Header files (.H) Make files options REMEMBER For applications of your own, it is recommended to put the source code in $WM_PROJECT_USER_DIR following the same structure as in $WM_PROJECT_DIR/ applications. Also, you will need to modify Make/files and Make/options to show the new name and location of the compiled binaries and libraries to link the utility against. This is done so you do not modify anything in the original installation, except for updates!. You can do anything you want to your own copies, so you do not risk messing things up.

Directory structure of an OpenFOAM utility REMEMBER You can put your OpenFOAM cases, solvers, utilities and libraries in any directory, but it is highly advisable to save everything in your OpenFOAM user directory or $WM_PROJECT_USER_DIR.

Today s lecture 1. What is OpenFOAM? Brief overview 2. OpenFOAM directory organization 3. Directory structure of an application/utility 4. Applications/utilities in OpenFOAM 5. Directory structure of an OpenFOAM case This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

In $FOAM_SOLVERS (use alias sol to go there) you will find the directories containing the source code for the solvers available in the OpenFOAM installation (version 2.3.x): basic combustion compressible discretemethods DNS electromagnetics financial heattransfer incompressible lagrangian multiphase stressanalysis Solvers in OpenFOAM

Solvers in OpenFOAM For example, in the sub-directory incompressible you will find several subdirectories containing the source code of the following solvers: adjointshapeoptimizationfoam boundaryfoam icofoam nonnewtonianicofoam pimplefoam pisofoam shallowwaterfoam simplefoam Inside each directory you will find a *.C file with the same name as the directory. This is the main file, where you will find the top-level source code and a short description of the solver. In incompressible/icofoam/icofoam.c you will find the following description: Transient solver for incompressible, laminar flow of Newtonian fluids.

Solvers in OpenFOAM REMEMBER You have the source code right there. So take your time and dig into each directory to get a complete description of each solver.

Utilities in OpenFOAM In $FOAM_UTILITIES (use alias util to go there) you will find the directories containing the source code for the utilities available in the OpenFOAM installation (version 2.3.x): mesh miscellaneous parallelprocessing postprocessing preprocessing surface thermophysical As for the solver, take your time and dig into each directory to get a complete description of each utility.

Utilities in OpenFOAM For example, in the sub-directory mesh/generation you will find several subdirectories containing the source code of the following utilities: blockmesh extrude extrude2dmesh foamyhexmesh foamyquadmesh snappyhexmesh Inside each utility directory you will find a *.C file with the same name as the directory. This is the main file, where you will find the top-level source code and a short description of the utility. In snappyhexmesh/snappyhexmesh.c you will find the following description: Automatic split hex mesher. Refines and snaps to surface.

Utilities in OpenFOAM For example, in the sub-directory postprocessing/velocityfield you will find several sub-directories containing the source code of the following utilities: Co enstrophy flowtype Lambda2 Mach Pe Q streamfunction streamfunction uprime vorticity Inside each utility directory you will find a *.C file with the same name as the directory. This is the main file, where you will find the top-level source code and a short description of the utility. In Q/Q.C you will find the following description: Calculates and writes the second invariant of the velocity gradient tensor. Q = 0.5*(sqr(tr(gradU)) - tr(((gradu)&(gradu)))) [1/s^2] The -nowrite option just outputs the max/min values without writing the field.

Utilities in OpenFOAM REMEMBER You have the source code right there. So take your time and dig into each directory to get a complete description of each solver.

Applications and libraries in OpenFOAM If you are interested in knowing all the solvers, utilities and libraries that come with the OpenFOAM distribution, you can read the applications and libraries section in the user guide (chapter 3). In the directory $WM_PROJECT_DIR/doc/ you will find the OpenFOAM documentation in pdf format. To open the user guide type in the terminal, acroread $WM_PROJECT_DIR/doc/Guides-a4/ UserGuide.pdf acroread $WM_PROJECT_DIR/doc/Guides-a4/UserGuide.pdf

Applications and libraries in OpenFOAM If you have internet access you can read the online user guide. Go to the link http://www.openfoam.org/docs/user/, then go to chapter 3 (applications and libraries), and then go the sub-sections, 3.5 Standard solvers, 3.6 Standard utilities, and/or 3.7 Standard libraries.

Applications and libraries in OpenFOAM Remember, you have the source code, that is best source of information. So take your time and dig into each directory to get a complete description of each application and library available in OpenFOAM. The solvers in the OpenFOAM distribution are in the $FOAM_SOLVERS directory, reached quickly by typing sol at the command line. The utilities in the OpenFOAM distribution are in the $FOAM_UTILITIES directory, reached quickly by typing util at the command line. The source code of the libraries in the OpenFOAM distribution is in the $FOAM_SRC directory, reached quickly by typing src at the command line.

Today s lecture 1. What is OpenFOAM? Brief overview 2. OpenFOAM directory organization 3. Directory structure of an application/utility 4. Applications/utilities in OpenFOAM 5. Directory structure of an OpenFOAM case This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

Directory structure of an OpenFOAM case $WM_PROJECT_USER_DIR/run case_directory (case name) system controldict fvschemes fvsolution constant physical properties polymesh mesh information 0 boundary/initial conditions time_directories solution files case_directory: path to the case, often located in $WM_PROJECT_USER_DIR/run system: contains run-time control and solver numerics. constant: contains physical properties and turbulence modeling properties and so on. constant/polymesh: contains the polyhedral mesh information. 0: contains boundary conditions and initial conditions. time_directories: contains the solution and derived fields.

Directory structure of an OpenFOAM case REMEMBER You always run the solvers and utilities in the the top level of the case directory (the directory with the case name). Not in the directory system, not in the directory constant, not in the directory 0.

Directory structure of an OpenFOAM case REMEMBER You can put your OpenFOAM cases, solvers, utilities and libraries in any directory, but it is highly advisable to save everything in your OpenFOAM user directory or $WM_PROJECT_USER_DIR.

Directory structure of an OpenFOAM case In the USB key you will find many tutorials (which are different from those that come with the OpenFOAM installation), let us work with these tutorials to understand and get functional using OpenFOAM. You can extract the tutorials wherever you want. However, I highly recommend you to extract them in your OpenFOAM user directory or in $WM_PROJECT_USER_DIR/run. From now on, this directory will become $ptofc (abbreviation of path to OpenFOAM course). You can add this alias to your.bashrc file, alias ptofc='cd $PATH_TO_TUTORIALS

Directory structure of an OpenFOAM case By the way, to uncompress the tutorials go to the directory where you copied the training material and type in the terminal, tar zxvf file_name.tar.gz On the other side, if you want to compress a directory you can proceed as follows, tar zcvf file_name.tar.gz directory_name

Directory structure of an OpenFOAM case At this point we are ready to run our first case. So buckle up and enjoy the ride.

Today s lecture 1. What is OpenFOAM? Brief overview 2. OpenFOAM directory organization 3. Directory structure of an application/utility 4. Applications/utilities in OpenFOAM 5. Directory structure of an OpenFOAM case This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

Thank you for your attention

These lectures notes are licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/