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.

A Bug in Particle Tracing Module??

Please login with a confirmed email address before reporting spam

Dear all,

I wanted to use the mathematical particle tracing interface in a 2D-axisymmetric geometry, the particles are obtained from a text file and loaded into the simulation using 'Release from data file' feature, the solver shows that the number of particles solved for is correct, however, many particles are not where they should be.

I played around with the data file and noticed that when the initial velocity in r-direction is positive, the particle is misplaced. When it is negative, it is placed correctly where it should be. I tried to removed the velocity columns from the data file, but kept receiving 'inconsistent number of columns in a row' although it is consistent (just the position coordinates)

I put a list of 12 particles at the end of this message, the domain is 0<r<45 mm and -120mm<z<0

Has anybody experienced something similar? If so does anybody know a work-about?

Many thanks,

% r (m) z (m) vr (m/s) vz (m/s)
0.038599 -2.46E-04 -0.010676 -0.0032493
0.044065 -0.017612 0.019707 0.013575
0.044013 -0.031845 0.019873 -0.057048
9.32E-04 -0.026502 0.035804 -0.53902
0.044017 -0.052103 0.053356 0.12149
8.99E-04 -0.042594 0.010231 -0.43515
0.044011 -0.066294 0.043055 -0.028832
9.04E-04 -0.059036 0.0026897 -0.36018
9.04E-04 -0.065583 -0.0036967 -0.37632
9.05E-04 -0.07553 -0.028216 -0.071567
0.044146 -0.11693 -0.0054449 0.024493
0.044079 -0.11091 -0.018534 0.025057

4 Replies Last Post 9 dic 2015, 13:23 GMT-5
Christopher Boucher COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 7 dic 2015, 10:30 GMT-5
Hi Maher,

Yes, this looks like a bug in the Release from Data File feature. In a 2D axisymmetric geometry, this feature is relying on the assumption that columns for the out-of-plane 'phi' component of the position and velocity are present. As a result, in the data you attached, it was the third column that was being used for the initial z-coordinates, not the second.

We hope to address the issue in a future software update. A temporary workaround is to insert a row of zeros after the r-component of position. The bug seems to affect only the position components, not the velocity components, so a row of zeros for the nonexistent 'phi' component of velocity isn't needed.

Best Regards,
Chris
Hi Maher, Yes, this looks like a bug in the Release from Data File feature. In a 2D axisymmetric geometry, this feature is relying on the assumption that columns for the out-of-plane 'phi' component of the position and velocity are present. As a result, in the data you attached, it was the third column that was being used for the initial z-coordinates, not the second. We hope to address the issue in a future software update. A temporary workaround is to insert a row of zeros after the r-component of position. The bug seems to affect only the position components, not the velocity components, so a row of zeros for the nonexistent 'phi' component of velocity isn't needed. Best Regards, Chris

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 8 dic 2015, 05:21 GMT-5
Dear Christopher,

Thanks for your kind reply. It is working perfectly!! I appreciate your help.

I have a small question if you don't mind, all PDE-interfaces of COMSOL can pass a solution from one solver to another through 'Values of dependent variables' in 'study'. It doesn't work for the particle tracing module.

I can do it by exporting the particles information from one study and import them into another, which is easy to do for a single simulation, but say for a parametric sweep, it isn't easy to do it manually every time.

Is there a method to pass the particles information from one study to another internally (without exporting and importing the data)?

Thanks for your great help,
Maher

Dear Christopher, Thanks for your kind reply. It is working perfectly!! I appreciate your help. I have a small question if you don't mind, all PDE-interfaces of COMSOL can pass a solution from one solver to another through 'Values of dependent variables' in 'study'. It doesn't work for the particle tracing module. I can do it by exporting the particles information from one study and import them into another, which is easy to do for a single simulation, but say for a parametric sweep, it isn't easy to do it manually every time. Is there a method to pass the particles information from one study to another internally (without exporting and importing the data)? Thanks for your great help, Maher

Daniel Smith COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 8 dic 2015, 16:14 GMT-5
Hi Maher, there is a trick to pass the final particle position and velocity from one study to another. You can't however, pass only the position, or only the velocity, you have to do both.

The attached model does this. The trick is that Study 2 starts the times list at 1s instead of 0, and the "Initial values of variables solved for" is set to Study 1.

If you want control over the positions and velocities independently, I think the Application Builder can offer a solution. You could easily write a method to run a particle tracing study, write out the particle data to a temporary file, then use that same temporary file in the "Release from Data File" node. This would allow any combination of initial particle positions and velocities in a subsequent study.

Dan
Hi Maher, there is a trick to pass the final particle position and velocity from one study to another. You can't however, pass only the position, or only the velocity, you have to do both. The attached model does this. The trick is that Study 2 starts the times list at 1s instead of 0, and the "Initial values of variables solved for" is set to Study 1. If you want control over the positions and velocities independently, I think the Application Builder can offer a solution. You could easily write a method to run a particle tracing study, write out the particle data to a temporary file, then use that same temporary file in the "Release from Data File" node. This would allow any combination of initial particle positions and velocities in a subsequent study. Dan


Please login with a confirmed email address before reporting spam

Posted: 9 years ago 9 dic 2015, 13:23 GMT-5
Thanks very much Daniel!! It works perfectly well.

Regards,
Maher
Thanks very much Daniel!! It works perfectly well. Regards, Maher

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.