CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] Ellipsoid Particles using funkySetFields (https://www.cfd-online.com/Forums/openfoam-community-contributions/185400-ellipsoid-particles-using-funkysetfields.html)

beatsy March 24, 2017 12:31

Ellipsoid Particles using funkySetFields
 
Hi all, I am new to OpenFOAM and i am trying to implement two ellipsoid shaped particles using funkySetFields to run using interFoam to simulate sintering. I have already successfully done this with two spheres but am unable to alter the formula correctly to change the shape.

I would like to make the centre of the two ellipsoids to be (0.01,0.0105,0.0105) and (0.011,0.0105,0.0105) respectively. With the dimensions in the x,y,z directions to be 0.0005,0.0008,0.0005 for both.

The two approaches i have already tried is:

funkySetFields -time 0 -keepPatches -field alpha.water -expression "pow(pos().x-((0.01)/0.0005),2) + pow(pos().y-((0.0105)/0.0008),2) + pow(pos().z-((0.0105)/0.0005),2)<1 || pow(pos().x-((0.011)/0.0005),2) + pow(pos().y-((0.0105)/0.0008),2) + pow(pos().z-((0.0105)/0.0005),2)<1 ? 1:0"

funkySetFields -time 0 -keepPatches -field alpha.water -expression "mag(pos()-vector(0.01/0.0005,0.0105/0.0008,0.0105/0.0005))<1 || mag(pos()-vector(0.011/0.0005,0.0105/0.0008,0.0105/0.0005))<1 ? 1:0"

If anyone could give any suggestions it would be much appreciated.

(For reference the equation of an ellipsoid is (x^2)/(a^2)+(y^2)/(b^2)+(z^2)/(c^2)=1)


All times are GMT -4. The time now is 11:41.