Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Charged particle tracing in 2D

Please login with a confirmed email address before reporting spam

Hello everyone, I'm hoping someone might be able to point me the right way with my model.

I'm trying to use the Charged Particle Tracing module to track particles moving through previously calculated E and B fields. I first calculate the fields and then use these when solving for the trajectories. It seems that my model correctly accounts for the E field forces but not the B field. Given the large magnetic fields, the particle should track the B field streamlines - I have confirmed this using the post-processing particle tracing (I would prefer not to use this as I would like to calculate the number of particles which leave the upper surface that reach the solenoid at the bottom, this seems simple to do using the CPT module).

I believe this might be due to the magnetic field producing forces which are out of the plane. I tried selecting "Include out-of-plane degrees of freedom" in the CPT settings but this just gives an error.

Can anyone suggest how I can get the CPT calculation to take the B field into account correctly? I think I might have missed something simple but I can't think of anything. Do I have to do a full 3D simulation to use the CPT module correctly? I've read about extrusion coupling but I haven't been able to put this to use - would this solve my problem?

I've included an attachment of my model if anyone can spare the time to help.

Thanks very much,
Anthony


12 Replies Last Post Jun 21, 2012, 10:37 a.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 13, 2012, 2:44 a.m. EDT
Hi

you need to reload your file, the server must have been saturated yesterday, for me it says "0" bytes when I try to read it ;)

--
Good luck
Ivar
Hi you need to reload your file, the server must have been saturated yesterday, for me it says "0" bytes when I try to read it ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 13, 2012, 8:24 a.m. EDT
Hello, thanks for taking the time to help me with this. I really appreciate it :)

I have re-uploaded the file, I think it should be ok now.

Thanks,
Anthony
Hello, thanks for taking the time to help me with this. I really appreciate it :) I have re-uploaded the file, I think it should be ok now. Thanks, Anthony

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 19, 2012, 10:39 p.m. EDT
Does anyone have any suggestions for this problem? I still cannot get the B-field force to act. Any ideas would be greatly welcomed :)

Thanks.
Does anyone have any suggestions for this problem? I still cannot get the B-field force to act. Any ideas would be greatly welcomed :) Thanks.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 20, 2012, 2:12 a.m. EDT
Hi

indeed, so far I havent managed neither ;)
but I have not been using particle tracking many times so far, so I still need to learn it better.

My only though is that the particle velocity is so high that the deformation is negligible, but that one should be able to check by a handcalculation, what I havnt found time to test

--
Good luck
Ivar
Hi indeed, so far I havent managed neither ;) but I have not been using particle tracking many times so far, so I still need to learn it better. My only though is that the particle velocity is so high that the deformation is negligible, but that one should be able to check by a handcalculation, what I havnt found time to test -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 20, 2012, 3:25 a.m. EDT
I still cannot get the B-field force to act.

I didn't quite understand what results you expected and why.

You kind of skipped over that part in your original post:

Given the large magnetic fields, the particle should track the B field streamlines - I have confirmed this using the post-processing particle tracing.

That doesn't make sense to me. Why would charged particles ever follow the B-field streamlines? If you have confirmed this, how exactly?

For the record, the result you get makes total sense to me. Since B and v are both in-plane, the Lorentz force is purely out-of-plane, so you must see no effect. But maybe I'm missing something...



[quote]I still cannot get the B-field force to act.[/quote] I didn't quite understand what results you expected and why. You kind of skipped over that part in your original post: [quote]Given the large magnetic fields, the particle should track the B field streamlines - I have confirmed this using the post-processing particle tracing.[/quote] That doesn't make sense to me. Why would charged particles ever follow the B-field streamlines? If you have confirmed this, how exactly? For the record, the result you get makes total sense to me. Since B and v are both in-plane, the Lorentz force is purely out-of-plane, so you must see no effect. But maybe I'm missing something...

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 20, 2012, 9:30 a.m. EDT
Thanks for having a look, COMSOL is a great program but it still boggles my mind sometimes.

Sorry if I have been slightly unclear. I have attached a image of the same setup using the post-processing particle tracer instead. I've messed around with the colours slighty, the black to white background indicates B-field magnitude, the grey lines are 'streamlines' for the B-field and the coloured tracks are the particle tracing, green indicates high speed, red low. This is the behaviour I am expecting from the CPT module but am not getting; it is not taking the B-field into account. The particles released from the upper surface should roughly follow the field lines - this would be more accurate a statement if the E-field were turned off.

The Lorentz force due to such a large magnetic field should cause the particle to follow the field lines whilst executing a helical orbit. The component of velocity along the field line, as you said, gives no force. The component of velocity perpendicular to the field line results in a force which causes the particle to orbit around the field line. In the image I have attached, the particle tracks are really small helical tracks when one zooms in.

This was news to me having never taken a plasma physics course, but apparently this is widely known - 'Magnetic confinement rests upon the property that charged particles, like those in a plasma, will travel along the lines of a magnetic field'.

I completely agree with your final sentence, however it is precisely the functionality I am asking about. The Lorentz-force is purely out of plane initially and so for all time as far as the CPT module is concerned. I need the CPT module to take this out-of-plane force into account. I believe the 'Include out of plane degrees of freedom' check-box in the CPT settings should allow it to correctly account for this but it throws errors when I try this. If the somewhat 'simpler' post-processing particle tracer can include the out-of-plane forces, as shown by the attached image, I assume the more complicated CPT module also can.

If the CPT module cannot, can someone point me to documentation on coupling my 2D field solution to a 3D CPT solver? Extrusion model coupling seems to be something like this.

Thanks for all the replies.

Anthony
Thanks for having a look, COMSOL is a great program but it still boggles my mind sometimes. Sorry if I have been slightly unclear. I have attached a image of the same setup using the post-processing particle tracer instead. I've messed around with the colours slighty, the black to white background indicates B-field magnitude, the grey lines are 'streamlines' for the B-field and the coloured tracks are the particle tracing, green indicates high speed, red low. This is the behaviour I am expecting from the CPT module but am not getting; it is not taking the B-field into account. The particles released from the upper surface should roughly follow the field lines - this would be more accurate a statement if the E-field were turned off. The Lorentz force due to such a large magnetic field should cause the particle to follow the field lines whilst executing a helical orbit. The component of velocity along the field line, as you said, gives no force. The component of velocity perpendicular to the field line results in a force which causes the particle to orbit around the field line. In the image I have attached, the particle tracks are really small helical tracks when one zooms in. This was news to me having never taken a plasma physics course, but apparently this is widely known - 'Magnetic confinement rests upon the property that charged particles, like those in a plasma, will travel along the lines of a magnetic field'. I completely agree with your final sentence, however it is precisely the functionality I am asking about. The Lorentz-force is purely out of plane initially and so for all time as far as the CPT module is concerned. I need the CPT module to take this out-of-plane force into account. I believe the 'Include out of plane degrees of freedom' check-box in the CPT settings should allow it to correctly account for this but it throws errors when I try this. If the somewhat 'simpler' post-processing particle tracer can include the out-of-plane forces, as shown by the attached image, I assume the more complicated CPT module also can. If the CPT module cannot, can someone point me to documentation on coupling my 2D field solution to a 3D CPT solver? Extrusion model coupling seems to be something like this. Thanks for all the replies. Anthony


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 20, 2012, 11:51 a.m. EDT
I've never taken a plasma physics course either, but thanks to your elaborate reply I've finally understood how magnetic confinement works. I get it now: as soon as the particle acquires some out-of-plane velocity after release, the Lorentz force will also have some in-plane component. Intuitively, at least, I can see how the particle will end up swiveling along the magnetic field line.

You're absolutely right, activating the out-of-plane degree of freedom should do the trick. And like you, I kept getting some weird error messages. It seems that the particle tracing module is quite picky about the time-stepping algorithm. For example, it won't let me use BDF at all.

Eventually I figured out that one way to get the time-depedent solver up and running is to set the generalized-alpha time stepping to "Manual".

PS: For some reason I couldn't attach the modified model file – I keep getting a "File extension error", whatever that's supposed to mean. But it's really easy to reproduce anyway.

I've never taken a plasma physics course either, but thanks to your elaborate reply I've finally understood how magnetic confinement works. I get it now: as soon as the particle acquires some out-of-plane velocity after release, the Lorentz force will also have some in-plane component. Intuitively, at least, I can see how the particle will end up swiveling along the magnetic field line. You're absolutely right, activating the out-of-plane degree of freedom should do the trick. And like you, I kept getting some weird error messages. It seems that the particle tracing module is quite picky about the time-stepping algorithm. For example, it won't let me use BDF at all. Eventually I figured out that one way to get the time-depedent solver up and running is to set the generalized-alpha time stepping to "Manual". PS: For some reason I couldn't attach the modified model file – I keep getting a "File extension error", whatever that's supposed to mean. But it's really easy to reproduce anyway.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 20, 2012, 2:46 p.m. EDT
Is there any chance you could send it to me via e-mail? I have tried enabling the 'out-of-plane degrees of freedom' and using a 'Manual' stepping but it is still throwing errors under the 'Dependent Variables 1' sub-section. To be exact:

'Failed to evaluate variable.
- Variable: mod1.qphi
- Geometry 2
- Boundary: 1
Failed to evaluate expression.
- Expression: mod1.qphi
- Feature: Dependent Variables 1 (sol2/v1)
- Error: Failed to evaluate expression'

This was using 'Generalized alpha', 'Manual', '1e-11' time step, '0.75' amplification, 'Linear' predictor. Not sure what else I can play around with.

Thanks very much!
Is there any chance you could send it to me via e-mail? I have tried enabling the 'out-of-plane degrees of freedom' and using a 'Manual' stepping but it is still throwing errors under the 'Dependent Variables 1' sub-section. To be exact: 'Failed to evaluate variable. - Variable: mod1.qphi - Geometry 2 - Boundary: 1 Failed to evaluate expression. - Expression: mod1.qphi - Feature: Dependent Variables 1 (sol2/v1) - Error: Failed to evaluate expression' This was using 'Generalized alpha', 'Manual', '1e-11' time step, '0.75' amplification, 'Linear' predictor. Not sure what else I can play around with. Thanks very much!

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 20, 2012, 3:37 p.m. EDT
Hi

I'm not by my WS so I cannot check, but was'nt your model in 2D-axi ?
Are we sure we can see correctly the twisting of the e particles without going to a full 3D model, at least rolled out for the particle analysis ?

--
Good luck
Ivar
Hi I'm not by my WS so I cannot check, but was'nt your model in 2D-axi ? Are we sure we can see correctly the twisting of the e particles without going to a full 3D model, at least rolled out for the particle analysis ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 21, 2012, 3:02 a.m. EDT
Starting with your original model and doing exactly what you did (i.e. "Include out-of-plane degrees of freedom" to "on", "Steps taken by solver" to "manual", "Time step" to "1e-11"), then re-running the particle tracing study, I got an error message saying "Solution cannot be updated. Clear Solution to expunge. Failed to evaluate variable Jacobian."

I then cleared the solution, re-ran both studies, and voilà, it worked, see figure attached or the modified model file. (Turns out, "File extension error" is the forum software's way of saying, "You need to activate Firefox's Flash plugin." Obviously...)
Starting with your original model and doing exactly what you did (i.e. "Include out-of-plane degrees of freedom" to "on", "Steps taken by solver" to "manual", "Time step" to "1e-11"), then re-running the particle tracing study, I got an error message saying "Solution cannot be updated. Clear Solution to expunge. Failed to evaluate variable Jacobian." I then cleared the solution, re-ran both studies, and voilà, it worked, see figure attached or the modified model file. (Turns out, "File extension error" is the forum software's way of saying, "You need to activate Firefox's Flash plugin." Obviously...)


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 21, 2012, 3:08 a.m. EDT
Activating that check box adds the third degree of freedom to the particle trajectories. Otherwise, the φ-component of the particle's position and velocity is simply set to zero (as one can see in the "equation view" somewhere). However, the geometry for the field variables remains 2d-axisymmetric, i.e. Bφ = 0 throughout. So that provides exactly the functionality Anthony was looking for. The field's rotational symmetry isn't broken until the particles start interacting with it.
Activating that check box adds the third degree of freedom to the particle trajectories. Otherwise, the φ-component of the particle's position and velocity is simply set to zero (as one can see in the "equation view" somewhere). However, the geometry for the field variables remains 2d-axisymmetric, i.e. Bφ = 0 throughout. So that provides exactly the functionality Anthony was looking for. The field's rotational symmetry isn't broken until the particles start interacting with it.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 21, 2012, 10:37 a.m. EDT
Thanks very much! That is exactly what I needed.
Thanks very much! That is exactly what I needed.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.