22
Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011. Turbo Tools and General Grid Interface Theoretical Basis and Implementation Hrvoje Jasak, Wikki United Kingdom and Germany Turbo Tools and General Grid Interface – p. 1

Hrvoje Jasak, Wikki United Kingdom and Germany · Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011. Turbo Tools and General Grid Interface Theoretical Basis and Implementation

  • Upload
    dinhthu

  • View
    223

  • Download
    2

Embed Size (px)

Citation preview

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Turbo Tools and General Grid InterfaceTheoretical Basis and Implementation

Hrvoje Jasak, Wikki

United Kingdom and Germany

Turbo Tools and General Grid Interface – p. 1

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

General Grid Interface

Objective

• Present the working of single and multiple rotating frames of reference solvers

• Review implementation of the General Grid Interface (GGI) in OpenFOAM and itsuse in turbomachinery applications

Topics

• Rotating frames of reference

• Handling of rotor-stator interfaces

• General Grid Interface: design rationale

• Numerical considerations: discretising GGI interface

• GGI interpolation and weight calculation

• Derived forms: cyclic GGI partial overlap GGI, mixing plane

• Code components

• Parallelisation of GGI interfaces

• Preparing a mesh for GGI

• Example of use

• Summary

Turbo Tools and General Grid Interface – p. 2

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Introduction

Turbomachinery CFD with OpenFOAM

• Turbomachinery CFD poses special requirements on simulation software

◦ Handling rotation of components

◦ Treatment of interfaces between rotating and stationary mesh

◦ Boundary conditions for total state variables and rotation

◦ Data extraction and post-processing for properties of interest

• Beyond turbo-tools capability, tutorials, validation examples and best practiceguidelines are valuable for new users

• Development in turbomachinery driven by Turbomachinery SIG , led by ChalmersUniversity, Hydro Quebec and Wikki

Turbo Tools and General Grid Interface – p. 3

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Rotating Reference Frames

Rotating Reference Frame

• For fast-rotating components, solution in terms of relative velocity is preferable,with effects on the convection term

u = urel + urot = urel + ω × r

Single Rotating Frame of Reference

• Solution algorithm in terms of urel is preferred, with the addition of centrifugal andCoriolis force to the momentum equation, implemented in simpleSRFFoam

• For easier specification of boundary conditions, use SRFVelocity boundarycondition◦ Specify boundary condition either in absolute or relative frame of reference,

controlled by the relative switch

◦ If relative = true, rotation shall be added to the boundary value

• SRFModel specifies the mode of rotation, currently rpm

Turbo Tools and General Grid Interface – p. 4

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Rotating Reference Frames

Multiple Rotating Components

• Model assumes steady-state simulation of a domain where some componentsare in rotation and others are stationary

• Transient effect of rotor-stator interface is lost

• In stationary regions, solve for absolute velocity u

• Choice of velocity variable in a rotating region causes complications

1. If solving for urel in rotating regions, centrifugal and Coriolis force are added,but a transformation of velocity is required at the interface

2. If solving for u, form of the momentum convection term is identical to movingmesh simulations, where all convection terms operate with relative flux∇•(urelu), with addition of Coriolis force only: this is implemented inMRFSimpleFoam

• Handling of rotating zones

◦ Addition of Coriolis force only in rotating zones

◦ Modification of face fluxes to account for (fictitious) rotation of the zone

◦ External boundary of the rotating cell zone must be a surface of rotation ,otherwise the fluxes after correction for rotation will not be conservative

• Code supports multiple rotating regions, using MRFZones class

Turbo Tools and General Grid Interface – p. 5

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Rotor-Stator Interfaces

Handling of Rotor-Stator Interfaces

• In simple SRF/MRF cases, a steady simulation is assumed and effect orrotor-stator interface is (almost) completely lost

• . . . but transient behaviour is sometimes of a primary interest

• Further complications arise from non-matching number of blade passagesbetween consecutive rotor and stators stages: no easy symmetry conditions

• Number of options are used regularly

◦ Frozen rotor : do nothing. Simulate fixed relative position of rotor and stator

◦ Full transient simulation with sliding mesh

◦ Options on multiple rotor-stator pairs with circumferential scaling

◦ Mixing plane: circumferential averaging on the interface

• All of the above require special handling in a CFD code

Turbo Tools and General Grid Interface – p. 6

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Background on GGI

Handling Sliding Mesh Interfaces

• Turbomachinery applications typically involve components in relative motion: needto handle a set of separate regions as one contiguous mesh

• Components move relative to each other, but at each time instance create a singlecontiguous region: “attaching and detaching” the mesh during simulation

• This is a subset of topological mesh changes , already implemented inOpenFOAM: do we need anything further?

• Unfortunately, topological changes do not satisfy all our needs

Turbo Tools and General Grid Interface – p. 7

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Sliding Interface

Topological Mesh Changes: Sliding Interface

• Sliding interface topology modifier

◦ Defined by a master and slave surfaces

◦ As surfaces move relative to each other, perform mesh cutting operations andreplace original faces with facets

◦ Re-assemble mesh connectivity on all cells and faces touching the slidingsurface: fully connected 3-D mesh

• Polyhedral mesh support in OpenFOAM facilitates topological changes

• Once the mesh is complete, there is no further impact in the code!

• Connectivity across interface changes with relative motion

rotor side

stator side

rotor side

stator side

������������������������������������������������������

������������������������������������������������������

������

������

������

������

������������������������������������

������������������������������������

Turbo Tools and General Grid Interface – p. 8

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

GGI Design Rationale

GGI Interface in Turbomachinery

• Apart from “fully overlapped” cases, turbomachinery meshes contain similarfeatures that should employ identical methodology, but are not quite the same

◦ Non-matching cyclics for a single rotor passage

◦ Partial overlap for different rotor-stator pitch

◦ Mixing plane : perform averaging instead of coupling directly

• Component coupling requires data manipulation (copy, transform, average)

• In such cases, the behaviour is closer to a coupled boundary condition , but thenumerics is similar to sliding interface

• Objective: mimic behaviour of sliding interface without ch anging the mesh

Turbo Tools and General Grid Interface – p. 9

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

GGI Discretisation

FVM Discretisation on a GGI Interface

• Review discretisation of convection and diffusion when faces are replaced;volumetric integral terms are not affected

• Convection operator splits into a sum of face flux integrals

Z

V

∇•(φu) dV =

I

S

φ(n•u)dS =X

f

φf (sf •uf ) =X

f

φf F

where φf is the face value of φ and F = sf •uf is the face flux

• Diffusion operator captures the gradient transport

I

S

γ(n•∇φ)dS =X

f

Z

Sf

γ(n•∇φ) dS =X

f

γf sf •(∇φ)f

• Face terms: interpolated value and face gradient

φf = fxφP + (1 − fx)φN , sf •(∇φ)f = |sf |φN − φP

|df |

Turbo Tools and General Grid Interface – p. 10

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

GGI Discretisation

FVM Discretisation on a GGI Interface

• When cutting is performed, total face area is replaced by facets

• Discretisation on the interface can be rewritten as a sum of facet operations.Inverting the loop, we can is introduce shadow neighbour values φs

N values forthe in front of the face, creating the effect as if the interface is integrally matched

φsN =

X

t

wtφt

where t denotes a selection of cell/face values on the “other side”

• Consistency conditions: simple averaging is not flux-conservative

◦ Area of original face must be equal to sum of facet areas replacing it

X

t

wt = 1 for all faces on both sides

◦ If face A touches face B, perceived facet area must be the same

wA→BSA = wB→ASB

Turbo Tools and General Grid Interface – p. 11

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

GGI Interpolation

GGI Interpolation

• Role of GGI interpolation is to calculate shadow interpolation weights

• Idea 1: form a matrix equation for weights and solve: does not work (HJ)

• Idea 2: use geometrical cutting as in sliding interface and calculate weights as peroriginal definition. Also provides the addressing

wt =Sfacet

S

GGI Intersection Algorithm

• Developed and implemented by Martin Beaudoin, Hydro Quebec

• Components

1. Quick reject in 3-D: Axis-Aligned Bounding Box2. Projection into common plane

3. Quick reject in 2-D: Separating Axis Theorem4. Point in polygon detection: Horman-Agathos algorithm5. Polygon intersection: Sutherland-Hodgman clipping algorithm

• Result: facet area, GGI addressing and weights

Turbo Tools and General Grid Interface – p. 12

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Derived Forms of GGI

Extending Basic GGI Algorithm

• GGI operates as a coupled patch field condition: interpolate shadow and update

• Cyclic GGI◦ Create transformed surface of the shadow patch and calculate weights

◦ Transform scalar/vector/tensor data according to rank

◦ Use GGI interpolation on transformed shadow data and update as usual

• Partial Overlap GGI◦ Create transformed surface of the shadow patch by copying the geometry

multiple times to achieve full overlap and calculate weights

◦ Transform scalar/vector/tensor data according to rank and expand overnumber of copies

◦ Use GGI interpolation on transformed shadow data and update as usual

• GGI interpolation is useful beyond GGI: provides flux conservative andfunction-monotonic interpolation

◦ Conjugate heat transfer with non-matching solid-fluid boundaries

◦ Fluid-structure interaction: force-conservative interpolation

Turbo Tools and General Grid Interface – p. 13

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Mixing Plane Interface

Mixing Plane Interface

• Turbomachinery components include multiple identical channels: modelling asingle channel simplifies the simulation

• Banded circumferential averaging at rotor-stator interface allows the transientproblem, with substantial reduction in simulation cost

• Circumferential averaging introduces a one-time mixing loss, but without otheradverse effects: blade wakes and passage-to-passage variation averaged out

• Consistency in interpolation is essential for mass conservation and accuracy!

Turbo Tools and General Grid Interface – p. 14

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Mixing Plane Interface

Implementation of a Mixing Plane Interface

• Basic GGI interpolation tool already performs the correct operation◦ Area-weighted interpolation: can be done in ribbons

◦ Strict mass conservation: banded patches to achieve circumferentialaveraging in a prescribed manner

• Implementation: mixing plane = two GGI interfaces used back-to-back

• (The more we work on this, the easier it becomes: no interpolation bias)

• Mixing plane work by Martin Beaudoin, Hydro Quebec

Turbo Tools and General Grid Interface – p. 15

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

GGI Code Components

Implementation of GGI in OpenFOAM

• Interpolation and geometry◦ Basic algorithms: Horman-Agathos, Sutherland-Hodgman

◦ Templated GGI interpolation, abstracting patch type

◦ Instantiated interpolation for stand-alone patch and polyPatch

• GGI patch and discretisation (identical for cyclic GGI and partial overlap)◦ Mesh patch with interpolation: ggiPolyPatch, ggiPointPatch◦ Matrix support: ggiLduInterface, ggiLduInterfaceField

◦ Coupled FV patch with discretisation support ggiFvPatch andggiFvPatchField: constrained patch

◦ Special support for AMG coarsening, to be done consistently on all levels:processorGAMGInterface and processorGAMGInterfaceField

Turbo Tools and General Grid Interface – p. 16

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Parallelisation of GGI

Parallelisation of GGI

• In parallel, sliding GGI changes processor-to-processor connectivity

• Trouble in weights calculation and in scheduling of processor-to-processorcommunications: dangerous or inefficient

• Solution: Global sync of GGI data◦ Complete sliding surface must be present on all CPUs: decomposition

◦ In each evaluation, gather-scatter of shadow data for complete interface

◦ Evaluate GGI as usual: local patch only addresses a part of sliding surface

Turbo Tools and General Grid Interface – p. 17

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Prepare for GGI

Definition of a GGI Patch and Field

• Build the mesh in the usual way, with disconnected components

• Prepare face zone for master and slave surface

wooster*685-> setSetfaceSet insideZone new patchToFace insideSliderfaceSet outsideZone new patchToFace outsideSliderquit

wooster*685-> setsToZones -noFlipMap

• Boundary file definition: constant/polyMesh/boundary

insideSlider outsideSlider{ {

type ggi; type ggi;nFaces 36; nFaces 36;startFace 1192; startFace 1228;shadowPatch outsideSlider; shadowPatch insideSlider;zone insideZone; zone outsideZone;bridgeOverlap false; bridgeOverlap false;

} }

Turbo Tools and General Grid Interface – p. 18

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Prepare for GGI

Field Definition

• GGI is a constrained condition: forces patch field type

boundaryField{

insideSlider{

type ggi;}...

}

• Parallel decomposition: GGI patch surface must be present on all CPUs in itsentirety

• Decomposition dictionary: new entry for global face zones

globalFaceZones ( insideZone outsideZone );

• Some care is required in choice of linear equation solvers

Turbo Tools and General Grid Interface – p. 19

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Simple Examples

Simple Examples of GGI Interfaces in Use

Turbo Tools and General Grid Interface – p. 20

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Simple Examples

Capsizing Body with Topological Changes or GGI

• Full capsize of a floating body cannot be handled without topology change

• Mesh motion is decomposed into translational and rotational component

◦ External mesh performs only translational motion

◦ Rotation on capsize accommodated by a GGI interface

• Automatic motion solver handles the decomposition, based on 6-DOF solution

• Mesh inside of the sphere is preserved: boundary layer resolution

• Precise handling of GGI interface is essential: boundedness and massconservation for the VOF variable must be preserved

Turbo Tools and General Grid Interface – p. 21

Sixth OpenFOAM Workshop, Penn State University, 13-16 June 2011.

Summary

Summary

• GGI interface allows coupling of mesh components without the need fortopological mesh changes

• GGI discretisation is identical to sliding interface with mesh cutting

• Interpolation weights are calculated using polygon clipping

• Derived forms: cyclic GGI and partial overlap based on GGI interpolation

• Mixing plane implemented as a pair of back-to-back GGIs

• Parallelisation : complete GGI surface present on all CPUs. Added option ofpreserving faces in decomposition without attached cells

• Recent updates for communication scheduling and improved parallel scaling

• The code is complete, validated and ready for use

Turbo Tools and General Grid Interface – p. 22