Code clean-up

This commit is contained in:
Hrvoje Jasak 2011-03-24 11:52:08 +00:00
parent c93078bf1e
commit 39eada0427
3 changed files with 49 additions and 33 deletions

View file

@ -67,7 +67,7 @@ Foam::RBFMotionFunctionObject::RBFMotionFunctionObject
statPoints_() statPoints_()
{ {
Info << "Creating RBFMotion check" << endl; Info << "Creating RBFMotion function object" << endl;
} }
@ -117,4 +117,5 @@ bool Foam::RBFMotionFunctionObject::read(const dictionary& dict)
return false; return false;
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -26,7 +26,7 @@ Class
RBFMotionFunctionObject RBFMotionFunctionObject
Description Description
FunctionObject checking the fluxes on ggi interfaces. FunctionObject specifying motion of control points using RBF
Author Author
Frank Bos, TU Delft. All rights reserved. Frank Bos, TU Delft. All rights reserved.

View file

@ -9,35 +9,50 @@
scalar alphaOld = 0.0; scalar alphaOld = 0.0;
scalar alphaCur = 0.0; scalar alphaCur = 0.0;
/* scalar rotationAmplitude_(0.707); // scalar rotationAmplitude_(0.707);
scalar rotationFrequency_(0.0); // scalar rotationFrequency_(0.0);
vector translationFrequency_(0.0,0.25,0.0); // vector translationFrequency_(0.0,0.25,0.0);
vector translationAmplitude_(0.0,5.0,0.0); // vector translationAmplitude_(0.0,5.0,0.0);
vector initialRotationOrigin_(0.0,0.0,0.0);*/ // vector initialRotationOrigin_(0.0,0.0,0.0);
scalar pi=3.141592; scalar pi=3.141592;
alphaOld = rotationAmplitude_*Foam::sin(2*pi*rotationFrequency_*oldTime); alphaOld = rotationAmplitude_*Foam::sin(2*pi*rotationFrequency_*oldTime);
alphaCur = rotationAmplitude_*Foam::sin(2*pi*rotationFrequency_*curTime); alphaCur = rotationAmplitude_*Foam::sin(2*pi*rotationFrequency_*curTime);
vector translationVector(0.0,0.0,0.0); vector translationVector
translationVector.x()=translationAmplitude_[0] (
*( translationAmplitude_[0]*
(
Foam::sin(2*pi*translationFrequency_[0]*curTime) Foam::sin(2*pi*translationFrequency_[0]*curTime)
- Foam::sin(2*pi*translationFrequency_[0]*oldTime) - Foam::sin(2*pi*translationFrequency_[0]*oldTime)
); ),
translationVector.y()=translationAmplitude_[1] translationAmplitude_[1]*
*( (
Foam::sin(2*pi*translationFrequency_[1]*curTime) Foam::sin(2*pi*translationFrequency_[1]*curTime)
- Foam::sin(2*pi*translationFrequency_[1]*oldTime) - Foam::sin(2*pi*translationFrequency_[1]*oldTime)
),
0
); );
translationVector.z()=0.0;
tensor RzOld(Foam::cos(alphaOld), -Foam::sin(alphaOld), 0, Foam::sin(alphaOld), Foam::cos(alphaOld), 0, 0, 0, 1); tensor RzOld
tensor RzCur(Foam::cos(alphaCur), -Foam::sin(alphaCur), 0, Foam::sin(alphaCur), Foam::cos(alphaCur), 0, 0, 0, 1); (
Foam::cos(alphaOld), -Foam::sin(alphaOld), 0,
Foam::sin(alphaOld), Foam::cos(alphaOld), 0,
0, 0, 1
);
//vectorField rotationField = ( (RzCur & (statPoints_ - initialRotationOrigin_)) - (oldPoints - initialRotationOrigin_) ); tensor RzCur
(
Foam::cos(alphaCur), -Foam::sin(alphaCur), 0,
Foam::sin(alphaCur), Foam::cos(alphaCur), 0,
0, 0, 1
);
vectorField rotationField = ( RzCur - RzOld ) & ( statPoints_ - initialRotationOrigin_ ); vectorField rotationField
(
(RzCur - RzOld)
& (statPoints_ - initialRotationOrigin_)
);
motion = translationVector + rotationField; motion = translationVector + rotationField;