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.

Varying Number of particles per release time comsol error (Failed to Parse expression for integer values)

Please login with a confirmed email address before reporting spam

I'm trying to simulate a condition at which particles are released at multiple timestep, wherein on each timestep the number of particles released follows a defined distribution (see attached photo).

In doing so, I always encounter an error "Error when compiling equations. Failed to parse expression for integer values. -Feature: Release 1(rel1) - Parameter:N" whenever i plug in the current time on the equation. I tried to round-off the value of using ceil() function however it doesn't work and the error persist.

Surpirsingly, if I fed the function with constant value (even with floating point), the error no longer exist and the computation continues. Although this makes the particle tracing simulation release a constant number of particle on specified release times, contrary to what I wanted to do.

Is there a workaround in comsol for me to implement my simulation?

Thank you for your help.



4 Replies Last Post 2021年5月26日 GMT-4 09:14

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 2021年5月13日 GMT-4 10:35

Hi Paul,

It semms to be a bug in COMSOL! I need to define an inlet with varying number per release in my project as well. I need both the number and density of electrons per released to be a function of the electric field at the surface of the feature from which I want the electrons to be released. So, just like you, I am defining a variable, FNequation in my case, and put it in "Number of particle per release:" and "Density proportional to:" boxes, which are just after each other in the inlet seting menue as you can see from the attached picture. The surprise for me is that one of these boxes recognised my variable, FNequation, but the other one does not. The density box has no problem with the variable but the box for number of particles per release is returning this error: "Unknown model parameter. -Parameter: FNequation". Similar to your case, if I put a constant value in that box the error no longer exist. I have also tried ceil(FNequation) and floor(FNequation) to make sure that I am feeding the box with a integer value but it does not remove the error.

If you have got any solution to your problem please let me know too.

Thank you very much,

Hassan

Hi Paul, It semms to be a bug in COMSOL! I need to define an inlet with varying number per release in my project as well. I need both the number and density of electrons per released to be a function of the electric field at the surface of the feature from which I want the electrons to be released. So, just like you, I am defining a variable, FNequation in my case, and put it in "Number of particle per release:" and "Density proportional to:" boxes, which are just after each other in the inlet seting menue as you can see from the attached picture. The surprise for me is that one of these boxes recognised my variable, FNequation, but the other one does not. The density box has no problem with the variable but the box for number of particles per release is returning this error: "Unknown model parameter. -Parameter: FNequation". Similar to your case, if I put a constant value in that box the error no longer exist. I have also tried ceil(FNequation) and floor(FNequation) to make sure that I am feeding the box with a integer value but it does not remove the error. If you have got any solution to your problem please let me know too. Thank you very much, Hassan


Christopher Boucher COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 2021年5月17日 GMT-4 10:03

Hi, this is not a bug but the intended behavior in the current version of COMSOL. When a particle tracing model has multiple release times, the number of particles released is required to be the same for all release times. So the "Number of particles per release" may not be an expression that depends on the time or solution variables, even if that expression should return an integer value. It can only depend on global parameters.

Hi, this is not a bug but the intended behavior in the current version of COMSOL. When a particle tracing model has multiple release times, the number of particles released is required to be the same for all release times. So the "Number of particles per release" may not be an expression that depends on the time or solution variables, even if that expression should return an integer value. It can only depend on global parameters.

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 2021年5月17日 GMT-4 19:29

Hi, this is not a bug but the intended behavior in the current version of COMSOL. When a particle tracing model has multiple release times, the number of particles released is required to be the same for all release times. So the "Number of particles per release" may not be an expression that depends on the time or solution variables, even if that expression should return an integer value. It can only depend on global parameters.

Hi Christopher,

Thank you for your clarification. I wish you guys will find a way to integrate this feature in future version of comsol. In my opinion, I see a use of this scenario on various systems that presents a growth/decay phenomena on particles.

>Hi, this is not a bug but the intended behavior in the current version of COMSOL. When a particle tracing model has multiple release times, the number of particles released is required to be the same for all release times. So the "Number of particles per release" may not be an expression that depends on the time or solution variables, even if that expression should return an integer value. It can only depend on global parameters. Hi Christopher, Thank you for your clarification. I wish you guys will find a way to integrate this feature in future version of comsol. In my opinion, I see a use of this scenario on various systems that presents a growth/decay phenomena on particles.

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 2021年5月26日 GMT-4 09:14

Hi, this is not a bug but the intended behavior in the current version of COMSOL. When a particle tracing model has multiple release times, the number of particles released is required to be the same for all release times. So the "Number of particles per release" may not be an expression that depends on the time or solution variables, even if that expression should return an integer value. It can only depend on global parameters.

Hi Christopher,

Thanks for the reply. I was thinking that any input box can accept expressions. Particularly, in this case, it is kind of trivial that users might need time-dependent current sources. Hope this to be flaged as a limitation and will be resolved in the next versions.

>Hi, this is not a bug but the intended behavior in the current version of COMSOL. When a particle tracing model has multiple release times, the number of particles released is required to be the same for all release times. So the "Number of particles per release" may not be an expression that depends on the time or solution variables, even if that expression should return an integer value. It can only depend on global parameters. Hi Christopher, Thanks for the reply. I was thinking that any input box can accept expressions. Particularly, in this case, it is kind of trivial that users might need time-dependent current sources. Hope this to be flaged as a limitation and will be resolved in the next versions.

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.