CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Calculating center of mass (http://www.cfd-online.com/Forums/openfoam-solving/60633-calculating-center-mass.html)

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(
 
Try:

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

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

Enjoy,

Hrv

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 03:03.