Docsity

Particle Simulation: Governing Equations, Applications, and Methods - Prof. Juan Cebral, Study notes of Computer Science

Partial preview of the text

Download Particle Simulation: Governing Equations, Applications, and Methods - Prof. Juan Cebral and more Study notes Computer Science in PDF only on Docsity!

Particle Methods 1.

PP Methods

PM Methods

PPPM Methods

SPH Methods

Particle systems

•^

Particle simulations are common in many fields ofcomputational sciences

-^

Many continuous problems can be re-cast as particlesystems

-^

Many problems can be thought of as particle systems (e.g. visualization / computer graphics – smoke, fire, …)

-^

Pros: particles are easier to handle than meshes

-^

Cons: usually need many particles, boundaries aredifficult

Governing equations

•^

System of coupled ODE’s given by Newton’s secondLaw:

-^

The force vector is the sum of the forces exerted by allother particles and external forces

mass:

vector

force:

vector

velocity:

ector

position v: i i i^ i

i

i

i

i

i d dt m

d dt m x v f

v

x

f

v^ =

Particle forces

Different types of forces can be applied to the particles: •^

Forces from an external field^ – Particles traveling through an electro-magnetic field (Lorentz

forces)

  • Particles traveling through a gravitational field – Particles moving with a given velocity field (streamlines) -^

Forces from other particles^ – Charged particles^ – Gravitating particles^ – Collisions

-^

Forces from the domain boundaries^ – Contact forces

Particle Animations: Blood Flows

Particle Animations: Smoke

Example: plasma physics

-^

A plasma is a hot, fully ionized gas which can be regarded as acollection of positive ions and negative electrons interacting throughtheir mutual electric and magnetic fields Maxwell’s equations:

t

t

c ∂^ ∂ − = × ∇

= ⋅ ∇

∂ ∂

= × ∇

= ⋅ ∇

B

E E

E

j

B B

0

2

(^0) /

1

0

ε μ ρ

[^

] B v E

F^

×

=^

q

:

force

Lorentz

F

v^

= d^ dt m :

law s

Newton'

∑

∑

=

=

=

=

N i

i i

N i

i

V

q V q

1

1

/

:

density

current

Electric

/

:

density

Charge

v

j

ρ

Examples: plasma models

-^

Full plasma physics equations^ –

Described by the full Maxwell’s equations in 3D

-^

Magneto-hydrodynamics (MHD)^ –

Low density/frequency plasmas can be described as a continuousneutral fluid through which electric currents flow => governing equationsare Maxwell’s equations and Navier-Stokes equations

-^

Electrostatic plasmas^ –

High frequencies and small space scales

0

2

0

/ 0

, /

0

, 0

ε ρ

φ

ε φ ρ

−

∇

−∇

⇒

= × ∇ = ⋅ ∇ = × ∇ = ⋅ ∇

E

E

E

B

B

Particle-Particle Method

•^

Simplest method to advance a particle system Basic idea: •^

Compute total force on each particle as sum of forcesexerted by all other particles

-^

Advance particle velocities using Newton’s second law

-^

Advance particle positions from current velocities

PP basic loop

•^

Initialize force array:

f

=0i

•^

For each pair of particles

i,j

  • Compute force

f

ij

•^

Integrate equations of motion– Advance velocities– Advance positions

-^

Update– Velocities– Positions– Time

-^

Loop back

Force calculation

calcForces(x,f) {

for(i=0; i<3*Npart; i++) f[i]=0.0;

// init force array =

for(i=0; i Operation count

•^

For one time step and

Np

particles:

  • Force calculation:

O(N

(^2) p )

  • Update:

O(N

)p

•^
=> FLOPS
N

(^2) p

(FLOPS: floating point operations per second) ¾

To do one timestep per second with 10

6

particles,

we would need a 10 Tflops machine

N

p^

FLOPS/timestep

10

2

10

5

10

3

10

7

10

4

10

9

10

5

10

11

10

6

10

13

10

7

10

15

Symmetric force calculations

•^

Newton’s 3

rd

law:

fij

=- f

ji

•^

Can cut the inner loop in the force calculation by 2 for(i=0; i Avoiding force divergences

•^

Several force potentials diverge at

r=

(when two

particles become too close) causing numericalinstabilities

-^

Option 1: use adaptive time-steps

-^

Option 2: add a force cut-off for

r<

(neglect very short range force effects)

•^

Option 3: add repulsive term to model particle collisions

r

φ (r) cut-off

ε

r

φ (r)