CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   How to compute total liquid volume of the whole domain (http://www.cfd-online.com/Forums/openfoam-post-processing/75307-how-compute-total-liquid-volume-whole-domain.html)

anmartin April 21, 2010 15:13

How to compute total liquid volume of the whole domain
 
I finished an interDyMFoam run. The case has variations of liquid in the domain, i would like to discover it but at the same time, I would like to compute the total liquid volume at each time step (post-porcessing). Can someone suggest the way(s) to do this?

Where i have to put the code from http://www.cfd-online.com/Forums/ope...le-domain.html

Info << " Liquid: " << sum(mesh.V()*gamma) << endl;

Thanks!

romant April 22, 2010 03:05

You can put the code into the main function, close to the end of the loop like before the solver writes the time information.

After that you have to recompile the solver.

anmartin April 22, 2010 15:22

Thanks a lot,

I have recompile interDyMFoam, and now i can see the total volume of fluid inside my domain as:
Time = 0.05
Liquid: sum((V*alpha1)) [0 3 0 0 0 0 0] 0.033936:)

Time = 9.08938
Liquid: sum((V*alpha1)) [0 3 0 0 0 0 0] 0.0338348:confused:


Unfortunately, i still have another problem.

I have some fluid, but my simulation is a Tank (wall) excite by a sinusoidal lateral excitation using InterDyMFoam.

Anybody know what could be the reason? Any ideas?

Thanks,

romant April 23, 2010 02:16

code correction
 
Quote:

Originally Posted by anmartin (Post 255962)
Thanks a lot,

Time = 0.05
Liquid: sum((V*alpha1)) [0 3 0 0 0 0 0] 0.033936:)

Time = 9.08938
Liquid: sum((V*alpha1)) [0 3 0 0 0 0 0] 0.0338348:confused:

Sorry I forgot something. Of course the code must read
Code:

Info << " Liquid: " << sum(mesh.V()*gamma).value() << endl;


All times are GMT -4. The time now is 00:22.