Runtime bugfixes and minor reorganization
This commit is contained in:
parent
546cfc0f5f
commit
afeca8ee2f
7 changed files with 11 additions and 180 deletions
|
@ -13,7 +13,6 @@ sixDOF = sixDOF
|
|||
$(sixDOF)/finiteRotation/finiteRotation.C
|
||||
$(sixDOF)/sixDOFqODE/sixDOFqODE.C
|
||||
|
||||
$(sixDOF)/sixDOFODE/sixDOFODEIO.C
|
||||
$(sixDOF)/sixDOFODE/sixDOFODE.C
|
||||
$(sixDOF)/sixDOFODE/newSixDOFODE.C
|
||||
$(sixDOF)/quaternionSixDOF/quaternionSixDOF.C
|
||||
|
|
|
@ -151,7 +151,7 @@ void Foam::finiteRotation::updateRotation(const HamiltonRodriguezRot& rot)
|
|||
}
|
||||
|
||||
|
||||
void Foam::finiteRotation::updateRotationGivenIncrement(const tensor& incR)
|
||||
void Foam::finiteRotation::updateRotationWithIncrement(const tensor& incR)
|
||||
{
|
||||
rotIncrementTensor_ = incR;
|
||||
rotTensor_ = (incR & rotTensor_);
|
||||
|
|
|
@ -108,7 +108,7 @@ public:
|
|||
void updateRotation(const HamiltonRodriguezRot& rot);
|
||||
|
||||
//- Update rotation given increment rotation tensor
|
||||
void updateRotationGivenIncrement(const tensor& incR);
|
||||
void updateRotationWithIncrement(const tensor& incR);
|
||||
|
||||
//- Return initial quaternions
|
||||
const HamiltonRodriguezRot& eInitial() const;
|
||||
|
|
|
@ -190,7 +190,7 @@ Foam::tensor Foam::geometricSixDOF::expMap(const vector& rotInc) const
|
|||
+ (skewRotInc & skewRotInc)*(1.0 - cos(magRotInc))/sqr(magRotInc);
|
||||
}
|
||||
|
||||
return R;
|
||||
return R.T();
|
||||
}
|
||||
|
||||
|
||||
|
@ -568,15 +568,11 @@ void Foam::geometricSixDOF::derivatives
|
|||
// Get rotational increment vector (u)
|
||||
const vector rotIncrementVector(y[9], y[10], y[11]);
|
||||
|
||||
// Calculate rotation increment tensor obtained with exponential map using
|
||||
// the increment vector
|
||||
const tensor rotIncrement = expMap(rotIncrementVector);
|
||||
|
||||
// Update rotation tensor
|
||||
rotation_.updateRotation(rotIncrement);
|
||||
// Calculate current rotation tensor obtained with exponential map
|
||||
const tensor curRot = (expMap(rotIncrementVector) & rotation_.rotTensor());
|
||||
|
||||
// Calculate translational acceleration using current rotation
|
||||
const vector accel = A(curX, curU, rotation_.rotTensor()).value();
|
||||
const vector accel = A(curX, curU, curRot).value();
|
||||
|
||||
// Set the derivatives for velocity
|
||||
dydx[3] = accel.x();
|
||||
|
@ -593,7 +589,7 @@ void Foam::geometricSixDOF::derivatives
|
|||
);
|
||||
|
||||
// Calculate rotational acceleration using current rotation
|
||||
const vector omegaDot = OmegaDot(rotation_.rotTensor(), curOmega).value();
|
||||
const vector omegaDot = OmegaDot(curRot, curOmega).value();
|
||||
|
||||
dydx[6] = omegaDot.x();
|
||||
dydx[7] = omegaDot.y();
|
||||
|
@ -649,7 +645,7 @@ void Foam::geometricSixDOF::update(const scalar delta)
|
|||
omegaVal.z() = coeffs_[8];
|
||||
|
||||
// Update rotation with final increment vector
|
||||
rotation_.updateRotation
|
||||
rotation_.updateRotationWithIncrement
|
||||
(
|
||||
expMap(vector(coeffs_[9], coeffs_[10], coeffs_[11]))
|
||||
);
|
||||
|
|
|
@ -85,6 +85,9 @@ void Foam::sixDOFBodies::setBodies()
|
|||
bodyI,
|
||||
ODESolver::New(lookup("solver"), odes_[bodyI])
|
||||
);
|
||||
|
||||
Info<< "Finished creating " << odes_[bodyI].type()
|
||||
<< " object for body " << names_[bodyI] << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 4.0
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
sixDOFODEIO
|
||||
|
||||
Description
|
||||
Class used to control input/output for sixDOFODEIO. Need separate classes in
|
||||
order to be able to have run-time selection and automatic I/O.
|
||||
|
||||
Author
|
||||
Vuko Vukcevic, FSB Zagreb. All rights reserved.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sixDOFODEIO.H"
|
||||
#include "sixDOFODE.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sixDOFODEIO::sixDOFODEIO(const IOobject& io, const sixDOFODE& sixDOF)
|
||||
:
|
||||
IOdictionary(io),
|
||||
sixDOF_(sixDOF)
|
||||
{
|
||||
// Note: parameter sixDOF is incomplete here, must not call its member
|
||||
// functions here.
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sixDOFODEIO::~sixDOFODEIO()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::sixDOFODEIO::writeData(Ostream& os) const
|
||||
{
|
||||
return sixDOF_.writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
|
@ -1,102 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 4.0
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation, either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
foam-extend is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
sixDOFODEIO
|
||||
|
||||
Description
|
||||
Class used to control input/output for sixDOFODEIO. Need separate classes in
|
||||
order to be able to have run-time selection and automatic I/O.
|
||||
|
||||
Author
|
||||
Vuko Vukcevic, FSB Zagreb. All rights reserved.
|
||||
|
||||
SourceFiles
|
||||
sixDOFODEIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef sixDOFODEIO_H
|
||||
#define sixDOFODEIO_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class sixDOFODE;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class sixDOFODEIO Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class sixDOFODEIO
|
||||
:
|
||||
public IOdictionary
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Const reference to the underlying sixDOFODE object
|
||||
const sixDOFODE& sixDOF_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
sixDOFODEIO(const sixDOFODEIO&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const sixDOFODEIO&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary and sixDOFODE object
|
||||
sixDOFODEIO(const IOobject& io, const sixDOFODE& sixDOF);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~sixDOFODEIO();
|
||||
|
||||
|
||||
// Write control
|
||||
|
||||
//- writeData member function controlling output
|
||||
virtual bool writeData(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
Reference in a new issue