Skip to content

Commit 3e8ba47

Browse files
committed
add basic support for rotation changes
1 parent db21a33 commit 3e8ba47

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

Common/include/CConfig.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5946,6 +5946,13 @@ class CConfig {
59465946
* \return Rotation velocity of the marker.
59475947
*/
59485948
su2double GetMarkerRotationRate(unsigned short iMarkerMoving, unsigned short iDim) const { return MarkerRotation_Rate[3*iMarkerMoving + iDim];}
5949+
/*!
5950+
* \brief Set the rotation rate of the marker.
5951+
* \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving)
5952+
* \param[in] iDim - spatial component
5953+
* \return Rotation velocity of the marker.
5954+
*/
5955+
void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerRotation_Rate[3*iMarkerMoving + iDim] = val;}
59495956

59505957
/*!
59515958
* \brief Get the pitching rate of the mesh.

SU2_CFD/include/drivers/CDriver.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ class CDriver : public CDriverBase {
536536
*/
537537
void SetRotationRate(passivedouble rot_x, passivedouble rot_y, passivedouble rot_z);
538538

539+
void SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z);
539540
/// \}
540541
};
541542

SU2_CFD/src/iteration/CIteration.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,18 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac
8888
}
8989

9090
break;
91+
92+
9193
}
9294

93-
if (config->GetSurface_Movement(AEROELASTIC) || config->GetSurface_Movement(AEROELASTIC_RIGID_MOTION)) {
95+
if (config->GetSurface_Movement(AEROELASTIC) || config->GetSurface_Movement(AEROELASTIC_RIGID_MOTION) || config->GetSurface_Movement(MOVING_WALL)) {
9496
/*--- Apply rigid mesh transformation to entire grid first, if necessary ---*/
97+
9598
if (IntIter == 0) {
99+
cout << "TESTING:\n";
100+
101+
cout << config->GetSurface_Movement(MOVING_WALL);
102+
cout << "\n";
96103
if (Kind_Grid_Movement == AEROELASTIC_RIGID_MOTION) {
97104
if (rank == MASTER_NODE) cout << endl << " Performing rigid mesh transformation." << endl;
98105

@@ -110,6 +117,10 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac
110117

111118
grid_movement->UpdateMultiGrid(geometry, config);
112119
}
120+
if(config->GetSurface_Movement(MOVING_WALL)){
121+
geometry[MESH_0]->SetWallVelocity(config, true);
122+
123+
}
113124

114125
}
115126

SU2_CFD/src/python_wrapper_structure.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,11 @@ void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passived
166166
config_container[iZone]->SetRotation_Rate(2, rot_z);
167167
}
168168
}
169+
void CDriver::SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z){
170+
for (iZone = 0; iZone < nZone; iZone++) {
171+
config_container[iZone]->SetMarkerRotation_Rate(iMarker, 0, rot_x);
172+
config_container[iZone]->SetMarkerRotation_Rate(iMarker, 1, rot_y);
173+
config_container[iZone]->SetMarkerRotation_Rate(iMarker, 2, rot_z);
174+
}
175+
}
169176

0 commit comments

Comments
 (0)