sixDoFSolverI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
29 
31 {
32  return body_.motionState_.centreOfRotation();
33 }
34 
36 {
37  return body_.motionState_.Q();
38 }
39 
41 {
42  return body_.motionState_.v();
43 }
44 
46 {
47  return body_.motionState_.a();
48 }
49 
51 {
52  return body_.motionState_.pi();
53 }
54 
56 {
57  return body_.motionState_.tau();
58 }
59 
60 
62 {
63  return body_.motionState0_.centreOfRotation();
64 }
65 
66 inline const Foam::tensor& Foam::sixDoFSolver::Q0() const
67 {
68  return body_.motionState0_.Q();
69 }
70 
71 
72 inline const Foam::vector& Foam::sixDoFSolver::v0() const
73 {
74  return body_.motionState0_.v();
75 }
76 
77 
78 inline const Foam::vector& Foam::sixDoFSolver::a0() const
79 {
80  return body_.motionState0_.a();
81 }
82 
83 
85 {
86  return body_.motionState0_.pi();
87 }
88 
89 
91 {
92  return body_.motionState0_.tau();
93 }
94 
95 inline Foam::scalar Foam::sixDoFSolver::aDamp() const
96 {
97  return body_.aDamp_;
98 }
99 
101 {
102  return body_.tConstraints_;
103 }
104 
106 {
107  return body_.rConstraints_;
108 }
109 
110 //- Apply rotation tensors to Q0 for the given torque (pi) and deltaT
111 // and return the rotated Q and pi as a tuple
113 (
114  const tensor& Q0,
115  const vector& pi,
116  const scalar deltaT
117 ) const
118 {
119  return body_.rotate(Q0, pi, deltaT);
120 }
121 
122 //- Update and relax accelerations from the force and torque
124 (
125  const vector& fGlobal,
126  const vector& tauGlobal
127 )
128 {
129  body_.updateAcceleration(fGlobal, tauGlobal);
130 }
131 
132 
133 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::sixDoFSolver::rConstraints
tensor rConstraints() const
Rotational constraint tensor.
Definition: sixDoFSolverI.H:105
Foam::sixDoFSolver::Q
tensor & Q()
Return the orientation.
Definition: sixDoFSolverI.H:35
Foam::sixDoFSolver::tau0
const vector & tau0() const
Return the torque at previous time-step.
Definition: sixDoFSolverI.H:90
Foam::sixDoFSolver::centreOfRotation
point & centreOfRotation()
Return the current centre of rotation.
Definition: sixDoFSolverI.H:30
Foam::sixDoFSolver::a
vector & a()
Return non-const access to acceleration.
Definition: sixDoFSolverI.H:45
Foam::sixDoFSolver::v0
const vector & v0() const
Return the velocity at previous time-step.
Definition: sixDoFSolverI.H:72
Foam::sixDoFSolver::v
vector & v()
Return non-const access to vector.
Definition: sixDoFSolverI.H:40
Foam::sixDoFSolver::Q0
const tensor & Q0() const
Return the orientation at previous time-step.
Definition: sixDoFSolverI.H:66
Foam::sixDoFSolver::rotate
Tuple2< tensor, vector > rotate(const tensor &Q0, const vector &pi, const scalar deltaT) const
Apply rotation tensors to Q0 for the given torque (pi) and deltaT.
Definition: sixDoFSolverI.H:113
Foam::sixDoFSolver::centreOfRotation0
const point & centreOfRotation0() const
Return the centre of rotation at previous time-step.
Definition: sixDoFSolverI.H:61
Foam::sixDoFSolver::pi
vector & pi()
Return non-const access to angular momentum.
Definition: sixDoFSolverI.H:50
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
Foam::sixDoFSolver::aDamp
scalar aDamp() const
Acceleration damping coefficient (for steady-state simulations)
Definition: sixDoFSolverI.H:95
Foam::Vector< scalar >
Foam::sixDoFSolver::updateAcceleration
void updateAcceleration(const vector &fGlobal, const vector &tauGlobal)
Update and relax accelerations from the force and torque.
Definition: sixDoFSolverI.H:124
Foam::sixDoFSolver::tConstraints
tensor tConstraints() const
Translational constraint tensor.
Definition: sixDoFSolverI.H:100
Foam::sixDoFSolver::pi0
const vector & pi0() const
Return the angular momentum at previous time-step.
Definition: sixDoFSolverI.H:84
Foam::sixDoFSolver::tau
vector & tau()
Return non-const access to torque.
Definition: sixDoFSolverI.H:55
Foam::Tuple2
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: stringOps.H:60
Foam::sixDoFSolver::body_
sixDoFRigidBodyMotion & body_
The rigid body.
Definition: sixDoFSolver.H:61
Foam::sixDoFRigidBodyMotionState::centreOfRotation
const point & centreOfRotation() const
Return access to the centre of mass.
Definition: sixDoFRigidBodyMotionStateI.H:31
Foam::sixDoFSolver::a0
const vector & a0() const
Return the acceleration at previous time-step.
Definition: sixDoFSolverI.H:78