Skip to content

Commit 7d0cd31

Browse files
authored
Merge pull request #2090 from su2code/fix_surface_motion
Fix composite surface motions
2 parents 0699292 + 542bf07 commit 7d0cd31

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

SU2_CFD/src/solvers/CMeshSolver.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,6 @@ void CMeshSolver::RestartOldGeometry(CGeometry *geometry, const CConfig *config)
969969
void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigned long iter) {
970970

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

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

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

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

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

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

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

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

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

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

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

TestCases/hybrid_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def main():
526526
unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def"
527527
unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg"
528528
unst_deforming_naca0012.test_iter = 5
529-
unst_deforming_naca0012.test_vals = [-3.665120, -3.793643, -3.716518, -3.148310]
529+
unst_deforming_naca0012.test_vals = [-3.665126, -3.793497, -3.716496, -3.148290]
530530
unst_deforming_naca0012.unsteady = True
531531
unst_deforming_naca0012.enabled_with_tsan = False
532532
test_list.append(unst_deforming_naca0012)

0 commit comments

Comments
 (0)