Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 ·...

28
11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To gain some understanding of how computational fluid dynamics (CFD) can help us to better understand water resource recovery facilities using an open source tool.

Transcript of Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 ·...

Page 1: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

1

Randal W. Samstag, MS, PE, BCEE

Civil and Sanitary Engineer

Bainbridge Island, WA US

To gain some understanding ofhow computational fluiddynamics (CFD) can help us tobetter understand waterresource recovery facilitiesusing an open source tool.

Page 2: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

2

“If we know what is happening within the vessel, then we are able topredict the behavior of the vessel as a reactor. Though fine in principle,the attendant complexities make it impractical to use this approach.” –Octave Levenspiel (1972)

Computational fluid dynamics (CFD) changes this picture. UsingCFD, we can compute three-dimensional velocity fields and followinteractions of reactants and products through a tank. We can usethis information to optimize tank geometry and to improve designsand operation.

TIME TOPIC INSTRUCTOR AND AFFILIATION

8:30 to 9:15 Welcome and Introduction to CFD forWRRF

Randal Samstag, Civil and SanitaryEngineer

9:15 to 10:00 Good Modeling Practice for CFD Edward Wicklein, Carollo Engineers

10:00 to 10:30 Break

10:30 to 12:00 Introduction to CFD using Open FOAM Nelson Marques, blueCAPE

12:00 to 1:30 Lunch

1:30 to 3:00 Getting Started with OpenFOAM:Example Case (Parshall flume) - Setup,Meshing, Pre Processing, Simulation andPost Processing

Nelson Marques, blueCAPE

3:00 to 3:30 Break

3:30 to 4:00 CFD for flow splitting Edward Wicklein, Carollo Engineers

4:00 to 5:00 OpenFOAM case: Flow Splitting Nelson Marques, blueCAPE

Page 3: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

3

TIME TOPIC INSTRUCTOR AND AFFILIATION8:30 to 9:00 Welcome and Brief Introduction to CFD for

WRRF and installation of software forparticipants who could not attend Day One

Randal Samstag, Civil and Sanitary EngineerNelson Marques, blueCAPE

9:00 to 9:30 CFD for mixing Edward Wicklein, Carollo EngineersStephen Saunders, IBIS Group CFD

9:30 to 10:00 OpenFOAM case study: Mixing Nelson Marques, blueCAPE

10:00 to 10:30 Break10:30 to 11:00 CFD for Sedimentation: Calibration Modeling

and VerificationAlonso Griborio, Hazen and Sawyer

11:00 to 12:00 OpenFOAM case study: Sedimentation Nelson Marques, blueCAPE

12:00 to 1:30 Lunch

1:30 to 2:00 CFD of Disinfection Facilities Edward Wicklein and Stephen Saunders2:00 to 3:00 OpenFOAM case study: Ultraviolet

DisinfectionNelson Marques, blueCAPE

3:00 to 3:30 Break3:30 to 4:45 OpenFOAM advanced topics: Making your

own casesNelson Marques, blueCAPE

4:45 to 5:00 Wrap-up and Adjourn Randal Samstag, Civil and Sanitary Engineer

• IWA CFD Working Group“The WG intends to solve shortcomings arising from lack of knowledge of CFDin the water and wastewater community in the short term by producing papersand books as well as hands-on training for the IWA MIA members (and beyond).Furthermore, a book dedicated for training new people in thewater/wastewater field will be produced.”

Page 4: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

4

• Published Papers• Good Modelling Practice in Applying Computational Fluid Dynamics for WWTP Modelling, WEFTEC 2012• A protocol for the use of computational fluid dynamics as a supportive tool for wastewater treatment

plant modelling, WST• Computational Fluid Dynamics: an important modelling tool for the water sector, IWC Conference• Good Modelling Practice in Applying Computational Fluid Dynamics for WWTP Modelling, WST (2016)• CFD for Wastewater: An Overview, WST (2016)

• Workshops• WEFTEC 2012 (Fluent)• WWTMod 2012• Watermatex 2015 (OpenFOAM)• WEFTEC 2016 (Flow-3D)• WEFTEC 2017 (OpenFOAM)

• Book Projects• IWA Scientific and Technical Report• CFD for Water Book for Students and Practitioners

Page 5: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

5

Web: http://rsamstag.com/

Phone: +1 (206) 851-0094

Email: [email protected]

Page 6: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

6

Randal W. Samstag, MS, PE, BCEE

Civil and Sanitary Engineer

Bainbridge Island, WA US

• What is CFD?

• How is it done?

• What is it good for?

• Conclusions

Page 7: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

7

What is CFD (computational fluid dynamics)?

“ . . . flows and related phenomena can be described by partialdifferential equations, which cannot be solved analytically except inspecial cases. To obtain an approximate solution numerically, we have touse a discretization method which approximates the differentialequations by a system of algebraic equations, which can then be solvedon the computer.” - Ferziger and Peric (2002) Computational Techniquesfor Fluid Dynamics, 3rd Edition, Springer.

“Computational fluid dynamics, then, is a separate discipline, distinctfrom and supplementing both experimental and theoretical fluiddynamics, with its own techniques, its own difficulties, and its ownrealm of utility, offering new perspectives in the study of physicalprocesses.” - Roach, P.J. (1982) Computational Fluid Dynamics, HermosaPublishers.

• Navier-Stokes Equations

• Generalized Transport Equation

• Turbulence• Reynolds Averaging

• Prandtl mixing length model• k-epsilon model

• Large Eddy Simulation

• Discretization• Finite Difference• Finite Element• Finite Volume• Gridless Methods

Page 8: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

8

• Solution techniques• Vorticity / stream function method

• SIMPLE algorithm

• Using 3D transport models for solids transport

• Volume of Fluid Method for open water surface modelling

• Using 3D transport for biokinetics

• Multi-phase models for water and air

• Drift flux model for sedimentation

Wicklein et al. (2016) Good modellingpractice in applying computational fluiddynamics for WWTP modelling,WST, 73 (5) 969-982.

Page 9: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

9

Wicklein et al. (2016)

Wicklein et al. (2016)

Page 10: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

10

Wicklein et al. (2016)

Wicklein et al. (2016)

Page 11: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

11

• Hand Coded• Fortran• C++

• Commercial platforms (Examples)• ANSYS (Fluent and CFX)• Cd-adapco (STAR-CCM+ and STAR-CD)• FLOW Science (FLOW-3D)• COMSOL Multiphysics• CHAM (PHOENICS)

• Open source platforms• OpenFOAM

Page 12: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

12

Page 13: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

13

What can be done with CFD?Wastewater Treatment Examples

Samstag et al. (2016) CFD for Wastewater: An Overview, Water Science and Technology, 74 (3), 549–563.

Page 14: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

14

• Parshall Flume (Day 1)

• Splitter Box (Day 1)

• Mixing Tank (Day 2)

• Clarifier (Day 2)

• UV Disinfection (Day 2)

Page 15: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

15

• Optimize tank geometry• Evaluation of the impacts of reactor geometry on performance

• Evaluation of location for control sensors

• Improve flow and solids splitting in distribution channels

• Evaluate the impacts of mixing on performance

• Verify simpler models

• Improve basic understanding of process behavior

Page 16: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

16

Web: http://rsamstag.com/

Phone: +1 (206) 851-0094

Email: [email protected]

Page 17: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

17

CFD Solves the Navier-Stokes Equations by numerical schemes.

• Continuity Equation: Law of MassConservation

• Momentum Equations: Newton’s SecondLaw (incompressible laminar flow)

0

i

i

x

U

t

ii

ij

ij

i Fx

U

x

P

x

UU

t

U

j

2

21

r

ri

ij

i

irj

ij

i gxx

U

x

P

x

UU

t

U

)(1 2

Unsteady Term

Advective TermPressure Term

Diffusion TermSource Term(gravity force)

Page 18: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

18

S

xxxU

t jii

i

2

Advection DiffusionUnsteady Source

What about turbulence? One way to model it is to usethe Reynolds Averaged Navier-Stokes Equations (RANS).

• All flow in WRRF is turbulent.

• Turbulent flow is variable inspace and time

• Osborne Reynolds suggestedthat turbulent flow could beconsidered as a composite of anaverage part and a fluctuatingpart.

See Henze, J. O. (1975) Turbulence, 2nd Ed, McGraw-Hill.

Page 19: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

19

r

riji

j

i

jij

ij

i guux

U

xx

P

x

UU

t

U

1

Suxxx

Ut

i

ijj

j

Rodi (1980) Turbulence Models and Their Application in Hydraulics: A state-of-the art review, IAHR / AIRH.

Rodi (1980) Turbulence Models and Their Application in Hydraulics: A state-of-the art review, IAHR / AIRH.

Page 20: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

20

• Simplest model: Prandtl’s Mixing Length Hypothesis (Plane mixing layer,width δ)

• Two Equation Models: k – epsilon

y

ul mt

2

G

it

ti

P

j

i

i

j

j

it

ik

t

ii

ix

gx

U

x

U

x

U

x

k

xx

kU

t

k

S

kCRcGP

kC

xxxU

tf

i

t

ii

i

2

231 1)(

2kCt

07.0

ml

Rodi (1980) Turbulence Models and Their Application in Hydraulics: A state-of-the art review, IAHR / AIRH.

RANS Simulation (Steady State) LES Simulation (Transient)

Page 21: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

21

• Finite difference

• Method of weighted residuals (finite element)

• Finite volume formulation

• Grid-less methods

All of these have been used in CFD for wastewater. Finite difference was the firsttechnique used. Finite element has been used for clarifier modeling. Finite volumeformulation is the most common commercial CFD software approach. Grid-lessmethods have not been much used, but may be promising.

xg

y

u

x

u

x

p

y

uv

x

u

t

u

2

2

2

22 )(

y

vuvu jijijiji

))(())(( 2/1,2/12/1,2/12/1,2/12/1,2/1

Horizontal Momentum Eqn.

t

uu nji

nji ,2/1

1,2/1

x

jijijijijjg

y

uuu

x

u

2

,2/11,2/11,2/1

2

,2/3,/21-1,/23-1 22uu

Finite Difference Equivalent

x

uu jiji2

,12,

x

pp jiji

,1,

Harlow, F.H. and Welch, J. E. (1965) Numerical Calculation of Time-Dependent ViscousIncompressible Flow of Fluid with Free Surface, Physics of Fluids, V. 8 Number 12.

Page 22: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

22

• Interpolate the velocity and pressure fields

• Substitute interpolations into the governing equations.• Continuity

• X/Y momentum

• Solve the system of equations iteratively

nuul

ull , nvv

l

vll , npp

l

pll ,

Fletcher, C.A.J (2006) Computational Techniques for Fluid Dynamics, Volume II, 2nd Ed. Springer-Verlag.

pj,k

uj,kuj-1,k

v,j,k-1

vj,k

Continuity Eqn.

pj,kuj-1,k

vj+1,k-1

x Momentum Eqn.

pj+1,k

uj+1,kuj,k

vj,k

vj,k-1

vi+1,k+1

pj,k+1

uj-1,k

vj+1,k

y Momentum Eqn.

pi,k

uj+1,k

vj,k

vj,k+1

Vj,k-1

uj,k

uj,k+1uj-1,k+1

Patankar, S. V. (1980) Numerical Heat Transfer and Fluid Flow, Hemisphere Publishing.

Vi-1,k

Page 23: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

23

• Vortex Methods• Developed by Chorin

• Random walk of “vortex blobs”

• SPH• “Lagrangian” method developed

from astrophysics

PEREIRA, L. A. A.; HIRATA, M. H. and SILVEIRA NETO, A.. Vortex methodwith turbulence sub-grid scale modelling. J. Braz. Soc. Mech. Sci. & Eng.[online]. 2003, vol.25, n.2 [cited 2015-05-01], pp. 140-146 .

• Transform the governing equations:• Vorticity / stream function method

• Use iteration and convergence• SIMPLE

Both of these methods have been used in CFD for wastewater.

Page 24: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

24

x

v

y

u

Definition of Vorticity

yu

xv

Vorticity Transport Eqn.

Definition of Stream Function

2

2

2

2

yxPoisson Eqn. for Stream Function

Roach, P.J. (1982) Computational Fluid Dynamics, Hermosa Publishers.

0Re

1)()(2

2

2

2

yxy

v

x

v

t

• Guess the pressure field

• Solve the momentum equations

• Solve pressure correction

• Calculate velocities

• Solve for other properties(temperature, solids)

• Update the pressure field anditerate to convergence

Patankar, S. V., (1980) Numerical Heat Transfer and Fluid Flow.

Page 25: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

25

3D transport models can be coupled to the velocitycalculations to simulate sedimentation and mixing.

• Solids Transport

• Vesilind settling

• Density couple

kCos eVV

s

ww c

1

k

s

is

t

ii

i

x

CV

x

C

xx

Cu

t

C

Samstag, et al. (1992)

Continuity Equation:

Fluid Marker Equation:

Momentum Equations:

2

2

2

2

2

2

2

2

1

1

y

v

x

v

y

p

y

vv

x

vu

t

v

y

u

x

u

x

p

y

uv

x

uu

t

u

0

y

Fv

x

Fu

t

F F=1 if fluid is presentF=0 if fluid is not present

Hirt and Nichols (1981) , Volume of Fluid Method, Los Alamos Scientific Laboratory, Los Alamos, NM.

0

y

v

x

u

t

u

Page 26: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

26

• An elementary tutorial inOpenFOAM is based on VOFmethod using the interFoamsolver.

• The famous dam break problemwas simulated first using theMAC method by Harlow andWelsh.

• This simulation using a RANSturbulence approach.

3D transport models can be implemented for wastewaterquality parameters as well.

Biokinetic Models• ASM Models

• Advanced oxidation Models

• Disinfection models

Sobremisana, Ducoste and de los Reyes III (2011)

Page 27: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

27

0)(

id

d vtt

0)(

ic

c vtt

idiiV

i

djid

j

id Tvux

pvv

xv

t,)()()(

iciiV

i

cjic

j

ic Tvux

pvv

xv

t,)()()(

Crowe, Sommerfield, and Tusji (1998) Multiphase Flows with Droplets and Particles.

Mixture Continuity Equation

Drift Equation

Mixture Momentum Equation

Brennan, D. (2001) The Numerical Simulation of Two-Phase Flows in Settling Tanks, PhD Dissertation,University of London.

Page 28: Civil and Sanitary Engineer Bainbridge Island, WA US · PDF file02.06.2015 · 11/11/2017 1 Randal W. Samstag, MS, PE, BCEE Civil and Sanitary Engineer Bainbridge Island, WA US To

11/11/2017

28

• Ferziger, J.H. and Peric, M. (2002) Computational Techniques for Fluid Dynamics, 3rd Edition, Springer.

• Roach, P.J. (1982) Computational Fluid Dynamics, Hermosa Publishers. rt and Nichols (1981) , Volume of Fluid Method, Los Alamos Scientific Laboratory, LosAlamos, NM.

• Henze, J.O. (1975) Turbulence, 2nd Ed, McGraw-Hill

• Rodi (1980) Turbulence Models and Their Application in Hydraulics: A state-of-the art review, IAHR / AIRH.

• Harlow, F.H. and Welch, J.E. (1965) Numerical Calculation of Time-Dependent Viscous Incompressible Flow of Fluid with Free Surface, Physics of Fluids, V. 8 Number12.

• Finlayson, B. (1980) Nonlinear Analysis in Chemical Engineering, McGraw-Hill.

• Patankar, S. V. (1980) Numerical Heat Transfer and Fluid Flow, Hemisphere Publishing.

• Chorin, A.J. (1989) Computational Fluid Mechanics, Academic Press.

• Samstag, R.W., McCorquodale, J.A. and Zhou, S.P. (1992) Prospects for transport modeling of process tanks, Water Science and Technology. 26 (5/6), 1401-1410.

• Hirt and Nichols (1981) , Volume of Fluid Method, Los Alamos Scientific Laboratory, Los Alamos, NM.

• Sobremisana, Ducoste, and de los Reyes III 2011 Combining CFD, floc dynamics, and biological reaction kinetics to model carbon and nitrogen removal in anactivated sludge system. Water Environment Conference, WEFTEC Conference.

• Crowe, Sommerfield, and Tusji (1998) Multiphase Flows with Droplets and Particles.

• Wicklein, E., Batstone, D.J., Ducoste, J., Laurent, J., Griborio, A., Wicks, J., Saunders, S., Samstag, R., Potier, O. and Nopens, I. 2016 Good modelling practice inapplying computational fluid dynamics for WWTP modelling. Water Science and Technology. 73 (5) 969-982.

• R. W. Samstag, J. J. Ducoste, A. Griborio, I. Nopens, D. J. Batstone, J. D. Wicks, S. Saunders, E. A. Wicklein, G. Kenny and J. Lauren (2016) CFD for Wastewater: AnOverview, Water Science and Technology, 74 (3), 549–563.