1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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
29 Floating body is a representation of the mesh and 6-DOF forces with the
30 following characteristics:
32 1) Mesh representation is given as a list of patches representing the hull.
33 Patches can be used to capture individual components (eg. keel,
34 bulb, rudder, hull etc.)
36 2) Mesh is structured in the following way
37 Hull is created with symmetry around the y-z plane
38 Incoming velocity is in -x direction
39 Mesh can be of one of following types
40 2.1) Single zone mesh, with or without prismatic layers
41 2.2) Two-component GGI mesh with a spherical interface
43 2) Flow force calculation is based on turbulent single-phase or
44 free surface flow for all patches. Only the force on wetted surfaces
45 (gamma = 1) is considered
47 3) External propulsion force is given as direction and height above
48 centre of gravity. Force magnitude equals to total drag force
52 Holds inertial parameters of the boat
53 Force balance includes hydrodynamic forces and external propulsion force
54 Motion can be constrained in each of the following:
63 Hrvoje Jasak, Wikki Ltd. All rights reserved.
68 \*---------------------------------------------------------------------------*/
70 #ifndef floatingBody_H
71 #define floatingBody_H
74 #include "polyPatchID.H"
77 #include "sixDOFqODE.H"
78 #include "ODESolver.H"
80 #include "tetFemMatrices.H"
81 #include "tetPointFields.H"
82 #include "faceTetPolyPatch.H"
83 #include "uniformDimensionedFields.H"
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 /*---------------------------------------------------------------------------*\
93 Class floatingBody Declaration
94 \*---------------------------------------------------------------------------*/
100 //- Name of floating body
103 //- Reference to mesh
110 PtrList<polyPatchID> hullPatches_;
112 //- Hull slider patch: moving with hull translation and rotation
113 polyPatchID hullSlider_;
115 //- Hull slider zone: moving with hull translation and rotation
116 faceZoneID hullSliderZone_;
118 //- Fixed slider patch: moving with hull translation only
119 polyPatchID fixedSlider_;
121 //- Fixed slider zone: moving with hull translation only
122 faceZoneID fixedSliderZone_;
124 //- Centre of slider rotation relative to centre of gravity
125 vector centreOfSlider_;
128 // External force variables
130 //- Add propulsion force
131 Switch addPropulsionForce_;
133 //- Propulsion direction
134 vector propulsionDirection_;
136 //- Propulsion force point relative to centre of gravity
137 vector propulsionForceCentroid_;
142 //- 6-DOF motion equation
146 autoPtr<ODESolver> solver_;
148 //- ODE solver accuracy
151 //- Fixed motion components
153 //- Fixed surge (x-translation)
156 //- Fixed sway (y-translation)
159 //- Fixed heave (z-translation)
162 //- Fixed roll (rotation around x)
165 //- Fixed pitch (rotation around y)
168 //- Fixed yaw (rotation around z)
172 //- Steady-state 6-DOF simulation
177 //- Current time index
180 //- Current centre of rotation
183 //- Force at the beginning of time-step
186 //- Moment at the beginning of time-step
190 //- Output file for translation and rotation
194 // Private Member Functions
196 //- Disallow default bitwise copy construct
197 floatingBody(const floatingBody&);
199 //- Disallow default bitwise assignment
200 void operator=(const floatingBody&);
206 //- Return the effective viscous stress (laminar + turbulent).
207 tmp<volSymmTensorField> devRhoReff() const;
209 //- Return drag force on the hull
210 vector dragForce() const;
212 //- Return drag moment on the hull
213 vector dragMoment() const;
216 void fixTranslation(vector& v) const;
219 void fixRotation(vector& rot) const;
221 //- Return velocity of the centre of rotation
222 vector rotCentreVelocity() const;
224 //- Calculate boundary velocity
225 tmp<vectorField> boundaryVelocity
227 const vectorField& boundaryPoints
236 //- Construct from dictionary
241 const dictionary& dict
245 // Destructor - default
251 const word& name() const
256 //- Return ID of hull slider patch
257 const polyPatchID& hullSlider() const
262 //- Return ID of fixed slider patch
263 const polyPatchID& fixedSlider() const
268 //- Set boundary motion
269 void setMotion(tetPointVectorField& motionU);
271 //- Correct motion. This will move zones in parallel
272 void correctMotion(vectorField& newAllPoints) const;
276 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
278 } // End namespace Foam
280 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
284 // ************************************************************************* //