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-2024 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 Usage
35  \table
36  Property | Description | Required | Default value
37  type | Type name: sixDoFRigidBodyControl | yes |
38  angleUnits | units in which angles are written \\
39  | no | [rad]
40  angularVelocityUnits | units in which angular velocities are written \\
41  | no | [rad/s]
42  window | Averaging window | yes |
43  convergedVelocity | Linear velocity convergence criterion \\
44  | yes |
45  convergedAngularVelocity | Angular velocity convergence criterion \\
46  | yes |
47  \endtable
48 
49  Example of function object specification:
50  \verbatim
51  sixDoFRigidBodyControl
52  {
53  type sixDoFRigidBodyControl;
54  libs ("libsixDoFRigidBodyState.so");
55 
56  angleUnits [deg];
57  angularVelocityUnits [deg/s];
58 
59  window 1;
60  convergedVelocity (1e-2 1e-2 1e-2);
61  convergedAngularVelocity (5 5 5);
62  }
63  \endverbatim
64 
65 See also
66  Foam::functionObjects::sixDoFRigidBodyState
67 
68 SourceFiles
69  sixDoFRigidBodyControl.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef sixDoFRigidBodyControl_H
74 #define sixDoFRigidBodyControl_H
75 
76 #include "sixDoFRigidBodyState.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 namespace functionObjects
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class sixDoFRigidBodyControl Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class sixDoFRigidBodyControl
90 :
91  public sixDoFRigidBodyState
92 {
93  // Private Data
94 
95  //- Reference to the Time
96  const Time& time_;
97 
98  scalar w_;
99 
100  vector convergedVelocity_;
101 
102  vector convergedAngularVelocity_;
103 
104  vector meanVelocity_;
105 
106  vector meanAngularVelocity_;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("sixDoFRigidBodyControl");
113 
114 
115  // Constructors
116 
117  //- Construct from Time and dictionary
119  (
120  const word& name,
121  const Time& runTime,
122  const dictionary& dict
123  );
124 
125  //- Disallow default bitwise copy construction
127 
128 
129  //- Destructor
130  virtual ~sixDoFRigidBodyControl();
131 
132 
133  // Member Functions
134 
135  //- Read the sixDoFRigidBodyControl data
136  virtual bool read(const dictionary&);
137 
138  //- Execute, currently does nothing
139  virtual bool execute();
140 
141 
142  // Member Operators
143 
144  //- Disallow default bitwise assignment
145  void operator=(const sixDoFRigidBodyControl&) = delete;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace functionObjects
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Convergence control based on the 6-DoF motion state.
sixDoFRigidBodyControl(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
void operator=(const sixDoFRigidBodyControl &)=delete
Disallow default bitwise assignment.
TypeName("sixDoFRigidBodyControl")
Runtime type information.
virtual bool execute()
Execute, currently does nothing.
virtual bool read(const dictionary &)
Read the sixDoFRigidBodyControl data.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
dictionary dict