presentation
Transcription
presentation
OpenFOAM: Year in Review Hrvoje Jasak [email protected], [email protected] Wikki Ltd, United Kingdom Faculty of Mechanical Engineering and Naval Architecture University of Zagreb, Croatia 5th OpenFOAM Workshop, Gothenburg 21-24 June 2010 OpenFOAM: Year in Review – p. 1 Outline Topics 1. Introduction and Project Overview 2. Robustness and accuracy and scaling improvements 3. Radial Basis Function in mesh motion, morphing and shape optimisation 4. Dynamic remeshing with tetrahedral edge swapping 5. Overset grid in OpenFOAM 6. Python and SALOME interface: VulaSHAKA project 7. Deployment of OpenFOAM 8. New Features in the upcoming release 9. Summary and Outlook OpenFOAM: Year in Review – p. 2 Introduction OpenFOAM Since Montreal 2009 • A successful year for the community: further penetration into scientific research community, research laboratories and industrial CFD • Major community contributions: from new ideas to complete capability libraries ◦ Radial Basis Function ◦ Turbomachinery features and validation ◦ Naval hydrodynamics effort and Overset grid ◦ Python and SALOME integration ◦ Robustness and accuracy improvements • Next stage: integration, consolidation, validation ◦ Public test loop, nightly builds, validation cases ◦ Documentation and community portal ◦ Integrated cross-platform version ◦ Quarterly release schedule OpenFOAM: Year in Review – p. 3 Robustness, Accuracy, Scaling Robustness and Accuracy Improvements • Tetrahedral mesh solution improvement ◦ Historically, tet meshes are easier to generate, but “hex-based” CFD methodology has produced poorer results, especially for boundary layers. Improvements took approx. 6 years in Star-CD and Fluent ◦ Pointwise mesh generator: unstructured complex geometry meshes with anisotropic tetrahedral mesh extrusion in boundary layers (with optional recombination of tetrahedra) • With community effort, we got there in approx. 6 months: special discretisation Performance and Parallel Scaling Improvements • Tuning of OpenFOAM for high-end parallel machines: collaboration with Intel • Scalable Software Workshop: National Science Foundation, USA • OpenMP baseline by Sandeep Menon, UMass Amherst ◦ Basic wrapping and examples for use of OpenMP in the library ◦ Objective: provide multi-core support at linear solver, matrix and calculus and field operator level, in stages! • OpenFOAM on GPU: Work in progress (don’t look at me!) OpenFOAM: Year in Review – p. 4 Massively Parallel Scaling Scaling Test, VOF Free Surface Flow, 50m Cells (In Cooperaton with Intel) 3000 72 CPU 144 CPU 288 CPU Execution Time [s] 2500 2000 1500 1000 500 0 0 2e-07 4e-07 Simulation Time (Iteration) [s] 6e-07 8e-07 Intel Xeon Processor: X5650 B0; Frequency: 2.93 GHz # processors 2; # cores 6; Cache (L1 KB/L2 MB/L3 MB): 32 KB / 256 KB / 12 MB; 6x4GB DDR3 1333 RDIMM QDR InfiniBand 4x Intel and the Intel logo are trademarks or registered trademarks od Intel Corporation or its subsidiaries in the United States and other countries OpenFOAM: Year in Review – p. 5 Radial Basis Function Radial Basis Function Interpolation • RBF interpolation defines the interpolation directly from the sufficient smoothness criterion on the interpolation (positive weighting factors): s(x) = Nb X γj φ(|x − xb,j |) + q(x) j=1 where ◦ x is the interpolant location ◦ xb is the set of Nb locations carrying the data ◦ φ(x) is the basis function, dependent on point distance ◦ q(x) is the (usually linear) polynomial function, depending on choice of basis function and γj , eg. q = b0 + b1 x + b2 y + b3 z • Consistency of interpolation is achieved by requiring that all polynomials of the order lower than q disappear at data points Nb X γj p(xb,j ) = 0 j=1 OpenFOAM: Year in Review – p. 6 Radial Basis Function RBF Interpolation Procedure 1. Establish locations of data-carrying points xb 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 ◦ PhD project by dr. Frank Bos, TU Delft ◦ Basic implementation of RBF in OpenFOAM ◦ Automatic selection of control points with coarsening + extinguishing function for far-field motion control: reduce number of control points ◦ RBF interpolation to calculate mesh motion (+ parallelisation) ◦ Implemented as an option in dynamic mesh motion • RBF mesh morpher in geometric shape optimisation ◦ Morphing points control change of shape as data carriers ◦ Small number of degrees of freedom: ideal for parametrisation ◦ Mesh quality in deformation guaranteed by properties of RBF OpenFOAM: Year in Review – p. 7 Radial Basis Function Radial Basis Function in 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: Year in Review – p. 8 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: (d0 , d1 ) 4. Set of scalar parameters δ for control points, defining current motion as d(δ) = d0 + δ(d1 − d0 ), 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: Year in Review – p. 9 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: Year in Review – p. 10 Shape Optimisation Shape Optimisation Background • Specify a desired object of optimisation and use the parametrisation of geometry to explore the allowed solution space in order to find the minimum of the optimisation objective objective = f (shape) 1. Parametrisation of Geometry • Computational geometry is complex and usually available as the computational mesh: a large amount of data • Parametrisation tool: RBF mesh morphing, defining deformation at a small number of mesh-independent points in space 2. CFD Flow Solver is used to provide the flow solution on the current geometry, in preparation for objective evaluation 3. Evaluation of Objective: usually a derived property of the flow solution 4. Optimiser Algorithm: explores the solution space by providing sets of shape coordinates and receiving the value of objective. The search algorithm iteratively limits the space of solutions in search of a minimum value of objective OpenFOAM: Year in Review – p. 11 Shape Optimisation 2-D Wedge: Minimise X-Component of Force • Using 4 moving control points along the height, with independent motion parameters in optimisation Point ( 0 0.25 ±0.1) ( 0.5 0.75 ±0.1) ( 1 1.25 ±0.1) ( 1.5 1.75 ±0.1) Motion range (( 0.45 0 0) ( -0.45 0 0)) (( 0.25 0 0) ( -0.25 0 0)) (( 0.25 0 0) ( -0.25 0 0)) (( 0.25 0 0) ( -0.25 0 0)) • Motion in all points is parallel to surface to preserve height and ground clearance iter iter iter iter = = = = 1 pos = (0.2 0.2 0.7) v = 2296.61 6 pos = (0.4792 0.1746 0.995) v = 24 pos = (0.9554 0.01677 0.977) v 36 pos = (0.9322 0.00383 0.993) v size = 0.3321 2125.69 size = 0.2915 = 2079.52 size = 0.05354 = 2071.47 size = 0.00980 OpenFOAM: Year in Review – p. 12 Shape Optimisation 3-D Sphere: Minimising Drag Force • Using 9 control points in motion, with symmetry constraints: 4 points in front square, radial motion; 4 points in back square, radial and axial motion; 1 tail point, axial motion only • Optimisation is performed with 3 parameters: iter iter iter iter = = = = 1 pos = (0.2 0.7 0.2) v = 147.96 size = 0.2997 5 pos = (0.06111 0.7092 0.7092) v = 106.26 size = 0.2153 12 pos = (0.03727 0.9354 0.3830) v = 77.934 size = 0.0793 22 pos = (0.04095 0.9458 0.3413) v = 75.821 size = 0.006610 OpenFOAM: Year in Review – p. 13 Tetrahedral Edge Swapping Re-Meshing with Tetrahedral Edge Swapping • In cases where mesh motion involves topological change at the boundary or unpredictable mesh deformation, topological change machinery is impractical: cannot decide a-priori where to place topology modifiers • Dynamic remeshing using tetrahedral edge swapping ◦ Motion is prescribed on external boundaries ◦ Tetrahedral cell quality examined continuously: bad cells trigger automatic remeshing without user interaction: answers to dynamicMesh interface ◦ Implemented by Sandeep Menon, UMass Amherst as a ready-to-use library • Example: viscoelastic droplet collision using free surface tracking • Can be used for all dynamic mesh cases: ultimate ease of mesh setup! OpenFOAM: Year in Review – p. 14 Overset Grid in OpenFOAM foamedOver: Overset Grid Technology in OpenFOAM • Work by David Boger, Penn State University using SUGGAR and DirtLib libraries developed by Ralph Noack, Penn State (must mention Eric Paterson!) • Overset Grid Technology ◦ Multiple components meshed individually, with overlap ◦ Hole cutting algorithm to remove excess overlap cells ◦ Mesh-to-mesh interpolation with implicit updates built into patch field updates and linear solver out-of-core operations • Body-fitted component meshes: preserving quality and near-wall resolution • Simple mesh motion and geometrical studies (replacing individual components) • Overset grid is physics-neutral! Currently testing for free surface flows OpenFOAM: Year in Review – p. 15 VulaSHAKA Project VulaSHAKA Background and Project Road-Map: OpenFOAM/SALOME Integration • SALOME is an open source integration platform for numerical simulation ◦ Development coordinated and financed by EDF (France) ◦ Designed specifically to “host” numerical simulation software • OpenFOAM/SALOME Integration ◦ IFoam: Interactive FOAM, Python-based, explicit and implicit distributed process coupling and data translation ◦ GFoam: Stand-alone GUI, including IFoam engine ◦ SFoam: IFoam and GFoam embedded in a SALOME module OpenFOAM: Year in Review – p. 16 VulaSHAKA Project VulaSHAKA Project Snapshots • CAD generation, meshing, boundary condition setup and post-processing OpenFOAM: Year in Review – p. 17 VulaSHAKA Project VulaSHAKA Code Components • IFoam (Interactive FOAM): Interactive calculation and integration framework for OpenFOAM, provides integration to SALOME • pyFoam (sorry, Bernhard): Python front-end to OpenFOAM, supports IFoam • unv2foam: Extends OpenFOAM ideasUnvToFoam utility, introducing embedded capabilities necessary for embedding (available as C++ function) • foam2vtk: Memory based conversion of FOAM objects into VTK objects for display • foam2med: Allows translation of OpenFOAM data into MED format to enable integration with SALOME • confFoam: Common configuration package for OpenFOAM development based on automake tools • User requirements and future plans: establish international collaboration • Developer credits ◦ Ivor Clifford, (currently Penn State University), formerly PBMR ◦ Alexey Petrov, Johannes Odendaal, PBMR Pty, South Africa OpenFOAM: Year in Review – p. 18 Deployment of OpenFOAM OpenFOAM Extend Deployment and Release Schedule • Substantial community contributions and developments need a better deployment framework: help the users with new capability and share results of your work • Improvements in many directions needed: mimic operation of a software company • Community effort is the only way to address all needs: large amount of work! Major Improvements in the Pipeline 1. Unified Linux, Mac OS-X and Windows version 2. Testing and validation harness 3. Community portal and joint documentation effort 4. Quarterly release schedule OpenFOAM: Year in Review – p. 19 New Features in Upcoming Release New Features • Functional merge with OpenFOAM-1.6.x: new developments + consistent controls • Major new features ◦ Block matrix implementation with parallelisation support ◦ Re-meshing with tetrahedral edge swapping: Sandeep Menon ◦ Completion of the internal combustion engine library: Poly Milano ◦ Parallelisation work in Fluid-Structure interaction solver ◦ Python-SWIG interface to OpenFOAM and finiteVolume library: sufficient to migrate complete physics solvers into python • Running OpenFOAM without trace on disk: complete functional case generation and setup. This is a part of python interface requirement – enable full interpreted execution of OpenFOAM cases, from mesh generation to post-processing • Parallelisation of topology modifiers: parallel dynamic mesh • Accuracy improvements on tetrahedral meshes • Bug fixes and algorithmic improvements (approx 5000) • Changing software management system to git OpenFOAM: Year in Review – p. 20 New Features in Upcoming Release Native Windows Version of OpenFOAM • Major piece of work, actively supported by Microsoft: HPC platform push • No shortcuts: native compiler and operating system interface (non-POSIX) • Complete rewrite of build system: CMake: generate Visual Studio project files • New mechanism for include file handling: Michael Wild, FreeFOAM • Library symbol import-export handling: changes to all class files! • Plan: keep Windows port as a git branch to stabilise the regular release and resolve deployment and efficiency issues • The work is lost if development lines do not merge. Therefore . . . Unified Linux, Mac OS-X and Windows Version • Merging the development line and regular porting required • Binary releases for Linux, Mac and Windows; USB stick, Debian packages • Public testing and validation runs prior to release • Quarterly release schedule to minimise version-to-version jumps • I would like a Release Committee please! Can you help? OpenFOAM: Year in Review – p. 21 Summary A Year in Life of OpenFOAM • Very successful: improved capability, visibility and quality of the code • This is a community-driven project with numerous contributors: Thank You All • Presence of OpenFOAM in the numerical simulation arena is changing the way users are applying CFD simulations in industrial settings • Academic sharing of results and joint research is easier and more productive Outlook • Need to make OpenFOAM easier for entry-level users: several ongoing projects • Formalise and validate software capability: adding new features is as important as making the best possible use of existing capability • Expand the pool of expert developers: NUMAP-FOAM Summer School, Zagreb • Grow the community and user base: software lives only as long as it is used • OpenFOAM Workshop 2011: Who is Next? . . . let’s see what the future brings OpenFOAM: Year in Review – p. 22