00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 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 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your 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, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::sixDoFRigidBodyMotionConstraints::fixedAxis 00026 00027 Description 00028 sixDoFRigidBodyMotionConstraint. Body may only rotate around 00029 an axis fixed in global space. 00030 00031 SourceFiles 00032 fixedAxis.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef fixedAxis_H 00037 #define fixedAxis_H 00038 00039 #include <forces/sixDoFRigidBodyMotionConstraint.H> 00040 #include <OpenFOAM/point.H> 00041 #include <OpenFOAM/tensor.H> 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 namespace sixDoFRigidBodyMotionConstraints 00049 { 00050 00051 /*---------------------------------------------------------------------------*\ 00052 Class fixedAxis Declaration 00053 \*---------------------------------------------------------------------------*/ 00054 00055 class fixedAxis 00056 : 00057 public sixDoFRigidBodyMotionConstraint 00058 { 00059 00060 // Private data 00061 00062 //- Reference axis in global space 00063 vector fixedAxis_; 00064 00065 00066 public: 00067 00068 //- Runtime type information 00069 TypeName("fixedAxis"); 00070 00071 00072 // Constructors 00073 00074 //- Construct from components 00075 fixedAxis 00076 ( 00077 const dictionary& sDoFRBMCDict 00078 ); 00079 00080 //- Construct and return a clone 00081 virtual autoPtr<sixDoFRigidBodyMotionConstraint> clone() const 00082 { 00083 return autoPtr<sixDoFRigidBodyMotionConstraint> 00084 ( 00085 new fixedAxis(*this) 00086 ); 00087 } 00088 00089 00090 // Destructor 00091 00092 virtual ~fixedAxis(); 00093 00094 00095 // Member Functions 00096 00097 //- Calculate the constraint position, force and moment. 00098 // Global reference frame vectors. Returns boolean stating 00099 // whether the constraint been converged to tolerance. 00100 virtual bool constrain 00101 ( 00102 const sixDoFRigidBodyMotion& motion, 00103 const vector& existingConstraintForce, 00104 const vector& existingConstraintMoment, 00105 scalar deltaT, 00106 vector& constraintPosition, 00107 vector& constraintForceIncrement, 00108 vector& constraintMomentIncrement 00109 ) const; 00110 00111 //- Update properties from given dictionary 00112 virtual bool read(const dictionary& sDoFRBMCCoeff); 00113 00114 //- Write 00115 virtual void write(Ostream&) const; 00116 }; 00117 00118 00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00120 00121 } // End namespace solidBodyMotionFunctions 00122 } // End namespace Foam 00123 00124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00125 00126 #endif 00127 00128 // ************************ vim: set sw=4 sts=4 et: ************************ //