FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

tabulatedAxialAngularSpring.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-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::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring
00026 
00027 Description
00028     sixDoFRigidBodyMotionRestraints model.  Axial angular spring with moment
00029     values drawn from an interpolation table.  Linear damping.
00030 
00031 SourceFiles
00032     tabulatedAxialAngularSpring.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef tabulatedAxialAngularSpring_H
00037 #define tabulatedAxialAngularSpring_H
00038 
00039 #include <forces/sixDoFRigidBodyMotionRestraint.H>
00040 #include <OpenFOAM/point.H>
00041 #include <OpenFOAM/tensor.H>
00042 #include <OpenFOAM/interpolationTable.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 namespace sixDoFRigidBodyMotionRestraints
00050 {
00051 
00052 /*---------------------------------------------------------------------------*\
00053                   Class tabulatedAxialAngularSpring Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class tabulatedAxialAngularSpring
00057 :
00058     public sixDoFRigidBodyMotionRestraint
00059 {
00060     // Private data
00061 
00062         //- Reference orientation where there is no moment
00063         tensor refQ_;
00064 
00065         //- Global unit axis around which the motion is sprung
00066         vector axis_;
00067 
00068         //- Spring moment interpolation table, depending on angleFormat
00069         interpolationTable<scalar> moment_;
00070 
00071         //- Boolean stating whether the angle around the axis needs to
00072         //  be converted to degrees before asking the
00073         //  interpolationTable for a moment value
00074         bool convertToDegrees_;
00075 
00076         //- Damping coefficient (Nms/rad)
00077         scalar damping_;
00078 
00079 
00080 public:
00081 
00082     //- Runtime type information
00083     TypeName("tabulatedAxialAngularSpring");
00084 
00085 
00086     // Constructors
00087 
00088         //- Construct from components
00089         tabulatedAxialAngularSpring
00090         (
00091             const dictionary& sDoFRBMRDict
00092         );
00093 
00094         //- Construct and return a clone
00095         virtual autoPtr<sixDoFRigidBodyMotionRestraint> clone() const
00096         {
00097             return autoPtr<sixDoFRigidBodyMotionRestraint>
00098             (
00099                 new tabulatedAxialAngularSpring(*this)
00100             );
00101         }
00102 
00103 
00104     // Destructor
00105 
00106         virtual ~tabulatedAxialAngularSpring();
00107 
00108 
00109     // Member Functions
00110 
00111         //- Calculate the restraint position, force and moment.
00112         //  Global reference frame vectors.
00113         virtual void restrain
00114         (
00115             const sixDoFRigidBodyMotion& motion,
00116             vector& restraintPosition,
00117             vector& restraintForce,
00118             vector& restraintMoment
00119         ) const;
00120 
00121         //- Update properties from given dictionary
00122         virtual bool read(const dictionary& sDoFRBMRCoeff);
00123 
00124         //- Write
00125         virtual void write(Ostream&) const;
00126 };
00127 
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 } // End namespace solidBodyMotionFunctions
00132 } // End namespace Foam
00133 
00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00135 
00136 #endif
00137 
00138 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines