All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sixDoFRigidBodyControl.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::functionObjects::sixDoFRigidBodyControl
26 
27 Description
28  Convergence control based on the 6-DoF motion state.
29 
30  The body linear and angular velocities are averaged over a specified time
31  window and compared to specified velocity convergence criteria and the run
32  stopped after writing the current time results, if the criteria are met.
33 
34  Example of function object specification:
35  \verbatim
36  sixDoFRigidBodyControl
37  {
38  type sixDoFRigidBodyControl;
39  libs ("libsixDoFRigidBodyState.so");
40 
41  angleFormat degrees;
42 
43  window 1;
44  convergedVelocity (1e-2 1e-2 1e-2);
45  convergedAngularVelocity (5 5 5);
46  }
47  \endverbatim
48 
49  Note the units of the \c convergedAngularVelocity are specified by the \c
50  angleFormat entry.
51 
52 Usage
53  \table
54  Property | Description | Required | Default value
55  type | Type name: sixDoFRigidBodyControl | yes |
56  angleFormat | Degrees or radians | no | radian
57  window | Averaging window | yes |
58  convergedVelocity | Linear velocity convergence criterion | yes |
59  convergedAngularVelocity | Angular velocity convergence criterion | yes |
60  \endtable
61 
62 See also
63  Foam::functionObjects::sixDoFRigidBodyState
64 
65 SourceFiles
66  sixDoFRigidBodyControl.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef sixDoFRigidBodyControl_H
71 #define sixDoFRigidBodyControl_H
72 
73 #include "sixDoFRigidBodyState.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 namespace functionObjects
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class sixDoFRigidBodyControl Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class sixDoFRigidBodyControl
87 :
88  public sixDoFRigidBodyState
89 {
90  // Private Data
91 
92  //- Reference to the Time
93  const Time& time_;
94 
95  scalar w_;
96 
97  vector convergedVelocity_;
98 
99  vector convergedAngularVelocity_;
100 
101  vector meanVelocity_;
102 
103  vector meanAngularVelocity_;
104 
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("sixDoFRigidBodyControl");
111 
112 
113  // Constructors
114 
115  //- Construct from Time and dictionary
117  (
118  const word& name,
119  const Time& runTime,
120  const dictionary& dict
121  );
122 
123  //- Disallow default bitwise copy construction
125 
126 
127  //- Destructor
128  virtual ~sixDoFRigidBodyControl();
129 
130 
131  // Member Functions
132 
133  //- Read the sixDoFRigidBodyControl data
134  virtual bool read(const dictionary&);
135 
136  //- Execute, currently does nothing
137  virtual bool execute();
138 
139 
140  // Member Operators
141 
142  //- Disallow default bitwise assignment
143  void operator=(const sixDoFRigidBodyControl&) = delete;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace functionObjects
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
dictionary dict
void operator=(const sixDoFRigidBodyControl &)=delete
Disallow default bitwise assignment.
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
engineTime & runTime
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Convergence control based on the 6-DoF motion state.
A class for handling words, derived from string.
Definition: word.H:59
virtual bool read(const dictionary &)
Read the sixDoFRigidBodyControl data.
sixDoFRigidBodyControl(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
TypeName("sixDoFRigidBodyControl")
Runtime type information.
virtual bool execute()
Execute, currently does nothing.
Namespace for OpenFOAM.