Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected fluctuations at the injector #271

Closed
smallrainbow opened this issue Jul 3, 2020 · 20 comments
Closed

Unexpected fluctuations at the injector #271

smallrainbow opened this issue Jul 3, 2020 · 20 comments
Assignees
Labels

Comments

@smallrainbow
Copy link

Dear developers,

This is a memo on the injector problem (SMILEI_v4.5 and the lastest version, tested on 2020-07-03).

(1) The problem is: some unexpected fluctuations appear after several timesteps of the simulation. Maybe partially caused by the initial positions of different species of particles.
The results are plotted as follows:
smilei_test_injector

The namelist has been attached here. mynamelist.zip

(2) We also try to set the same position for ions and electrons by using a command: position_initialization = "I1", in the E1 species block and comment out the line # regular_number = [npc],

However, the injecor does not work well. Please see the following output.
2

Thank you very much for your efforts on SMILEI and looking forward to the updated version!

@weipengyao
Copy link
Contributor

Dear @smallrainbow,

I have met the same problem as you.
And since I use mi/me=1836, the Ex at the injection boundary is even larger.
(Of course, I guess with electron-positron plasma, there will be no such problem.)

I've seen some papers (using injection with other code) mentioning adding a localized electric field filter to manually get rid of this Ex, but I don't know whether it is physically appropriate.

One thing that can reduce this is to have a background plasma with much higher density -- but I guess it will no be exactly what you want to study.

Anyway, I also want to know how to deal with this problem with injection.

@xxirii
Copy link
Contributor

xxirii commented Jul 3, 2020

Dear @smallrainbow and @ywppku ,

I have studied your case.

First, I have changed the way you inject particles so that ions are localized at the same position of electrons. The correct way to do this is to name injectors and then use of them as a reference for the other :

ParticleInjector(
    name = "inj_I1",
    species = 'I1',
    position_initialization = "inj_E1",
    box_side = 'xmin',
)

ParticleInjector(
    name = "inj_E1",
    species = 'E1',
    position_initialization = position_initialization,
    box_side = 'xmin',
)

Then, I have used your case but I have deleted useless features for the injector including external fields and particle track in my cases.

After running different cases, I have started to think that the regular position initialization may be the issue here. For instance, injectors do not recognize regular_number = [npc] but it should. I need to investigate but it seems that the random option is giving good results according to the following figure, isn't it?
injection_regular_random

@ywppku I must admit that the method implemented in Smilei is relatively basic. However, I am interested in your suggestion if you have better algorithms published in the litterature.

@xxirii xxirii added the bug label Jul 3, 2020
@xxirii xxirii self-assigned this Jul 3, 2020
@mccoys
Copy link
Contributor

mccoys commented Jul 3, 2020

@xxirii I think that this method to assign injectors to another should be on the doc page under the "Recommandations" sections. It is already in the namelist, but probably a good idea to clarify things again.

@smallrainbow
Copy link
Author

@ywppku Thanks for your infomation.
@xxirii Send me an email, then I will send a code to you. Hope it will be helpful. Thanks.

@smallrainbow
Copy link
Author

pic1d_injector.zip
@xxirii for private communications, I send you the extracting passwords on Riot. Thanks.

@smallrainbow
Copy link
Author

@xxirii
Hi, I think you are right. You have already get the key point. Just forget my old code.
I try a longer run (plots are show below) with your suggested namelist. It works perfect !
I believe that if you could apply "regular" to the injector block, the results could be better and better.
Thank you very much, xxirii. You do help a lot !

longer run with suggested namelist

@weipengyao
Copy link
Contributor

@smallrainbow Glad to see that you've already solved the problem. Can you give me some suggestions on how to elegantly use the injection method?

Physically, the external B-field (perpendicular to the plasma drift) should produce more charge-separation of electrons and ions, thus creating some electric field (at the injection boundary).

Do you have the external B-field for the above results?

@smallrainbow
Copy link
Author

@ywppku Please follow xxirii's suggestion (I even don't know his/her name, I should say thanks to him/her). He fixed the problem (not me). Please see the suggested namelist above.

Yes, in this case, the background B is strictly perpendicular to the injection flow.

@smallrainbow
Copy link
Author

About the current smooth (not so urgent):
If we use the current smooth block, something will happen (please see below).

switch on the current smooth

@smallrainbow
Copy link
Author

smallrainbow commented Jul 4, 2020

@xxirii When I increase the temperature of electrons, the run will crash again (even no filter). My email is yangz@latmos.ipsl.fr
Please send me a message, I send you a injector without fluctuation. You are expert on coding, and you might find the trick used in this code. Thanks for your understanding, the code writer only allow private communications.

@ywppku Yes, I think you are correct. Some trick is required to deal with the injector at the boundary.

hot plasmas

@smallrainbow
Copy link
Author

smallrainbow commented Jul 4, 2020

The code writer mentioned that his method is follow the following section in C K Birdsall & A B Langdon's Plasma Physics via Computer Simulation (flux distribution function is used for the injector) Computer Simulation.
image

In addition, as mentioned by ywppku, smooth and filter is employed somewhere which is tricky.

@smallrainbow
Copy link
Author

smallrainbow commented Jul 8, 2020

Hi @xxirii
I find another paper on the injector for drifting Maxwellian distributions (drifting Maxwell–Jüttner in SMILEI is more general I think), please direct to http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.566.8427&rep=rep1&type=pdf

In this paper, they did not directly show their results (and their code is not opensource), thence I don't know it is really good or not.

So we may go back to the code which I send you before. At least this is the only code I can have to generate a stable injection boundary. Thanks for your time.

@smallrainbow
Copy link
Author

@xxirii
Hi, thanks again for your time. It seems another UK open source code (EPOCH) also have similar problems. I just made similar tests as SMILEI above. The fluctuation appears as in SMILEI.
When they follow your suggestion and set the initial particles in the same locations (electrons and ions). The results become better.
hacked_epoch_by_chris

Please let me know how was going on your side on the injector (setup by using the same position for different species of particles)? Thank you very much!

@smallrainbow
Copy link
Author

smallrainbow commented Sep 24, 2020

Hi @xxirii ,

In the recommendation of inejctor, it mentions that one option is "regular positionning".
For such setup, can we put injected ions and electrons at exactly the same places? Thank you.

@xxirii
Copy link
Contributor

xxirii commented Sep 24, 2020

Hi,

Regular positioning is an option not recommended if you use non-relativistic distribution to inject particles. The doc has been recently updated to highlight the problem in this case. Use rather the random positioning in this case. However, it is always recommended to inject electrons and ions at the same position to have something neutral behind the boundary.

If you have a doubt about namelist syntax to do so, let me know.

@smallrainbow
Copy link
Author

Hi @xxirii ,

Did you change the code to fix the unstable boundary problem as mentioned above in the lastest version?

Thank you very much!

@xxirii
Copy link
Contributor

xxirii commented Sep 25, 2020

Hi, I did not change the code to fix the problem above. The latest version however allows for injection in all directions but it's the same algorithm as before.

@smallrainbow
Copy link
Author

@xxirii Thanks for the details. Looking forward to your new version. Merci.

@smallrainbow
Copy link
Author

@xxirii
Dear developer,

Could you let me know is there any news on the injector? : )
Thank you!

@xxirii
Copy link
Contributor

xxirii commented Aug 28, 2021

Dear @smallrainbow ,

I did have a look to quick hack following issue #349 in order to improve the behavior with Maxwellian injectors with small drift velocity. But it did not really help. I do believe that our injector implementation is working well when the drift velocity is high (relativistic maybe) as we discussed in many issues. The implementation of a more advanced injector is in our todo list but not in high priority for the moment. I am myself busy with other numerical/ HPC aspects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants