CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   translation along circumferential trajectory (https://www.cfd-online.com/Forums/openfoam-programming-development/201949-translation-along-circumferential-trajectory.html)

karamiag May 16, 2018 04:33

translation along circumferential trajectory
 
1 Attachment(s)
Hi every body,
using the testTubeMixer tutorial, I would like to perform the translation without rotation of the tube along circumferential trajectory (see attached image). To do this I am trying to modify this line of the oscillatingLinearMotion.C file:

Code:

const vector displacement = amplitude_*sin(omega_*t);
in

Code:

const vector displacement.x() = amplitude_.x()*sin(omega_*t);
const vector displacement.y() = amplitude_.y()*cos(omega_*t);
const vector displacement.z() = 0.;

but this is not the right syntax:(. Fundamentally I do not know how to access and modify the components of the vector displacement :confused:.
Thank you very much for your help!:o

karamiag May 18, 2018 04:02

Any, even small, hint is welcome!

karamiag May 19, 2018 13:02

Ok solved in this way :D :)
Code:

vector displacement =amplitude_*sin(omega_*t);
displacement.x()=amplitude_.x()*sin(omega_*t);
displacement.y()=amplitude_.y()*cos(omega_*t);

even if I had to delete the word const before the vector declaration of displacement. Any comment about this?


All times are GMT -4. The time now is 08:58.