OpenFOAM Optimization Tools



Similar documents
Recent Developments in OpenFOAM

HPC Deployment of OpenFOAM in an Industrial Setting

Current Development Work in OpenFOAM

Quality and Reliability in CFD

OpenFOAM: Year in Review

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

OpenFOAM: Open source CFD in research and industry

OpenFOAM: Introduction, Capabilities and HPC Needs

OpenFOAM Opensource and CFD

TWO-DIMENSIONAL FINITE ELEMENT ANALYSIS OF FORCED CONVECTION FLOW AND HEAT TRANSFER IN A LAMINAR CHANNEL FLOW

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

HPC enabling of OpenFOAM R for CFD applications

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

Modeling of Earth Surface Dynamics and Related Problems Using OpenFOAM

Lecture 6 - Boundary Conditions. Applied Computational Fluid Dynamics

Implementation of a flexible fiber model in a general purpose CFD code

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

Course Outline for the Masters Programme in Computational Engineering

Automated moving mesh techniques in CFD

FLUX / GOT-It Finite Element Analysis of electromagnetic devices Maccon GmbH

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

Overset Grids Technology in STAR-CCM+: Methodology and Applications

Giorgio Bornia. Research statement. Primary interests

Steady Flow: Laminar and Turbulent in an S-Bend

Computational Modeling of Wind Turbines in OpenFOAM

CastNet: Modelling platform for open source solver technology

Christof Hinterberger, Mark Olesen

Introduction to Engineering System Dynamics

ME6130 An introduction to CFD 1-1

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

POLITECNICO DI MILANO Department of Energy

CFD modelling of floating body response to regular waves

CONVERGE Features, Capabilities and Applications

Navier-Stokes Equation Solved in Comsol 4.1. Copyright Bruce A. Finlayson, 2010 See also Introduction to Chemical Engineering Computing, Wiley (2006).

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

How To Write A Program For The Pd Framework

A DISCRETE ADJOINT VERSION OF AN UNSTEADY INCOMPRESSIBLE SOLVER FOR OPENFOAM USING ALGORITHMIC DIFFERENTIATION

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

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

Vista: A Multi-field Object Oriented CFD-package

Plates and Shells: Theory and Computation - 4D9 - Dr Fehmi Cirak (fc286@) Office: Inglis building mezzanine level (INO 31)

Applications of the Discrete Adjoint Method in Computational Fluid Dynamics

AeroFluidX: A Next Generation GPU-Based CFD Solver for Engineering Applications

NUMERICAL ANALYSIS OF THE EFFECTS OF WIND ON BUILDING STRUCTURES

List of Problems Solved Introduction p. 1 Concept p. 1 Nodes p. 3 Elements p. 4 Direct Approach p. 5 Linear Spring p. 5 Heat Flow p.

Computational Fluid Dynamics Research Projects at Cenaero (2011)

3. Prescribe boundary conditions at all boundary Zones:

Computational Fluid Dynamics in Automotive Applications

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.

Model of a flow in intersecting microchannels. Denis Semyonov

Spatial Discretisation Schemes in the PDE framework Peano for Fluid-Structure Interactions

CFD Application on Food Industry; Energy Saving on the Bread Oven

Turbulence Modeling in CFD Simulation of Intake Manifold for a 4 Cylinder Engine

FLUID MECHANICS IM0235 DIFFERENTIAL EQUATIONS - CB _1

CFD Applications using CFD++ Paul Batten & Vedat Akdag

Finite Element Method (ENGC 6321) Syllabus. Second Semester

Introduction to COMSOL. The Navier-Stokes Equations

Introduction to ANSYS

How To Model A Horseshoe Vortex

INTRODUCTION TO FLUID MECHANICS

CastNet: GUI environment for OpenFOAM

Design and Analysis of Engine Cooling Fan

Electromagnetic Sensor Design: Key Considerations when selecting CAE Software

A QUICK GUIDE TO THE FORMULAS OF MULTIVARIABLE CALCULUS

How To Run A Cdef Simulation

Calculation of Eigenfields for the European XFEL Cavities

Back to Elements - Tetrahedra vs. Hexahedra

OpenFOAM: Open Platform for CFD and Complex Physics Simulations

Polyhedral Mesh Generation for CFD-Analysis of Complex Structures

Self Financed One Week Training

CFD SIMULATION OF IPR-R1 TRIGA SUBCHANNELS FLUID FLOW

OPTIMISE TANK DESIGN USING CFD. Lisa Brown. Parsons Brinckerhoff

Titelmasterformat durch Klicken bearbeiten

Mesh Moving Techniques for Fluid-Structure Interactions With Large Displacements

INTEGRAL METHODS IN LOW-FREQUENCY ELECTROMAGNETICS

Use of OpenFoam in a CFD analysis of a finger type slug catcher. Dynaflow Conference 2011 January , Rotterdam, the Netherlands

Optimization of Supply Chain Networks

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

H.Calculating Normal Vectors

Lecture 16 - Free Surface Flows. Applied Computational Fluid Dynamics

Multi-Block Gridding Technique for FLOW-3D Flow Science, Inc. July 2004

CFD SIMULATION OF SDHW STORAGE TANK WITH AND WITHOUT HEATER

Multiphase Flow - Appendices

Experiences Extending the CFD Solver of the PDE Framework Peano

This tutorial provides a recipe for simulating L

AN INTRODUCTION TO NUMERICAL METHODS AND ANALYSIS

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

APPLICATION OF OPTIMIZATION METHODS IN 2D HYDROFOIL DESIGN

Laminar Flow in a Baffled Stirred Mixer

TESLA Report

Abaqus/CFD Sample Problems. Abaqus 6.10

FEM Software Automation, with a case study on the Stokes Equations

CFD: What is it good for?

Simulation of Fluid-Structure Interactions in Aeronautical Applications

CHAPTER 4 4 NUMERICAL ANALYSIS

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

Thermo-Mechanical Coupled Simulation with LS-DYNA

Transcription:

OpenFOAM Optimization Tools Henrik Rusche and Aleks Jemcov h.rusche@wikki-gmbh.de and a.jemcov@wikki.co.uk Wikki, Germany and United Kingdom OpenFOAM Optimization Tools p. 1

Agenda Objective Review optimisation problems Status in OpenFOAM Topics 1. Introduction 2. Problem description and classification 3. What is OpenFOAM 4. Shape optimisation with radial basis functions 5. Gradient based optimisation techniques 6. Topology optimisation with adjoint equation 7. Summary OpenFOAM Optimization Tools p. 2

Introduction Find min(f(p)) where f is the objective functional f is calculated by executing a computational workflow (pre-processing, solver, post-processing) Classification: Single vs. Multi-Objective problem (f is a vector) Unconstraint vs. constraint problem (additional restrictions on f and/or p) Parameter vs. Shape or Topology optimisation (geometry is changed) Gradient vs. non-gradient based algorithms (uses f p ) Optimization as a discipline is very rich in methods, approaches and algorithms Many external tools exists (Dakota, modefrontier, LMS Optimus) OpenFOAM Optimization Tools p. 3

Different Approaches General approaches to optimization Non-gradient based algorithms Simplex, Brent s, and Powell s methods Genetic algorithms Surrogate and reduced order model algorithms Gradient based algorithms Steepest descent Newton s method Conjugate gradient Sequential quadratic programming (SQP) Gradient calculation Finite differences, incomplete gradient, reduced order model for gradients, etc. Continuous adjoint and tangent equations Discrete adjoint and tangent equations OpenFOAM Optimization Tools p. 4

OpenFOAM: Executive Overview What is OpenFOAM? OpenFOAM is a free-to-use Open Source numerical simulation software with extensive CFD and multi-physics capabilities Free-to-use means using the software without paying for license and support, including massively parallel computers: free 1000-CPU CFD license! Software under active development, capabilites mirror those of commercial CFD Substantial installed user base in industry, academia and research labs Possibility of extension to non-traditional, complex or coupled physics: Fluid-Structure Interaction, complex heat/mass transfer, internal combustion engines, nuclear Main Components Discretisation: Polyhedral Finite Volume Method, second order in space and time Lagrangian particle tracking, Finite Area Method (2-D FVM on curved surface) Massive parallelism in domain decomposition mode Automatic mesh motion (FEM), support for topological changes All components implemented in library form for easy re-use Physics model implementation through equation mimicking OpenFOAM Optimization Tools p. 5

Implementing Continuum Models Equation Mimicking Natural language of continuum mechanics: partial differential equations Example: turbulence kinetic energy equation k t + (uk) [(ν +ν t) k] = ν t [ ] 1 2 2 ( u+ ut ) ǫ o k k o Objective: represent differential equations in their natural language solve ( fvm::ddt(k) + fvm::div(phi, k) - fvm::laplacian(nu() + nut, k) == nut*magsqr(symm(fvc::grad(u))) - fvm::sp(epsilon/k, k) ); Correspondence between the implementation and the original equation is clear OpenFOAM Optimization Tools p. 6

Non-gradient Based optimization Non-gradient based optimization is based on the evaluation of gradients of objective functional in which OpenFOAM is responsible for providing the current state Usually several states are saved in order to deduce the behavior of the function being minimized This knowledge is used to retain and discard the states in an effort to find the optimal point Typical problem with non-gradient based algorithms is so called curse of dimensionality - too many parameters require excessive number of non-linear function evaluations thus making the algorithms very expensive In shape optimization effective geometrical parameterization is crucial in controlling the cost of the optimization algorithm OpenFOAM Optimization Tools p. 7

RBF Mesh Morphing and Motion Radial Basis Function (RBF) Interpolation RBF interpolation defines the interpolation directly from the sufficient smoothness criterion on the interpolation (positive weighting factors): s(x) = N b j=1 γ j φ( x x b,j )+q(x) Weighting factors calculated by inversion of a (small) dense matrix RBF Interpolation Procedure 1. Establish locations of data-carrying points x b and their values 2. Assemble and solve the equation set for γ and β using a direct solver 3. Calculate values at desired locations by evaluating s(x) Using RBF in a CFD Code Context Automatic mesh motion: mesh deformation based on a small number of control points located on moving boundaries: one-off interpolation cost RBF mesh morphing in geometric shape optimisation: morphing points control OpenFOAM Optimization Tools p. 8

Radial Basis Function Radial Basis Function Automatic Mesh Motion Mathematical tool which allows data interpolation from a small set of control points to space with smoothness criteria built into the derivation Used for mesh motion in cases of large deformation: no inverted faces or cells Control points chosen on a moving surface, with extinguishing function used to control far-field mesh motion Implemented by Frank Bos, TU Delft and Dubravko Matijašević, FSB Zagreb OpenFOAM Optimization Tools p. 9

Radial Basis Function RBF Mesh Morphing RBF morphing object defines the parametrisation of geometry (space): 1. Control points in space, where the parametrised control motion is defined 2. Static points in space, whose motion is blocked 3. Range of motion at each control point: (d 0,d 1 ) 4. Set of scalar parameters δ for control points, defining current motion as d(δ) = d 0 +δ(d 1 d 0 ), where 0 δ 1 For each set of δ parameters, mesh deformation is achieved by interpolating motion of control points d over all vertices of the mesh: new deformed state of the geometry Mesh in motion remains valid since RBF satisfies smoothness criteria Using RBF in Optimisation Control points may be moved individually or share δ values: further reduction in dimension of parametrisation of space Mesh morphing state is defined in terms of δ parameters: to be controlled by the optimisation algorithm OpenFOAM Optimization Tools p. 10

Radial Basis Function RBF Mesh Morphing: Cylinder and Sphere Examples Parametrisation uses a single parameter δ for this motion, with various number of control points OpenFOAM Optimization Tools p. 11

Geometric Shape Optimisation HVAC 90 deg Bend: Flow Uniformity at Outlet Flow solver: incompressible steady-turbulent flow, RANS k ǫ model; coarse mesh: 40 000 cells; 87 evaluations of objective with CFD restart RBF morphing: 3 control points in motion, symmetry constraints; 34 in total Objective: flow uniformity at outlet plane iter = 0 pos = (0.9 0.1 0.1) v = 22.914 size = 0.69282 iter = 5 pos = (0.1 0.1 0.1) v = 23.0088 size = 0.584096 iter = 61 pos = ((0.990164 0.992598 0.996147) v = 13.5433 size = 0.000957 OpenFOAM Optimization Tools p. 12

Non-gradient Based optimization Radial basis function and free form deformation are effective tools in geometrical parameterization By using the geometrical parameterization, the number of parameters is reduced from thousands to a manageable number (up to 25 parameters) Non-gradient algorithms of the simplex type are not effective when used with large number of parameters due to large deformations of the geometric simplex in parameter space and algorithms that avoid this problem must be used Gradient based optimization largely avoids these problems as it uses analytical and semi-analytical tools to compute the gradient and deduce the local behavior of the function OpenFOAM Optimization Tools p. 13

Gradient Based optimization Gradient based optimization algorithms rely on the analytical and semi-analytical tools of gradient evaluation in order to guide optimization algorithms OpenFOAM software framework allows a rapid implementation of PDE solvers If the original PDE equations are differentiated with respect to the optimization parameter, the resulting equations form a continuous approach to gradient evaluation Two approaches in analytical differentiation of PDEs and gradient evaluations: Continuous tangent equations Continuous adjoint equations OpenFOAM Optimization Tools p. 14

Continuous Analytical Gradient (1) Continuous tangent equations are obtained by performing the Getaux (Frechet) differentiation of the original PDEs In the case of the incompressible laminar Navier-Stokes equations, continuous tangent equations are as follows: u = 0 u u +u u ν u = p This system of equations describes the propagation of the derivatives from inputs to outputs in the system OpenFOAM Optimization Tools p. 15

Analytical Gradient Based optimization An example of gradient of velocity field with respect to the inlet velocity in the smaller pipe computed by continuous tangent equations: OpenFOAM Optimization Tools p. 16

Continuous Analytical Gradient (2) Continuous adjoint equations are obtained by using the duality principles on continuous tangent equation In the case of the incompressible laminar Navier-Stokes equations, continuous adjoint equations are as follows: u u (u ) u ν u u = 0 = p This system of equations describes the propagation of the derivatives from outputs to inputs in the system OpenFOAM Optimization Tools p. 17

Analytical Gradient Based optimization An example of gradient of velocity field with respect to the outlet velocity in the larger pipe computed by continuous adjoint equations: OpenFOAM Optimization Tools p. 18

Discrete Analytical Gradient Approaches in discrete analytical gradient evaluation: By hand Source code parsing Operator overloading Currently in OpenFOAM there is operator overloading approach implemented in class FadOne Consistent use of this class leads to the discrete tangent code Using the templating of the code and operator overloading, the compiler insert a general code for derivative evaluation at the compilation time Gradients computed this way are accurate to the machine precision Discrete adjoint gradient evaluation is also possible based on this approach OpenFOAM Optimization Tools p. 19

Semi-Analytical Gradient The structure of the computational code can be reused in the so called semi-analytical approach to efficiently evaluate gradients This approach is similar in structure to discrete adjoint and tangent equations as the discrete structure of the code is re-used Derivatives are evaluated by adding a different forcing term to the right hand side of the discrete (implicit or explicit) system This approach is consistent with the original system of equations if exact gradients are used in the Newton linearization In OpenFOAM an implementation is possible by making minimal changes to the top level code OpenFOAM Optimization Tools p. 20

Topology Optimisation An example of a topology optimisation using porous media approach to block the flow and continuous adjoint equation for sensitivity: OpenFOAM Optimization Tools p. 21

Summary OpenFOAM is ideal for integration into an external optimisation loop No license cost Text file controlled Integrated Pre- and Post-processing Command-line driven workflows OpenFOAM software framework is ideal for advanced techniques (e.g. gradient based algorithms) due to existence of the necessary infrastructure for implementation of PDEs and algorithms Many tools for optimization already exist in OpenFOAM The best algorithm depends on the exact problem as well as the client s infrastructure and established workflows OpenFOAM Optimization Tools p. 22