Skip to content

Commit

Permalink
Merge pull request #2090 from su2code/fix_surface_motion
Browse files Browse the repository at this point in the history
Fix composite surface motions
  • Loading branch information
pcarruscag authored Jul 26, 2023
2 parents 0699292 + 542bf07 commit 7d0cd31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions SU2_CFD/src/solvers/CMeshSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,6 @@ void CMeshSolver::RestartOldGeometry(CGeometry *geometry, const CConfig *config)
void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigned long iter) {

su2double deltaT, time_new, time_old, Lref;
const su2double* Coord = nullptr;
su2double Center[3] = {0.0}, VarCoord[3] = {0.0}, Omega[3] = {0.0}, Ampl[3] = {0.0}, Phase[3] = {0.0};
su2double VarCoordAbs[3] = {0.0};
su2double rotCoord[3] = {0.0}, r[3] = {0.0};
Expand Down Expand Up @@ -1052,10 +1051,14 @@ void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigne

for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {

/*--- Index and coordinates of the current point ---*/
/*--- Index and coordinates of the current point accounting for other
* motions that may be applied, e.g. plunging. ---*/

iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
Coord = geometry->nodes->GetCoord(iPoint);
su2double Coord[3] = {0.0};
for (iDim = 0; iDim < nDim; ++iDim) {
Coord[iDim] = nodes->GetMesh_Coord(iPoint, iDim) + nodes->GetBound_Disp(iPoint, iDim);
}

/*--- Calculate non-dim. position from rotation center ---*/

Expand Down Expand Up @@ -1086,7 +1089,6 @@ void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigne
void CMeshSolver::Surface_Rotating(CGeometry *geometry, CConfig *config, unsigned long iter) {

su2double deltaT, time_new, time_old, Lref;
const su2double* Coord = nullptr;
su2double VarCoordAbs[3] = {0.0};
su2double Center[3] = {0.0}, VarCoord[3] = {0.0}, Omega[3] = {0.0},
rotCoord[3] = {0.0}, r[3] = {0.0}, Center_Aux[3] = {0.0};
Expand Down Expand Up @@ -1158,10 +1160,14 @@ void CMeshSolver::Surface_Rotating(CGeometry *geometry, CConfig *config, unsigne

for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {

/*--- Index and coordinates of the current point ---*/
/*--- Index and coordinates of the current point accounting for other
* motions that may be applied, e.g. plunging. ---*/

iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
Coord = geometry->nodes->GetCoord(iPoint);
su2double Coord[3] = {0.0};
for (iDim = 0; iDim < nDim; ++iDim) {
Coord[iDim] = nodes->GetMesh_Coord(iPoint, iDim) + nodes->GetBound_Disp(iPoint, iDim);
}

/*--- Calculate non-dim. position from rotation center ---*/

Expand Down
2 changes: 1 addition & 1 deletion TestCases/hybrid_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def main():
unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def"
unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg"
unst_deforming_naca0012.test_iter = 5
unst_deforming_naca0012.test_vals = [-3.665120, -3.793643, -3.716518, -3.148310]
unst_deforming_naca0012.test_vals = [-3.665126, -3.793497, -3.716496, -3.148290]
unst_deforming_naca0012.unsteady = True
unst_deforming_naca0012.enabled_with_tsan = False
test_list.append(unst_deforming_naca0012)
Expand Down

0 comments on commit 7d0cd31

Please sign in to comment.