OpenFOAM logo
Open Source CFD Toolkit

STARCoordinateRotation.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     STARCoordinateRotation
00027 
00028 Description
00029     The 3 rotations are defined in the STAR convention
00030     (around Z, around X' and around Y').
00031 
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef STARCoordinateRotation_H
00036 #define STARCoordinateRotation_H
00037 
00038 #include "coordinateRotation.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                    Class STARCoordinateRotation Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 class STARCoordinateRotation
00050 :
00051     public coordinateRotation
00052 {
00053     // Private data
00054 
00055         //- Local-to-global transformation tensor
00056         tensor R_;
00057 
00058 
00059 public:
00060 
00061     // Constructors
00062 
00063         //- Construct from components
00064         STARCoordinateRotation
00065         (
00066             const scalar rotZ,
00067             const scalar rotY,
00068             const scalar rotX
00069         )
00070         :
00071             R_
00072             (
00073                 cos(rotZ)*cos(rotY) + sin(rotZ)*sin(rotX)*sin(rotY),
00074                 -sin(rotZ)*cos(rotX),
00075                 -cos(rotZ)*sin(rotY) + sin(rotZ)*sin(rotX)*cos(rotY),
00076 
00077                 sin(rotZ)*cos(rotY) - cos(rotZ)*sin(rotX)*sin(rotY),
00078                 cos(rotZ)*cos(rotX),
00079                 -sin(rotZ)*sin(rotY) - cos(rotZ)*sin(rotX)*cos(rotY),
00080 
00081                 cos(rotX)*sin(rotY),
00082                 sin(rotX),
00083                 cos(rotX)*cos(rotY)
00084             )
00085         {}
00086 
00087 
00088     // Destructor
00089 
00090         virtual ~STARCoordinateRotation()
00091         {}
00092 
00093 
00094     // Return local-to-global transformation tensor
00095     virtual const tensor& R() const
00096     {
00097         return R_;
00098     }
00099 
00100 };
00101 
00102 
00103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00104 
00105 } // End namespace Foam
00106 
00107 
00108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00109 
00110 #endif
00111 
00112 // ************************************************************************* //
For further information go to www.openfoam.org