mechanical and industrial engineering umassamherst blair perot mike martell chris zusi department of...

19
chanical and Industrial Engineering UMassAmhers t Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation of the Oriented-Eddy Collision Turbulence Model in OpenFoam Theoretical & Computational Fluid Dynamics Laboratory First Dutch OpenFOAM Day Nov 4 th , 2010

Upload: alicia-carr

Post on 16-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

Mechanical and Industrial Engineering

UMassAmherst

Blair PerotMike Martell

Chris Zusi

Department of Mechanical and Industrial Engineering

Implementation of the Oriented-Eddy Collision

TurbulenceModel in OpenFoam

Theoretical & Computational Fluid Dynamics Laboratory

First Dutch OpenFOAM Day Nov 4th, 2010

Page 2: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

2

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Goal: Develop a New Turbulence Model

Navy Requirements Easy for others to test. Easy for others to adopt. Easy to test real world applications.

Our Requirements Solve coupled tensor PDE’s. Mixed BCs. Handle arbitrary numbers of equations.

Page 3: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

3

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Advantages over commercial code• Free, open source, parallel• Users can inspect, alter, expand on the source

code. Advantages over in house code development• Many numerical methods, operators, utilities

already implemented and tested

Large, user-driven support community• Interact with other OpenFOAM users.• Get help from CFD experts.

Why OpenFoam?

Page 4: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

4

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Advantages over commercial code• Free, open source, parallel• Users can inspect, alter, expand on the source

code. Advantages over in house code development• Many numerical methods, operators, utilities

already implemented and tested

Large, user-driven support community• Interact with other OpenFOAM users.• Get help from CFD experts.

Why OpenFoam?

Page 5: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

5

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Advantages over commercial code• Free, open source, parallel• Users can inspect, alter, expand on the source

code. Advantages over in house code development• Many numerical methods, operators, utilities

already implemented and tested

Large, user-driven support community• Interact with other OpenFOAM users.• Get help from CFD experts.

Why OpenFoam?

Page 6: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

6

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Prior Experience:

In House Codes UNS3D: Moving unstructured staggered mesh code for two-phase incompressible flows Stag++: Cartesian staggered mesh for DNS/LES of incompressible turbulence.

Fluent User defined subroutines for RANS modeling.

OpenFoam Wind turbine blade simulation. Rotating imbedded mesh.

Page 7: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

7

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Wind Turbine Calculations with OpenFoam

Spin indicator = second invariant of the strain tensor

Runs on 8-16 CPUs No major issues

Page 8: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

8

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Eddy Collision Model Overview

Pouring Spherical objects results in

RANS eqns.

Assumption:Turbulent Flow = Flow of a Colloidal suspension of disk-like spinning objects.

Pouring a concentrated Disk suspension results

in OEC model

Page 9: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

9

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Review of OEC Model Properties

Cost roughly about 10x k/e.

Four model constants.

Realizable, Material Frame Indifferent, Galilean Invariant, Exact in linear limit, etc.

Log(Cost )

Log(Physics )

10.1

1

100

10

10 1000.1

LES

RANS

OEC

Page 10: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

10

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

PDE Formulation

• Global Variables (sum many eddies – 20-50)

1ij ijNR R 2 21

2 /T ii iiR R q

2, , ,

1 1 1( ) ( )3 3

ik k i i i i t i k ik

R

Dqq u q q A B q W

Dt

* * 2, , , ,2 2

, ,, ,,

,

12 2

( ) ( )( )

ij j li li k il l k kj j k jl l k ki ij

R

ij k kij ij t ij k t k t ij ijk

k

DR q qq qu u R u u R q R

q qDt

R K KA M R D K E R W

K KK

Eddy Velocity Fluctuation (tensor)

Eddy Size and Orientation (vector)

Page 11: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

11

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Open Foam Formulation

Implicit terms on the left-hand side.

Explicit terms on the right-hand side.

2, , ,

1 1 1( ) ( )3 3

ik k i i i i t i k ik

R

Dqq u q q A B q W

Dt

fvm::ddt(qiINT) - (1.0/3.0)*fvm::laplacian(dEff(), qiINT) + (1.0/3.0)*fvm::SuSp(((alpha*nu()*qsq + tauR)), qiINT) == - fvc::div(phi_, qiINT) - ( qiINT & fvc::grad(U) ) - ( Ai + Bi )

Page 12: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

12

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

First Challenge: Multiple Eddies

The Number of Eddies for each physical location is arbitrary.

10 is minimal necessary. 100 is usually very good.

998

371

236

10849

9256

16

210255

998998

373711

232366

1081084949

99256256

1616

221021025555

Rij_[eddy][cell].xx()

Pointer list with an entry for every eddy

Location in mesh

Component (11 in this

case)

Pointer lists are employed to keep track of eddies

Page 13: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

13

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Multiple Eddies: OpenFoam SolutionforAll(initOrientations_,i) { ... solveqR(i, qi_[i], ...); ... } void OEC::solveqR(int i, volVectorField qiINT, ...) { ... tmp<fvVectorMatrix> qEqn ( fvm::ddt(qiINT) = ... ); ... solve(qEqn, mesh_.solver("q")); ...}

This system allows us to write generalized functions which handle any number of eddy vectors.

The model can be implemented on a per-eddy basis.

Averaging all of the entities in a given pointer list is also easy, which is good because all we really care about is the average R, K, etc.

Page 14: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

14

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Second Challenge: Tensors

No gradient of a rank 2 (and higher) tensor

,

,

( )ijt k

k

RD K

K

… fvc::grad(R)

Solution:

Break it into vectors

forAll (mesh_.C(), cell) // internal cells { Rx[cell].x() = Rtmp[cell].xx(); Rx[cell].y() = Rtmp[cell].xy(); Rx[cell].z() = Rtmp[cell].xz();

... gradKgradR[cell].xx() = ( gradK[cell].x()*gradRx[cell].xx() + gradK[cell].y()*gradRx[cell].xy() + gradK[cell].z()*gradRx[cell].xz() ); gradKgradR[cell].yy() = ( gradK[cell].x()*gradRy[cell].yx() + gradK[cell].y()*gradRy[cell].yy() + gradK[cell].z()*gradRy[cell].yz() ); gradKgradR[cell].zz() = ( gradK[cell].x()*gradRz[cell].zx() + gradK[cell].y()*gradRz[cell].zy() + gradK[cell].z()*gradRz[cell].zz() );

Page 15: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

15

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Third Challenge: Boundary Conditions

On wall, the boundary conditions are mixed.

This is for an xz-wall.

We currently can not do walls that are not aligned with the tensor coordinate directions.

Y

wall

1

23 6108

49

Y

wall

1

23 6108

49

131112

22 23

33

1

2

3

0 0

0 0

0

0

0

ij slip wall

i wall

RRR

y y

R R R

R

y

q

qq

y

q

Page 16: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

16

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Last Challenge: Stable Time Marching

Many source terms have no fvm:: (implicit) implementation.

Some explicit source terms can be unstable with Explicit Euler time advancement.

Solution:• Write a RK3 solver.• Modify equations with explicit time derivative• Use FOAM’s .storeOldTime() to save the old

time values.

Page 17: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

17

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Last Challenge: Stable Time Marching

Many source terms have no fvm:: (implicit) implementation.

Some explicit source terms can be unstable with Explicit Euler time advancement.

Solution:• Write a RK3 solver.• Modify equations with explicit time derivative• Use FOAM’s .storeOldTime() to save the old

time values.

Page 18: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

18

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Last Observation:

Gradient of a vector

1 2

1 1

1 2

2 2

1,1 2,1 11 12,

1,2 2,2 21 22

a ax x

i j i ja ax x

a a g ga a

a a g g

Page 19: Mechanical and Industrial Engineering UMassAmherst Blair Perot Mike Martell Chris Zusi Department of Mechanical and Industrial Engineering Implementation

19

UMassAmherst

Mechanical and Industrial EngineeringTheoretical & Computational Fluid Dynamics Laboratory

Summary:

OEC is implemented in OpenFoam.