OpenFOAMq OpensourceCFDtoolbox,which
suppliespreconfiguredsolvers,utilities andlibraries.
q FlexiblesetofefficientC++modules---object-oriented.
q UseFinite-VolumeMethod(FVM)tosolvesystemsofPDEsascribedonany3Dunstructured meshofpolyhedralcells.
q Goodparallelization. Overview of OpenFOAM structures
q Resourcefulcommunity (CFDforum,http://www.cfd-online.com/Forums/openfoam/)contribution(user-definedlibraries).
q interFoam,whichisasolverfor2incompressiblefluidswithinterfacetracking,isusedinthepresentstudy.Tutorials:http://cfd.direct/openfoam/user-guide/dambreak/
0whereboundaryconditions aredefinedforalpha.water,B,k,nuSgs,p_rgh,U
constant
system
Meshbuilding -- blockMeshDict
Turbulence closure– turbulenceProperties,LESProperties
Computational timecontrol-- controlDict
Numerical schemes -- fvSchemes
Numerical solvers-- fvSolution
Initialcondition -- setFieldslDict
Domaindecomposition -- decomposeParDict
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
x
y
z
0 (00-0.3)
1 (18.200.064)
2 (18.200.3)
Howtochooseanappropriatedomainheight?- Bigenoughtomakesurethebreakingwavewillnottouchthetopboundary;- Nottobig,tosavecomputationalcost.
3 (000.3)
4 (00.6 -0.3)
5 (18.2 0.60.064)
6 (18.20.60.3)
7 (00.60.3)
Howtochooseanappropriatedomainwidth?- Bigenoughtocoverseverallargesteddiesintheexperiment;- Nottobig,tosavecomputationalcost.
Inthiscase,thedomainlengthissettobesmallerthanthatintheexperiment[Ting2006,2008]butlongenoughtocovertheinitialshorelineandswashzone
DomainLayout
Nz=80.Howtodeterminethenumberofgridsintheverticaldirection?-- Determined bythenumberofgridsneededtosolvethewave.
E.g.,inthiscase,H0=0.22m.Using30gridstosolvethewave∆z =7.5mmattheleftboundaryNz =Domainheight/∆z =80
z
Nx=2427.Howtodeterminethenumberofgridsinthestreamwise direction?--Makesuretheratioof∆𝑥/∆𝑧 isnottoobig(<5).
E.g.,inthiscase,Dzmax=7.5mmattheleftboundary;Dzmin=3mmattherightboundary.Tomake∆𝑥/∆𝑧 <5,chooseDxmax=11.5mm(∆𝑥/∆𝑧=3.8)attheleftboundaryandDxmin=4.6mm (∆𝑥/∆𝑧 =1.5)attherightboundary.∆𝑥 isshrinkingfromthelefttotheright.(Sois∆𝑧 )
Buildthegrids
Ny=80.Howtodeterminethenumberofgridsinthespanwisedirection?Makesuretheratiosof∆𝑦/∆𝑧 and∆𝑥/∆𝑦 arenottoobig.E.g.,inthiscase,∆y =7.5mm
x
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Choose theturbulenceclosure
Large-eddysimulation inthissimulation
DynamicSmagorinsky closure isused,andanimprovedversionofdynamicSmagorinsky closuredeveloped byAlbertoPassalacqua isadopted.
HowtoinstalltheimproveddynamicSmagorinsky closureinOpenFOAM?1. Downloadthesourcecodeusinggit:
git clonegit://github.com/AlbertoPa/dynamicSmagorinsky.git2.Enterthedirectorywherethesourcecodehasbeenextracted,andcompileitbytyping:
wmake libso3.AddthefollowinglinetothecontrolDict ofyourcase:libs("libOpenFOAM.so""libdynamicSmagorinskyModel.so");4.SpecifyLESModel dynamicSmagorinsky;deltacubeRootVol;inLESModel.5.Addthesubdictionary
dynamicSmagorinskyCoeffs{filtersimple;ce 1.048;}
toLESModels.
Filter isdefinedas Δ = Vcell3
https://github.com/AlbertoPa/dynamicSmagorinsky
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Settheinitial condition
(00-0.3)
(00.6-0.3)
(000) (00.60)
(150.60)(1500)
Offshore
Onshore
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Definetheboundaries
(Wall function isused)
Sends inthetargetsolitarywavethroughgroovyBC
WhatisgroovyBC?-- Alibrarythatcanbeusedtogeneratearbitraryboundaryconditions basedonexpressions. Itisincluded intheswak4Foamlibrarypackage.
Link:https://openfoamwiki.net/index.php/Contrib/swak4Foam
InstallgroovyBC
1.Downloadswak4Foamlibrarypackagefrom
svn checkoutsvn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/libraries/swak4Foam/ swak4Foam_2.x
2.Inthedirectoryofthesources,type
wmake all
UsegroovyBC tosendinsolitarywave
ExpressionofthetheoreticalsurfaceelevationinLeeetal.[1982]
ExpressionofthetheoreticalvelocityinLeeetal.[1982]
α1 =
1, z ≤ Hcosh2 atp −ct + xs( )( )
0, z > Hcosh2 atp −ct + xs( )( )
#
$
%%
&
%%
c = gh 1+H h( )h = 0.3m H = 0.22m fs = 2.644 g = 0,0,−9.81( ) xs = hfsH h
atp = 0.75Hh3
u =
ghHcosh2 atp −ct + xs( )"# $%h
1− 0.25Hcosh2 atp −ct + xs( )"# $%h
"
#&&
$
%'', z ≤ H
cosh2 atp −ct + xs( )( )
0, z > Hcosh2 atp −ct + xs( )( )
)
*
++
,
++
w =
− ghzh
1− 0.5Hdexcosh2 atp −ct + xs( )"# $%h
"
#&&
$
%'', z ≤ H
cosh2 atp −ct + xs( )( )
0, z > Hcosh2 atp −ct + xs( )( )
)
*
++
,
++
v = 0
Specifytheboundary conditions
p_rgh:dynamicpressure
U:velocity
alpha.water: (percentageofwaterineachcell) intheVOFequationα1
B:subgrid-scale tensor inLES.istheunittensor; isthedeviatoric partofthesubgrid-scale tensorandisparameterizedbysubgrid closure
B = 2 3kI +Beff I
k:subgrid-scale kineticenergyinLES.,,istherateofstrain
k = cIΔ2 D 2 cI ≈ 0.2 D
nuSgs:,sub-gridscale viscosity inLESν sgs
Specifytheboundary conditions
zeroGradient:normalgradientiszero
cyclic:periodic boundarycondition
inletOutlet:≈ zeroGradient.ButswitchtofixedValue (using“inletValue”) ifthevelocityjustoutside theboundaryisflowingintothedomain
pressureInletOutletVelocity: =pressureInletVelocity +inletOutpressureInletVelocity: When𝑝 isknownattheinlet,𝑈 isevaluatedfromthefluxnormaltothepath.
totalPressure: Totalpressure is fixed;whenchanges,pwillbeadjustedaccordingly
p0 = p+1 2ρ U2
U
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Numerical schemes
ddtSchemes: firsttime derivative 𝜕/𝜕𝑡 .“CrankNicholson 1”isthepure2nd-orderCrank-Nicolson scheme
gradSchemes: Gradient𝛻.“Gausslinear”meansGauss’theoremisusedwhentransformingintegralovervolumeintointegraloversurface;“linear”meanscentraldifferencescheme (CDS)
divSchemes: Divergent𝛻 ..“GausslimitedLinearV 1”and“GaussvanLeer”arebothTVDschemeswithdifferentlimiters. “Gauss interfaceCompression” isusedfortheinterfacecompression term
interpolationSchemes: numericalscheme fortheevaluation offacevaluesfromthecellcentervalues
snGradSchemes: component ofgradientnormaltoacell face
fluxRequired: fieldswhichrequirethegeneration ofaflux
laplacianSchemes: Laplacian .“Gauss linearcorrected”isCDSwithsomecorrectionterms
∇2
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Numerical solvers
SolvesthePressurePoissonEquation
Setthesolversforp_rgh andU
PIMPLE=SIMPLE+PISO
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Setthetimecontrol
startFrom
stopAt
deltaT
writeControl
adjustTimeStep
maxCo
maxAlphaCo
maxDeltaT
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Decompose thedomain
“decomposeParDict”
simpleCoeffs{n(412);…
}
numberOfSubdomains 8;
x
y
z
TypedecomposePar
Buildthedomainandsetthegrids
Choosetheturbulence closure
Setthe initial condition
Settheboundarycondition
Choosethenumericalschemes
Choosethenumericalsolvers
Setthetimecontrol
Decompose thedomain
Runthecase
Runthecase
TypeinterFoam
Top Related