Counting particles that exit the FieldSet domain #1481
Replies: 2 comments 10 replies
-
The easiest solution is to add a So (note, not tested as I don’t have access to a laptop at the moment) class CustomParticle(JITParticle):
deleted = Variable(‘deleted’, initial=0)
def DeleteParticle(particle, fieldset, time):
if particle.state == StatusCode.ErrorOutOfBounds:
particle.deleted=1
particle.delete() |
Beta Was this translation helpful? Give feedback.
-
Hi! I have not tried yet what you said earlier, as right now I'm not really sure how can I know which particles are the ones missing, as they're supposed to be indistinguishable. But I have tried some other things that may be useful (I hope). First of all, I have set 2 new source points so now there should not be any particle that goes out of bounds. I have done the Previously I had (losing 126 particles):
I have now tried setting both of them to 1 hour (losing 72 particles), and I also have tried 15 minutes for both (losing only 17 particles but increasing a LOT the execution time). Finally, I have also checked how many particles I'm losing for 2 and 3 days simulation with my original I really hope this helps somehow... Thanks once again!! |
Beta Was this translation helpful? Give feedback.
-
Hi!
Is there any way I can count the number of particles that go out of bounds in my simulation? I have used the following kernel in order to delete every particle that goes out of my domain (it's used in #1412 ):
I can't find a way to do this. I thought maybe I could create another kernel somehow but I can't come up with anything...
Beta Was this translation helpful? Give feedback.
All reactions