CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Volume calculation (

jf January 7, 2005 05:28

Volume calculation

I have to find the shared volume of 2 volumes. The first volume is an orthogonal 6 faces volume and the other is an arbitrary six faces volume.

Is there an efficient way to do this ? I have to do this operation about 2e8 times.

Thanks in advance for your advices.


x_flow February 5, 2005 07:31

Re: Volume calculation
I think that is a computational geometry question. Maybe you can find a good answer if you should post it at a computational geometry forum or newsgroup. Do these volumes intersect?

jf February 7, 2005 10:58

Re: Volume calculation
Hi x_flow,

Thanks for your response. I've dropped this problem for the moment but I will be back on it in a few weeks.

Yes, the volumes intersect. In fact, I want to (volume) average data from a mesh A to another mesh B which is uniform in the 3 directions. So I have to find which part (volume) of a cell of the mesh A belong to a cell of the mesh B. That's why I want to know the intersection of the 2 cells.

You're probably right that I should go to a computational geometry forums and ask there (Are you familiar with forum in this field ? Do you know a *good* one ?). However since this is related to mesh calculation, I tought that someone here could respond me (Isn't it similar to certain tasks in the multigrid procedure calculation ?).

x_flow February 7, 2005 13:17

Re: Volume calculation
You can try:

I now that similiar algorithms are used for colision detection which is a big issue in computer games and so on.

If you need the exact volume of the intersection between two cells of arbritrary topology it might be bit difficult. If you only need an aproximation you can try to decompose the domain into cubes (defined size) and then test if they share both cells. This can be done using intersection tests of the centroid of the cube and both meshes (cells). There is a good book on these topics: "Computational Geometry in C" by Joseph O'Rourke.

jf February 8, 2005 16:55

Re: Volume calculation
Yes, the computation of the intersections needs to be exact (conservative).

Thanks for both references. I will give a look to them.

All times are GMT -4. The time now is 20:26.