SIMULATION METHODS SIMULATION METHODS IN SCIENCE AND IN SCIENCE AND
ENGINEERINGENGINEERING
Dr Dr habhab. . inzinz. . WitoldWitold DzwinelDzwinel, , prof.nprof.n. . AGHAGH
Plan przedmiotu: Metody symulacji w naucePlan przedmiotu: Metody symulacji w nauce
1.1. CeleCele i i srodki modelowania, fizyka a rzeczywistoscsrodki modelowania, fizyka a rzeczywistosc2.2. Nowoczesne problemy symulacji w nauce Nowoczesne problemy symulacji w nauce –– multimulti--resolutionresolution andand crosscross--
scalingscaling3.3. WprowadzenieWprowadzenie do do chaosuchaosu4.4. Metody Monte Metody Monte CarloCarlo –– uklady statyczneuklady statyczne
1.1. Generatory liczb losowychGeneratory liczb losowych2.2. Przypomnienie prostych schematów bazujacych na Przypomnienie prostych schematów bazujacych na zaszas. . MetropolisaMetropolisa3.3. DirectDirect--simulationsimulation Monte Monte CarloCarlo (uklady dynamiczne)(uklady dynamiczne)4.4. Wielkosci fizyczne w metodach MWielkosci fizyczne w metodach M--CC
5.5. Metoda dynamiki molekularnejMetoda dynamiki molekularnej1.1. Elementy kwantowej MD (Elementy kwantowej MD (abab initioinitio CarCar--ParinnelloParinnello))2.2. Podstawy i równaniaPodstawy i równania3.3. Schematy numeryczneSchematy numeryczne4.4. Algorytmy liczenia oddzialywan w modelach Algorytmy liczenia oddzialywan w modelach krótkokrótko--zasiegowychzasiegowych5.5. Algorytm Ewalda dla oddzialywan Algorytm Ewalda dla oddzialywan dalekodaleko--zasiegowychzasiegowych6.6. Fast Fast MultipoleMultipole AlgorithmAlgorithm i obliczenia duzej skalii obliczenia duzej skali7.7. Wielkosci Wielkosci charaktrystycznecharaktrystyczne GreenGreen--KoboKobo relationsrelations etc.etc.8.8. Obliczenia duzej skali Obliczenia duzej skali –– równolegloscrównoleglosc
Plan przedmiotu: Metody symulacji w nauce Plan przedmiotu: Metody symulacji w nauce c.d.c.d.
1.1. Hydrodynamika fluktuacyjna w Hydrodynamika fluktuacyjna w mezoskalimezoskali1.1. DyssypatywnaDyssypatywna dynamika dynamika czastekczastek –– schematy numeryczneschematy numeryczne2.2. Fluid Fluid ParticleParticle ModelModel3.3. GenericGeneric DPDDPD4.4. ChapmanChapman--Enskog’aEnskog’a rozwiniecie, równanie rozwiniecie, równanie FokkeraFokkera--PlancaPlanca--
BoltzmannaBoltzmanna5.5. Symulacje zlozonych cieczySymulacje zlozonych cieczy
2.2. SmoothedSmoothed particleparticle hydrodynamicshydrodynamics3.3. Metody symulacji wykorzystujace metody róznic i elementów Metody symulacji wykorzystujace metody róznic i elementów
skonczonychskonczonych4.4. Wprowadzenie do teorii chaosuWprowadzenie do teorii chaosu5.5. Automaty komórkoweAutomaty komórkowe
1.1. Proste CA, mrówka Proste CA, mrówka LansingtonaLansingtona, , 2.2. Model Model IsingaIsinga3.3. LGALGA4.4. LBGLBG5.5. Zlozone CA Zlozone CA –– modele fizyczne (modele fizyczne (VichniacVichniac model) i geologiczne model) i geologiczne
((anastomosinganastomosing riversrivers))6.6. SOC SOC –– modele trzesien ziemi, plonacego lasu, osypywanie siemodele trzesien ziemi, plonacego lasu, osypywanie sie7.7. Modele Modele PennyPenny starzenia sie, symulacje ewolucji osobniczejstarzenia sie, symulacje ewolucji osobniczej
Plan przedmiotu: Metody symulacji w nauce Plan przedmiotu: Metody symulacji w nauce c.d.c.d.
1.1. Symulacje ukladów sypkich i granulatówSymulacje ukladów sypkich i granulatów2.2. Symulacje innych ukladów dyskretnych (ruch pojazdów w Symulacje innych ukladów dyskretnych (ruch pojazdów w
miescie, optymalizacja ruchu na lotnisku itd.)miescie, optymalizacja ruchu na lotnisku itd.)3.3. Systemy Systemy PrusinkiewiczaPrusinkiewicza i i LindemayeraLindemayera4.4. Artificial lifeArtificial life
CrossCross--scales simulations...scales simulations...
Ø Cross-scales simulations –large-scale simulations involving many spatio-temporal scales
• E.Clementi- global ab initio simulations (1983)• P.Lomdahl-Beazley – 3-D NEMD - 109 L-J particles,
penetration dynamics, fracture (1024 CM-5, Los Alamos) (1994)
• F.Abraham– ab initio MD+MD+FEM (fracture dynamics also Holian-Ravello) (1995)
• High-performance computing, ASCI (Options: Red, Blue, Blue Mountain, White) (1995 – NOW)
• Vashishta and Nakano – 3-D long-ranged NEMD, FMM–real electronic structures – 109 particles (1998)
MD MD –– FEMFEM
Molecular Dynamics (MD)
FINER GRID RESOLUTION
INCONSISTENCY?
LARGER NUMBER OF PARTICLES
SPATIAL SCALE [m]
TIME [s]
10 -14
10-12
10-6
1
60
10 -3
10-9 10-6 10-3 1
atoms ⇒ Schwarz procedure ⇒ grid
Finite Differences (FDM) & Finite Elements (FEM)
• chem
ical reactions •
microscopic rheological properties
• mesoscopic flows of colloidal suspension in a capillary
• mesoscopic rheological properties,
• viscoelasticity
• permeability • phase diagram • thermal
conductivity • other global
parameters
ab initio
Molecular Dynamics
• potentials • parameters of chem. reactions
HadjiconstantinouHadjiconstantinou--Patera MD+FEM; Glowinski et. al. DNS;Patera MD+FEM; Glowinski et. al. DNS;
... ... and scales crossing modelsand scales crossing models
ØØ Scales crossing models employ Scales crossing models employ mesoscopicmesoscopicobjects representing clusters of atoms and objects representing clusters of atoms and molecules molecules
•• Spatial scaleSpatial scale àà 100 nm 100 nm -- 1010µµm m •• Temporal scaleTemporal scaleàà nanosecondsnanoseconds--milisecondsmiliseconds
ØØ MesoscopicMesoscopic world world –– blend of microblend of micro--macro macro effectseffects
•• Microscopic Microscopic àà thermal fluctuations, chemical reactions, thermal fluctuations, chemical reactions, interatomicinteratomic forces, excluded volume effects forces, excluded volume effects –– e.g., depletion e.g., depletion forces, (also quantum effects)forces, (also quantum effects)
•• Macroscopic Macroscopic àà flows, advection, complex flows flows, advection, complex flows ààhydrodynamic instabilities (Rhydrodynamic instabilities (R--T, RT, R--M, RM, R--B, KelvinB, Kelvin--HelmholtzHelmholtz, , SaffmanSaffman--Taylor) Taylor) àà mixing, vortices formationmixing, vortices formation
OnOn--lattice and offlattice and off--lattice lattice methodsmethods
ØØ OnOn--lattice methods (particles or group of particles lattice methods (particles or group of particles colliding on grid nodes)colliding on grid nodes)ll Cellular automata: CA, LG, LBG Cellular automata: CA, LG, LBG ll Random walker: DLA, RLA, PercolationRandom walker: DLA, RLA, Percolationll Spin glassesSpin glasses
ØØ OffOff--lattice methodslattice methodsll MonteMonte--Carlo: DSMC (direct simulation MC) [Bird 1983]Carlo: DSMC (direct simulation MC) [Bird 1983]ll Moving grid: SPH (smoothed particle hydrodynamics, Moving grid: SPH (smoothed particle hydrodynamics,
[Monaghan 1980] MPS (moving particles semi[Monaghan 1980] MPS (moving particles semi--implicit method)implicit method)ll Fluid particles: DPD [Fluid particles: DPD [HoogerbruggeHoogerbrugge, , KoelmanKoelman],], FPM, TCFPM, TC--DPD DPD
[[EspanolEspanol, 2001], 2001]ll Granular dynamics [Granular dynamics [H.HerrmannH.Herrmann]]
ØØ HeterogeneousHeterogeneousll HardHard--core particles in fluid FEM+MD: e.g., DNS [core particles in fluid FEM+MD: e.g., DNS [GlowinskiGlowinski et. et.
al.], FPD [Tanaka, Araki]al.], FPD [Tanaka, Araki]ll LBG+MD [LBG+MD [Yoemans, Coveney, SlootYoemans, Coveney, Sloot]]
OffOff--lattice lattice àà particlesparticles OOOFFFFFF--- GGGRRRIIIDDD PPPAAARRRTTTIIICCCLLLEEE MMMEEETTTHHHOOODDDSSS
conservative interactions
MD
DDPPDD + dissipative and Brownian forces
FFPP MM + particles rotation, non-central forces
SS PPHH Regularized tensor interactions
AT
OM
S
CL
UST
ER
S OF
AT
OM
S
FL
UID
PA
RT
ICL
ES-V
OL
UM
EL
ESS
MOVING MESH NODES
+ variable mass and particle volume non-isothermal model
TTCC-- DDPP DD FL
UID
PA
RT
ICL
ES O
N V
OR
ON
OI L
AT
TIC
E
Fluid ParticlesFluid Particles
colloidal bead
dissipative particle
BOTTOM-UP APPROACH
MD – particles creating Voronoy clusters
Colloidal bead
Dissipative particle
TOP-DOWN APPROACH
Finite Volume - contiuum description.
• Bottom-up approach, Flekkoy and Coveney, 1999
• Top-down approach, Serrano and Espanol, 2002
( )[ ] ∑∑∑ +
⋅++−++=
lkl
lklklklkl
klkl
klkl
l
lkklk
k
rpLMM
dtd FeeUUeUUgP ~
22η&
( ) ( ) ( ) ( )i
ii
N
ii
i
ii
N
ii
mhWff
mhWff
ρρ,)( ;,)(
11
rrrrrrrr −∇⋅=∇−⋅= ∑∑==
( ) ( ) ( ) , ,,1
21
22 hWmp
dtd
hWpp
mdt
dji
N
jjij
i
iiji
N
j j
j
i
ij
iii
rrvvrrv
−∇−−=−∇⋅
+−= ∑∑
−−
oρ
ερρ
EQUATIONEQUATIONLotka-Volterra model is the simplest model of predator-prey interactions. Themodel was developed independently by Lotka (1925) and Volterra (1926):
It has two variables (P, H) and several parameters:H = density of preyP = density of predatorsr = intrinsic rate of prey population increasea = predation rate coefficientb = reproduction rate of predators per 1 prey eatenm = predator mortality rate
COMMENTCOMMENT
ØØ The model of The model of LotkaLotka and and VolterraVolterra is not very is not very realistic. realistic.
ØØ It does not consider any competition among prey It does not consider any competition among prey or predators. As a result, prey population may or predators. As a result, prey population may grow infinitely without any resource limits. grow infinitely without any resource limits.
ØØ Predators have no saturation: their consumption Predators have no saturation: their consumption rate is unlimited. rate is unlimited.
ØØ The rate of prey consumption is proportional to The rate of prey consumption is proportional to prey density. Thus, it is not surprising that model prey density. Thus, it is not surprising that model behavior is unnatural showing no asymptotic behavior is unnatural showing no asymptotic stability. stability.
PROSTE ALGORYTMYPROSTE ALGORYTMYZLOZONY SWIATZLOZONY SWIAT
Prof. dr hab. inz. Witold Dzwinel
Katedra Informatyki AGH
Molecular Dynamics Molecular Dynamics BasicsBasics
Aaron Aaron WemhoffWemhoffMultiphase Transport LaboratoryMultiphase Transport Laboratory
MicroscaleMicroscale Heat Transfer LaboratoryHeat Transfer LaboratoryDepartment of Mechanical EngineeringDepartment of Mechanical Engineering
University of California, BerkeleyUniversity of California, Berkeley
About Molecular DynamicsAbout Molecular Dynamics• Molecule behavior based on basic Newtonian mechanics of
monatomic condensed gases
• Allows for “bottom-up” approach to predicting system phenomena at the nanoscale
• Newton → Idea
• Computing Age → Implementation
• Computationally intensive
• Advantage: simple theoretical background
• Disadvantage: limited system size
Why Monatomic Gases?Why Monatomic Gases?• Monatomic Gases → van der Waals liquids and solids
• The van der Waals forces are weak…
→ Forces are sufficient at low temperatures (small kBT).
• It won’t apply at room temperatures…→ Same phenomena as common solids at room temperature b/c of the ratio of interatomic to thermal energies
• Hydrogen bonding and other polar interactions are not included…
→ Can still observe basic phenomena at the nanoscale; more complex situations can be considered through complex intermolecular potential functions.
• Newton:dtvd
mF ii
jij
rr=∑ ij
ij
ijij r
rF ˆ
∂∂
−=φr
i
j
Fij
vi(t)
Force
Mass
Acceleration
Potential Energy
Unit vector from i to j
KineticsKinetics
• Newton:dtvd
mF ii
jij
rr=∑ ij
ij
ijij r
rF ˆ
∂∂
−=φr
• Updated Position:
( ) ( )i
iiii m
tFttvttrttr
)(21
)()()( 2
rrrr
∆+∆+=∆+
new position
old positionold velocity
old force
KineticsKinetics
i
Fij
vi
i
(t)
(t + ∆t)
j
• Newton:dtvd
mF ii
jij
rr=∑ ij
ij
ijij r
rF ˆ
∂∂
−=φr
• Updated Position:
( ) ( )i
iiii m
tFttvttrttr
)(21
)()()( 2
rrrr
∆+∆+=∆+
• Updated Velocity:
( )i
iii m
tFttv
ttv
)(21
)(2
rrr
∆+=
∆
+ ( )i
iii m
ttFtttvttv )(21
2)( ∆+∆+
∆+=∆+
rr
first half of time step second half of time step
KineticsKinetics
i
Fij
vi
i
(t)
Fij
vi
(t + ∆t)
j
• Newton:dtvd
mF ii
jij
rr=∑ ij
ij
ijij r
rF ˆ
∂∂
−=φr
• Updated Position:
( ) ( )i
iiii m
tFttvttrttr
)(21
)()()( 2
rrrr
∆+∆+=∆+
• Updated Velocity:
( )i
iii m
tFttv
ttv
)(21
)(2
rrr
∆+=
∆
+ ( )i
iii m
ttFtttvttv )(21
2)( ∆+∆+
∆+=∆+
rr
• System Temperature:
TNkmv B
N
ii 2
321
1
2 =∑=
∑=
=N
iii
B
vmNk
T1
2
31
system kinetic energy equipartition theorem
KineticsKinetics
i
Fij
vi
i
(t)
Fij
vi
(t + ∆t)
j
Carey, V.P., Statistical Thermodynamics and Microscale Thermophysics, New York: Cambridge University Press, 1999.
• No long range interactions• Interact via elastic collisions
“Hard Sphere” Potential
Gases• Electric dipole ~ r -3
• 2 dipoles ~ r -6
• Repulsive nuclear forces ~ r -12
• Total Potential = (Attractive) + (Repulsive)“Lennard-Jones 6-12 Potential”
Dense Gases, Liquids and SolidsIntermolecular PotentialsIntermolecular Potentials
• Large systems are composed of a grid of equivalent smaller systems
∞
∞
∞∞
v
Periodic Boundary Periodic Boundary ConditionsConditions
• Large systems are composed of a grid of equivalent smaller systems
• When molecules pass through one boundary another molecule enters in the opposite boundary
∞
∞
∞∞
Periodic Boundary Periodic Boundary ConditionsConditions
• Thin liquid film mixture density profile
Matsumoto, M., Takaoka, Y. and Kataoka, Y., 1993, Liquid-Vapor Interface of Water-Methanol Mixture, J. Chem. Physics, Vol. 98, pp. 1464-1472.
Tarek, M., Tobias, D.J. and Klein, M.L., 1996, Molecular Dynamics of an Ethanol-Water Solution, Physica A, Vol. 231, pp. 117-122.
ExamplesExamples
Weng, J.G., Park, S.H., Lukes, J.R., and Tien, C.L., 2000, Molecular dynamics investigation of thickness effect on liquid films, Journal of Chemistry and Physics, Vol. 113, pp. 5917-5923.
• Thin liquid film stress distribution
ExamplesExamples
• Molecular transport in droplets
Maruyama, S., Matsumoto, S., and Ogita, A., 1994, Surface Phenomena of Molecular Clusters by Molecular Dynamics Method, Thermal Science and Engineering, Vol. 2, No. 1.
• Bubble nucleation on solid surfaces
Maruyama, S, and Kimura, T., 2000, A Molecular Dynamics Simulation of a Bubble Nucleation on Solid Surface, Heat and Technology, Vol. 18, pp. 69-73.
ExamplesExamples
• Rayleigh-Taylor instability generation
Dzwinel, W., Alda, W., Pogoda, M., and Yuen, D.A., 2000, Turbulent mixing in the microscale : a 2D molecular dynamics simulation, Physica D, Vol. 137, pp. 157-171.
ExamplesExamples
• Newton:dtvd
mF ii
jij
rr=∑ ij
ij
ijij r
rF ˆ
∂∂
−=φr
• Updated Position:
( ) ( )i
iiii m
tFttvttrttr
)(21
)()()( 2
rrrr
∆+∆+=∆+
• Updated Velocity:
( )i
iii m
tFttv
ttv
)(21
)(2
rrr
∆+=
∆
+ ( )i
iii m
ttFtttvttv )(21
2)( ∆+∆+
∆+=∆+
rr
• System Temperature:
TNkmv B
N
ii 2
321
1
2 =∑=
∑=
=N
iii
B
vmNk
T1
2
31
system kinetic energy equipartition theorem
KineticsKinetics
i
Fij
vi
i
(t)
Fij
vi
(t + ∆t)
j
Simulating Dynamical Features of Escape Simulating Dynamical Features of Escape PanicPanic
Dirk Helbing, Illes Farkas, and Dirk Helbing, Illes Farkas, and Tamas VicsekTamas Vicsek
Presentation byPresentation byAndrew GoodmanAndrew Goodman
The ProblemThe Problem
ØØCrowd stampedes can be deadlyCrowd stampedes can be deadlyØØ People act in uncoordinated and People act in uncoordinated and
dangerous ways when panickingdangerous ways when panickingØØ It is difficult to obtain real data on crowd It is difficult to obtain real data on crowd
panicspanics
The SolutionThe Solution
ØØModel people as selfModel people as self--driven particlesdriven particlesØØModel physical and socioModel physical and socio--psychological psychological
influences on people’s movement as influences on people’s movement as forcesforces
ØØ Simulate crowd panics and see what Simulate crowd panics and see what happenshappens
Acceleration of Simulated Acceleration of Simulated PeoplePeople
ØØ vvii00(t) = desired speed(t) = desired speed
ØØ eeii00(t) = desired direction(t) = desired direction
ØØ vvii(t) = actual velocity(t) = actual velocityØØ tt i i = characteristic time= characteristic timeØØ mmii = mass= mass
Forces from Other PeopleForces from Other People
ØØ Force from other people’s bodies being in Force from other people’s bodies being in the waythe way
ØØ Force of friction preventing people from Force of friction preventing people from slidingsliding
ØØ Psychological “force” of tendency to avoid Psychological “force” of tendency to avoid each othereach other
ØØ Sum of forces of person j on person i is fSum of forces of person j on person i is f ijij
Total Force of Other PeopleTotal Force of Other People
ØØ AAiiexp[(rexp[(rijij –– ddijij)/B)/Bii]]nnijij is psychological “force”is psychological “force”•• rrijij is the sum of the people’s radiiis the sum of the people’s radii•• ddijij is the distance between their centers of massis the distance between their centers of mass•• nnij ij is the normalized vector from j to iis the normalized vector from j to i•• AAii and Band B ii are constantsare constants
Physical ForcesPhysical Forces
ØØ kg(rkg(rijij –– ddijij))nnijij is the force from other is the force from other bodiesbodies
ØØ ??gg(r(rijij –– ddijij))?? vvttijijttijij is the force of sliding is the force of sliding
frictionfrictionØØ g(x) is 0 if the people don’t touch and x g(x) is 0 if the people don’t touch and x
if they do touchif they do touchØØ ttijij is the tangential directionis the tangential directionØØ ?? vv tt
ijij is the tangential velocity differenceis the tangential velocity differenceØØ k and k and ?? are constantsare constants
Forces from WallsForces from Walls
ØØ Forces from walls are calculated in basically Forces from walls are calculated in basically the same way as forces from other peoplethe same way as forces from other people
Values Used for Constants and Values Used for Constants and ParametersParameters
ØØ Values chosen to match flows of people Values chosen to match flows of people through an opening under nonthrough an opening under non--panic panic conditionsconditions
ØØ People are modeled as the same except People are modeled as the same except for their radiusfor their radius
ØØ Insufficient data on actual panic situations Insufficient data on actual panic situations to analyze the algorithm quantitativelyto analyze the algorithm quantitatively
Simulation of CloggingSimulation of Clogging
ØØ As desired speed increases beyond 1.5m As desired speed increases beyond 1.5m ss--11, it takes more time for people to leave, it takes more time for people to leave
ØØ As desired speed increases, the outflow of As desired speed increases, the outflow of people becomes irregularpeople becomes irregular
ØØ Arch shaped clogging occurs around the Arch shaped clogging occurs around the doorway doorway
Mass BehaviorMass Behavior
ØØ Panicking people tend to exhibit herding Panicking people tend to exhibit herding behaviorbehavior
ØØ Herding simulated using “panic parameter” pHerding simulated using “panic parameter” p
FindingsFindings
ØØ Bottlenecks cause cloggingBottlenecks cause cloggingØØ Asymmetrically placed columns around Asymmetrically placed columns around
exits can reduce clogging and prevent exits can reduce clogging and prevent build up of fatal pressuresbuild up of fatal pressures
ØØ A mixture of herding and individual A mixture of herding and individual behavior is idealbehavior is ideal
Some QuestionsSome Questions
ØØ Are parameters based on nonAre parameters based on non--panic panic situations correct for panic situations?situations correct for panic situations?
ØØHow can we get quantitative data about How can we get quantitative data about panic situations to test simulations?panic situations to test simulations?
ØØWhat happens when injured people are What happens when injured people are allowed to fall over (and possibly be allowed to fall over (and possibly be trampled)?trampled)?