How to Start Using Particle Dynamics Solver

Numerical methods and mathematical models of Elmer
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How to Start Using Particle Dynamics Solver

Post by raback »

Hi

Seems like a good fit. You probably need a series of solvers. You can add them up one-by-one.

1) WhitneyAVSolver and/or StatElecSolver to compute initial fields
2) MagnetoDynamicsCalcFields to get the B fields from A
3) ParticleDynamics to follow the particles

Test case ParticleElstatMag is a good place to start. It uses just electrostatics for so it misses some steps but particles are ok there. The ParticleDynamics has a ton of choices also to be made.


-Peter
AlbertoR
Posts: 6
Joined: 13 Feb 2024, 12:17
Antispam: Yes

Re: How to Start Using Particle Dynamics Solver

Post by AlbertoR »

raback wrote: 13 Feb 2024, 18:22 Hi

Seems like a good fit. You probably need a series of solvers. You can add them up one-by-one.

1) WhitneyAVSolver and/or StatElecSolver to compute initial fields
2) MagnetoDynamicsCalcFields to get the B fields from A
3) ParticleDynamics to follow the particles

Test case ParticleElstatMag is a good place to start. It uses just electrostatics for so it misses some steps but particles are ok there. The ParticleDynamics has a ton of choices also to be made.


-Peter
Hi Peter,
Thank you again for the very competent answer.

The sequence that you propose is very logical but maybe it does not fit exactly my purposes. I mean, I would like to separate the three steps in three separated computations; the last one (the ParticleDynamics) executed several times with some variations on the boundary or starting conditions.
(maybe your proposal was exactly this and I have misunderstood your intervention).

This because the fields should not be recomputed but, at least, multiplied by a factor (for instance, the magnetic field of a solenoid has always the same shape with the exception of the intensity that depends on the current given to it).

Now I'm reading the documentation to clarify something that is diriment for me: can I set a magnetic or electric field computed before, or even determined by another program, as boundary conditions in the ParticleDynamics simulation?
The answer to this question is very important because some of the fields that I "use" in my simulations are given by other people and I can not replicate their computation with Elmer.

Another question is: can I built a 3D mesh with solids inside of which particles can move (let say the vacuum parts) and others on which they splat (let say the physical elements)?
This last question is less important because I can imagine that in the worst scenario I can realize a 3D mesh with just the vacuum volume.

Thank you for the support.

Alberto
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How to Start Using Particle Dynamics Solver

Post by raback »

Hi

You could save the results and do a restart where you omit recomputation (deactivating the unnecessary solvers).

You could fit a point cloud coming elsewhere etc. containing B field, for example.

You should maybe define "splat". Generally there are models on what happens at boundaries. E.g. classical bouncing or just exiting. Real physics on the boundary is more prone to have issues because of the little use.

-Peter
AlbertoR
Posts: 6
Joined: 13 Feb 2024, 12:17
Antispam: Yes

Re: How to Start Using Particle Dynamics Solver

Post by AlbertoR »

Dear Peter (and the others interested),
I started to do some test starting with the example "ParticleElstatMag", but I stopped soon.

My problem is definitely related to my lack of competence with Elmer: the effect of the magnetic field is always invisible in the solutions.

I tried to increase enormously the charge, to change the mass, to reduce the potential, to put a initial speed and so on ... But the magnetic field is not acting on the particles.

I read some of the Fortran ParticleDynamics.F90 code and I deduced that it computes the forces taking the needed features on the basis of the name passed in the .sif file (for instance one can pass the magnetic field with: Magnetic Field Variable Name = String "B"). Is it possible that there is no definition of the speed? In the fortran code I see that 'Velocity Variable Name' is required to define a non-zero speed.

In this case, what is the name that defines the speed in the .sif file?

Thank you in advance.
Alberto
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How to Start Using Particle Dynamics Solver

Post by raback »

Hi Alberto,

The velocity should be the velocity of the particles. If there is no electric field the particles will stay at rest (in this test). When I increase |B| from 1 to 2 the results change at least for me. Maybe you set the electric field to zero and particles never start.

This is really the only test for this. The electrostatic part has been tested a lot. The additions for Lorentz force is simple enough:

Code: Select all

         IF( GotB ) THEN           
           CALL GetVectorFieldInMesh(BVar, BulkElement, Basis, BAtPoint )           
           Force = Force + charge * CrossProduct( Velo, BAtPoint )  
           ....
so what could possibly go wrong...

-Peter
AlbertoR
Posts: 6
Joined: 13 Feb 2024, 12:17
Antispam: Yes

Re: How to Start Using Particle Dynamics Solver

Post by AlbertoR »

Hi Peter,
Sorry it took me so long to answer, in this period I'm very busy... Now I'm resuming this activity.

I have run several times the example but as a result I see just the particles "fall" for the electric field. I changed also something in the case.sif in order to explore the possibilities (for instance I put an initial speed, I changed their mass or charge, I changed the time step or changed the strength of electric and magnetic fields), but the particles moved always as the magnetic field were zero.

Maybe I did something wrong from the beginning? I have to use a different version of Elmer (I'm using the last release)?

As always, thank to everyone.
Alberto
AlbertoR
Posts: 6
Joined: 13 Feb 2024, 12:17
Antispam: Yes

Re: How to Start Using Particle Dynamics Solver

Post by AlbertoR »

Dear all,

I think to have found the problem of the simple example "ParticleElstatMag". In my case, "B" is always 0 and scalar however it is defined in the initial condition. This, obviously, means that the particles can't see the magnetic field.

Actually I realized a simple 3D model where there is a magnetization due to a Body Force and then computed by the "MagnetoDynamics" solver.
In that field I have putted one particle with an initial velocity and accelerated by an electric field, both transversal to the magnetic field.
In the particleDynamic solver I assigned these fields in this way:
Potential Variable Name = String "Potential"
Magnetic Field Variable Name = String "Magnetic Flux Density"
and the particle moved as expected.

Here there is the sif file and the mesh, if one want use this example to start.

Alberto
Attachments
mesh.zip
(201.19 KiB) Downloaded 3 times
case.sif
(6.7 KiB) Downloaded 3 times
Post Reply