Customization of LES turbulence model in OpenFOAM

  • View
    141

  • Download
    22

Embed Size (px)

Text of Customization of LES turbulence model in OpenFOAM

1. Customiza*onofLESturbulencemodel inOpenFOAM yotakagi77 OpenCAELocalUserGroupsinJapan @Kansai June13,2015,OsakaUniversity 2. Agenda Basicinforma*ononturbulencemodel Tensormathema*cs Exercise1:Compilingandexecu*onofWALE model Exercise2:Implementa*onofcoherent structureSmagoriskymodel Addi*onalworks 3. Basicinforma*ononturbulencemodel 4. Turbulentowsimula*on DNSLESRANS ModelingNoSubgridscaleReynoldsaverage Accuracy Cost Vortex(eddy)eldReynoldsaverage4 5. Turbulentowsimula*on DNSLESRANS ModelingNoSubgridscaleReynoldsaverage Accuracy Cost DNSgrid,uReynoldsaverage5 6. Turbulentowsimula*on DNSLESRANS ModelingNoSubgridscaleReynoldsaverage Accuracy Cost LESgrid,u=uuReynoldsaverage6 7. Turbulentowsimula*on DNSLESRANS ModelingNoSubgridscaleReynoldsaverage Accuracy Cost FilteringapproachReynoldsaverage7 8. Detached-eddysimula*on(DES) P.R.Spalart(1997): WenamethenewapproachDetached-Eddy Simula8on(DES)toemphasizeitsdis8ncttreatmentsof a?achedandseparatedregions. Super-RegionRegion Euler(ER) RANS(RR)Viscous(VR) Outer(OR) LES(LR)Viscous(VR) Focus(FR) Departure(DR) 8 Spalart(2001) 9. Detached-eddysimula*on(DES) P.R.Spalart(1997): WenamethenewapproachDetached-Eddy Simula8on(DES)toemphasizeitsdis8ncttreatmentsof a?achedandseparatedregions. Super-RegionRegion Euler(ER) RANS(RR)Viscous(VR) Outer(OR) LES(LR)Viscous(VR) Focus(FR) Departure(DR) Spalart(2001) 9 10. Couplingwithmomentumequa*on throughviscosity RANS LES U t + UU( ) + t( ) U + (U)T ( )( )= p U t + UU( ) + SGS( ) U + (U)T ( )( )= p Turbulent viscosity Sub-grid scale viscosity Onlychangeviscosity! 10 11. Signicantproblem: dierenceofltering(average)approaches LESFilteringReynoldsaverage Spa*alTemporal InconsistencyattheinterfacebetweenLESandRANSregions 11 12. StandardSGSmodelinOpenFOAM LibrarynameNote SmagorinksySmagorinskymodel Smagorinksy2Smagorinskymodelwith3-Dlter homogeneousDynSmagor insky HomogeneousdynamicSmagorinskymodel dynLagragianLagrangiantwoequa*oneddy-viscositymodel scaleSimilarityScalesimilaritymodel mixedSmagorinskyMixedSmagorinsky/scalesimilaritymodel homogeneousDynOneEqE ddy OneEqua*onEddyViscosityModelforincompressible ows laminarSimplyreturnslaminarproper*es kOmegaSSTSASk-SSTscaleadap*vesimula*on(SAS)model 13. StandardSGSmodelinOpenFOAM LibrarynameNote oneEqEddyk-equa*oneddy-viscositymodel dynOneEqEddyDynamick-equa*oneddy-viscositymodel spectEddyViscSpectraleddyviscositymodel LRDDiStressLRRdieren*alstressmodel DeardorDiStressDeardordieren*alstressmodel SpalartAllmarasSpalart-Allmarasmodel SpalartAllmarasDDESSpalart-Allmarasdelayeddetachededdysimula*on (DDES)model SpalartAllmarasIDDESSpalart-AllmarasimprovedDDES(IDDES)model vanDriestDelta Simplecube-rootofcellvolumedeltausedin incompressibleLESmodels 14. Tensormathema*cs 15. Tensor Rank0:scalar,e.g.volumeV,pressurep. Rank1:vector,e.g.velocityvectoru,surface vectorS.Descrip*on:a=ai=(a1,a2,a3). Rank2:tensor,e.g.strainratetensorSij, rota*ontensorij. Descrip*on: T = Tij = T11 T12 T13 T21 T22 T23 T31 T32 T33 ! " # # # $ % & & & 16. Symmetric/an*symmetrictensor Velocitygradienttensorisdecomposedinto strainratetensor(symmetric)andvor*city tensor(an*symmetric,skew). Inturbulencemodeling,Sijandijareusually used. Dij = ui xj , Sij = 1 2 ui xj + uj xi " # $$ % & '', ij = 1 2 ui xj uj xi " # $$ % & '' Dij = Sij +ij 17. Opera*onsexclusivetotensorsofrank2 T = 1 2 (T+ TT )+ 1 2 (T TT ) = symmT+skewT, trT = T11 +T22 +T33, diagT = (T11,T22,T33), T = T 1 3 (trT)I+ 1 3 (trT)I = devT+ hydT, detT = T11 T12 T13 T21 T22 T23 T31 T32 T33 18. OpenFOAMtensorclasses Opera2onMathema2calClass Addi*ona+ba+b Subtrac*onabab Scalarmul*plica*onsas*a Scalardivisiona/sa/s Outerproductaba*b Innerproductaba&b Doubleinnerproducta:ba&&b Crossproductaba^b Squarea2sqr(a) Magnitudesquared|a|2magSqr(a) Magnitude|a|mag(a) Poweranpow(a,n) 19. OpenFOAMtensorclasses Opera2onMathema2calClass TransposeTTT.T() DiagonaldiagTdiag(T) TracetrTtr(T) DeviatoriccomponentdevTdev(T) SymmetriccomponentsymmTsymm(T) Skew-symmetric component skewTskew(T) DeterminantdetTdet(T) CofactorscofTcof(T) InverseinvTinv(T) 20. Exercise1:Compilingandexecu*onof WALEmodel 21. Governingequa*onforincompressibleLES Filteredcon*nuityandNavier-Stokesequa*ons where ui xi = 0, ui t +uj ui xj = 1 p xi + xi (ij + 2Sij ) ij = uiuj uiuj 22. SGSeddyviscositymodel Decomposi*onofkine*cenergy Conserva*onofGSenergykGS Conserva*onofSGSenergykSGS kGS t +uj kGS xj = ijSij GS + xi uiij puj + kGS xj # $ %% & ' (( k = 1 2 ukuk = 1 2 ukuk + 1 2 (ukuk ukuk ) kGS kSGS kSGS t +uj kSGS xj = ijSij SGS + xi uiij 1 2 (uiuiuj +uj uiui ) puj puj + kSGS xj # $ % % & ' ( ( 23. Smagorinskymodel LocalequilibriumbetweenSGSproduc*on rateandSGSenergydissipa*on: Eddyviscosityapproxima*on: Aperdimensionalanalysisandscaling, SGS ui xj ui uj ui xj ui xj $ % && ' ( )) = ijSij ij a = 2vSGS Sij SGS = (CS )2 | S |, | S |= 2SijSij , CS : Smagorinskyconstant 24. WALEmodel Tracelesssymmetricpartofthesquareofthe velocitygradienttensor: EddyviscosityofWALEmodel: Sij d = 1 2 (Dij 2 + Dji 2 ) 1 3 ijDkk 2 = SikSkj +ikkj 1 3 ij SmnSmn mnmn #$ %& Sij d Sij d = 1 6 (S2 S2 +2 2 )+ 2 3 S2 2 + 2IVS, S2 = SijSij, 2 = ijij, IVS = SikSkjjlli SGS = (Cw)2 (Sij d Sij d )3/ 2 (SijSij )5/ 2 + (Sij d Sij d )5/ 4 (NicoudandDucros,1999) 25. ModelparametersofWALEmodel FieldaFieldbFieldcFielddFieldeFieldf Cw 2/Cs 210.8110.5210.8410.5510.7011.27 If CS = 0.18, 0.55 CW 0.6. If CS = 0.1, 0.32 CW 0.34. ModelparameterCwisdependentonSmagorinsky constantCS. (NicoudandDucros,1999) 26. SourcecodeofWALEmodel V&Vworkinggroup,OpenCAESocietyofJapan hsps://github.com/opencae/VandV/tree/master/ OpenFOAM/2.2.x/src/libraries/incompressibleWALE OpenFOAM-dev hsps://github.com/OpenFOAM/OpenFOAM-dev/tree/ master/src/TurbulenceModels/turbulenceModels/LES/WALE 27. Downloadandcompile $ mkdirp$FOAM_RUN $ cd $ gitclonehttps://github.com/opencae/VandV $ cdVandV/OpenFOAM/OpenFOAM-BenchmarkTest/ channelReTau110 $ cprsrc$FOAM_RUN/.. $ run $ cd../src/libraries/incompressibleWALE $ wmakelibso $ ls$FOAM_USER_LIBBIN 1. DownloadthesourcecodeofWALEmodelfromtheV&V repository,andcompiletheWALEmodellibrary. 28. Simula*onofchannelow $ run $ cpr$FOAM_TUTORIALS/incompressible/pimpleFoam/ channel395/./ReTau395WALE $ cdReTau395WALE 2. ThestandardtutorialcaseofchannelowatRe=395: copythetutorialcaseleintoyourrundirectory. 3. Editconstant/LESProper*esandsystem/controlDict $ geditconstant/LESProperties LESModelWALE; printCoeffson; deltacubeRootVol; ... 29. Simula*onofchannelow $ geditsystem/controlDict ... libs ("libincompressibleWALE.so"); ThislineisnecessarytocallthenewWALElibraryinsolver. $ ./Allrun 4. Apercheckingothernumericalcondi*onsandparameter, runthesolver. 5. Ifthesolvercalcula*onisnormallynished,youcheckthe logsandvisualizetheoweldwithParaView,andplotthe eldsprolegeneratedbypostChannel. 30. Simula*onofchannelowatRe=110 $ run $ cpr~/VandV/OpenFOAM/OpenFOAM-BenchmarkTest/ channelReTau110/template$FOAM_RUN/ReTau110WALE $ cdReTau110WALE $ geditcaseSettings 6. IfyouusethetestcaseofchannelowsuppliedintheV&V repository,copythetemplatecaseandedittheseung. controlDict { deltaT0.002; endTime0.022; libs"libincompressibleWALE.so"; } 31. Simula*onofchannelowatRe=110 turbulenceProperties { simulationTypeLESModel; } LESProperties { LESModelWALE; deltacubeRootVol; } TheoriginalcaseSeungsisforDNSsimula*ononlargeparallel machine.Youhadbesertochangeotherparametersin blockMeshDictanddecomposeParDict. 32. Simula*onofchannelowatRe=110 $ ./Allrun 7. Apercheckingothernumericalcondi*onsandparameter, runthesolver. 8. Ifthesolvercalcula*onisnormallynished,youcheckthe logsandvisualizetheoweldwithParaView.Ifthe integra*on*meisnotsucientfortheoweldtobecome fullydevelopedstate,runlongersimula*ons. 33. Exercise2:Implementa*onofcoherent structureSmagoriskymodel 34. OriginalsourcecodesforSGSmodel $ src $ cdturbulenceModels/incompressible/LES/ $ ls 1. ChecktheoriginalsourcecodeforSGSmodel. 2. GlancethecodesofSmagorinskymodel. $ geditSmagorinsky/Smagorinsky.* 3. Inthisexercise,welookthecodesofdynamicmodels. $ ls*[Dd]yn* 4. Comparethestructuresandstatementsoftherelatedcodes (*.Cand*.H). 35. Privatememberfunc*ons: updateSubGridScaleFields voidSmagorinsky::updateSubGridScaleFields (constvolTensorField&gradU) {nuSgs_=ck_*delta()*sqrt(k(gradU)); nuSgs_.correctBoundaryConditions(); } voiddynLagrangian::updateSubGridScaleFields (consttmp&gradU) {nuSgs_=(flm_/fmm_)*sqr(delta())*mag(dev(symm(gradU))); nuSgs_.correctBoundaryConditions(); } voiddynOneEqEddy::updateSubGridScaleFields (constvolSymmTensorField&D, constvolScalarField&KK ) {nuSgs_=ck(D,KK)*sqrt(k_)*delta(); nuSgs_.correctBoundaryConditions(); } InSmagorinsky.C IndynLagrangian.C IndynOneEqEddy.C 36. Understandingformula*onwithcodes Whatcalcula*on,mathema*calopera*on,andvariableare necessaryforcoherentstructureSmagosinskymodel(CSM)? Comparetheformula*onofmodelswiththerelatedsource codes. InCSM,thesecondinvariantofvelocitygradientisused: where Q = 1 2 ijij SijSij( )= 1 2 uj xi ui xj Sij = 1 2 ui xj + uj xi # $ %% & ' ((, ij = 1 2 ui xj uj xi # $ %% & ' (( 37. CoherentstructureSmagorinskymodelfornon- rota*ngow(NRCSM) Smagorinskymodel(SM)basedonaneddy-viscosity, ThemodelparameterCisdeterminedasfollows: with where NRCSMmodelisinvalidforrota*ngow. C = C1 | FCS |3/ 2 C1 = 1 20 , FCS = Q E ij a = 2C2 | S | Sij (ij a = 2t Sij, t = C2 | S |) E = 1 2 ijij + SijSij( )= 1 2 ui xj $ % && ' ( )) 2 38. CoherentstructureSmagorinskymodel(CSM) Smagorinskymodel(SM)basedonaneddy-viscosity, ThemodelparameterCisdeterminedasfollows: with where ImprovedCSMmodelisvalidforrota*ngow. C = C2 | FCS |3/ 2 F C2 = 1 22 , FCS = Q E , F =1 FCS ij a = 2C2 | S | Sij (ij a = 2t Sij, t = C2 | S |) E = 1 2 ijij + SijSij( )= 1 2 ui xj $ % && ' ( )) 2 39. Seungformakingnewlib