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

Tutorial introducing particles (step-68?) #10043

Closed
bangerth opened this issue May 5, 2020 · 6 comments
Closed

Tutorial introducing particles (step-68?) #10043

bangerth opened this issue May 5, 2020 · 6 comments
Milestone

Comments

@bangerth
Copy link
Member

bangerth commented May 5, 2020

There is currently no tutorial that shows how to create simulations that use ParticleHandler. step-70 (see #9078) uses particles but in a non-trivial way, and it would be useful to have a more introductory way to show what the ParticleHandler class is about and can do.

In a comment (#9078 (comment)) @blaisb mentions that he and @tonielgeitani have a small code that could serve that role. @blaisb -- want to give an overview of what that code does?

Alternatively, I had thought that one could implement a little testcase where we solve for the electrostatic potential (i) between two electrodes, and (ii) due to free charges, like in a cathode ray tube (yes, so old-fashioned). The potential satisfies the Laplace equation with the particles as right hand side sources:

  - Delta phi = \sum_i e \delta(x-xi).

Particles correspond to electrons being accelerated by the field. This would provide for a nice two-way coupling between particles and fields. The field solver is just a stationary Laplace equation as long as particle velocities are << speed of light, with no time dependence in the equation. The only time dependence is in the particle position, where particles satisfy the equation

  m \ddot x(t) = e \nabla \phi.

An interesting complication is that one has to create particles at the negative electrode (cathode) in every time step, and that other particles just disappear out of the domain.

@gassmoeller -- FYI, in case you're interested in these sorts of questions.

@bangerth bangerth added this to the Release 9.3 milestone May 5, 2020
@bangerth bangerth mentioned this issue May 5, 2020
@blaisb
Copy link
Member

blaisb commented May 6, 2020

Absolutely.

What @tonielgeitani and I are doing right now is a lot more simple than what Luca and I are doing in step-70. I think it's also very traditional (and maybe very similar to how particles are used in Aspect?). The example we have started writing, which I think could become a relatively simple step, follows the motion of particles within a predetermined velocity field (in this case a Rayleigh-Kotte vortex and a deformation field).

I was planning on having the step contain the following elements:
A) Advection of particles when the velocity is prescribed by a Function. This is very easy. You just integrate the motion in time of the particles.

B) Advection of the particles when the velocity is knowns at the DOFs. This would mimic how a real velocity field (e.g. obtained by the solution of the Navier-Stokes equation) would be used to advect the particles.

For both A) and B), I wanted to add also parallel load balancing and to attach the processor ID as a field to the particles. Consequently, as the particles will be moved by the vortices, the cells in which they are located will be distributed in order to maintain an even load between the processors and to ensure that all processors as a similar number of particles. In this case, since there is little to no load associated with the cells, the entire balancing weight would be attributed to the presence of the particles.

Right now the step is lacking part B), the load balancing and the attachment of the processor ID to the particles (so it is just beggining). The timeline we have in mind is to have it finished by the end of May. @tonielgeitani is still in his first year of his PhD and I think it's a good opportunity for him to learn these aspects of deal.II. Submitting it as a step after we have reviewed it extensively together would also allow us to gather feedback and improve :)! I also still have a lot to learn on my side :)!

Clearly, this is a very "basic" step, but I think it would show the basic features of particles and how they behave in parallel. I also think it is very complimentary to your step idea (which is very good). So why not try to do both? What do you think? @gassmoeller would maybe have additional suggestions?

Here are some examples of the results the step gives:
rayleigh-kotte

deformation_field

@bangerth
Copy link
Member Author

bangerth commented May 6, 2020

I mis-spoke when I said that step-70 uses particles in a rather trivial way. I really meant "non-trivial" (edited above) and that is of course the rationale for having a simpler tutorial program.

I think your plan is good. Maybe we should have two tutorial programs. Let's see who finds time to make it happen -- I'm looking forward to seeing what you have!

@blaisb
Copy link
Member

blaisb commented May 7, 2020

Perfect.
So the current optimistic time-line is to have an initial version before the hackathon, but early june might be more realistic. This will be @tonielgeitani and I first step from scratch, so reviews will be very much appreciated :).

@bangerth
Copy link
Member Author

bangerth commented May 7, 2020

Oh, take your time -- there is really no rush on this!

@peterrum
Copy link
Member

peterrum commented May 7, 2020

@blaisb I would recommend that you reserve the number 68 by a WIP PR (as was done in #8229).

@drwells
Copy link
Member

drwells commented Sep 18, 2020

Fixed by #10301.

@drwells drwells closed this as completed Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants