SmileiPIC / Smilei

Particle-in-cell code for plasma simulation
https://smileipic.github.io/Smilei
335 stars 119 forks source link

Grid definition using arbitrary units ? #30

Closed dsbertini closed 6 years ago

dsbertini commented 6 years ago

Hi , I got confused with the SMILEI internal system of Units- So let's suppose i have a 2D domain defines by the standard x_min, x_max y_min y_max points expressed in m, x_min = -90.0e-6
x_max = 60.0e-6
y_min = -80.0e-6
y_max = 80.0e-6
Now i have the following number of cells: nx = 15000
ny = 16000
which defines a space step i.e resolution in x y of 10 nm How should i program this simple domain using arbitrary units in SMILEI ? Which reference value, entity should i use , wavelength, frequency ? And most of all how then can i re_scale the output once i choose such a reference ?

MickaelGrech commented 6 years ago

Hi!

So SMILEI is built up on relativistic normalized units that appear naturally from the Vlasov-Maxwell system of equations. This is explained here, and also discussed in SMILEI paper which you can find here.

Now, if you are considering a simulation relying on the Vlasov-Maxwell system only, i.e. as long as you do not use additional physics modules such as collisions and/or ionization etc..., you can scale your system by introducing a characteristic (reference) angular frequency $\omega_r$. (1) If you are considering a plasma only (e.g. no laser), the best is to chose $\omegar = \omega{p0}$ with $\omega_{p0}$ the electron plasma frequency for a given density of $n_0$ of your plasma. Then this density :$n_0$ will be equal to 1 in the code, and you will have to normalize your density profile to this $n_0$ density. (2) If you are considering laser-plasma interaction, it is better to consider $\omega = \omega_0$, with $\omega_0 = 2\pi c/\lambda_0$ the angular frequency of your laser (with $\lambda_0$ its wavelength). Doing so implies that all densities in the code will be in units of the critical density for the electromagnetic radiation at angular frequency $\omega_0$.

From your previous issue, I guess that you are in situation (2). That means that all times in the code will be in units of $\omega_0^{-1}$, and distances in units of $k_0^{-1} = \omega_0/c$. Obviously, it might be more tractable for you to express everything in units of the laser wavelength in your input file. This is where SMILEI's python input file becomes very useful. Indeed, you can just introduce the normalized laser wavelength $\hat{\lambda}_0 = k_0\,\lambda_0 = 2\pi$, and similarly for times the normalized optical cycle $\hat{\tau}_0 = \omega_0\,\lambda_0/c = 2\pi$. Then, whenever you need to define a distance in your input file (similarly a duration) you will write it as $\hat{D} = (D/\lambda_0) \hat{\lambda}_0$ ($\hat{T} = (T/\tau_0) \hat{\tau}_0$, with $tau_0=\lambda_0/c$ the duration of an optical cycle).

dsbertini commented 6 years ago

Hi Mickael, Thanks for the detailed information. I am indeed in case (2) so that i will follow your advices. Now about EM boundaries, i would like to have boundary condition where EM waves impinging on it are transmitted with as little reflexion as possible ( simple_laser boundary in Epoch ) . Which boundary option is close to that characteristic in SMilei code?

MickaelGrech commented 6 years ago

In SMILEI that would be the silver-muller boundary condition. It is an injecting (for the laser) absorbing (for any light coming out of the simulation box) condition. It is not perfect however, and we plan to implement PML in a forthcoming future.

On Thu, Nov 23, 2017 at 1:58 PM, dsbertini notifications@github.com wrote:

Hi Mickael, Thanks for the detailed information. I am indeed in case (2) so that i will follow your advices. Now about EM boundaries, i would like to have boundary condition where EM waves impinging on it are transmitted with as little reflexion as possible ( simple_laser boundary in Epoch ) . Which boundary option is close to that characteristic in SMilei code?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SmileiPIC/Smilei/issues/30#issuecomment-346611864, or mute the thread https://github.com/notifications/unsubscribe-auth/ARdSYnYEYAB-YF9H7dqTwkcok8z8FDiwks5s5Wv4gaJpZM4QoZS8 .

--

Mickael Grech Chargé de recherche CNRS

Laboratoire d'Utilisation des Lasers Intenses Ecole Polytechnique Route de Saclay 91128 Palaiseau Cedex, France

tel.: +33 (0)1 69 33 54 16 gsm: +33 (0)6 95 56 48 43 mickael.grech@polytechnique.edu

dsbertini commented 6 years ago

you mean CPML : Convolutional Perfectly Matched Layer boundary conditions ?

MickaelGrech commented 6 years ago

We are not yet clear on which PML we want to implement in SMILEI. It will also depend on the user need. If you have any suggestion, we are interested.

On Thu, Nov 23, 2017 at 2:46 PM, dsbertini notifications@github.com wrote:

you mean CPML : Convolutional Perfectly Matched Layer boundary conditions ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SmileiPIC/Smilei/issues/30#issuecomment-346622397, or mute the thread https://github.com/notifications/unsubscribe-auth/ARdSYoV7n-NgCDIBvjSTpnk1LCXlY1Ghks5s5XcYgaJpZM4QoZS8 .

--

Mickael Grech Chargé de recherche CNRS

Laboratoire d'Utilisation des Lasers Intenses Ecole Polytechnique Route de Saclay 91128 Palaiseau Cedex, France

tel.: +33 (0)1 69 33 54 16 gsm: +33 (0)6 95 56 48 43 mickael.grech@polytechnique.edu

dsbertini commented 6 years ago

I just know that there is a recent implementation of CPML in epoch. The ideas/alogrithms are taken from the book in Computational Electrodynamics: The Finite-Difference Time-Domain Method” by Taflove and Hagness