スライド 1umeda/vlasov/vlasov1_handson...title スライド 1 author umeda created date 9/7/2018...
TRANSCRIPT
VLASOV1:One-dimensional (1x1v) Electrostatic Vlasov Code
ISSS-13 Hands-on Session for Vlasov code
Takayuki UmedaInstitute for Space-Earth Environmental Research
Nagoya [email protected]
Computer Simulations
• Programming in Fortran/C• Compiling (with gfortran/gcc,
Intel ifort/icc, PGI pgf90/pgcc)• Running programs• Data output• Data import into
Visualization tool• Visualization
• For research
• Coding in script
• Running scripts
• Visualization
• For education
GeneralMATLAB/Octave/ScilabIDL/FL, python, ...
• Easy for debugging• Useful to beginners
KEMPO1 vs. VLASOV1
• Particle-In-Cell– Lagrangian + Eulerian
• Electromagnetic /Electrostatic
• 1x3v
• Self-consistent (enhanced) thermal fluctuations
• Eulerian
• Electrostatic only– Limited applications
• 1x1v– 1x3v too heavy...
• Thermal fluctuations imposed as initial noise.
• Various schemes
• Similar graphical user interface of MATLAB
Computational Resources: How heavy??
• 1x1v: Nx × Nv = 1000×1000 ~ 10MBSuitable for laptop computing
• 2x2v: Nx×Ny×Nvx×Nvy = 1004 ~ 4GB• 2x3v: Nx×Ny×Nvx×Nvy×Nvz = 405 ~ 4GBHigh-performance and parallel computing is essential for hyper-dimensional simulations.
Large gaps in both computational time and memory
Exercises
• Electrostatic Linear Dispersion Relation: omega-k_diagram.dat
• Propagation of Langmuir Wavesand Landau Damping: wave_propagation.dat
• Langmuir Decay Instability: Lamgmuir_decay.dat• Two-stream Instability: two-stream_instability.dat• Buneman Instability: Buneman_instability.dat• Harmonic Langmuir waves: harmonic_Langmuir.dat
ES dispersion relation
• Load “w-k_diagram.dat” and Preview parameters. • START the simulation run. • Change any parameter as you like…(^^)
• Change Interpolation scheme and check how the ω-k diagram changes.
Basic Equations (1D)• Vlasov equation
and• Poisson equation
or• Maxwell equation
0=∂∂
+∂∂
+∂∂
xxx v
fEmq
xfv
tf
0=∂∂
+∂∂
xJ
txρ
∫= xvfq dρ
00
=+∂∂
εxx J
tE
00
=−∂∂
ερ
xEx
Overview of Numerical Techniques for 1D ES code
0=∂∂
+∂∂
+∂∂
xxx v
fEmq
xfv
tf
0
0
=∂∂
+∂∂
=∂∂
+∂∂
xx
x
vfE
mq
tf
xfv
tf
“Splitting” Scheme [Cheng & Knorr 1976]Vlasov equation
Valid when vx and Ex are constant in time.
Use this as an approximation for Δt << 1.
Splitting Scheme[Cheng & Knorr, 1976]
i i+1
j
j+1vx
Ex
0
0
=∂∂
+∂∂
=∂∂
+∂∂
xfE
mq
tf
xfv
tf
x
x
Get ○
Splitting Scheme[Cheng & Knorr, 1976]
i i+1
j
j+1vx
Ex
0
0
=∂∂
+∂∂
=∂∂
+∂∂
xfE
mq
tf
xfv
tf
x
x
Get △
Splitting Scheme[Cheng & Knorr, 1976]
i i+1
j
j+1vx
Ex
0
0
=∂∂
+∂∂
=∂∂
+∂∂
xfE
mq
tf
xfv
tf
x
x
Get ☆
Time Stepping
t – ∆t/2
t
t +∆t/2
t + ∆t
KEMPO1(EM)v
x
J
B E1
2
3
4
6
5
Splitting Schemev
x
J
E3
1
5
12
4
Time Stepping
t – ∆t/2
t
t +∆t/2
t + ∆t
KEMPO1(EM)v
x
J
B E1
2
3
4
6
5
VLASOV1(ES)v
x
J
E2
3
4
1
v: velocity***.m x: position***.m
Numerical Integration in Time
• Euler : Low accuracy• Runge-Kutta (4th-order) : Higher accuracy
Needs more memory to keep intermediate data
• Semi-Lagrangian
xff
tt
∂∂~δ
𝑓𝑓𝑡𝑡+∆𝑡𝑡 = 𝑓𝑓𝑡𝑡 + ∆𝑡𝑡𝛿𝛿𝑓𝑓𝑡𝑡
𝑓𝑓𝑡𝑡+∆𝑡𝑡(𝑥𝑥) = 𝑓𝑓𝑡𝑡(𝑥𝑥 − 𝑣𝑣∆𝑡𝑡)
𝑓𝑓𝑡𝑡+∆𝑡𝑡 = 𝑓𝑓𝑡𝑡 + ∆𝑡𝑡6 𝛿𝛿𝑓𝑓𝑡𝑡+2𝛿𝛿𝑓𝑓′+2𝛿𝛿𝑓𝑓′′+𝛿𝛿𝑓𝑓′′′
𝑓𝑓′ = 𝑓𝑓𝑡𝑡 + ∆𝑡𝑡2 𝛿𝛿𝑓𝑓
𝑡𝑡 , 𝑓𝑓′′ = 𝑓𝑓𝑡𝑡 + ∆𝑡𝑡2 𝛿𝛿𝑓𝑓
′
𝑓𝑓′′′ = 𝑓𝑓𝑡𝑡 + ∆𝑡𝑡𝛿𝛿𝑓𝑓′′
Semi-Lagrangian
0=∂∂
+∂∂
xfV
tf
),(),( ttVxfttxf ii ∆−=∆+
x
f(x,t)V∆t
1D advection equation
Shift of profiles with a numerical interpolation.
General solution
f(x,t+∆t)
)( Vtxff −≡
Interpolation Schemes
SchemeLinear2nd-order4th-orderCubic SplineFFTCIP3PIC4
AccuracyVery lowMiddleHighHighHighestVery highHigh
Conservation/Oscillation
Y/NY/YY/YN/YN/YN/YY/N
CPU loadLowLowMiddleHigherHighHighHigher
Conservative Form
• Non-conservative form
• Conservative form
For the periodic system (U1/2=UNx+1/2)
it
itt
i fff δ+=∆+
21
21 +−
∆+ −+= iit
itt
i UUff
∑∑ =∆+
i
ti
i
tti ff
∆t is included in δf and U.
Lagrange Interpolation• 1st-order (Linear)
• 2nd-order
• 4th-order
abxxg +=)(
abxcxxg ++= 2)(
Spuriousundershoot/overshoot
(extremum)
abxcxdxexxg ++++= 234)(
Lagrange Interpolation• 1st-order upwind
Conservative• 2nd-order central
Conservative
( )ti
ti
xti
tti ff
xtvff −
∆∆
+= −∆+
1
Ui+1/2Ui-1/2
+−
∆∆
+
−∆∆
+= +−+−∆+
22
211
211
ti
ti
tix
ti
tixt
itt
ifff
xtvff
xtvff
−
∆∆
−
+∆∆
−
−
∆∆
+
+∆∆
+=
++
−−∆+
22
22
12
1
12
1
ti
tix
ti
tix
ti
tix
ti
tixt
itt
i
ffxtvff
xtv
ffxtvff
xtvff Ui-1/2
Ui+1/2
Lagrange Interpolation• 4h-order centralConservative
+−+−
∆∆
+
+−−
∆∆
+
−+−
∆∆
+
−++−∆∆
=
−++
−++
−++
−+++
2433
12
241515
1277
1124
1123
1122
11221
ti
ti
ti
tix
ti
ti
ti
tix
ti
ti
ti
tix
ti
ti
ti
tix
i
ffffxtv
ffffxtv
ffffxtv
ffffxtvU
Cubic Spline32 xdxcxbff iii
ti
tti −+−=∆+
Non-conservativeδf
iiit
it
i
iiit
it
i
dcbffdcbff
+++=
−+−=
+
−
1
1
iiii
ti
iiii
ti
dcbbx
f
dcbbx
f
32
32
11
11
++==∂∂
−+−=−=∂∂
++
−−
xxtvx ≡
∆∆
x=-1 for “i+1”x=0 for “i”x=1 for “i-1”
iii
ti
iii
ti
dccxf
dccxf
622
622
121
2
121
2
+==∂∂
−==∂∂
++
−−
MATLAB has “spline” function.
Matrix operation necessary“Global” interpolation
FFT (Spectral Scheme)
tkx
tk
ttk FtjkvFF ∆+=∆+
]exp[ tjkvFF xt
ktt
k ∆−=∆+
[ ]∑ −=k
ikt
i tkxjFf )(exp ω
0=∂∂
+∂∂
xfv
tf
x
),(),( ttvxfttxf xii ∆−=∆+Non-conservativeGlobal interpolation
MATLAB has “fft” function.
Semi-Lagrangian
CIP Scheme: Constrained Interpolation Profile
xfg
xgv
tg
xfv
tf
x
x
∂∂
≡=∂∂
+∂∂
=∂∂
+∂∂
,0
0
One of “multi-data (multi-moment)” schemes
2
32
32
∆∆
+∆∆
+=
∆∆
+
∆∆
+∆∆
+=
∆+
∆+
xtvd
xtvcgg
xtvd
xtvc
xtvgff
xi
xi
ti
tti
xi
xi
xi
ti
tti
CIP Scheme: Constrained Interpolation Profile
xfg
xgv
tg
xfv
tf
x
x
∂∂
≡=∂∂
+∂∂
=∂∂
+∂∂
,0
0
2
32
32
∆∆
+∆∆
+=
∆∆
+
∆∆
+∆∆
+=
∆+
∆+
xtvd
xtvcgg
xtvd
xtvc
xtvgff
xi
xi
ti
tti
xi
xi
xi
ti
tti
)(2)(32
11
11
−−
−−
−−+=−−+=
iiiii
iiiii
ffggdffggc
3data (𝑓𝑓, 𝜕𝜕𝑓𝑓/𝜕𝜕𝑥𝑥, 𝜕𝜕𝑓𝑓/𝜕𝜕𝑣𝑣) for 1x1v
One of “multi-data (multi-moment)” schemes
“PIC” Scheme: Conservative,Non-oscillatory and Positive
( )( )( ) ( )( )( )( ) ( )( )( )( ) ( ) cffxxx
bffxxxaffxxxxfU
ti
ti
ti
ti
ti
ti
tii
12
1
1
2112132112
21
++
+
−+
−−−+−−−−++
−−++−=
Another conservative form of the 4th-degree Lagrange interpolation.
Modification (correction) of the gradients.
Details are given in Umeda EPS 2008 & Umeda et al. CPC 2012
Gradients
0 ≤ 𝑎𝑎, 𝑏𝑏, 𝑐𝑐 ≤ 1
“PIC” Scheme: Conservative,Non-oscillatory and Positive
Details are given in Umeda EPS 2008 & Umeda et al. CPC 2012
Detect local extrema (fmax and fmin) and limit the gradient to (fmax-fi) or (fmin-fi)
Langmuir wave propagation
• Load “wave_propagation.dat” and Previewparameters. Also, preview the initial noise.
• START the simulation run.
Electron fluid eqs.
γ = 3 for 1D velocity space.
Langmuir wave propagation
• Change initial noise and check the wave propagation.
• Change interpolation scheme and check how the result changes.
Linear interpolation
Numerical diffusion (dissipation)
Langmuir wave propagation
• Change initial noise and check the wave propagation.
• Change interpolation scheme and check how the result changes.
• Change E-field scheme and check how the result changes.– Charge+Poisson and Charge Conservation
should be same.
i-1 i i+1ρ
f(v)ρ
f(v)ρ
f(v)
ExJx
Staggered Grid SystemSame as KEMPO1Ex
Jx
Poisson Maxwell0=
∂∂
+∂∂
xJ
txρ
∫= xvfq dρ
Charge conservation
i-1 i i+1ρ
f(v)ρ
f(v)ρ
f(v)
ExJx
Collocated Grid SystemExJx
Maxwell
∫= xvfq dρ
ExJx
∫= xxx vfvqJ d
Can we use this “non-conservative” scheme??Check by Current+E-field
Landau damping
• Change Initial noise to a higher mode number and check the wave propagation.
Mode 7 + FFT
exp(-0.096*2 t)
Recurrence [Cheng & Knorr 1976]
(back to initial condition)
dv ~ 0.2kx = 2*pi*7/100tR = 2*pi/(kx*dv)
~ 71.4
Langmuir decay• Load “Langmuir_decay.dat” and Preview parameters. • START the simulation run. • Make the thermal velocity of ions (Species 2) smaller
and check how the wave propagate. VT(2) = 0.05VT(2) = 0.2
Langmuir decay• Make the amplitude of the initial noise smaller and
check how the wave mode propagate.• Check that large-amplitude Langmuir waves are
stable when ions are absent.
VT(2) = 0.05, PAMP(4) = 0.5VT(2) = 0.05, Pamp(4) = 0.05
Two-stream instability
• Load “two-stream_instability.dat” and Previewparameters.
• START the simulation run. • Change Interpolation scheme and check how
the result changes. – Compare the results between 4th Lagrange
and PIC4, and check how the limiter of PIC4 scheme affects.
Buneman instability• Load “Buneman_instability.dat” and Preview
parameters. • START the simulation run. • Change the thermal velocity of ions and check
how the result changes. VT(2) = 0.2VT(2) = 0.1
Harmonic Langmuir waves• Load “harmonic_Langmuir.dat” and Preview
parameters. • START the simulation run.
Yoon et al. & Umeda et al. PoP 2003
For further studies…• If you want install your own scheme, edit
“velocity.m” and “position.m” files. – Numerical schemes for Vlasov simulations
are still developing. • Try to implement recent high-accuracy
schemes into VLASOV1.– MMA [Minoshima+ CPC 2015] is a high-accuracy
multi-data scheme. Please compare with CIP.– Monotonicity Preserving scheme [Tanaka+ ApJ
2017] is a higher-order one. Please compare with PIC4.
For further studies…• For scientific computing, the VLASOV1/MATLAB
code should be ported to Fortran/C. – Fortran/C codes run much faster than MATLAB
scripts.• Parallel computing is also necessary for solving
multiple velocity dimensions. • High-performance computing techniques are
required for large-scale simulations. • If you find any bug, please report to