CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   rotationVelocity in rotatingTotalPressure and SRF (https://www.cfd-online.com/Forums/openfoam-bugs/66545-rotationvelocity-rotatingtotalpressure-srf.html)

deepblue17 July 18, 2009 06:20

rotationVelocity in rotatingTotalPressure and SRF
 
Hello,

I think the computation of the rotationVelocity in rotatingTotalPressure and SRF could be simplified. The piece of code is:

Code:

vector axisHat = omega_/mag(omega_);
vectorField rotationVelocity =
omega_ ^ (patch().Cf() - axisHat*(axisHat & patch().Cf()));

In mathematical formulation this yields to:

\vec{axis} = \frac{\vec{\omega} }{ |\vec{\omega}|}
\vec{V} = \vec{\omega} \times ( \vec{r} - \vec{axis} \bullet (\vec{axis} \bullet \vec{r} ) )
= \vec{\omega} \times  \vec{r} - \vec{\omega} \times \vec{axis} \bullet (\vec{axis} \bullet \vec{r} )

Reformulation of the right term:
\vec{\omega} \times \vec{axis} \bullet (\vec{axis} \bullet \vec{r} )  = ( \vec{\omega} \times \frac{ \vec{\omega} }{ |\vec{\omega}|} ) \bullet (\vec{axis} \bullet \vec{r} ) =  ( \vec{\omega} \times \vec{\omega}  ) \bullet \frac{ (\vec{axis} \bullet \vec{r} )}{ |\vec{\omega}|} = \vec{0}

This reduces the computation of the rotationVelocity to:

\vec{V} = \vec{\omega} \times \vec{r}

or in C++

Code:

vectorField rotationVelocity = omega_ ^ patch().Cf();

immortality December 7, 2012 08:11

can we use rotatingTotalPressure in a 2-D case?


All times are GMT -4. The time now is 06:50.