-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompressible random vector field: add zero mean velocity feature #258
Comments
Hi Joshua, this is indeed by design and not a bug. The algorithm was designed to study the diffusion of particles in random velocity fields with a mean velocity greater than 0 in the x-direction. However, random velocity fields without a mean velocity would be great to include. So, please go ahead! Do you know the Kraichnan 1970 paper "Diffusion by a Random Velocity Field"? He uses a more general approach for the incomprehensibility by using the cross product. In case you don't have access to the paper, I can send it to you. I think the easiest way for you to compile the Cython code, is to use pip. The |
Dear Lennart, Thanks for your reply. I was able to get setup in editable mode and implement the Kraichnan method for a zero-velocity fluid. It is fairly simple. Will open pull request for the nd-vector-fields branch asap, still running some tests to make sure everything is in order. Will continue discussion on the other open discussion. #251 |
Hello,
I believe I found a bug with the incompressible random vector field algorithm. Generating a 3d incompressible field
A
(3 space dimensions, 3-component vectors), I find that the quantitydA_z/dy-dA_y/dz
is always zero in the limit of large grid sizes.A priori there is no reason this should be true for a generic incompressible field, and is unphysical, as it means the curl of A always has x-component equal to zero. This could be an artefact of the projector used to ensure incompressibility. The projector appears to introduce a preferential direction along the x-axis...
So as is, the incompressible random vector field code is not able to simulate an incompressible fluid with non-zero curl along the x-axis. For a fluid with zero mean velocity this is especially problematic.
If this was by design, it would be very useful to have an algorithm which generates a random 3d vector field which is not incompressible, so that an incompressible one may be obtained by then taking the curl. This is as simple as removing the projector in the
summate_incompr
method. Edit: Actually, I'm wondering if there is any downside with this method? For a Gaussian field, the curl of the field should have the same statistics (e.g correlation length) as the field itself (don't know a proof of this statement, but seems plausible).I would do this myself, however I would need some help understanding your workflow. I am guessing something like: write cython in the
summator.pyx
file and then compilesummator.c
which I think is done automatically insetup.py
. However must I rerun 'setup.py' everytime after making changes? Some details on your workflow here so I can try to make some contributions would be great!Here is the minimal example showing the issue:
The text was updated successfully, but these errors were encountered: