Skip to content
Yakumoo edited this page Aug 31, 2023 · 16 revisions

All the equations are dimensionless.

Nomenclature:

  • n : density
  • φ : electric potential
  • Ω = Δφ : vorticity
  • κ : density gradient
  • C : adiabatic parameter
  • ν : viscosity
  • D : diffusivity
  • Xₖ : X in the Fourier space
  • X̅ = 1/Ly ∫_y X(x,y) dy : zonal average
  • X̃ = X - X̅ : fluctuations
  • [X,Y] = ∂ˣX∂ʸY - ∂ʸX∂ˣY : Poisson bracket
  • X* : conjugate of X

hasegawa_wakatani_pspectral_2d

Pseudo-spectral method (periodic boundaries) of the Hasekawa-Wakatani model in 2D.

We used the 2/3 rule for the zero padding to avoid aliasing effects. These equations are expressed in the Fourier space. ϕ k t = C k k 2 ( ϕ k n k ) ν k ϕ k + 1 k 2 [ ϕ , Δ ϕ ] k n k t = C k ( ϕ k n k ) i κ k y ϕ k D k n k [ ϕ , n ] k where [ ϕ , Δ ϕ ] k = RFFT 2 ( iRFFT 2 ( i k x φ k )   iRFFT 2 ( i k y k 2 φ k ) iRFFT 2 ( i k y φ k )   iRFFT 2 ( i k x k 2 φ k ) )

\ C k ν k D k
k y 0 C ν x k x 2 + ν y k y 2 D x k x 2 + D y k y 2
k y = 0 (zonal flows) 0 ν z D z

The initial state is initialised in the Fourier space.

hasegawa_wakatani_pspectral_2d:
  grid_size: 682
  domain: 50
  atol: 1.0e-10
  rtol: 1.0e-10
  νx: 1.0e-4
  νy: 1.0e-4
  νz: 1.0e-5
  Dx: 1.0e-4
  Dx: 1.0e-4
  Dz: 1.0e-5
  tf: 500
  video_length: 10
pspectral_2D.mp4

Runtime (GPU RTX 3060) ≈ 1h20

hasegawa_wakatani_pspectral_1d

Pseudo-spectral method of the single poloidal mode of Hasekawa-Wakatani.

It is simply a wrapper of hasegawa_wakatani_pspectral_2d where the grid_size in the y direction is 4. The domain in the y direction is 2*pi/ky where ky is the most unstable wave number (maximizing the growth rate γ) computed numerically. See also hasegawa_wakatani_findiff_1d.

hasegawa_wakatani_pspectral_1d:
  grid_size: 682
  domain: 50
  νx: 1.0e-2
  νy: 1.0e-4
  νz: 1.0e-5
  Dx: 1.0e-4
  Dy: 1.0e-4
  Dz: 1.0e-5
  tf: 300
  atol: 1.0e-10
  rtol: 1.0e-10
  video_length: 30
  video_fps: 100

We increased νx because the loss of νy/modes in the y direction

pspectral_1d_decomposed

hasegawa_wakatani_findiff_1d

Finite difference method of the single poloidal mode model.

In this model, only one poloidal mode is kept. Therefore, we can express n, φ and Ω this way: X = X + X k e i k y y + X k e i k y y where ky is a parameter, the single poloidal mode, the most unstable wave number. The equations become: Ω k t = i k y ( ϕ k Ω x Ω k ϕ x ) + C ( ϕ k n k ) + ν x 2 Ω k x 2 ν y k y 2 Ω k

n k t = i k y ( ( n x κ ) ϕ k Ω k ϕ x ) + C ( ϕ k n k ) + D x 2 n k x 2 D y k y 2 n k

Ω t = 2 k y x Im ϕ k Ω k ν z Ω n t = 2 k y x Im ϕ k n k D z n

where

Ω = ( 2 x 2 k y 2 ) ϕ Ω k = 2 x 2 ϕ k

and (from the dispersion relation, see)

k y = argmax k y   γ ( k ) | k x = 0 γ ( k ) = A + H + G 2 H = G ² + ( C κ k y k ² ) ² A = 1 2 ( D k ² + C + ( C k ² + ν k ² ) ) G = B ² + ( C k ) ² B = 1 2 ( D k ² + C ( C k ² + ν k ² ) )

hasegawa_wakatani_findiff_1d:
  grid_size: 682
  domain: 50
  νx: 1.0e-2
  νy: 1.0e-4
  νz: 1.0e-5
  Dx: 1.0e-4
  Dy: 1.0e-4
  Dz: 1.0e-5
  acc: 10
  tf: 300
  atol: 1.0e-10
  rtol: 1.0e-10
  video_length: 30
  video_fps: 100

Periodic

Note the result is similar to hasegawa_wakatani_pspectral_1d because it is the same problem solved with 2 different methods. findiff_1d

Dirichlet

We simply add this line as a parameter in the .yaml file:

  boundary: dirichlet

findiff_1d_dirichlet

Force

The goal is to create a natural density gradient. In this configuration:

  • we set κ=0
  • we add a source term S in the equation of n̅ wich represents the particle injection from the center. Its distribution a gaussian centered on the left hand side of the domain. We also add a small well on the right hand side to act like the loss of the particle at the edges. The equation becomes: n t = 2 k y x Im ϕ k n k ( D z + well ) n + S
  • the boundary conditions are:
side n̅, Ω̅ nₖ, Ωₖ
left neumann dirichlet
right dirichlet dirichlet
  κ: 0
  ky: 1.3
  tf: 2000000
  boundary: force 0.001

where 0.001 is the amplitude of the source term and we increased the simulation time tf.

force

hasegawa_wakatani_findiff_2d

Finite difference method of the Hasegawa-Wakatani model in 2D (centered grid).

This is much slower than hasegawa_wakatani_pspectral_2d

Δ ϕ t = [ ϕ , Δ ϕ ] + C ( ϕ ~ n ~ ) + ν Δ 2 ϕ ~ ν z Δ ϕ n t = [ ϕ , n ] + C ( ϕ ~ n ~ ) + D Δ n ~ D z n κ ϕ y

We compute φ by solving Ω=Δφ at each time step.

hasegawa_wakatani_findiff_2d:
  grid_size: 800
  domain: 50
  D: 1.0e-3
  Dz: 1.0e-5
  ν: 1.0e-3
  νz: 1.0e-5
  acc: 6
  atol: 1.0e-10
  rtol: 1.0e-6
  tf: 500
  video_length: 10
  video_fps: 60

Periodic

findiff_2d_periodic.mp4

Dirichlet

  boundary: dirichlet

The initial state is a gaussian in the density field n.

findiff_2d.mp4

runtime (GPU RTX 3060) ≈ 90h

hasegawa_mima_pspectral_2d

Pseudo-spectral method of the Hasegawa-Mima model. This is the abiabatic limit of the Hasegawa-Wakatani model: when C→∞, we have n=ϕ.

The equation is expressed in the Fourier space. ϕ k t = [ ϕ , ϕ Δ ϕ ] k + i k y κ ϕ k 1 + k 2 ν k 2 ϕ k + forcing ν k 2 = ν z if k y = 0 Where the forcing term is a gaussian centered in kx=0 and ky=force_ky with an amplitude force_amplitude and a random phase at each step.

hasegawa_mima_pspectral_2D:
  grid_size: 682
  ν: 1.0e-4
  force_ky: 1
  force_amplitude: 5.0e-3
  atol: 1.0e-10
  rtol: 1.0e-6
  tf: 500
mima_pspectral_2d.mp4

hasegawa_wakatani_pspectral_3d

Similar to hasegawa_wakatani_pspectral_2d but k 2 = k x 2 + k y 2 + k z 2

hasegawa_wakatani_pspectral_3d:
  grid_size: 128
  domain: 50
  ν: 2.0e-2
  νz: 1.0e-5
  D: 1.0e-2
  Dz: 1.0e-5
  atol: 1.0e-10
  rtol: 1.0e-10
  tf: 300
pspectral_3d.mp4