SmileiPIC / Smilei

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

EM_boundary_conditions set as "PML" in 3Dcartesian is ok? #700

Closed zk-fdu closed 3 months ago

zk-fdu commented 6 months ago

Hi, I want to set a electromagnetic boundary condition as "PML " in 3Dcartesian so that incident wave along x axis is not reflective when crossing the medium.However, when i self-defined a laser wave via Laser Envelope Model and run the code, th code immediately killed. The resulting message is "Segmentation fault (Address not mapped to object [(nil)])" . I checked this question online, which says this resulted from insufficeint memory. Strangely, I set a electromagnetic boundary as "silver-muller" when the rest remained unchanged, and the code run normally. Therefore, I wanna know if EM_boundary_conditions set as "PML" in 3Dcartesian is ok in Laser Envelope Model? Thanks a lot!

Guilleaumes commented 6 months ago

Hello,

Can you provide your namelist in order I can check all parameters is correctly given ?

Using Envelope PML is not very user friendly for now and namelist writting could be cumbersome with this functionnality for now. We are trying to change that. On top of that, be aware that PML envelope in X direction is currently instable and lead to some spurious energy growth at the present day. It's due to the fact FDTD scheme assume "forward envelope propagation" and fixe carrier wave with +k0.

PML Envelope have been extensively tested and used for Y and Z PML (transverse PML)

PML Envelope for 2D, 3D and AM are currently improved by the Smilei Team on all of theses aspect, so you're feedback are welcome.

zk-fdu commented 6 months ago

Hi, @Guilleaumes Thanks for your answer! I run the code in the version of smilei5.0. Regarding Laser Envelope Model,two namelist.py will be given as follows: one is based on EM_boundary_conditions"reflective",which is named after "reflective_Envelope" and run fine; the other on EM_boundary_conditions"PML", referred to as "PML_Envelope" and run abnormally. I don't know why. I would appreciate it very much if you could help me! PML_Envelope.txt.txt reflective_Envelope.txt.txt

Guilleaumes commented 3 months ago

After checking your input, you have to define BC condition as :

Main( ... EM_boundary_conditions = [['silver-muller','silver-muller'],['PML','PML'],['PML','PML']], number_of_pml_cells = [[0,0],[16,16],[16,16]], ... )

LaserEnvelope( ... Envelope_boundary_conditions = [ ["reflective", "reflective"],["PML","PML"],["PML","PML"]], ... )

x-PML with Envelope is not supported for now

zk-fdu commented 3 months ago

Ok,I see. Thanks!

-----原始邮件----- 发件人:Guilleaumes @.> 发送时间:2024-06-07 23:39:17 (星期五) 收件人: SmileiPIC/Smilei @.> 抄送: Zhao @.>, Author @.> 主题: Re: [SmileiPIC/Smilei] EM_boundary_conditions set as "PML" in 3Dcartesian is ok? (Issue #700)

After checking your input, you have to define BC condition as :

Main( ... EM_boundary_conditions = [['silver-muller','silver-muller'],['PML','PML'],['PML','PML']], number_of_pml_cells = [[0,0],[16,16],[16,16]], ... )

LaserEnvelope( ... Envelope_boundary_conditions = [ ["reflective", "reflective"],["PML","PML"],["PML","PML"]], ... )

x-PML with Envelope is not supported for now

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

mccoys commented 3 months ago

Can this be closed?