1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring
29 sixDoFRigidBodyMotionRestraints model. Axial angular spring with moment
30 values drawn from an interpolation table. Linear damping.
33 tabulatedAxialAngularSpring.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef tabulatedAxialAngularSpring_H
38 #define tabulatedAxialAngularSpring_H
40 #include "sixDoFRigidBodyMotionRestraint.H"
43 #include "interpolationTable.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace sixDoFRigidBodyMotionRestraints
53 /*---------------------------------------------------------------------------*\
54 Class tabulatedAxialAngularSpring Declaration
55 \*---------------------------------------------------------------------------*/
57 class tabulatedAxialAngularSpring
59 public sixDoFRigidBodyMotionRestraint
63 //- Reference orientation where there is no moment
66 //- Global unit axis around which the motion is sprung
69 //- Spring moment interpolation table, depending on angleFormat
70 interpolationTable<scalar> moment_;
72 //- Boolean stating whether the angle around the axis needs to
73 // be converted to degrees before asking the
74 // interpolationTable for a moment value
75 bool convertToDegrees_;
77 //- Damping coefficient (Nms/rad)
83 //- Runtime type information
84 TypeName("tabulatedAxialAngularSpring");
89 //- Construct from components
90 tabulatedAxialAngularSpring
92 const dictionary& sDoFRBMRDict
95 //- Construct and return a clone
96 virtual autoPtr<sixDoFRigidBodyMotionRestraint> clone() const
98 return autoPtr<sixDoFRigidBodyMotionRestraint>
100 new tabulatedAxialAngularSpring(*this)
107 virtual ~tabulatedAxialAngularSpring();
112 //- Calculate the restraint position, force and moment.
113 // Global reference frame vectors.
114 virtual void restrain
116 const sixDoFRigidBodyMotion& motion,
117 vector& restraintPosition,
118 vector& restraintForce,
119 vector& restraintMoment
122 //- Update properties from given dictionary
123 virtual bool read(const dictionary& sDoFRBMRCoeff);
126 virtual void write(Ostream&) const;
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace solidBodyMotionFunctions
133 } // End namespace Foam
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 // ************************************************************************* //