diff --git a/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/RBFMotionFunctionObject.C b/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/RBFMotionFunctionObject.C index 322546055..ab0540cfb 100644 --- a/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/RBFMotionFunctionObject.C +++ b/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/RBFMotionFunctionObject.C @@ -67,7 +67,7 @@ Foam::RBFMotionFunctionObject::RBFMotionFunctionObject statPoints_() { - Info << "Creating RBFMotion check" << endl; + Info << "Creating RBFMotion function object" << endl; } @@ -105,9 +105,9 @@ bool Foam::RBFMotionFunctionObject::execute() # include "kinematicModel.H" - ms.setMotion(motion); - movePoints(ms.newPoints()); - + ms.setMotion(motion); + movePoints(ms.newPoints()); + return true; } @@ -117,4 +117,5 @@ bool Foam::RBFMotionFunctionObject::read(const dictionary& dict) return false; } + // ************************************************************************* // diff --git a/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/RBFMotionFunctionObject.H b/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/RBFMotionFunctionObject.H index 8b430483e..65c6cc892 100644 --- a/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/RBFMotionFunctionObject.H +++ b/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/RBFMotionFunctionObject.H @@ -26,7 +26,7 @@ Class RBFMotionFunctionObject Description - FunctionObject checking the fluxes on ggi interfaces. + FunctionObject specifying motion of control points using RBF Author Frank Bos, TU Delft. All rights reserved. diff --git a/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/kinematicModel.H b/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/kinematicModel.H index 1ef96f3fb..a1426c439 100644 --- a/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/kinematicModel.H +++ b/tutorials/incompressible/icoDyMFoam/movingBlockRBF/RBFMotionFunction/kinematicModel.H @@ -1,43 +1,58 @@ // Motion is a vectorField of all moving boundary points vectorField motion(ms.movingPoints().size(), vector::zero); - - vectorField oldPoints=ms.movingPoints(); - - scalar oldTime = time_.value() - time_.deltaT().value(); + + vectorField oldPoints = ms.movingPoints(); + + scalar oldTime = time_.value() - time_.deltaT().value(); scalar curTime = time_.value(); scalar alphaOld = 0.0; scalar alphaCur = 0.0; -/* scalar rotationAmplitude_(0.707); - scalar rotationFrequency_(0.0); - vector translationFrequency_(0.0,0.25,0.0); - vector translationAmplitude_(0.0,5.0,0.0); - vector initialRotationOrigin_(0.0,0.0,0.0);*/ - - scalar pi=3.141592; +// scalar rotationAmplitude_(0.707); +// scalar rotationFrequency_(0.0); +// vector translationFrequency_(0.0,0.25,0.0); +// vector translationAmplitude_(0.0,5.0,0.0); +// vector initialRotationOrigin_(0.0,0.0,0.0); + + scalar pi=3.141592; alphaOld = rotationAmplitude_*Foam::sin(2*pi*rotationFrequency_*oldTime); alphaCur = rotationAmplitude_*Foam::sin(2*pi*rotationFrequency_*curTime); - vector translationVector(0.0,0.0,0.0); - translationVector.x()=translationAmplitude_[0] - *( - Foam::sin(2*pi*translationFrequency_[0]*curTime) - -Foam::sin(2*pi*translationFrequency_[0]*oldTime) - ); - translationVector.y()=translationAmplitude_[1] - *( - Foam::sin(2*pi*translationFrequency_[1]*curTime) - -Foam::sin(2*pi*translationFrequency_[1]*oldTime) - ); - translationVector.z()=0.0; - - tensor RzOld(Foam::cos(alphaOld), -Foam::sin(alphaOld), 0, Foam::sin(alphaOld), Foam::cos(alphaOld), 0, 0, 0, 1); - tensor RzCur(Foam::cos(alphaCur), -Foam::sin(alphaCur), 0, Foam::sin(alphaCur), Foam::cos(alphaCur), 0, 0, 0, 1); + vector translationVector + ( + translationAmplitude_[0]* + ( + Foam::sin(2*pi*translationFrequency_[0]*curTime) + - Foam::sin(2*pi*translationFrequency_[0]*oldTime) + ), + translationAmplitude_[1]* + ( + Foam::sin(2*pi*translationFrequency_[1]*curTime) + - Foam::sin(2*pi*translationFrequency_[1]*oldTime) + ), + 0 + ); - //vectorField rotationField = ( (RzCur & (statPoints_ - initialRotationOrigin_)) - (oldPoints - initialRotationOrigin_) ); + tensor RzOld + ( + Foam::cos(alphaOld), -Foam::sin(alphaOld), 0, + Foam::sin(alphaOld), Foam::cos(alphaOld), 0, + 0, 0, 1 + ); - vectorField rotationField = ( RzCur - RzOld ) & ( statPoints_ - 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_) + ); motion = translationVector + rotationField;