diff --git a/src/OpenFOAM/primitives/transform/transform.H b/src/OpenFOAM/primitives/transform/transform.H index 3f50d677db8ee0e45b784abda0b633ed4f5ac4a5..646ba7734f811fafa5795707dcc8837ede46f89c 100644 --- a/src/OpenFOAM/primitives/transform/transform.H +++ b/src/OpenFOAM/primitives/transform/transform.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,6 +42,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +//- Rotational transformation tensor from vector n1 to n2 inline tensor rotationTensor ( const vector& n1, @@ -76,6 +77,48 @@ inline tensor rotationTensor } +//- Rotational transformation tensor about the x-axis by omega radians +inline tensor Rx(const scalar& omega) +{ + const scalar s = sin(omega); + const scalar c = cos(omega); + return tensor + ( + 1, 0, 0, + 0, c, s, + 0, -s, c + ); +} + + +//- Rotational transformation tensor about the y-axis by omega radians +inline tensor Ry(const scalar& omega) +{ + const scalar s = sin(omega); + const scalar c = cos(omega); + return tensor + ( + c, 0, -s, + 0, 1, 0, + s, 0, c + ); +} + + +//- 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 + ); +} + + inline label transform(const tensor&, const bool i) { return i;