Loading...
Searching...
No Matches
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 Copyright (C) 2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
30
32{
33 return body_.motionState_.centreOfRotation();
38 return body_.motionState_.Q();
43 return body_.motionState_.v();
48 return body_.motionState_.a();
53 return body_.motionState_.pi();
54}
57{
58 return body_.motionState_.tau();
59}
61
63{
64 return body_.motionState0_.centreOfRotation();
65}
67inline const Foam::tensor& Foam::sixDoFSolver::Q0() const
68{
69 return body_.motionState0_.Q();
70}
71
73inline const Foam::vector& Foam::sixDoFSolver::v0() const
74{
75 return body_.motionState0_.v();
76}
77
79inline const Foam::vector& Foam::sixDoFSolver::a0() const
80{
81 return body_.motionState0_.a();
82}
83
85inline const Foam::vector& Foam::sixDoFSolver::pi0() const
86{
87 return body_.motionState0_.pi();
88}
90
91inline const Foam::vector& Foam::sixDoFSolver::tau0() const
92{
93 return body_.motionState0_.tau();
95
96inline Foam::scalar Foam::sixDoFSolver::aDamp() const
97{
98 return body_.aDamp_;
103 return body_.tConstraints_;
104}
105
107{
108 return body_.rConstraints_;
110
111//- Apply rotation tensors to Q0 for the given torque (pi) and deltaT
112// and return the rotated Q and pi as a tuple
114(
115 const tensor& Q0,
116 const vector& pi,
117 const scalar deltaT
118) const
119{
120 return body_.rotate(Q0, pi, deltaT);
121}
123//- Update and relax accelerations from the force and torque
125(
126 const vector& fGlobal,
127 const vector& tauGlobal
128)
129{
130 body_.updateAcceleration(fGlobal, tauGlobal);
132
134{
135 body_.updateConstraints();
136}
137
138
139// ************************************************************************* //
constexpr scalar pi(M_PI)
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition Tuple2.H:51
tensor tConstraints() const
Translational constraint tensor.
void updateAcceleration(const vector &fGlobal, const vector &tauGlobal)
Update and relax accelerations from the force and torque.
const vector & tau0() const
Return the torque at previous time-step.
vector & pi()
Return non-const access to angular momentum.
point & centreOfRotation()
Return the current centre of rotation.
const point & centreOfRotation0() const
Return the centre of rotation at previous time-step.
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.
sixDoFRigidBodyMotion & body_
The rigid body.
void updateConstraints()
Update the constraints to the object.
tensor & Q()
Return the orientation.
scalar aDamp() const
Acceleration damping coefficient (for steady-state simulations).
const vector & v0() const
Return the velocity at previous time-step.
const vector & a0() const
Return the acceleration at previous time-step.
const vector & pi0() const
Return the angular momentum at previous time-step.
const tensor & Q0() const
Return the orientation at previous time-step.
tensor rConstraints() const
Rotational constraint tensor.
vector & a()
Return non-const access to acceleration.
vector & tau()
Return non-const access to torque.
vector & v()
Return non-const access to vector.
Tensor< scalar > tensor
Definition symmTensor.H:57
vector point
Point is a vector.
Definition point.H:37
Vector< scalar > vector
Definition vector.H:57