Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions Common/src/geometry/CGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3510,14 +3510,16 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) {
unsigned long iPoint;
unsigned short iDim;

su2double RotVel[3] = {0.0,0.0,0.0}, Distance[3] = {0.0,0.0,0.0},
Center[3] = {0.0,0.0,0.0}, Omega[3] = {0.0,0.0,0.0};
su2double GridVel[3] = {0.0,0.0,0.0}, Distance[3] = {0.0,0.0,0.0},
Center[3] = {0.0,0.0,0.0}, Omega[3] = {0.0,0.0,0.0},
xDot[3] = {0.0,0.0,0.0};

/*--- Center of rotation & angular velocity vector from config ---*/

for (iDim = 0; iDim < 3; iDim++) {
Center[iDim] = config->GetMotion_Origin(iDim);
Omega[iDim] = config->GetRotation_Rate(iDim)/config->GetOmega_Ref();
xDot[iDim] = config->GetTranslation_Rate(iDim)/config->GetVelocity_Ref();
}

su2double L_Ref = config->GetLength_Ref();
Expand All @@ -3529,9 +3531,11 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) {
cout << ", " << Center[2] << " )\n";
cout << " Angular velocity about x, y, z axes: ( " << Omega[0] << ", ";
cout << Omega[1] << ", " << Omega[2] << " ) rad/s" << endl;
cout << " Translational velocity in x, y, z direction: ("
<< xDot[0] << ", " << xDot[1] << ", " << xDot[2] << ")." << endl;
}

/*--- Loop over all nodes and set the rotational velocity ---*/
/*--- Loop over all nodes and set the rotational and translational velocity ---*/

for (iPoint = 0; iPoint < nPoint; iPoint++) {

Expand All @@ -3544,15 +3548,15 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) {
for (iDim = 0; iDim < nDim; iDim++)
Distance[iDim] = (Coord[iDim]-Center[iDim])/L_Ref;

/*--- Calculate the angular velocity as omega X r ---*/
/*--- Calculate the angular velocity as omega X r and add translational velocity ---*/

RotVel[0] = Omega[1]*(Distance[2]) - Omega[2]*(Distance[1]);
RotVel[1] = Omega[2]*(Distance[0]) - Omega[0]*(Distance[2]);
RotVel[2] = Omega[0]*(Distance[1]) - Omega[1]*(Distance[0]);
GridVel[0] = Omega[1]*(Distance[2]) - Omega[2]*(Distance[1]) + xDot[0];
GridVel[1] = Omega[2]*(Distance[0]) - Omega[0]*(Distance[2]) + xDot[1];
GridVel[2] = Omega[0]*(Distance[1]) - Omega[1]*(Distance[0]) + xDot[2];

/*--- Store the grid velocity at this node ---*/

nodes->SetGridVel(iPoint, RotVel);
nodes->SetGridVel(iPoint, GridVel);

}

Expand Down
12 changes: 8 additions & 4 deletions TestCases/py_wrapper/translating_NACA0012/config.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ RESTART_SOL= NO
% FREE-STREAM DEFINITION
%
% We are translating the domain instead of having farfield velocity.
GRID_MOVEMENT= STEADY_TRANSLATION
MOTION_ORIGIN= ( 0.0, 0.0, 0.0 )
TRANSLATION_RATE= ( -264.994, -5.78219, 0.0 )
% Note: The rotating frame is intended for 3D cases. To use the feature in a 2D case,
% care must be taken with respect to the axes, e.g. to obtain a pitching motion, a
% rotation about the z-axis can be used.
GRID_MOVEMENT= ROTATING_FRAME
MOTION_ORIGIN= 0.0, 0.0, 0.0
ROTATION_RATE= 0.0, 0.0, 0.5
TRANSLATION_RATE= -264.994, -5.78219, 0.0
MACH_NUMBER= 0.0
FREESTREAM_PRESSURE= 101325.0
FREESTREAM_TEMPERATURE= 273.15
Expand Down Expand Up @@ -68,6 +72,6 @@ CONV_RESIDUAL_MINVAL= -9
%
MESH_FILENAME= ../../euler/naca0012/mesh_NACA0012_inv.su2
MESH_FORMAT= SU2
SCREEN_OUTPUT= (INNER_ITER, RMS_RES, LIFT, DRAG)
SCREEN_OUTPUT= (INNER_ITER, RMS_RES, LIFT, DRAG, MOMENT_X, MOMENT_Y, MOMENT_Z)
HISTORY_OUTPUT= (INNER_ITER, RMS_RES, AERO_COEFF)

Loading