@@ -3510,14 +3510,16 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) {
35103510 unsigned long iPoint;
35113511 unsigned short iDim;
35123512
3513- su2double RotVel[3 ] = {0.0 ,0.0 ,0.0 }, Distance[3 ] = {0.0 ,0.0 ,0.0 },
3514- Center[3 ] = {0.0 ,0.0 ,0.0 }, Omega[3 ] = {0.0 ,0.0 ,0.0 };
3513+ su2double GridVel[3 ] = {0.0 ,0.0 ,0.0 }, Distance[3 ] = {0.0 ,0.0 ,0.0 },
3514+ Center[3 ] = {0.0 ,0.0 ,0.0 }, Omega[3 ] = {0.0 ,0.0 ,0.0 },
3515+ xDot[3 ] = {0.0 ,0.0 ,0.0 };
35153516
35163517 /* --- Center of rotation & angular velocity vector from config ---*/
35173518
35183519 for (iDim = 0 ; iDim < 3 ; iDim++) {
35193520 Center[iDim] = config->GetMotion_Origin (iDim);
35203521 Omega[iDim] = config->GetRotation_Rate (iDim)/config->GetOmega_Ref ();
3522+ xDot[iDim] = config->GetTranslation_Rate (iDim)/config->GetVelocity_Ref ();
35213523 }
35223524
35233525 su2double L_Ref = config->GetLength_Ref ();
@@ -3529,9 +3531,11 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) {
35293531 cout << " , " << Center[2 ] << " )\n " ;
35303532 cout << " Angular velocity about x, y, z axes: ( " << Omega[0 ] << " , " ;
35313533 cout << Omega[1 ] << " , " << Omega[2 ] << " ) rad/s" << endl;
3534+ cout << " Translational velocity in x, y, z direction: ("
3535+ << xDot[0 ] << " , " << xDot[1 ] << " , " << xDot[2 ] << " )." << endl;
35323536 }
35333537
3534- /* --- Loop over all nodes and set the rotational velocity ---*/
3538+ /* --- Loop over all nodes and set the rotational and translational velocity ---*/
35353539
35363540 for (iPoint = 0 ; iPoint < nPoint; iPoint++) {
35373541
@@ -3544,15 +3548,15 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) {
35443548 for (iDim = 0 ; iDim < nDim; iDim++)
35453549 Distance[iDim] = (Coord[iDim]-Center[iDim])/L_Ref;
35463550
3547- /* --- Calculate the angular velocity as omega X r ---*/
3551+ /* --- Calculate the angular velocity as omega X r and add translational velocity ---*/
35483552
3549- RotVel [0 ] = Omega[1 ]*(Distance[2 ]) - Omega[2 ]*(Distance[1 ]);
3550- RotVel [1 ] = Omega[2 ]*(Distance[0 ]) - Omega[0 ]*(Distance[2 ]);
3551- RotVel [2 ] = Omega[0 ]*(Distance[1 ]) - Omega[1 ]*(Distance[0 ]);
3553+ GridVel [0 ] = Omega[1 ]*(Distance[2 ]) - Omega[2 ]*(Distance[1 ]) + xDot[ 0 ] ;
3554+ GridVel [1 ] = Omega[2 ]*(Distance[0 ]) - Omega[0 ]*(Distance[2 ]) + xDot[ 1 ] ;
3555+ GridVel [2 ] = Omega[0 ]*(Distance[1 ]) - Omega[1 ]*(Distance[0 ]) + xDot[ 2 ] ;
35523556
35533557 /* --- Store the grid velocity at this node ---*/
35543558
3555- nodes->SetGridVel (iPoint, RotVel );
3559+ nodes->SetGridVel (iPoint, GridVel );
35563560
35573561 }
35583562
0 commit comments