sixDoFMotion: Adding restraints and constraints to the motion of objects.
[OpenFOAM-1.6.x.git] / src / postProcessing / functionObjects / forces / pointPatchFields / derived / sixDoFRigidBodyMotion / sixDoFRigidBodyMotionConstraint / fixedOrientation / fixedOrientation.H
blob6aaa50aa6f549266ed7c2f14c0f80e47820c1168
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::sixDoFRigidBodyMotionConstraints::fixedOrientation
28 Description
29     sixDoFRigidBodyMotionConstraint.  Orientation of body fixed global
30     space. Only valid where the predicted deviation from alignment is
31     < 90 degrees.
33 SourceFiles
34     fixedOrientation.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef fixedOrientation_H
39 #define fixedOrientation_H
41 #include "sixDoFRigidBodyMotionConstraint.H"
42 #include "point.H"
43 #include "tensor.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 namespace sixDoFRigidBodyMotionConstraints
53 /*---------------------------------------------------------------------------*\
54                        Class fixedOrientation Declaration
55 \*---------------------------------------------------------------------------*/
57 class fixedOrientation
59     public sixDoFRigidBodyMotionConstraint
62 public:
64     //- Runtime type information
65     TypeName("fixedOrientation");
68     // Constructors
70         //- Construct from components
71         fixedOrientation
72         (
73             const dictionary& sDoFRBMCDict
74         );
76         //- Construct and return a clone
77         virtual autoPtr<sixDoFRigidBodyMotionConstraint> clone() const
78         {
79             return autoPtr<sixDoFRigidBodyMotionConstraint>
80             (
81                 new fixedOrientation(*this)
82             );
83         }
86     // Destructor
88         virtual ~fixedOrientation();
91     // Member Functions
93         //- Calculate the constraint position, force and moment.
94         //  Global reference frame vectors.  Returns boolean stating
95         //  whether the constraint been converged to tolerance.
96         virtual bool constrain
97         (
98             const sixDoFRigidBodyMotion& motion,
99             const vector& existingConstraintForce,
100             const vector& existingConstraintMoment,
101             scalar deltaT,
102             vector& constraintPosition,
103             vector& constraintForceIncrement,
104             vector& constraintMomentIncrement
105         ) const;
107         //- Update properties from given dictionary
108         virtual bool read(const dictionary& sDoFRBMCCoeff);
110         //- Write
111         virtual void write(Ostream&) const;
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 } // End namespace solidBodyMotionFunctions
118 } // End namespace Foam
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 #endif
124 // ************************************************************************* //