Numerics Improvements and Validation Results: FOAM-Extend Update on Work-in-Progress Hrvoje Jasak Wikki Ltd. United Kingdom Faculty of Mechanical Engineering and Naval Architecture, Uni Zagreb, Croatia 1st French OpenFOAM User Group Meeting, Rouen 18 May 2016 Numerics Improvements and Validation Results: FOAM-Extend p. 1
Outline Objective Give an update on ongoing technical developments Share some news from the neighbourhood Topics Major numerics clean-up in upcoming foam-extend-4.0 release Features and performance update for the coupled p-u solver Interface jump conditions in free surface flows: embedded interface model Decomposition method for free surface flow: relaxation zones and SWENSE Harmonic balance for turbomachinery simulations Report from NUMAP Spring 2016 Summary Numerics Improvements and Validation Results: FOAM-Extend p. 2
Clean-Up of Numerics in FOAM Numerics Clean-Up in the New Release: foam-extend Complaints about inconsistent numerics at Oct/2015 ESI User Group Meeting Dependence of the solution on time-step size and relaxation factor Noisy pressure trace in simulations with rotating interfaces (turbomachinery) Removed ddtphicorr and resolved the problem in top-level code Clear code: easy to understand More efficient in matrix assembly Fully consistent on moving and topologically changing meshes Basic numerics improvements: I have fixed icofoam and simplefoam Transient dynamic mesh simulations with topo changes: clean force/pressure trace! Compressible flow solver improvements: Henrik has fixed sonicfoam (and also coupled compressible rhopucoupledfoam) Consistent reduction to incompressible flow formulation in absence of ρ(p) compressibility Significant improvement in stability and robustness (!) Coupled p-u solver performance and better coupled implicit turbulence models Numerics Improvements and Validation Results: FOAM-Extend p. 3
Clean-Up of Numerics in FOAM Numerics Clean-Up in the New Release: Transient Solver Numerics Improvements and Validation Results: FOAM-Extend p. 4
Clean-Up of Numerics in FOAM Numerics Clean-Up in the New Release: Time-Step Dependence Numerics Improvements and Validation Results: FOAM-Extend p. 5
Performance of the Coupled p-u Solver Performance Improvements of the Coupled p-u Solver: Speed and Robustness Numerics Improvements and Validation Results: FOAM-Extend p. 6
Performance of the Coupled p-u Solver Performance Improvements of the Coupled p-u Solver: Speed and Robustness Numerics Improvements and Validation Results: FOAM-Extend p. 7
Performance of the Coupled p-u Solver Performance Improvements and Extensions in the Coupled p-u Solver Improvements in performance for the coupled solver: consistency, numerics Extension to compressible flows, MRF and porous media (implicit!) Major performance jump: block-coupled AMG with additive correction (Hutchinson 1988) Block-coupled k ǫ and k ω SST turbulence models Turbulence equations solved in a single block-coupled system Analysis of source terms to establish favourable cross-equation coupling Implemented in Diploma Thesis assignment: Robert Keser, Uni Zagreb Example: steady (MRF) and transient centrifugal pump Numerics Improvements and Validation Results: FOAM-Extend p. 8
Performance of the Coupled p-u Solver Performance Improvements and Extensions in the Coupled p-u Solver Initial Residuals 1 0.01 0.0001 Comparison between MRFcoupled and MRFsegregated initial residuals Ux_0 (coupled) Uy_0 (coupled) Uz_0 (coupled) p_0 (coupled) Ux_0 (segregated) Uy_0 (segregated) Uz_0 (segregated) p_0 (segregated) Initial Residuals Comparison between MRFcoupled and MRFsegregated turbulence initial residuals 1 0.1 0.01 0.001 0.0001 k_0 (segregated) omega_0 (segregated) k_0 (coupled) omega_0 (coupled) Head [m] 100 80 60 40 20 0-20 -40-60 -80 0 100 200 300 400 500 Iterations Comparison between MRFcoupled and MRFsegregated OtaBm1 pump head Head (segregated) Head (coupled) -100 0 100 200 300 400 500 Iterations Power [W] 1e+05 90000 80000 70000 60000 50000 40000 30000 20000 10000 Comparison between MRFcoupled and MRFsegregated OtaBm1 pump power 0 0 100 200 300 400 500 Iterations 1e-05 0 100 200 300 400 500 Iterations Power (segregated) Power (coupled) Efficiency [%] 140 120 100 80 60 40 20 Comparison between MRFcoupled and MRFsegregated OtaBm1 pump efficiency Efficiency (segregated) Efficiency (coupled) 0 0 100 200 300 400 500 Iterations Numerics Improvements and Validation Results: FOAM-Extend p. 9
Consistency Efficiency Improvements Various Efficiency and Accuracy Improvements Updated gradient caching infrastructure: steady and transient simulations Major efficiency upgrade for large GGI interfaces in parallel execution Fully parallel search and cutting (load balance on all processors) Optimised data exchange Example: large mixer simulation: 30 M cells, 155 k GGI faces, 56 cores Comms blocking non-blocking Old GGI 581.03 s 628.52 s New GGI 176.30 s 154.76 s Implemented a family of gradient limiters in a generic manner: Barth-Jespersen, Venkatakrishnan, Michalak-Gooch, Wang In progress: performance improvements for the Immersed Boundary Method In progress: block-coupled boundary coefficients in the coupled solver Further development of coupled density-based high-speed solver dbnsfoam New FSI library: Željko Tuković Consistency: Input deck compatibility with OpenFOAM-3.0.x Numerics Improvements and Validation Results: FOAM-Extend p. 10
Interface Jump Conditions Naval Hydro Pack: Interface Jump Conditions for Free Surface Flows In free surface flows, a discrete surface discontinuity exists with a sharp change in properties: ρ, ν: proper handling is needed for accurate free surface simulations Huang et.al. (2007) describe a ghost fluid single-phase formulation of interface jump conditions in CFD-Ship Iowa Extended, modified and numerically improved treatment by Vukčević and Jasak (2015) with 2-phase handling is implemented in the Naval Hydro pack Perfectly clean interface: no surface jets Pressure force evaluated exactly even for a smeared VOF interface Dramatically increased efficiency and accuracy of wave modelling dry cells, α <0.5 α =0.5 dry cell, α N <0.5 N β β + α =0.5 x Γ d f P wet cell, α P >0.5 wet cells, α >0.5 Numerics Improvements and Validation Results: FOAM-Extend p. 11
Interface Jump Conditions Interface Jump Conditions: Derivation Conditionally averaged momentum equation: (ρu) t + (ρuu) = σ eff p d (g x ρ) Looking at the RHS of the equation, the gradient of dynamic pressure ( p d ) is balanced by the density gradient ( ρ). The balance between pressure and density gradients happens in the momentum equation......which in turn causes spurious air velocities because the pressure density coupling should not be resolved in the momentum equation using a segregated solution algorithm Numerics Improvements and Validation Results: FOAM-Extend p. 12
Interface Jump Conditions Interface Jump Conditions: Derivation "Mixture formulation" of the momentum equation: u t + (uu) (ν e u) = 1 ρ p d Dynamic pressure jump conditions at the interface: [p d ] = [ρ]g x [ ] 1 ρ p d = 0 Interface jumps implemented directly in discretisation operators Interface jump condition can be used both with level set and VOF... and smearing of the surface in VOF no longer affects the pressure forces! Extension to viscous force jump can be performed but currently not used Numerics Improvements and Validation Results: FOAM-Extend p. 13
Interface Jump Conditions Interface Jump Conditions: Results Example: 2D ramp with free surface Relative error for water height at the outlet is 0.34% compared to analytical solution Note sharp p d jump and α distribution The simulation with interfoam is not stable due to spurious air velocities Numerics Improvements and Validation Results: FOAM-Extend p. 14
Interface Jump Conditions Interface Jump Conditions: Results Example: KCS sinkage and trim (Tokyo 2015 Workshop) Numerics Improvements and Validation Results: FOAM-Extend p. 15
Decomposition Models Decomposition Models: Wave Relaxation Zones and SWENSE General second-order CFD methodology brings a relatively high discretisation error: requirements on time-step and mesh size for realistic (irregular) wave propagation are high Introduction of sea states into a CFD domain typically cannot be done well using conventional boundary conditions: a better method is needed Relaxation Zone Approach Relaxation zones at edges of the domain are identified and the CFD solution fields are implicitly blended with prescribed wave fields In the bulk of the domain, conventional CFD methodology is used Domain-Wide Decomposition Approach (SWENSE) Governing equations are decomposed into the incident and diffracted (correction) component, which together make up the complete non-linear CFD solution, equivalent to solving Navier-Stokes free surface flow equations Incident fields are obtained from (complex) potential theory models CFD methodology is used to solve for the correction component Both approaches have advantages, depending on the level of non-linearity in the region of interest Numerics Improvements and Validation Results: FOAM-Extend p. 16
SWENSE Solver Decomposition Models: Wave Relaxation Zones and SWENSE Conventional VOF is not appropriate for SWENSE decomposition: the Naval Hydro pack is using alternative interface capturing techniques Implicitly redistanced level set method Phase field method Modifications in implicit field blending and numerics Result: highly accurate low-cost simulations: approx. 10 times faster than conventional CFD methodology; sea-keeping approx. 100 times faster y ψ(y) = y φ(ψ) =tanh ( ψ ǫ 2 ) α(ψ) =0.5(sgn(ψ) +1) Ω 2 air Γ (0) ( 1) ( +1) (0) ( +1) x,(ψ,φ,α) water Ω 1 Numerics Improvements and Validation Results: FOAM-Extend p. 17
SWENSE Solver Naval Hydro Pack: Tokyo 2015 Validation Detailed validation and verification (mesh uncertainty, periodic uncertainty) Steady resistance, KCS hull: Case 2.1 Added resistance in head waves, 5 heights: Case 2.10 Added resistance in oblique waves: 5 wave directions: Case 2.11 Numerics Improvements and Validation Results: FOAM-Extend p. 18
Harmonic Balance Solver Harmonic Balance Method: Work-Flow Variables are developed into Fourier series in time with n-harmonics and substituted into transport equation Transport equation with n sine and n cosine parts + mean part is obtained and written as a set of 2n+1 equations in frequency domain Equations are transformed back to time domain in order to be able to use time-domain boundary conditions and time-domain non-linear flow solver Harmonic Balance in FOAM-Extend Harmonic balance decomposition does not relate to a special physics model: implement HB as a choice of temporal discretisation scheme Geometric aspects of harmonic balance can be tackled without change Currently, HB is implemented in a segregated mode: low memory, and explicit inter-mode coupling terms. Analysis shows issues for HB without a dominant mean flow component: working towards coupled implicit HB solver Author: Gregor Cvijetić, Uni Zagreb Numerics Improvements and Validation Results: FOAM-Extend p. 19
Harmonic Balance Solver Rapid Simulation of Non-Linear Periodic Flow: Harmonic Balance A variable is presented by a Fourier series, using first n harmonics and the mean: replacing a transient simulation with a set of coupled steady-state problems Periodicity is independently developed in each computational point Non-linear interaction is captured without simplification Example: Harmonic Balance scalar equation set (uq tj ) (γ Q tj ) = 2ω 2n+1 ( 2n i=1 P (i j) Q ti ) P i = n ksin(kωi t), k=1 for i = {1,2n}. A transient equation is replaced by a set of n coupled quasi-steady coupled equations of the same type Physical justification: if a functional form of temporal variation is known, the function and its time derivative can be reproduced from a small number of data points by fitting a prescribed harmonic function (spectral time accuracy!) Numerics Improvements and Validation Results: FOAM-Extend p. 20
Harmonic Balance Solver Harmonic Balance for Navier-Stokes Equations Harmonic balance momentum equation (u tj u tj ) (γ u tj ) = 2ω 2n+1 ( 2n i=1 P (i j) u ti ) Harmonic continuity equation u tj = 0. Harmonic scalar transport (u tj Q tj ) (γ Q tj ) = 2ω 2n+1 ( 2n i=1 P (i j) Q ti ) Physical justification: each t j instance represents a single-time-step solution; time derivative terms couple solution fields to each other Numerics Improvements and Validation Results: FOAM-Extend p. 21
Harmonic Balance Solver Harmonic Balance Solver: ERCOFTAC Centrifugal Pump Validation of harmonic balance in turbulent incompressible periodic flow HB simulations performed using 1 and 2 harmonics: rotor and stator blade count Results compared against full transient simulation: excellent agreement Integral properties: typical error of 2% Local solution features: pressure on surface in time Mode and nature of flow instability Results are significantly better than expected! Substantial reduction in simulation time: Intel Core i5-3570k, 3.4 GHz computer with 16 GB memory Transient run needs approx. 50 blade passages to become quasi-periodic Transient HB, 1 h HB, 2 h Simulation time 5 hrs/rotation 52 mins 78 mins Iterations 600, dt = 5e-5 s 3000 2400 1 rotation = 0.03 s Numerics Improvements and Validation Results: FOAM-Extend p. 22
Harmonic Balance Solver Harmonic Balance Solver: ERCOFTAC Centrifugal Pump 0 0 0-200 -200-200 Pressure, Pa -400-600 -800-1000 Transient HB, 1h HB, 2h Pressure, Pa -400-600 -800-1000 Transient HB, 1h HB, 2h Pressure, Pa -400-600 -800-1000 Transient HB, 1h HB, 2h -1200-0.2-0.15-0.1-0.05 0 x-axis -1200-0.15-0.1-0.05 0 0.05 x-axis -1200-0.15-0.1-0.05 0 0.05 x-axis Transient solver HB, 1 h error, % HB, 2 h error, % Efficiency 89.72 93.55 4.26 90.07 0.39 t = T 3 Head 81.48 83.37 2.32 83.04 1.92 Torque 0.0297 0.0305 2.65 0.0303 2.03 Efficiency 89.92 92.07 2.38 93.85 4.36 t = 2T 3 Head 81.48 83.45 2.41 83.13 2.02 Torque 0.0296 0.0304 2.64 0.0303 2.28 Efficiency 89.83 89.63 0.22 91.68 2.07 t = T Head 81.49 83.09 1.96 82.94 1.77 Torque 0.0297 0.0304 2.65 0.0303 2.28 Numerics Improvements and Validation Results: FOAM-Extend p. 23
Harmonic Balance Solver Harmonic Balance Solver: Transient and Harmonic Balance ERCOFTAC Centrifugal Pump Numerics Improvements and Validation Results: FOAM-Extend p. 24
NUMAP Spring 2016 NUMAP Spring 2016 NUMAP Spring just completed: report by Bernardas Jankauskas, Uni Exeter ESI/OpenCFD sponsoring the 2016 NUMAP Spring School: Thank You! NUMAP Summer 2016: 22/Aug 2/Sep/2016 applications just closed Numerics Improvements and Validation Results: FOAM-Extend p. 25
Upcoming Events 11th OpenFOAM Workshop 26 30/Jun/2016 Guimares, Portugal http://www.openfoamworkshop.org NUMAP-FOAM Summer School 2016 Zagreb Croatia, 22/Aug 2/Sep/2016 https://www.fsb.unizg.hr/?openfoam Summer School 2016 User Day: Naval Hydrodynamics with OpenFOAM and the Naval Hydro Pack 23 May 2016 London, England http://www.wikki.co.uk/events/navalhydroevent Numerics Improvements and Validation Results: FOAM-Extend p. 26