Comments (12)
@igbondar @doyubkim
here are some helpful instructions for ivock implementation:
- the monopole tree code is not necessary, it is just used to compute the boundary values for the stream function poisson problem so that a Multigrid solver then performs more accurate asif the in an open-space. you can just use 0 values instead. while a slightly better solution could be to simply extend the solver domain a little bit when solving the vorticity stream function, with 0 boundary values.
- the vorticity stretching is important, and we approximated it from a geometric point of view:
which is, when you look at a conceptually "vortex tube", the velocity at its two ends are usually different, as a result, the vortex tube becomes longer or shorter by the velocity advection,
now:
a). circulation preservation states that the integral of vorticity flux across the cut plane of this infinitesimal tube stay unchanged,
b) incompressibility states the volume of the tube unchanged,
so, the cut area of the tube became smaller when it is stretched by the velocity field, which requires larger voriticity flux across the cut plan to maintain circulation.
hence, the vorticity(circulation per unit area of this vortex tube), becomes larger when the tube is stretched and smaller when the tube shrinks, when we approximate the vortex tube by vortex segments, this means the vorticity represented by a vortex segment enlarges at the same rate the segment stretches, which is the new_length/old_length. and vice versa.
||w||2 is the 2-norm, or say, length(w) of the vorticity, and you can verify the fact that we were in fact computing the length ratio before and after vorticity advection. in a backward way.
from fluid-engine-dev.
Thanks for the suggestion! Yes, this paper shows very nice results and would be nice to have for Jet codebase as well. I will add this to my feature wishlist.
from fluid-engine-dev.
feel free to let me know regarding algorithm details and implementation
from fluid-engine-dev.
Thanks, @zhxx1987 ! I haven't started developing IVOCK, yet, but will definitely ask you if I face any problems during the implementation.
from fluid-engine-dev.
Hi Doyub! What is your plan on implementing this?
The part with getting velocity from vorticity bit hard to transfer to code(.
from fluid-engine-dev.
Hi @igbondar!
At the moment, my general plan for Jet Framework is to
- Add/fix minor improvements/issues
- Consolidate existing branches for v1.4 and
- Refactor the API and some of the underlying code structure for v2.0
This means I won't be working on adding "features" like new solvers in the time frame above. If anybody can take a ticket like this one, I am more than happy to help.
Regarding your issue:
The part with getting velocity from vorticity bit hard to transfer to code(.
Feel free to ask me about the code. We can figure out what are needed to support your work.
from fluid-engine-dev.
Hi Doyub! Thanks for answer.
For now my main interest to test IVOCK in Houdini for real-world scenarios. Especially since it can preserve shape stability overtime, compared to existing vortex confinement.
As I understand to obtain u from v I need to almost re-create MultiGrid(same as in source code to IVOCK pdf) with monopole tree as described. I will try to readopt the code, that they have shared but for sure it is much better to understand all theory they mentioned in explanation.
On thing I don't get in ivock pdf - after equation 11 in text E=h/||w||2 - what 2 meaning in this case?
And thanks for your book and source code really helpful!
from fluid-engine-dev.
For this:
On thing I don't get in ivock pdf - after equation 11 in text E=h/||w||2 - what 2 meaning in this case?
I think @zhxx1987 can chime in to share some insights.
from fluid-engine-dev.
Hi @zhxx1987!
Thanks for help. I tried implement 2d case of IVOCK since it simpler and doesn't require vortex stretching.
The problem it is quickly become unstable even with a small increasing of correction values.
In picture - from left to right - stable fluids, ivock with 0.015 multiplier, ivock with 0.018 multiplier.
I think I did somewhere logic mistake or didn't use some clamping. If you have some time to answer I have couple questions.
I follow your pdf guide for 2d case w=(0,0,value):
- Get vorticity from vel
- advect it (BFECC - advection method Trace)
- advect velocity (BFECC - advection method Trace)
- get new vorticity from adv vel
- get vort difference
- For solving poisson equation I'm using this discretized formula
Xnn - sampled values of vorticity correction near examined cell - for 2d case (x-1,y), (x+1,y), (x,y-1),(x,y+1)
denominator b =4, a = -pow(2,grid_cell_size), numerator b= divergence of vorticity correction.
7. get curl from stream function and add it to velocity
- Can you suggest where could be possible error and how to control simulation so it isn't explode over time and be more predictable?
- In your C++ code you also using decay_vortices - what purpose of it? Or it is just for pyro model - I see only burn sampling.
from fluid-engine-dev.
Hi @zhxx1987!
Thanks for help. I tried implement 2d case of IVOCK since it simpler and doesn't require vortex stretching.
The problem it is quickly become unstable even with a small increasing of correction values.
In picture - from left to right - stable fluids, ivock with 0.015 multiplier, ivock with 0.018 multiplier.
I think I did somewhere logic mistake or didn't use some clamping. If you have some time to answer I have couple questions.
I follow your pdf guide for 2d case w=(0,0,value):
- Get vorticity from vel
- advect it (BFECC - advection method Trace)
- advect velocity (BFECC - advection method Trace)
- get new vorticity from adv vel
- get vort difference
- For solving poisson equation I'm using this discretized formula
Xnn - sampled values of vorticity correction near examined cell - for 2d case (x-1,y), (x+1,y), (x,y-1),(x,y+1)
denominator b =4, a = -pow(2,grid_cell_size), numerator b= divergence of vorticity correction.
7. get curl from stream function and add it to velocity
- Can you suggest where could be possible error and how to control simulation so it isn't explode over time and be more predictable?
- In your C++ code you also using decay_vortices - what purpose of it? Or it is just for pyro model - I see only burn sampling.
Hi igbondar,
here are couple things to check:
- BFECC itself is not an unconditionally stable advection scheme, it will introduce new extrema after advection. so, make sure you do the extrema clamping as in many real fluid solvers:
let's say the grid value at the grid point x of any field is phi_new after bfecc advection.
do a back trace of x using the divergence-free velocity field again and sample the 4 corners of the un-advected field.
clamp phi_new by the max and min of the 4 corner values. - there would be un-physical vorticity near the domain boundary and object boundary, make-sure to mask them out. after you computed delta_omega, you can zerofy those values close to domain or object boundaries.i mask out 10 cells away from the boundaries.
- the way you are solving the stream function equation looks like Jacobi iteration to me. which doesn't give best visual quality at all, for the vorticity stream function. you might be able to find 2D multigrid solvers from one of my repo and please use it instead.
- I believe the figures in my paper for 2D simulations was obtained with Semi-Lagrangian advectors for both velocity and vorticity fields. So it could be much less troublesome if you use this most robust advector instead.
- numerator b= divergence of vorticity correction. this is also incorrect, the 2D stream function for vorticity is simply
Laplace p = - omega
with omega = dv/dx - du/dy
and you shall recover (u,v) = (dp/dy, -dp/dx)
from fluid-engine-dev.
@igbondar after you done my check list, you shall be able to add back 1.0 of the missing vortices with no problem in 2D.
although I used 0.95 in my 3D cases due to some extra errors introduced by the vortex stretching.
from fluid-engine-dev.
for using multigrid solvers in 2D, please check the code at https://github.com/ziyinq/Bimocq/blob/master/src/bimocq2D/BimocqSolver2D.cpp
"buildMultiGrid" and "projection". for vorticity stream functions, PURE_NEUMANN = false.
from fluid-engine-dev.
Related Issues (20)
- How do I run the examples and the animations?
- How to run the particles2obj example? HOT 14
- Compile error when compiling with Clang 10 HOT 1
- Promotion of projects/research using Jet Framework HOT 4
- How to implement the xyz to mesh generation to another code for fluid simulation? HOT 1
- How do I set up a fluid particles at rest and a fluid particles with initial velocity HOT 3
- Suggestion to replace Travis CI/Appveyor with GitHub Actions HOT 5
- Some unit tests failure on 32-bit system
- Fix Visual Studio 2017 build failure on GitHub Action
- Timer test code failure on MinGW system
- No known features for CXX compiler "Clang" HOT 5
- running the Python example show error HOT 8
- Replace Clara
- makeTranslationMatrix should be transposed HOT 8
- About the local method in the surface_to_implicit HOT 1
- GridSmokeSolver3::computeDiffusion is diffusing smokeDensity instead of temperature HOT 2
- Incorrect formula for collider boundary conditions (Equation 3.18 in the book)
- can't build cmake in win64 HOT 1
- bug in void Matrix<T, M, N>::invert() in "include/detail/matrix-inl.h" HOT 1
- Newer Versions of Flatbuffer is breaking the build in particle_system_data2.cpp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluid-engine-dev.