Upload
others
View
13
Download
1
Embed Size (px)
Citation preview
Smooth Particle Hydrodynamic (SPH)
Presented by:
Omid Ghasemi Fare Nina Zabihi
XU Zhao Miao Zhang Sheng Zhi EGEE 520
OUTLINE
2
Ø IntroductionandHistoricalPerspective:
Ø GeneralPrinciples:
Ø GoverningEquations:
Ø Hand-CalculationExample:
Ø ComparingHand Calculationwith ResultsObtained bytheDevelopedCode:
Ø NumericalExampleandExampleApplications:
DiscretizationMethodsinNumericalSimulation
Grid-BasedMethods
MeshFreeMethods
3
DiscretizationMethodsinNumericalSimulation
Grid-BasedMethods
EulerianGrid LagrangianGrid
4
LimitationsofGridBasedMethods
Ø Euleriangridmethods:- Constructingregulargridsforirregulargeometry
Ø Lagrangianmethod;- Computingthemeshfortheobject- Largedeformationèrezoningtechniques
5
LimitationsofGridBasedMethods
Ø NotSuitableforproblemsinvolving:- Largedisplacements- Largeinhomogeinities- Movingmaterialinterface- Deformableboundaries- Freesurfaces
à HydrodynamicPhenomena:- Explosion- HighVelocityImpact(HVI)
StrongInterestinequivalentMeshFree
Methods
6
MeshFreemethods
Ø AccurateandstablenumericalsolutionsforintegralequationsorPDEswithallkindofboundaryconditions
Ø Asetofarbitrarydistributedparticleswithoutanyconnectivitybetweenthem.
7
MeshFreeParticleMethods(MPM)Ø Eachparticle:
- Directlyassociatedwithphysicalobject- Representspartofthecontinuumproblemdomain
Ø Particlesize:-Fromnano-tomicro-tomeso-tomacro-toastronomicalscales.
Ø Theparticlespossesasetoffieldvariables:-Velocity,momentum,energy,position,etc.
Ø Evolutionofthesystemdependsonconservationof:-Mass-Momentum-Energy
8
MeshFreeParticleMethods(MPM)
Ø Inherentlylagrangianmethods-Theparticlesrepresentthephysicalsystemmoveinthelagrangianframeworkaccordingtointernalinteractionandexternalforces
9
MeshFreeParticleMethods(MPM)
ü Advantages:- Discretizedwithparticleswithnofixedconnectivity
è Goodforlargedeformations
- Simplediscretizationofcomplexgeometry
- TracingthemotionoftheparticlesèEasytoobtainlargescalefeatures
- Availabletimehistoryofallparticles
10
SmoothedParticleHydrodynamics(SPH)
Ø Oneoftheearliestdevelopedmeshfreeparticlesmethods-Ameshfreeparticlemethod-Lagrangian-Easilyadjustableresolutionofthemethodwithrespecttovariablesuchasdensity
Ø Developedby:- GingoldandMonaghan(1977)- Lucy(1977)
à 3DastrophysicalproblemsmodeledbyclassicalNewtonianhydrodynamics
11
SmoothedParticleHydrodynamics(SPH)
FluidMechanics
B.Solenthaler,2009 Incompressibilityconstraints
Kyle&Terrell,2013 Full-FilmLubrication
SolidMechanics
Libersky&Petschek,1990 StrengthofMaterialproblem
Johnson&Beissel,1996Randles&Libersky,2000 Impactphenomena
Bonet&Kulasegaram,2000 Metalformingsimulations
Herreros&Mabssout,2011 Shockwavepropagationinsolids
Ø Extension:
12
BasicIdeaofSPH
Ø Domaindiscretization-Setofarbitrarilydistributedparticles-NoconnectivityisneededàSmoothinglength:spatialdistanceoverwhichthe
propertiesare"smoothed"byakernelfunctionØ Numericaldiscretization(ateachtimestep)
Approximationoffunctions,derivativesandintegralsinthegoverningequations-Particlesratherthanoveramesh-Usingtheinformationfromneighboringparticlesinanareaofinfluence
13
BasicIdeaofSPH
Ø Sizeofthesmoothinglength-Fixedinspaceandtime-Eachparticlehasitsownsmoothinglengthvaryingwithtime
èAutomaticallyadaptingtheresolutionofthesolution
dependingonlocalcondition
ü Verydenseregionàmanyparticlesareclosetogetherà relativelyshortsmoothinglength
ü Low-densityregionsàindividualparticlesarefarapartàlongersmoothinglength
è Optimisingthecomputationaleffortsfortheregionsofinterest
14
ImprovementandModifications
Ø IssuesandlimitationsassociatedtoSPH:-Tensileinstability-Zero-energymode
15
ImprovementandModifications
Ø TensileinstabilityRegionswithtensilestressstate:
• Morris(1996)àspecialsmoothingfunctions• Dyka(1997)àadditionalstresspoints• Monaghan(2000)àartificialforceàTensileinstabilityremainsoneofthemostcriticalproblems
oftheSPHmethod
asmallperturbationonthepositionsofparticles
particleclumpingandoscillatorymotionè
16
ImprovementandModifications
Ø ZeroEnergyMode
•
• AlsoappearinFDMandFEM• Using2typesofparticlesfordiscretization
-Velocityparticles-Stressparticles
Calculatingfieldvariablesandtheirderivativesatthesamepoints
Zerogradientofanalternatingfieldvariableattheparticles
è
17
GeneralPrinciples
18
19
Smoothed Particle Hydrodynamics (SPH)
Ø Interpolationmethod Approximate values andderivatives of continuous field quantities by usingdiscretesamplepoints.
Ø Thesamplepoints:Smoothedparticlesthatcarry: 1)Concreteentities,e.g.mass,position,velocity
2)Estimatedphysicalfieldquantitiesdependentof theproblem,e.g.mass-density,temperature,
pressure,etc.
20
Smoothed Particle Hydrodynamics (SPH) v Thebasicstepofthemethod(domaindiscretization,fieldfunctionapproximationandnumericalsolution):Ø Thecontinuum:Asetofarbitrarilydistributedparticleswithnoconnectivity
(meshfree);Ø Fieldfunctionapproximation:
Theintegralrepresentationmethod
Ø Convertingintegralrepresentationintofinitesummation:Particleapproximation
21
SPH vs Finite Difference Method
Ø The SPH quantities: Macroscopic and obtained asweightedaveragesfromtheadjacentparticles.
Ø Finitedifferencemethod :Requires theparticles tobealignedonaregulargrid
Ø SPH: Can approximate the derivatives of continuousfields using analytical differentiation on particleslocatedcompletelyarbitrary
22
Integral representation of a function: ThecontinuumAsetofarbitrarilyparticles
𝑓(𝑥)=∫Ω↑▒𝑓(𝑥 )𝑊(𝑥− 𝑥 ,ℎ)𝑑𝑥
23
Integral representation of a function: Ø The interpolation is based on the theory of integral
interpolants using kernels that approximate a deltafunction
Ø Theintegralinterpolantofanyquantityfunction,A(r)
Ø where:r isanypoint indomain(Ω),Wisasmoothingkernelwithhaswidth.
Ø The width, or core radius, is a scaling factor thatcontrolsthesmoothnessorroughnessofthekernel.
𝐴↓𝐼 (𝑟)=∫Ω↑▒𝐴(𝑟 )𝑊(𝑟− 𝑟 ,ℎ)𝑑𝑟
24
Ø Integral representation into finite summation
Ø Numericalequivalent
Ø where j is iterated over all particles, Vj is the volume
attributedimplicitlytoparticlej,rjtheposition,andAjisthevalueofanyquantityAatrj
Ø ThebasisformulationoftheSPH
𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑉↓𝑗 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
𝑉= 𝑚/𝜌
𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
𝐴↓𝐼 (𝑟)=∫Ω↑▒𝐴(𝑟 )𝑊(𝑟− 𝑟 ,ℎ)𝑑𝑟
25
Smoothing Kernels
Ø Mustbenormalizedtounity
Ø Highorderofinterpolation
Ø Spherical symmetry (for angular momentumconservation)
W(q)=8/𝜋 {█1−6 𝑞↑2 +6𝑞↑3 0≤𝑞≤ 1/2 �2(1−𝑞)↑3 1/2 ≤𝑞≤1�0 𝑞≥1
q= 𝑟↓𝑗,𝑖 /ℎ
26
Kernel Function
W(r,h)= 1/π∗ℎ↑3 ∗{█1+ 3/4 ∗𝑞↑3 + 3/2 ∗𝑞↑2 𝑖𝑓 0≤𝑞≤1� 1/4 ∗(2−𝑞)↑3 𝑖𝑓 1≤𝑞≤2�0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
q= 𝑟↓𝑗,𝑖 /ℎ
where:
Ø Kernelfunctionusedinhandcalculationandinthecode
27
Smoothing Kernels
∫Ω↑▒𝑊(𝑟,ℎ)𝑑𝑟=1
lim┬ℎ→0 �𝑊(𝑟,ℎ)=𝛿(𝑟)
𝛿(𝑟)={█∞ ||𝑟||=0�0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝑊(𝑟,ℎ)=𝑊(−𝑟,ℎ)
𝑊(𝑟,ℎ)≥0
Ø PropertiesofKernel
Normalizationcondition
where:
Mustalsobepositive
Evenfunction
28
Smoothing Kernels
Ø The first golden rule: If you want to find a physicalinterpretation then it is always best to assume thekernelisGaussian
The isotropic Gaussian kernel in 1D, for h=1
𝑊↓𝑔𝑎𝑢𝑠𝑠𝑖𝑎𝑛 (𝑟,ℎ)= 1/(2𝜋ℎ↑2 )↑3/2 𝑒↑−(‖𝑟‖ ↑2 ⁄2ℎ↑2 ) , ℎ>0
29
The Gradient and the Laplacian of a quantity field
Ø Usingtheproductrule
𝜕/𝜕𝑥 𝐴↓𝑆 (𝑟)= 𝜕/𝜕𝑥 ∑𝑗↑▒(𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝑊(𝑟− 𝑟↓𝑗 ,ℎ) )
𝜕/𝜕𝑥 (𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝑊(𝑟− 𝑟↓𝑗 ,ℎ) )= 𝜕/𝜕𝑥 (𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 ) 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)+ 𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝜕/𝜕𝑥 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
=0 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)+ 𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝜕/𝜕𝑥 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
=𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝜕/𝜕𝑥 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
30
The Gradient and the Laplacian of a quantity field
Ø Toobtainhigheraccuracyonthegradientofaquantity
fieldtheinterpolantcaninsteadbeobtainedbyusing
Ø The second golden rule: Rewrite formulaswith densityinsideoperators
(*)
𝛻𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
ρ𝛻𝐴=𝛻(𝜌𝐴)−A𝛻𝜌
𝛻𝐴= 1/𝜌 (𝛻(𝜌𝐴)−A𝛻𝜌 )
𝛻(𝜌𝐴)=ρ𝛻𝐴+A𝛻𝜌
31
The Gradient and the Laplacian of a quantity field
Ø A particular symmetrized form of (*) can be obtained
berewriting
𝛻𝐴↓𝑆 (𝑟)= 1/𝜌 [∑𝑗↑▒𝜌↓𝑗 𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)−𝐴∑𝑗↑▒𝜌↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ) ]
= 1/𝜌 [∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)−∑𝑗↑▒𝐴𝑚↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ) ]
= 1/𝜌 ∑𝑗↑▒(𝐴↓𝑗 −𝐴) 𝑚↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
𝛻𝐴/𝜌 =𝛻(𝐴/𝜌 )+ A/𝜌↑2 𝛻𝜌
𝛻𝐴=𝜌(𝛻(𝐴/𝜌 )+ A/𝜌↑2 𝛻𝜌 )
𝛻(𝐴/𝜌 )= 𝛻𝐴/𝜌 − A/𝜌↑2 𝛻𝜌
𝛻𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ) Whatwehave: 𝛻𝐴= 1/𝜌 (𝛻(𝜌𝐴)−A𝛻𝜌 )
32
The Gradient and the Laplacian of a quantity field Ø WhichinSPHtermsbecomes
Ø TheLaplacianofthesmoothedquantityfield 𝛻↑2 𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻↑2 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
𝛻𝐴↓𝑆 (𝑟)=𝜌[∑𝑗↑▒𝐴↓𝑗 /𝜌↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)+ 𝐴/𝜌↑2 ∑𝑗↑▒𝜌↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ) ]
=𝜌[∑𝑗↑▒𝐴↓𝑗 /𝜌↓𝑗↑ 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)+∑𝑗↑▒𝐴/𝜌↑2 𝑚↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ) ]
=𝜌∑𝑗↑▒(𝐴↓𝑗 /𝜌↓𝑗↑2 + 𝐴/𝜌↑2 ) 𝑚↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
Whatwehave: 𝛻𝐴=𝜌(𝛻(𝐴/𝜌 )+ A/𝜌↑2 𝛻𝜌 )𝛻𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
33
Solving Navier-Stokes by SPH
Ø Navier-Stokesequationsforanincompressible,isothermalfluid
𝜌𝑑𝑢/𝑑𝑡 =−𝛻𝑝+𝜇𝜏𝛻↑2 𝑢+𝑓
34
The Basis Formulations of SPH- Summary
⟨𝑓1+ 𝑓2⟩=⟨𝑓1⟩ +⟨𝑓2⟩
⟨𝑓1𝑓2⟩=⟨𝑓1⟩ ⟨𝑓2⟩
⟨𝑐𝑓2⟩=𝑐 ⟨𝑓2⟩
𝛻↑2 𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻↑2 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
Ø A symmetrized gradient of a higher accuracy can in
SPHbeobtainedby𝛻𝐴↓𝑆 (𝑟)=𝜌∑𝑗↑▒(𝐴↓𝑗 /𝜌↓𝑗↑2 + 𝐴/𝜌↑2 ) 𝑚↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
𝛻𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝛻𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
𝐴↓𝑆 (𝑟)=∑𝑗↑▒𝐴↓𝑗 𝑚↓𝑗 /𝜌↓𝑗 𝑊(𝑟− 𝑟↓𝑗 ,ℎ)
GoverningEquations
35
• ConservationofMass--DiffusionEquation(Fick’slaw)Momentum(Newtonsecondlaw)--Navier-StokesEquation
Energy(firstlawofthermodynamics)
36
Governing Equations
37
Eulerian vs. Lagrangian representations
• Spacefixed• Fluidinsidecontrol
volumechanges
• Fluidparcelinmaterialvolume
• Carriedalongwithflow
Controlvolume
In Out
38
Lagrangian Form
∆𝑉=∫𝑆↑▒𝐯 ∆𝑡∙𝒏𝑑𝑆∆(𝛿𝑉)/∆𝑡 =(𝛻∙𝐯)∫𝑆↑▒𝑑(𝛿𝑉) =𝛻∙𝐯𝛿𝑉𝛻∙𝐯= 1/𝛿𝑉 𝑑(𝛿𝑉)/𝑑𝑡
39
Continuity Eq.
𝛿𝑚=𝜌𝛿𝑉𝑑(𝛿𝑚)/𝑑𝑡 = 𝑑(𝜌𝛿𝑉)/𝑑𝑡 = 𝛿𝑉𝑑𝜌/𝑑𝑡 +𝜌𝑑(𝛿𝑉)/𝑑𝑡 =0𝑑𝜌/𝑑𝑡 =− 𝜌/ 𝛿𝑉 𝑑(𝛿𝑉)/𝑑𝑡 =−𝜌𝛻∙𝐯
MassconservedinaLagrangianfluidcell
𝑑𝜌/𝑑𝑡 =−𝜌𝛻∙𝐯
Conservationofmass
40
Continuity Eq. in SPH
𝑑𝜌/𝑑𝑡 =−𝜌𝛻∙𝐯 =− 𝜌[𝛻∙(𝜌𝐯)−𝐯∙𝛻𝜌/𝜌 ]
ContinuityEq. GradientApproximationinSPH:𝛻𝐴↓𝑆 (𝑟)= 1/𝜌 ∑𝑗↑▒(𝐴↓𝑗 −𝐴) 𝑚↓𝑗 𝛻𝑾(𝑟− 𝑟↓𝑗 ,ℎ)
𝑑𝜌↓𝑖 /𝑑𝑡 =−∑𝑗=1↑𝑁▒𝑚↓𝑗 (𝐯↓𝑖 − 𝐯↓j ) ∙ 𝛻↓𝑖 𝑾↓𝑖𝑗
𝛻↓𝑖 𝐴↓𝑖 = 1/𝜌↓𝑖 ∑𝑗=1↑𝑁▒𝑚↓𝑗 (𝐴↓𝑗 − 𝐴↓𝑖 ) 𝛻↓𝑖 𝑾↓𝑖𝑗
x
zy
zyxxpp δδδ )21.(
∂∂
+−zyxxpp δδδ )21.(
∂∂
−
zyzzzx
zx δδδτ
τ )21.(
∂∂
+
yxzzzx
zx δδδτ
τ )21.(
∂∂
−−
zxyyyx
yx δδδτ
τ )21.(
∂
∂−−zxy
yyx
yx δδδτ
τ )21.(
∂
∂+
zyxxxx
xx δδδτ
τ )21.(
∂∂
−− zyxxxx
xx δδδτ
τ )21.(
∂∂
+
41
Momentum equation in three dimensions
• Surfaceforces--pressure--viscousforce• Bodyforces--gravity--electromagneticforce
42
Momentum equation
Pressureactingonthefluidcell
−[(𝑝+ 𝜕𝑝/𝜕𝑥 )−𝑝]𝑑𝑦𝑑𝑧=− 𝜕𝑝/𝜕𝑥 𝑑𝑥𝑑𝑦𝑑𝑧
Stressactingonthefluidcell
(𝜕𝜏↓𝑥𝑥 /𝜕𝑥 + 𝜕𝜏↓𝑦𝑥 /𝜕𝑦 + 𝜕𝜏↓𝑧𝑥 /𝜕𝑦 )𝑑𝑥𝑑𝑦𝑑𝑧
x
zy
zyxxpp δδδ )21.(
∂∂
+−zyxxpp δδδ )21.(
∂∂
−
zyzzzx
zx δδδτ
τ )21.(
∂∂
+
yxzzzx
zx δδδτ
τ )21.(
∂∂
−−
zxyyyx
yx δδδτ
τ )21.(
∂
∂−−zxy
yyx
yx δδδτ
τ )21.(
∂
∂+
zyxxxx
xx δδδτ
τ )21.(
∂∂
−− zyxxxx
xx δδδτ
τ )21.(
∂∂
+
(xdirection)
43
Momentum equation
Newton’ssecondlaw
𝑚𝑑𝑣↓𝑥 /𝑑𝑡 =𝜌𝑑𝑥𝑑𝑦𝑑𝑧𝑑𝑣↓𝑥 /𝑑𝑡 =− 𝜕𝑝/𝜕𝑥 𝑑𝑥𝑑𝑦𝑑𝑧+(𝜕𝜏↓𝑥𝑥 /𝜕𝑥 + 𝜕𝜏↓𝑦𝑥 /𝜕𝑦 + 𝜕𝜏↓𝑧𝑥 /𝜕𝑦 )𝑑𝑥𝑑𝑦𝑑𝑧
𝜌𝑑𝐯/𝑑𝑡 =−𝛻𝑝+𝛻∙𝝉
𝜌𝑑𝑣↓𝑥 /𝑑𝑡 = 𝜕𝑝/𝜕𝑥 + 𝜕𝜏↓𝑥𝑥 /𝜕𝑥 + 𝜕𝜏↓𝑦𝑥 /𝜕𝑦 + 𝜕𝜏↓𝑧𝑥 /𝜕𝑦
𝜏↓𝑖𝑗 =𝜇(𝜕𝐯↓𝐣 /𝜕𝒙↓𝒊 + 𝜕𝐯↓𝐢 /𝜕𝒙↓𝒋 − 2/3 (𝛻∙𝐯)𝛿↓𝑖𝑗 )
44
Momentum Eq. in SPH
𝑑𝐯↓𝒊 /𝑑𝑡 =−∑𝑗=1↑𝑁▒𝑚↓𝑗 (𝑝↓𝑖 /𝜌↓𝑖↑2 + 𝑝↓𝑗 /𝜌↓𝑗↑2 +∏𝑖𝑗↑▒ ) 𝛻↓𝑖 𝑾↓𝑖𝑗
GradientApproximationinSPH:MomentumEq.
𝜌𝑑v/𝑑𝑡 =−𝛻𝑝+𝛻∙𝜏
𝛻↓𝑖 𝐴↓𝑖 = 1/𝜌↓𝑖 ∑𝑗=1↑𝑁▒𝑚↓𝑗 (𝐴↓𝑗 − 𝐴↓𝑖 ) 𝛻↓𝑖 𝑾↓𝑖𝑗
𝛻𝐴↓𝑆 (𝑟)= 1/𝜌 ∑𝑗↑▒(𝐴↓𝑗 −𝐴) 𝑚↓𝑗 𝛻𝑾(𝑟− 𝑟↓𝑗 ,ℎ)
45
Energy Eq.
x
y
Energychange
𝜌𝑑𝑒/𝑑𝑡 =−𝑝(𝜕𝑣↓𝑥 /𝜕𝑥 + 𝜕𝑣↓𝑦 /𝜕𝑦 + 𝜕𝑣↓𝑧 /𝜕𝑧 )
Workactingonthefluidcell:
pressure Deformationinxdirection:(𝑣↓𝑥 + 𝜕𝑣↓𝑥 /𝜕𝑥 − 𝑣↓𝑥 )𝑑𝑡= 𝜕𝑣↓𝑥 /𝜕𝑥 𝑑𝑥𝑑𝑡
𝑑𝑦𝑑𝑧𝜕𝑣↓𝑥 /𝜕𝑥 𝑑𝑥𝑑𝑡+𝑝𝑑𝑥𝑑𝑧𝜕𝑣↓𝑦 /𝜕𝑦 𝑑𝑦𝑑𝑡+𝑝𝑑𝑥𝑑𝑦𝜕𝑣↓𝑧 /𝜕𝑧 𝑑𝑧𝑑𝑡=𝑝𝑑𝑡𝑑𝑥𝑑𝑦𝑑𝑧( 𝜕𝑣↓𝑥 /𝜕𝑥 + 𝜕𝑣↓𝑦 /𝜕𝑦 + 𝜕𝑣↓𝑧 /𝜕𝑧 )
Internalenergychange:𝜌𝑑𝑒𝛿𝑉
46
Energy Eq. in SPH
𝑑𝑒/𝑑𝑡 =− 𝑝/𝜌 𝜕𝐯/𝜕𝒙
𝑑𝑒↓𝒊 /𝑑𝑡 = 𝑝↓𝑖 /𝜌↓𝑖↑2 ∑𝑗=1↑𝑁▒𝑚↓𝑗 (𝐯↓𝑖 − 𝐯↓𝑗 )𝛻↓𝑖 𝑾↓𝑖𝑗 + 1/2 ∑𝑗=1↑𝑁▒𝑚↓𝑗 ∏𝑖𝑗↑▒ (𝐯↓i − 𝐯↓j )𝛻↓𝑖 𝑾↓𝑖𝑗
𝛻↓𝑖 𝐴↓𝑖 = 1/𝜌↓𝑖 ∑𝑗=1↑𝑁▒𝑚↓𝑗 (𝐴↓𝑗 − 𝐴↓𝑖 ) 𝛻↓𝑖 𝑊↓𝑖 𝑗
GradientApproximationinSPH:EnergyEq.
47
Diffusion Eq.
Fick’slaw(xdirection)𝑢↓𝑥 =𝐷𝐴↓𝑥 𝜕𝐶/𝜕𝑥
Conservationofmass𝛿𝑉𝑑𝐶/𝑑𝑡 = 𝑢↓𝑥 𝑑𝑥+ 𝑢↓𝑦 𝑑𝑦+ 𝑢↓𝑧 𝑑𝑧
𝑑𝐶/𝑑𝑡 =𝐷𝛻↑2 C
Fluxchange(xdirection)𝑢↓𝑥 𝑑𝑥=𝐷[(𝐶+ 𝜕𝐶/𝜕𝑥 )−𝐶]𝑑𝑦𝑑𝑧=𝐷𝜕𝐶/𝜕𝑥 𝑑𝑥𝑑𝑦𝑑𝑧
Flux
x
y
48
Diffusion Eq. in SPH
𝑑𝐶/𝑑𝑡 =𝐷𝛻↑2 C= 1/𝜌 𝛻∙(𝐷𝜌𝛻𝐶)
𝑑𝐶↓𝑖 /𝑑𝑡 =∑𝑗=1↑𝑁▒𝑚↓𝑗 /𝜌↓𝑖 𝜌↓𝑗 ( 𝐷↓𝑖 + 𝐷↓𝑗 )( 𝜌↓𝑖 + 𝜌↓𝑗 ) 𝒓↓𝒊𝒋 ∙ 𝛻↓𝑖 𝑾↓𝑖𝑗 /𝑟↓𝑖𝑗↑2 + 𝜂↑2 ( 𝐶↓𝑖 − 𝐶↓𝑗 )
DiffusionEq. GradientApproximationinSPH:
𝛻↓𝑖 𝐴↓𝑖 = 1/𝜌↓𝑖 ∑𝑗=1↑𝑁▒𝑚↓𝑗 (𝐴↓𝑗 − 𝐴↓𝑖 ) 𝛻↓𝑖 𝑊↓𝑖 𝑗
Hand-CalculationExample
49
Problem Description
50
Initial Parameters
Mass Density Pressure Velocity Location h ∆t
Particlei 1 1 1 (0.2.0.1) (2,1) 2 1
Particlej 1 1 1 (0.3,0.3) (1,2) 2 1
51
Governing Equation
Accordingtothemomentumequation,For Particle i
𝑑𝑉↓𝑖 /𝑑𝑡 =− 𝑚↓𝑗 ∗( 𝑃↓𝑖 /𝜌↓𝑖↑2 + 𝑃↓𝑗 /𝜌↓𝑗↑2 + ∏↓𝑖,𝑗 )*𝛻W↓𝑖,𝑗 +𝑔
No Gravity
𝑑𝑉↓𝑖 /𝑑𝑡 =− 𝑚↓𝑗 ∗( 𝑃↓𝑖 /𝜌↓𝑖↑2 + 𝑃↓𝑗 /𝜌↓𝑗↑2 + ∏↓𝑖,𝑗 )*𝛻W↓𝑖,𝑗
52
Calculation of Viscosity Tensor
∏↓i,j = {█− a↓M ∗0.5∗(C↓si + C↓sj )∗µ↓ij +β ∗µ↓ij ↑2 /0.5∗(ρ↓i + ρ↓j ) if V↓ij ∙ X↓ij <0 �0 if V↓ij ∙ X↓ij >0 Inmycase
𝑉↓𝑖𝑗 = 𝑉↓𝑖 − 𝑉↓𝑗 =(−0.1,−0.2)𝑋↓𝑖𝑗 = 𝑋↓𝑖 − 𝑋↓𝑗 =(1,−1)𝑉↓𝑖𝑗 ∙ 𝑋↓𝑖𝑗 =−0.1+0.2=0.1>0
∏↓𝑖,𝑗 =0; 53
Calculation of 𝛻W↓𝑖,𝑗
Inmycase,
W(r,h)= 1/π∗h↑3 ∗{█1+ 3/4 ∗q↑3 + 3/2 ∗q↑2 if 0≤q≤1� 1/4 ∗(2−q)↑3 if 1≤q≤2�0 otherwise
q= 𝑟↓𝑖𝑗 /ℎ Inthiscase,𝑟↓𝑖𝑗 =|𝑋↓𝑖 − 𝑋↓𝑗 |=√�2 ,q=√�2 /2
So𝑊↓𝑖,𝑗 = 1/π∗ℎ↑3 ∗(1+ 3/2 ∗𝑞↑2 + 3/4 ∗𝑞↑3 )= 1/π∗ℎ↑3 + 3𝑟↑2 /2π∗ ℎ↑5 + 3𝑟↑3 /4π∗ ℎ↑6
54
Calculation of 𝛻W↓𝑖,𝑗 Usingthenumericalmethodtosolve𝛻W↓𝑖,𝑗 𝜕𝑊↓𝑖𝑗 /𝜕𝑥 = ( 1/π∗ℎ↑3 + 3∗((1−0.001)↑2 + 1↑2 )/2π∗ ℎ↑5 + 3∗((1−0.001)↑2 + 1↑2 )↑3/2 /4π∗ ℎ↑6 )−( 1/π∗ℎ↑3 + 3∗2/2π∗ ℎ↑5 + 3∗2↑3/2 /4π∗ ℎ↑6 )/0.001 =−4.57∗10^(−2)𝜕𝑊↓𝑖𝑗 /𝜕𝑦 = ( 1/π∗ℎ↑3 + 3∗(1↑2 + (1+0.001)↑2 )/2π∗ ℎ↑5 + 3∗(1↑2 +(1+0.001)↑2 )↑3/2 /4π∗ ℎ↑6 )−( 1/π∗ℎ↑3 + 3∗2/2π∗ ℎ↑5 + 3∗2↑3/2 /4π∗ ℎ↑6 )/0.001 =4.57∗10^(−2)
𝛻W↓i,j = 𝜕W↓ij /𝜕x , 𝜕W↓ij /𝜕y =(−4.57∗10↑−2 ,4.57∗10↑−2 );
Particlei
Particlej
𝑟↓𝑖,𝑗
55
Calculation of Acceleration, Velocity and Location
𝑎↓𝑖 = 𝑑𝑉↓𝑖 /𝑑𝑡 =− 𝑚↓𝑗 ∗( 𝑃↓𝑖 /𝜌↓𝑖↑2 + 𝑃↓𝑗 /𝜌↓𝑗↑2 + ∏↓𝑖,𝑗 )*𝛻W↓𝑖,𝑗 =−1∗(1/1↑2 + 1/1↑2 +0)∗(−4.57∗10↑−2 ,4.57∗ 10↑−2 )=(9.14∗ 10↑−2 ,−9.14∗10↑−2 );
𝐕↓𝐢 𝐧𝐞𝐰 = 𝐕↓𝐢 + 𝐚↓𝐢 ∗∆𝐭 =(𝟎.𝟐𝟗,𝟎.𝟎𝟏);
𝐗↓𝐢 𝐧𝐞𝐰 = 𝐗↓𝐢 + 𝐕↓𝐢 𝐧𝐞𝐰 ∗∆𝐭 =(2.29,1.01);
56
Calculation of Viscosity tensor for Particle j
dV↓j /dt =− m↓i ∗( P↓j /ρ↓j↑2 + P↓i /ρ↓i↑2 + ∏↓j,i )*𝛻W↓j,i ∏↓j,i = {█− a↓M ∗0.5∗(C↓si + C↓sj )∗µ↓ij +β ∗µ↓ij ↑2 /0.5∗(ρ↓i + ρ↓j ) if V↓ji ∙ X↓ji <0 �0 ifV↓ji ∙ X↓ji >0 𝑉↓𝑗,𝑖 = 𝑉↓𝑖 − 𝑉↓𝑗 =(0.1,0.2)𝑋↓𝑗,𝑖 = 𝑋↓𝑖 − 𝑋↓𝑗 =(−1,1)𝑉↓𝑗𝑖 ∙ 𝑋↓𝑗𝑖 =−0.1+0.2=0.1>0∏↓𝑗,𝑖 =0;
GoverningEquation
57
Calculation of 𝛻W↓𝑗,𝑖 for Particle j
W(r,h)= 1/π∗ℎ↑3 ∗{█1+ 3/4 ∗𝑞↑3 + 3/2 ∗𝑞↑2 𝑖𝑓 0≤𝑞≤1� 1/4 ∗(2−𝑞)↑3 𝑖𝑓 1≤𝑞≤2�0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 q=𝑟↓𝑗,𝑖 /ℎ 𝑟↓𝑗,𝑖 =|𝑋↓𝑗 − 𝑋↓𝑖 |=√�2 q=√�2 /2
𝑊↓𝑗,𝑖 = 1/π∗ℎ↑3 ∗(1+ 3/2 ∗𝑞↑2 + 3/4 ∗𝑞↑3 )= 1/π∗ℎ↑3 + 3𝑟↑2 /2π∗ ℎ↑5 + 3𝑟↑3 /4π∗ ℎ↑6
58
Calculation of 𝛻W↓𝑗,𝑖 for Particle j
𝜕𝑊↓𝑗,𝑖 /𝜕𝑥 = ( 1/π∗ℎ↑3 + 3∗(1↑2 + (1+0.001)↑2 )/2π∗ ℎ↑5 + 3∗(1↑2 +(1+0.001)↑2 )↑3/2 /4π∗ ℎ↑6 )−( 1/π∗ℎ↑3 + 3∗2/2π∗ ℎ↑5 + 3∗2↑3/2 /4π∗ ℎ↑6 )/0.001 =4.57∗10^(−2)
𝜕𝑊↓𝑗,𝑖 /𝜕𝑦 = ( 1/π∗ℎ↑3 + 3∗((1−0.001)↑2 + 1↑2 )/2π∗ ℎ↑5 + 3∗((1−0.001)↑2 + 1↑2 )↑3/2 /4π∗ ℎ↑6 )−( 1/π∗ℎ↑3 + 3∗2/2π∗ ℎ↑5 + 3∗2↑3/2 /4π∗ ℎ↑6 )/0.001 =−4.57∗10^(−2)
𝛻W↓𝑗,𝑖 = 𝜕𝑊↓𝑗,𝑖 /𝜕𝑥 , 𝜕𝑊↓𝑗,𝑖 /𝜕𝑦 =(−4.57∗10↑−2 ,4.57∗10↑−2 );
Particlej
Particlei𝑟↓𝑖,𝑗
59
Calculation of Acceleration, Velocity and Location
a↓j = dV↓j /dt =− m↓i ∗( P↓i /ρ↓i↑2 + P↓j /ρ↓j↑2 + ∏↓j,i )*𝛻W↓j,i =−1∗(1/1↑2 + 1/1↑2 +0)∗(4.57∗ 10↑−2 ,−4.57∗10↑−2 )=(−9.14∗10↑−2 ,9.14∗10↑−2 );
𝐕↓𝐣 𝐧𝐞𝐰 = 𝐕↓𝐣 +𝐚∗∆𝐭 =(𝟎.𝟐𝟏,𝟎.𝟑𝟗); 𝐗↓𝐣 𝐧𝐞𝐰 = 𝐗↓𝐣 +∆𝐕↓𝐣 𝐧𝐞𝐰 ∗∆𝐭 =(1.21,2.39); 60
The Change of Position and Velocity after ∆t
61
ComparingHandCalculationwithResultsObtainedbythe
DevelopedCode:
62
NumericalResults• t=• 1• • velocityforpartile:1• • 0.29140.0086• • newcordinatesforpartile:1• xy=• • 2.29141.0086
63
• t=• 1• • velocityforpartile:2• • 0.20860.3914• • newcordinatesforpartile:2• xy=• • 1.20862.3914
NumericalExampleandExampleApplications
64
6. Numerical Example
• 6.1IntroductiontoSPHysics• 6.2PrepareforSPHysics• 6.3Problemstatement• 6.4Inputdata• 6.5Runmodel• 6.6Visualizationofresult
65
6.1 Introduction to SPHysics
CodeFeatures:• Open-source• 2-Dand3-Dversions• Variabletimestep• Choicesofinputmodes• VisualizationroutinesusingMatlaborParaView
66
6.2 Prepare for SPHysics
• Windows:IntelVisualFortranSilverfrostFTN95GNUgfortrancompileronCygwin
• Linux:GNUgfortrancompilerIntelfortrancompiler
• Mac:GNUgfortran
67
6.3 Problem statement
Geometry
Waterbodycollapse
Properties
density=1000m3/sdx=dy=0.03mdt=0.0001stmax=3s
t=0
68
6.4 Input data
6.4.1Choosekernelfunction
• Guassian• Quadratic• Cubicspline• Quintic
69
6.4 Input data
6.4.2Choosetimeintegrationscheme • Predictor-Corrector scheme • Verlet scheme • Symplectic scheme • Beeman scheme
70
6.4 Input data
6.4.2Choosetimeintegrationschemes Predictor-Correctorscheme(AverageDifferenceoperator):Thisschemepredictstheevolutionintimeas,
Thesevaluesarethencorrectedusingforcesatthehalfstep,
71
6.4 Input data
6.4.2Choosetimeintegrationschemes Finally,thevaluesarecalculatedattheendofthetimestepshownasfollowing:
72
6.4 Input data
6.4.3ChooseoptionsforMomentumequation
• Artificialviscosity• Laminar• Laminarviscosity+Sub-ParticleScale
TheartificialviscosityproposedbyMonaghan(1992)hasbeenusedveryoftenduetoitssimplicity.
73
6.4 Input data
6.4.4ChooseDensityFilter:
• ZerothOrder–ShepardFilter
• FirstOrder–MovingLeastSquares(MLS)
74
6.4 Input data
6.4.5Otheroptions • Kernelcorrection• Kernelgradientcorrection• Continuityequation• Equationofstate• Particlesmovingequation• Thermalenergyequation
75
6.5 Run model
InLinux,twomainstepstorunourmodel: • CompileandgenerateSPHysicsgen_2DusingSPHysicsgen.make• RunSPHysicsgen_2DwithCase1.txtastheinputfile
• CompileandgenerateSPHysics_2DusingSPHysics.make
• ExecuteSPHysics_2D
76
6.4 Visualization of result
Ø Motionofparticles
77
6.4 Visualization of result
Ø Motionofparticles
78
6.4 Visualization of result
Timestep=0
m/s
Timestep=20
Ø Horizontalvelocityu
79
Timestep=10
Timestep=30
6.4 Visualization of result
Ø Horizontalvelocityu
80
Timestep=40
Timestep=60
Timestep=50
Timestep=70
m/s
6.4 Visualization of result
Ø Horizontalvelocityu
81
m/s
Timestep=80
Timestep=100
Timestep=90
Timestep=110
7.Numericalapplication
• Usesinastrophysics
• Usesinfluidsimulation
• UsesinSolidmechanics
82
7.1Usesinfluidsimulation
Simulationofdynamicoceanwave
83
7.1Usesinfluidsimulation
Simulationforhydraulicfacilitiesdesign(1)
84
7.1Usesinfluidsimulation
Simulationforhydraulicfacilitiesdesign(2)
85
7.2UsesinSolidmechanics
Simulationofdambreak
86
Thank you very much!
87