I have a simulation for which I started thinking about particle path
integration. It's not critical, but it sure would be very nice to get
these results on top of everything else. I've seen examples where an
element is added to the solution vector (ie, using add2W, for
vorticity) and auxiliary code is patched to handle the new component
at every integration step. But my understanding is, this mechanism
adds one value PER CELL for the entire flow field, which is usually
what's required. What I really need is to define ONE set of values
X,Y,U,V (representing a single particle) PER TIME STEP, and then add
an auxiliary drag code to integrate these four values at every time
step. In reality, having multiple 4-component vectors would allow me
to handle multiple particles in a single run, but the point remains:
these are not field variables...
Is this in any way a possibility? Or was the Christmas punch too
strong for me?
(I'm seeing all kinds of problems here: how to initialize the values,
how to declare and store them in code, and in the results for that
matter. How to access them when needed, 'plot image' won't work no
more...)
Thanks!
On Tue, 5 Jan 2010, chris wrote:
> I'm sure there's a way to do this somehow, but since I have no clue
> how to go about it, nor any appreciation of the amount of work
> involved, here it is:
>
> I have a simulation for which I started thinking about particle path
> integration. It's not critical, but it sure would be very nice to get
> these results on top of everything else. I've seen examples where an
> element is added to the solution vector (ie, using add2W, for
> vorticity) and auxiliary code is patched to handle the new component
> at every integration step. But my understanding is, this mechanism
> adds one value PER CELL for the entire flow field, which is usually
> what's required. What I really need is to define ONE set of values
> X,Y,U,V (representing a single particle) PER TIME STEP, and then add
> an auxiliary drag code to integrate these four values at every time
> step. In reality, having multiple 4-component vectors would allow me
> to handle multiple particles in a single run, but the point remains:
> these are not field variables...
>
> Is this in any way a possibility? Or was the Christmas punch too
> strong for me?
No your Wassail was not too strong. There's no convenient canned solution
to your problem, but the basic idea would be to append a customized step
to the integration sequence so as to take care of the movement of the
particles.
> (I'm seeing all kinds of problems here: how to initialize the values,
The particles would be initializsed in the problem setup.
> how to declare and store them in code, and in the results for that
and the "code" would live inside the patch-integrator, which is yours
to do as you so wish. After all, it's just a shared-object which
is sucked in on the fly, and it can be crafted anyway you want.
> matter. How to access them when needed, 'plot image' won't work no
plot image will work as usual, for the field solution. But you will need
custom plotting routines to take care of the particles.
James
> more...)
> Thanks!
>
>
http://blogs.adobe.com/adobereader/2009/12/adobe_reader_and_acrobat_versi.html
and so I too will no longer be supporting them in AMRITA.
James
Attached is a script, run_particles_v1, that is a first-cut attempt at
integrating particle paths. As it stands, the integration can cope with
multiple grid levels. But if you take a look at the logfile,
logs/particles, which is arranged as (iteration count, particle time,
eulerian solution time) you'll see there is a small integration error.
This arises because of numerial round-off. For example, sometimes a
particle will lie on a patch boundary and so be missed, or counted twice.
Nevertheless, if you take a look at the animation produced, schlieren.swf,
you'll see the integration is qualitatively correct.
Looking to the future, if there is sufficient interest, particle
support could be added directly to AMR_SOL which woud greatly reduce
the burden on the script writer.
James
To understand this, you have to know that program folds and me just
don't mix. So the first this I do whenever I get my hands on anything
is to remove them and streamline everything to reduce it to it's
minimalistic version. Then the learning begins...
...well, that's what I did with 'run_particles_v1'. As is, I can run
the script just fine. But there's a fold within the fortran code in
between lines 312 and 323. Take the original script, kill these two
lines, and on my machine the compilation process just hangs. (I spent
the last 4h tracking the hang to that specific fold...) Remove any
other fold within the code, and the whole thing compiles just fine.
When I say 'hang', it means I let it go for a minute, then stop it. It
never takes that long when things are ok.
And this is not a fortran indentation deal: removing the offending
fold, code/f77src/roe_fl.F looks all right. But take a look at code/
f77src/roe_fl.f: it's truncated in the middle of an include file! It's
as if the very last code parsing process before compilation choked on
something (string too long? blown stack?)
I'm not sure if anyone will be able to replicate behavior, or if
there's a reason for that specific fold to be mandatory. I understand
some are, but in this case, it looks very much optional to me...
Chris
On Thu, 21 Jan 2010, chris wrote:
> James,
> I started dissecting the script, and I think I might have found a
> major problem with the general auxiliary code machinery by accident.
> Hopefully, you'll know where the problem is.... and note that it
> doesn't have anything to do with the tracking stuff...
There's a bug in amrf77's preprocessing phase.
>
> To understand this, you have to know that program folds and me just
> don't mix. So the first this I do whenever I get my hands on anything
> is to remove them and streamline everything to reduce it to it's
> minimalistic version. Then the learning begins...
>
> ...well, that's what I did with 'run_particles_v1'. As is, I can run
> the script just fine. But there's a fold within the fortran code in
> between lines 312 and 323. Take the original script, kill these two
> lines, and on my machine the compilation process just hangs. (I spent
replace the line:
IF((I.GE.IW).AND.(I.LE.IE).AND.(J.GE.JS).AND.(J.LE.JN)) THEN
by:
IF((I.GE.IW).AND.(I.LE.IE).AND.
X (J.GE.JS).AND.(J.LE.JN)) THEN
and the script will run. I haven't yet figure out why the problem
occurs, but I'll get back to you when I have,
do gnof=1,nga(L+1)
grfd=gp(L+1) + gnof
...
If I understand, the number of finer grids are scanned, and inside,
grfd is a grid index inside the master list.
The thing is, if level 0 was defined with 4 patches, then gp(0) is 0,
and nga(0) is 4, so grfd should go from 0 to 3... and it currently
scans 1 to 4. (+ gnof always results in +1 since the scan starts at 0)
Shouldn't these lines be
do gnof=0,nga(L+1)-1
grfd=gp(L+1) + gnof
or
do gnof=1,nga(L+1)
grfd=gp(L+1) + gnof - 1
??? (notice the -1 in each case)
Looks to me like it currently scans everything but the first grid on a
given level ALONG with the first grid of the next level. Could this be
the real reason why particles are missed?
Chris
> run_particles_v1
> 20KViewDownload
>> I started dissecting the script, and I think I might have found a
>> major problem with the general auxiliary code machinery by accident.
>> Hopefully, you'll know where the problem is.... and note that it
>> doesn't have anything to do with the tracking stuff...
>There's a bug in amrf77's preprocessing phase.
The problem is in the file:
$AMRITA/tools/perl/amrpp/clean_f77.pl
replace line 25:
elsif($long_line =~ /[\=,\,\+\-\/\*]/) {
with:
elsif($long_line =~ /[\.\=,\,\+\-\/\*]/) {
and the script will run.
James
> To understand this, you have to know that program folds and me just
> don't mix. So the first this I do whenever I get my hands on anything
> is to remove them and streamline everything to reduce it to it's
> minimalistic version. Then the learning begins...
It's your perogative to not like program folds. But be clear, the examples
I post here are intended to be viewed in a fold-compliant editor and to
view them as a regular linear-listing will miss the point of their
construction. So much so, your "learning" will be hindered to the point
that you might as well stop using AMRITA.
James
--
You received this message because you are subscribed to the Google Groups "amrita-ebook" group.
To unsubscribe from this group and stop receiving emails from it, send an email to amrita-ebook...@googlegroups.com.
To post to this group, send email to amrita...@googlegroups.com.
Visit this group at http://groups.google.com/group/amrita-ebook.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to amrita-ebook+unsubscribe@googlegroups.com.
To post to this group, send email to amrita...@googlegroups.com.
Visit this group at http://groups.google.com/group/amrita-ebook.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "amrita-ebook" group.
To unsubscribe from this group and stop receiving emails from it, send an email to amrita-ebook+unsubscribe@googlegroups.com.
AMRITA::system { verbose mode g77 -O3 -w -fPIC -fno-f90 -fugly-complex -I/usr/include \ -I/home/Bijan/AMRITA/AMRITAv3.05/include/f77 \ -I/home/Bijan/AMRITA/AMRITAv3.05/src -I/include/f77 -I. -I.. \ -I/home/Bijan/.amrita/include/f77 -I/include/ -Dserial_code -DLinux_x86_64 -r -c \ f77src/roe_fl.f f77src/roe_fl.f: In subroutine `amr02_integrate_grid': f77src/roe_fl.f:1029: \ SUBROUTINE I_PARTICLES(Nt,L,GRD,IM,JM,NG,DX,DY,W,CTIME,DT) 1 \ f77src/roe_fl.f:2266: (continued): CALL I_particles(Nt , 2 Argument #3 (named \ `grd') of `i_particles' is one type at (2) but is some other type at (1) [info \ -f g77 M GLOBALS] f77src/roe_fl.f:1134: SUBROUTINE \ J_PARTICLES(Nt,L,GRD,IM,JM,NG,DX,DY,W,CTIME,DT) 1 f77src/roe_fl.f:2307: \ (continued): CALL J_particles(Nt , 2 Argument #3 (named `grd') of `j_particles' \ is one type at (2) but is some other type at (1) [info -f g77 M GLOBALS] }
To fix this, edit the file run_particles_v1 and change line 216 from:
AMRINT IM,JM,NG
to:
AMRINT GRD,IM,JM,NG
Then repeat for line 257.
James