sixDoFMotion: Adding restraints and constraints to the motion of objects.
[OpenFOAM-1.6.x.git] / src / postProcessing / functionObjects / forces / pointPatchFields / derived / sixDoFRigidBodyMotion / sixDoFRigidBodyMotionRestraint / tabulatedAxialAngularSpring / tabulatedAxialAngularSpring.H
blobf29563b9ca0ec6ee0c5abfd574dd12a698d6cae3
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring
28 Description
29     sixDoFRigidBodyMotionRestraints model.  Axial angular spring with moment
30     values drawn from an interpolation table.  Linear damping.
32 SourceFiles
33     tabulatedAxialAngularSpring.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef tabulatedAxialAngularSpring_H
38 #define tabulatedAxialAngularSpring_H
40 #include "sixDoFRigidBodyMotionRestraint.H"
41 #include "point.H"
42 #include "tensor.H"
43 #include "interpolationTable.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 namespace sixDoFRigidBodyMotionRestraints
53 /*---------------------------------------------------------------------------*\
54                   Class tabulatedAxialAngularSpring Declaration
55 \*---------------------------------------------------------------------------*/
57 class tabulatedAxialAngularSpring
59     public sixDoFRigidBodyMotionRestraint
61     // Private data
63         //- Reference orientation where there is no moment
64         tensor refQ_;
66         //- Global unit axis around which the motion is sprung
67         vector axis_;
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)
78         scalar damping_;
81 public:
83     //- Runtime type information
84     TypeName("tabulatedAxialAngularSpring");
87     // Constructors
89         //- Construct from components
90         tabulatedAxialAngularSpring
91         (
92             const dictionary& sDoFRBMRDict
93         );
95         //- Construct and return a clone
96         virtual autoPtr<sixDoFRigidBodyMotionRestraint> clone() const
97         {
98             return autoPtr<sixDoFRigidBodyMotionRestraint>
99             (
100                 new tabulatedAxialAngularSpring(*this)
101             );
102         }
105     // Destructor
107         virtual ~tabulatedAxialAngularSpring();
110     // Member Functions
112         //- Calculate the restraint position, force and moment.
113         //  Global reference frame vectors.
114         virtual void restrain
115         (
116             const sixDoFRigidBodyMotion& motion,
117             vector& restraintPosition,
118             vector& restraintForce,
119             vector& restraintMoment
120         ) const;
122         //- Update properties from given dictionary
123         virtual bool read(const dictionary& sDoFRBMRCoeff);
125         //- Write
126         virtual void write(Ostream&) const;
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace solidBodyMotionFunctions
133 } // End namespace Foam
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 #endif
139 // ************************************************************************* //