3y ago

109 Views

4 Downloads

2.91 MB

51 Pages

Transcription

Basic Courses (B1)INTRODUCTION TO OPENFOAMopen Field Operation And ManipulationC librariesName

INTRODUCTION TO OPENFOAMopen Field Operation And ManipulationC librariesOpenFOAM3 25Equations 26Solvers 33How to use/code 46Examples 49Conclusions50Rita F. Carvalho, MARE, Department of Civil Engineering, University of Coimbra, Portugal

OpenFOAM – what it isSOLVE PARTIAL DIFFERENTIAL EQUATIONS (PDE)RESOLUTION OF CURRENT “ENGINEERING” CHALLENGESUSE OF ADVANCED TECHNOLOGYRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM – what it isOpenFOAM is a powerful tool that allows the numerical solution of differential equations easily code specific problem based on differential equations (continuum mechanics)OpenFOAM is a software toolbox licensed under the GNU General Public Licensetrusted by many thousands of engineers and scientists in industry and academiaworldwide.OpenFOAM is an open source C library, prepared to simple or parallel computing tocreate executable applications (solvers & utilities) insolvers designed to solve a specific problem in continuum mechanicsutilities designed to perform tasks that involve data manipulation.OPENSOURCE, FREE, OPEN CODE, CONTINUOUS EVOLUTIONRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM – how can be used Users can use and write simple to complex solver with only few lines(depending of the knowledge in physics and programming techniques) Users can change the existing solvers, and, use them as the start point forthe creation of a new solver - The complete source of the code is available! Users can profit from the numeric tools to solve EDPs, laplacian, gradient,divergent . Terms Equations solvers Set of EquationsRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM applicationsMulti disciplinarMechanics of Fluids, Turbulence, Heat Transfers, Chemical Reactions,Electromagnetism, FinancialBesides in hydraulic and CFD Fields Aero and hydro dynamics of objects (vehicles, greenhouses, wind towers); Dimensioning of hydraulic structures; Optimization and design of river and maritime structures; Dimensioning of heat transfer devices; Influence of wind on structures; Propagation of polluting feathers; Simulation of sediment transport and location of erosion zones.Rita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

Different versions of OpenFOAMhttp://openfoamwiki.net/index.php/Forks and Variants#Definitions ForkThe idea behind forking is that when several changes to the code are made, the distribution of themodified group of changes should use a different name from the original project, to avoid confusion,and should follow the policies and guidelines mentioned above. Fork (software development) VariantThis is the denomination mostly used when the changes to the complete source code packagedon't seem substantial enough to require a fully dedicated source code branch for supporting thechanges made. This usually occurs for situations where the changes are done only a few times for aparticular version of a software or even when the changes are only provided as patch files.Nonetheless, these variants must still abide to the policies and guidelines mentioned above.Rita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

Different versions of OpenFOAMFORKS ‐ number of different flavours of OpenFOAM that are all based on the original FOAM‐code. OpenFOAM (Foundation) OpenFOAM by the OpenFOAM foundationOpenFOAM OpenFOAM by the ESI‐OpenCFDFoam‐extend Foam‐extend has a number of additional community‐contributed features.Othero Caelus‐CML ‐ version 5.10 (October 2015), it's officially a fork of OpenFOAM 2.1.1 ‐ Hybrid commercial model,made available freely to the public.o ENGYS' own builds of OpenFOAM ‐ Available for customers only/ Strictly commercial.o FreeFOAM ‐ Completely open to the general public. Currently distributed with Debiao iconCFD ‐ Strictly commercial.o RapidCFD and RapidCFD @ Sim‐Flow‐ fork of OpenFOAM that has been specifically designed to be built withCUDA. Current version is a fork from OpenFOAM 2.3.1o RheologicRemixRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

Different versions of OpenFOAMVERSIONS Latest OpenFOAM version: 6 (10th of July 2018) Latest Foam-Extend version: 4.0 (22nd of December 2016) Latest OpenFOAM version: v1812 (20th December 2018) OpenFOAM ReleaseNotes: 6 5.0 4.1 4.0 3.0.1 3.0.0 2.4.0 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.1 2.1.0 2.0.1 2.0.0 1.7.1 1.7.0 1.6 1.5 1.4.1 1.4 1.3 1.2 1.1 1.0 Foam-extend Release Notes: 4.0 3.2 3.1 3.0 OpenFOAM Release Notes: v1812 v1806 v1712 v1706 v1612 v1606 v3.0 http://openfoamwiki.net/index.php/Main PageRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

Different versions of OpenFOAM - InstallationOpenFOAM Linux ‐ Ubuntu Windows Mac OSOpenFOAM version: v1812Rita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - StructureThe OpenFOAM source code comprisesof four main components:src: the core OpenFOAM source code;applications: collections of libraryfunctionality wrapped up intoapplications, such as solvers andutilities;tutorials: a suite of test cases thathighlight a broad cross‐section ofOpenFOAM's capabilities;doc: supporting documentationRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - StructureThe OpenFOAM source code comprisesof four main components:src: the core OpenFOAM source code;applications: collections of libraryfunctionality wrapped up intoapplications, such as solvers andutilities;tutorials: a suite of test cases thathighlight a broad cross‐section ofOpenFOAM's capabilities;doc: supporting documentationRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - StructureThe OpenFOAM source code comprisesof four main components:src: the core OpenFOAM source code;applications: collections of libraryfunctionality wrapped up intoapplications, such as solvers andutilities;tutorials: a suite of test cases thathighlight a broad cross‐section ofOpenFOAM's capabilities;doc: supporting documentationRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM – Installation and useUsers wantUsers shouldA “black box” software that they can use withcomplete confidence for general problem classeswithout having to understand the fine algorithmicdetails.Know what they are using, what is behind softwareto be able to tune data structures for a particularapplication, even if the software is not as reliable asthat provided for general methodsLook at data, analyse it and be able to decide if it is trustableBe sure that they can have confidence in modelsHave an idea of what kind of uncertainty is possible in datato use a large body of numerical software freelyavailable 24 hours a day via electronic services ‐ thereare already dozens of libraries, technical reports onvarious parallel computers and software, test data,facilities to automatically translate FORTRANprograms to C, bibliographies, names and addressesof scientists and mathematicians, and so on.FOAM@IBERIA 2019OpenFOAM EquationsUnderstand why so different models, solvers, Rita F. de Carvalho Solvers How to use Examples Conclusions

OpenFOAM - NotesOpenFOAM contains a suite of numerical tools to solve a range of problems.To solve equations for a continuum, OpenFOAM uses a numerical approachwith the following features:1. Segregated, iterative solution:system of equations governing our problem of interest separate matrix equations are created for each equation, and are solvedwithin an iterative sequence (as opposed to created one, big matrix equationfor the entire system of equations).2. Finite volume method: Matrix equations are constructed using the finitevolume method applied to arbitrary shaped cells (any number of faces, anynumber of edges).Rita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - NotesPhysical approximations3Partial differential Equations, Initial and Boundary ConditionsCFD - Mass, momentum and energy conservation, inlet, outlet, walls, Depending of PDE – Physical phenomenonCalculate Position/Time;2Variables: u, p, T, φ; Properties: 𝜌, 𝜇, 𝑘, 𝜎, Г, c definitionNumerical solution techniques - Consideration of continuousmaterial/domain represented by discrete particles - Finite volumes, finiteelements Geometry and Meshing - acceptable element sizes andshapes accurate numerical approximations - Implicit Methods, precision,diffusion, relaxation and accuracy options 4CFD -Accurate treatment of momentum – advection term, couplingRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions1

OpenFOAM - NotesInvolving:Variables:dependent andindepedent, (x,t)PropertiesDifferential EquationsDomain / material represented as continuous and represented by discreteparticlesRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - NotesTo solve equations for a continuum, OpenFOAM uses a numerical approachwith the following features: Parallel computation are easy to perform (reduction of the computationaltime); You can create simple meshes with the mesh generator that comes withOpenFOAM. Also, you can convert to the OpenFOAM format, meshescreated with another software (check the user guide for the availableformats); It comes with several utilities; All components implemented in library form for easy re-use.Rita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - NotesOpenFOAM contains a suite of numerical tools to solve a range of problems.It includes methods to solve problems where matter is represented as acontinuum and where it is represented by discrete particles.To solve equations for a continuum, OpenFOAM uses numerical approachesCFD - We replace the actual molecular structure by a hypothetical continuousmedium, which at a point has the mean properties of the moleculessurrounding the point - "fluid particle“ – control volume – imaginary region inwhich dynamic forces are in equilibrium - we look at the forces in externalsurface of the control volume integral form of equations/ differential. we choose the most convenient in each caseRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - NotesDifferential Equations CFD ui ui p ji u j gi x j xi x j t1 ui 0 t xiDomain / material represented as continuous and represented by discreteparticles 2 BC 4 BC 6 BCRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - NotesTo solve equations for a continuum, OpenFOAM uses a numerical approachwith the following features:Collocated variables: The solution variable for each matrix equation is definedat cell centres.Different discretization schemes It uses second order schemes for theapproximation of the different operators, but, many schemes are available,including high order schemes;Equation coupling: The coupling between equations, particularly pressure andvelocity is performed using adapted versions of well-known algorithms suchas e.g. PISO and SIMPLE PIMPLERita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - NotesWe assume the fluid is continuous, the continuumhypothesis represented by discrete volumes withaverage PropertiesDensitySurface TensionBulk modulus / CompressibilityDiffusivity coefficient (spontaneous spreading of matter )Viscosity (random motion comes from the molecularnatures of the constituents)Rita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - NotesGeneral Equations – PDE ‐ OpenFoamPartial D.Equations MeshPre ‐ processor Properties Initial and Boundary Conditions Parameters, controls and optionsSolver Solve the equationGradients/divergents/ laplacians/interpolation Results analysisPost‐ enfoam.com/Rita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - sPost‐Processorsoftwares Pre‐ProcessorMeshIC BCProperties & parametersUtilitiesDictionary Solver Post‐ProcessorRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

OpenFOAM - EquationsEquations in a solver · 𝜙𝑈 ‐ · 𝜇 𝑈Divergent vector scalar 𝑝 .V u v w x y zLaplacian vector(gradient of a divergent) vector 2u 2 v 2 w V 2 2 2 x y z2Gradient scalar vector p p p ˆ p ˆî j k x y zEx: Solve (fvm::ddt(rho, U) fvm::div(phi, U)- fvm::laplacian(miu, U) - fvc::grad(p));it is fundamentally a tool for solving partial differential equations rather than aCFD package in the traditional senseRita F. de CarvalhoFOAM@IBERIA 2019OpenFOAM Equations Solvers How to use Examples Conclusions

Laplacian vector(gradient of a divergent) vectorOpenFOAM - SolversBasic’ solverslaplacianFoam/ overLaplacianDyMFoam Solves a simpleLaplace equation, e.g. for thermal diffusion in a solid · 𝛼 𝑇𝑇,fvScalarMatrix TEqn(fvm::ddt(T) –α𝛼 𝑇 thermal diffusivity 𝛼 is represented by DT Initial and BCddtSchemeslaplacianSchemesfvm::laplacian(DT, T) fvOptions(T)); fvSolution, fvSchemesinterpolationSchemesgradSchemes, divSchemes, snGradSchemesFOAM@IBERIA 2019OpenFOAM Equations Solvers 2V 2u 2 v 2 w x 2 y 2 z 2T[K] is the absolu

INTRODUCTION TO OPENFOAM open Field Operation And Manipulation C libraries Name. INTRODUCTION TO OPENFOAM open Field Operation And Manipulation C libraries Rita F. Carvalho, MARE, Department of Civil Engineering, University of Coimbra, Portugal OpenFOAM Equations Solvers How to use/code Examples Conclusions 3 25 26 33 46 49 50. SOLVE PARTIAL DIFFERENTIAL EQUATIONS (PDE .

Related Documents: