How to Start Using Particle Dynamics Solver

Numerical methods and mathematical models of Elmer
sabah
Posts: 4
Joined: 06 Dec 2017, 21:35
Antispam: Yes

How to Start Using Particle Dynamics Solver

Post by sabah »

I'm very new to Elmer, so I'm hoping this is a simple problem.

Trying to use the Particle Dynamics Solver (i.e. get Particle Dynamics to appear as a tab under "Equations") but have no idea how to go about this. I tried adding the relevant edf file via "Append" under "File" -> "Definitions", but could not find a Particle Dynamics one.

Would appreciate help on the matter. Thanks in advance.
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: How to Start Using Particle Dynamics Solver

Post by annier »

Hi,
I do not find Particledynamics.xml under edf or edf-directory of /usr/share/ElmerGUI/ locations whereas xml files for many other solvers are found.
So, you need to make a xml file for Particle Dynamics solver in the same way as other solvers and put it in edf directory.
E.g. advection-diffusiondotxml was developed from heatequationdotxml in elmer solver
The xml based template is similar for all solvers and the things have to be written for Particle Dynamics from the following Fortran subroutine/module.
https://github.com/ElmerCSC/elmerfem/bl ... namics.F90


Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How to Start Using Particle Dynamics Solver

Post by mzenker »

Hi,

AFAIK there is no particle dynamics xml for ElmerGUI. Unless you volunteer to build one (which is not difficult, just take an existing one and modify it), you will have to work with "ElmerNonGUI", i.e. a sif file edited by hand, the mesh converted with ElmerGrid (see ElmerGrid manual), and ElmerSolver called from the command line. You can find an example for a sif file using the particle dynamics solver here: http://elmerfem.org/forum/viewtopic.php?f=3&t=4466.
This might be a bit hard for a first-time user, but at the time being it is the only possibility (I know of) to use the particle tracking.
You can have a look into the tutorials for "ElmerNonGUI" (http://www.nic.funet.fi/pub/sci/physics ... nonGUI.pdf, with the associated files at http://www.nic.funet.fi/pub/sci/physics ... GUI.tar.gz), they might help you to get started.
Feel free to ask here if you have problems.

HTH,

Matthias

P.S.: I have just noticed that Anil was faster to respond, but didn't include the "NonGUI"... ;)
sabah
Posts: 4
Joined: 06 Dec 2017, 21:35
Antispam: Yes

Re: How to Start Using Particle Dynamics Solver

Post by sabah »

Hi,

Thanks to both Matthias and Anil for the very, very quick replies.

I've decided to use Elmer non-GUI. I've succeeded in converting my mesh file (drawn on GMSH) to a .mesh.* using ElmerGrid via the Command Prompt (cmd).

Was wondering how to create/edit my sif file... Do I use the ElmerGUI for this (i.e. "Sif"->"Edit"->"Solver Input File"->Save - but this doesn't give you a .sif...), as I'm struggling to do so via the Command Prompt.

Correct me if I'm wrong, but after creating the sif file, I can easily solve it using ElmerSolver via the Command Prompt...?

Thanks again. :)
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How to Start Using Particle Dynamics Solver

Post by mzenker »

Hi,

you can create a sif file with ElmerGUI, but since the particle dynamics solver cannot be accessed from there, you can only create a kind of dummy sif file using another or no solver, to get a starting point. The sif file is generated in ElmerGUI when you do File->Save project, or Sif->Generate followed by Sif->Edit, which opens the generated sif file in a text editor window. You can modify and save it from there. Beware that ElmerGUI does not keep the changes you make in the editor and overwrites the sif file the next time. So you should save your sif file at another place, or do not open ElmerGUI any more once the sif is created.
Anyway, this sif file created by ElmerGUI is just usable as rough starting point.
If you use "ElmerNonGUI" anyway, you would rather write your sif file from scratch using your favourite text editor, like notepad++ (Windows) or gedit, emacs or the like (Linux).
Once the file is created, you can call ElmerSolver from the command prompt.

HTH,
Matthias
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How to Start Using Particle Dynamics Solver

Post by raback »

Hi sabah

For the particle stuff there are some test cases. In principle the ways to use particles is endless, and of course not all such possibilities are supported with Elmer. It would help to pinpoint a relavant starting point if you would explain how you intend to use Elmer & particles.

-Peter
Gary R
Posts: 162
Joined: 12 Apr 2012, 07:23
Antispam: Yes
Location: Long Beach CA, USA

Re: How to Start Using Particle Dynamics Solver

Post by Gary R »

Annier or who ever;

I checked the ParticleDynamics.F90 file on GitHub. The thing I couldn't find was where to hook to the routine. I assume that the routing can be treated as a black box with just inputs and outputs defined. I am also new to Elmer. This will be my first outing without the ElmerGUI training wheels. Please elucidate.

Gary R.
AlbertoR
Posts: 5
Joined: 13 Feb 2024, 12:17
Antispam: Yes

Re: How to Start Using Particle Dynamics Solver

Post by AlbertoR »

Dear All,
I'm learning by myself to use Elmer to determine electric and magnetic fields and then study the beam dynamics in a beam line. Concerning the beam dynamics I'm using another code that can import the field determined by Elmer or with other FEM (actually I used also Simulia Opera by Dessault).

But here I found that also Elmer has a ParticleDynamic solver, although it seems to be quite a prototype. Is there any news on this topic?
Did someone use this solver?

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

Re: How to Start Using Particle Dynamics Solver

Post by raback »

Hi

There are two solvers that utilize particles: ParticleDynamics and ParticleAdvector. Here are consistency tests for the 1st one:

Code: Select all

elmeruser@elmer-VirtualBox:~/Source/elmerfem/fem/tests$ grep ParticleDynamics -r | grep Procedure
ParticleElstatMag/case.sif:  Procedure = "ParticleDynamics" "ParticleDynamics"
ParticleFalling3/case.sif:  Procedure = "ParticleDynamics" "ParticleDynamics"
ParticleElstat/case.sif:  Procedure = "ParticleDynamics" "ParticleDynamics"
ParticleFalling/case.sif:  Procedure = "ParticleDynamics" "ParticleDynamics"
ParticleFallingPathIntegral/case.sif:  Procedure = "ParticleDynamics" "ParticleDynamics"
ParticleFallingBlock/case.sif:  Procedure = "ParticleDynamics" "ParticleDynamics"
ParticleFalling2/case.sif:  Procedure = "ParticleDynamics" "ParticleDynamics"
ParticleHeating/case.sif:  Procedure = "ParticleDynamics" "ParticleDynamics"
I would say it is beyond prototype but there haven't been so many uses for it so far.

What would you like to do with it?

Generally I would think that it could be quite optimal in following a small number of particles (~< number of nodes) since it can use optimal accuracy for the electric and magnetic fields and you don't even need to save them. On the other, hand if you need to have much more particles than elements (Monte Carlo) then use something else.

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

Re: How to Start Using Particle Dynamics Solver

Post by AlbertoR »

raback wrote: 13 Feb 2024, 14:27 Hi

There are two solvers that utilize particles: ParticleDynamics and ParticleAdvector. Here are consistency tests for the 1st one:
...
What would you like to do with it?

Generally I would think that it could be quite optimal in following a small number of particles (~< number of nodes) since it can use optimal accuracy for the electric and magnetic fields and you don't even need to save them. On the other, hand if you need to have much more particles than elements (Monte Carlo) then use something else.

-Peter
Thank you Peter.

My purpose is to simulate a beam (1000 charged particles moving in almost the same direction) running through a pipe with, somewhere, electric and magnetic fields, this allows to determine the optical features and other things of beam lines, cavities etc. So it is not a Montecarlo study.

This is more or less what I'm doing with Simion (https://simion.com), where I can "import" external magnetic and electric field. I used also TraceWin (https://www.dacm-logiciels.fr/tracewin), but both of them have intrinsic limits, in my specific case, that maybe Elmer can overcome (more specifically Simion has cubic and regular mesh, which is a strong limit when curve surfaces are involved).

I will deepen ParticleDynamics and ParticleAdvector but, unfortunately, I'm a new user and I will surely need some some hint.

Alberto
Post Reply