CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Why are the rotational transformation tensors in transform.H transposed? (https://www.cfd-online.com/Forums/openfoam-programming-development/231260-why-rotational-transformation-tensors-transform-h-transposed.html)

tecmul October 28, 2020 10:58

Why are the rotational transformation tensors in transform.H transposed?
 
Hi all,
The rotational transformation tensors in transform.H seem to be the transpose of the actual transformation tensors.
For example:
Code:

//- Rotational transformation tensor about the z-axis by omega radians
inline tensor Rz(const scalar& omega)
{
    const scalar s = sin(omega);
    const scalar c = cos(omega);
    return tensor
    (
        c,  s,  0,
      -s,  c,  0,
        0,  0,  1
    );
}

This is the rotational transformation tensor around the z-axis.
\begin{bmatrix}
\cos \theta & -\sin \theta & 0 \\
\sin \theta & \cos \theta & 0 \\
0 & 0 & 1 \\
\end{bmatrix}

I checked multiple versions of OpenFoam and they all do the same thing. Why is this?

olesen October 29, 2020 10:36

Quote:

Originally Posted by tecmul (Post 786230)
Hi all,
The rotational transformation tensors in transform.H seem to be the transpose of the actual transformation tensors.
...
I checked multiple versions of OpenFoam and they all do the same thing. Why is this?


It is best phrased as a question of perspective. Does the transform represent how to get from a global coordinate orientation to a local coordinate orientation, or how to get from a local coordinate orientation to a global one?


If you can be content with "transform" meaning "how do I transform to get everything into the global reference?", it seems OK.


The axesRotation.C might make the local/global relationship clearer.

https://develop.openfoam.com/Develop...otation.C#L128

tecmul October 29, 2020 12:09

Quote:

Originally Posted by olesen (Post 786298)
It is best phrased as a question of perspective. Does the transform represent how to get from a global coordinate orientation to a local coordinate orientation, or how to get from a local coordinate orientation to a global one?

Ah, I think I understand now. I was thinking in terms of transforming a vector, not the coordinate system. Thank you very much.


All times are GMT -4. The time now is 03:58.