CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Calculating center of mass (

kristaps March 20, 2005 10:24

Does OpenFOAM has the function
Does OpenFOAM has the functionality to calculate the center of mass for a complex geometry? If yes, how to do that? If no, is it possible to implement it, using the libraries of OpenFOAM?

hjasak March 20, 2005 10:35

Try: vector c = sum(mesh.V(

vector c = sum(mesh.V()*mesh.C().internalField())/sum(mesh.V());

You will, of course, need a mesh for your geometry.



13msmemusman March 8, 2015 05:59

how to use this code???
can You guide me how to calculate centre of poressure???? can you tell me how to use it as i am new in openfoam vector c = sum(mesh.V()*mesh.C().internalField())/sum(mesh.V());

All times are GMT -4. The time now is 08:36.