[FLASH-USERS] Continuing to evolve particles that leave the domain

James Guillochon jfg at ucolick.org
Fri Apr 3 16:05:52 EDT 2015


Hi all, so Christoph had contacted me privately and shared a solution
within his Sinks unit to accomplish what I had wanted. The modification is
very similar to what Norbert and Anshu had suggested as the Sinks particles
are already evolved separately in their own arrays.

The fix essentially amounts to deleting the particles from the main
"particles" array while the code is running, and only re-writing them to
the "particles" array when IO operations are performed. Usually, this
operation is performed continuously throughout the simulation to ensure
that the two arrays match one another, but this is not necessary if the
particles are not utilized outside of the Sinks unit. By doing this, one
avoids the checks on the "particles" array that would usually delete
particles if they leave the domain. This also prevents particles from being
moved to different home blocks, so this hack is definitely not
generalizable to situations where the particles are mapped to the grid
(which is not the case for the Sinks unit).

Thanks again for your suggestions everyone! And thanks very much to
Christoph for helping me out with the Sinks code in particular.

On Sun, Mar 29, 2015 at 11:49 AM, James Guillochon <jfg at ucolick.org> wrote:

> Hi Klaus, Norbert and Anshu,
>
> Indeed I am relying upon "gr_ptKeepLostParticles" being set to true, the
> logic in the two routines I modified above check the value of that option.
> So that is a bug that should be fixed. Removing that line, and using the
> two simple changes I proposed above, seem to lead to a crash, so clearly
> the solution is more along the lines of what Anshu and Norbert suggested.
>
> Ideally I'd like a solution that uses the present machinery as much as
> possible, because I'd like to continue a rather expensive run that already
> used the existing machinery. Also, I'd like to continue using the sinks
> routines to apply gravity to the particles, rather than having to reinvent
> that code. At the present it looks like the sinks module only loops over
> the particles that are not marked as "lost," hence the approach where those
> particles are still included within the normal particles array. Since
> Christoph wrote the sinks module I've attempted to contact him directly.
>
> In the future it would definitely be nice to have the ability to continue
> to evolve particles that leave the domain in the mainline code, there are
> many use cases I can think of where it would be valuable.
>
> I'll let you guys know if I come up with a solution. Thanks for all your
> help!
> - James
>
> On Sat, Mar 28, 2015 at 5:30 PM, Klaus Weide <klaus at flash.uchicago.edu>
> wrote:
>
>> On Fri, 27 Mar 2015, James Guillochon wrote:
>>
>> > Hi all, I'm using active particles in my calculation, and I would like
>> to
>> > continue to evolve the particle trajectories even once the particles
>> have
>> > left the domain. I see that particles that leave the domain can be saved
>> > after they leave by enabling a flag, but it appears that their
>> evolution at
>> > this point is frozen. It looks like a few relatively simple changes in
>> > Particles_advance may be able to continue their evolution, but I wasn't
>> > sure if evolving these particles would cause issues.
>>
>> James,
>>
>> Have you tried to set the keepLostParticles runtime parameter?
>>
>> I have just noticed an apparent bug in Grid/GridParticles/gr_ptInit.F90.
>> That file contains the line
>>
>>    call RuntimeParameters_get("keepLostParticles",gr_ptKeepLostParticles)
>>
>> but later on another line
>>
>>    gr_ptKeepLostParticles=.false.
>>
>> that makes the runtime parameter ineffective.
>>
>> Does fixing this help with your problem?
>>
>> Klaus
>>
>
>
>
> --
> James Guillochon
> Einstein Fellow at the Harvard-Smithsonian CfA
> jguillochon at cfa.harvard.edu
>



-- 
James Guillochon
Einstein Fellow at the Harvard-Smithsonian CfA
jguillochon at cfa.harvard.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20150403/7fe1f8b4/attachment.htm>


More information about the flash-users mailing list