Skip to content

Commit 339d745

Browse files
committed
Merge branch 'develop' into adaptive_edge_color_group_size
2 parents aec3aab + 8b89e85 commit 339d745

10 files changed

Lines changed: 200 additions & 8 deletions

File tree

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Eduardo Molina
7171
Edwin van der Weide
7272
Ethan Alan Hereth
7373
Florian Dittmann
74+
Filip Hahs
7475
Francesco Poli
7576
Francisco D. Palacios
7677
Gaurav Bansal

Common/include/CConfig.hpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5911,6 +5911,15 @@ class CConfig {
59115911
*/
59125912
su2double GetMarkerTranslationRate(unsigned short iMarkerMoving, unsigned short iDim) const { return MarkerTranslation_Rate[3*iMarkerMoving + iDim];}
59135913

5914+
/*!
5915+
* \brief Set the translation rate of the marker.
5916+
* \param[in] iDim - spatial component
5917+
* \param[in] val - translational velocity
5918+
*/
5919+
void SetMarkerTranslationRate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) {
5920+
MarkerTranslation_Rate[3 * iMarkerMoving + iDim] = val;
5921+
}
5922+
59145923
/*!
59155924
* \brief Get the rotation rate of the mesh.
59165925
* \param[in] iDim - spatial component
@@ -5934,6 +5943,16 @@ class CConfig {
59345943
*/
59355944
su2double GetMarkerRotationRate(unsigned short iMarkerMoving, unsigned short iDim) const { return MarkerRotation_Rate[3*iMarkerMoving + iDim];}
59365945

5946+
/*!
5947+
* \brief Set the rotation rate of the marker.
5948+
* \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving)
5949+
* \param[in] iDim - spatial component
5950+
* \param[in] val - Rotational velocity
5951+
*/
5952+
void SetMarkerRotationRate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) {
5953+
MarkerRotation_Rate[3 * iMarkerMoving + iDim] = val;
5954+
}
5955+
59375956
/*!
59385957
* \brief Get the pitching rate of the mesh.
59395958
* \param[in] iDim - spatial component

SU2_CFD/include/drivers/CDriver.hpp

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

539+
/*!
540+
* \brief Set the moving wall marker rotation rates.
541+
* \param[in] iMaker - Index of moving wall marker.
542+
* \param[in] rot_x - Value of Angular velocity about x-axes.
543+
* \param[in] rot_y - Value of Angular velocity about y-axes.
544+
* \param[in] rot_z - Value of Angular velocity about z-axes.
545+
*/
546+
void SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z);
547+
548+
/*!
549+
* \brief Set the moving wall marker translation rates.
550+
* \param[in] iMaker - Index of moving wall marker.
551+
* \param[in] vel_x - Value of velocity along x-axis.
552+
* \param[in] vel_y - Value of velocity along y-axis.
553+
* \param[in] vel_z - Value of velocity along z-axis.
554+
*/
555+
void SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z);
556+
539557
/// \}
540558
};
541559

SU2_CFD/src/iteration/CIteration.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac
9090
break;
9191
}
9292

93-
if (config->GetSurface_Movement(AEROELASTIC) || config->GetSurface_Movement(AEROELASTIC_RIGID_MOTION)) {
93+
if (config->GetSurface_Movement(AEROELASTIC) || config->GetSurface_Movement(AEROELASTIC_RIGID_MOTION) || config->GetSurface_Movement(MOVING_WALL)) {
9494
/*--- Apply rigid mesh transformation to entire grid first, if necessary ---*/
95+
9596
if (IntIter == 0) {
97+
9698
if (Kind_Grid_Movement == AEROELASTIC_RIGID_MOTION) {
9799
if (rank == MASTER_NODE) cout << endl << " Performing rigid mesh transformation." << endl;
98100

@@ -110,6 +112,11 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac
110112

111113
grid_movement->UpdateMultiGrid(geometry, config);
112114
}
115+
if (config->GetSurface_Movement(MOVING_WALL)) {
116+
for (auto iMGlevel = 0u; iMGlevel <= config->GetnMGLevels(); iMGlevel++) {
117+
geometry[iMGlevel]->SetWallVelocity(config, iMGlevel == 0u);
118+
}
119+
}
113120

114121
}
115122

SU2_CFD/src/python_wrapper_structure.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,15 @@ void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passived
163163
main_config->SetRotation_Rate(2, rot_z);
164164
}
165165

166+
void CDriver::SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z) {
167+
config_container[selected_zone]->SetMarkerRotationRate(iMarker, 0, rot_x);
168+
config_container[selected_zone]->SetMarkerRotationRate(iMarker, 1, rot_y);
169+
config_container[selected_zone]->SetMarkerRotationRate(iMarker, 2, rot_z);
170+
}
171+
172+
void CDriver::SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z) {
173+
config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 0, vel_x);
174+
config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 1, vel_y);
175+
config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 2, vel_z);
176+
}
177+

TestCases/hybrid_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,16 +436,16 @@ def main():
436436
cavity.cfg_dir = "moving_wall/cavity"
437437
cavity.cfg_file = "lam_cavity.cfg"
438438
cavity.test_iter = 25
439-
cavity.test_vals = [-5.627934, -0.164469, 0.052000, 2.547063]
439+
cavity.test_vals = [-5.627868, -0.164404, 0.053310, 2.545839]
440440
test_list.append(cavity)
441441

442442
# Spinning cylinder
443443
spinning_cylinder = TestCase('spinning_cylinder')
444444
spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder"
445445
spinning_cylinder.cfg_file = "spinning_cylinder.cfg"
446446
spinning_cylinder.test_iter = 25
447-
spinning_cylinder.test_vals = [-8.001291, -2.607959, 1.501321, 1.488559]
448-
spinning_cylinder.test_vals_aarch64 = [-8.001291, -2.607959, 1.501321, 1.488559]
447+
spinning_cylinder.test_vals = [-8.006541, -2.609759, 1.495662, 1.486341]
448+
spinning_cylinder.test_vals_aarch64 = [-8.006541, -2.609759, 1.495662, 1.486341]
449449
test_list.append(spinning_cylinder)
450450

451451
######################################

TestCases/parallel_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,15 +925,15 @@ def main():
925925
cavity.cfg_dir = "moving_wall/cavity"
926926
cavity.cfg_file = "lam_cavity.cfg"
927927
cavity.test_iter = 25
928-
cavity.test_vals = [-5.611007, -0.146826, 1.113206, 1.491678]
928+
cavity.test_vals = [-5.610928, -0.146749, 1.114461, 1.490381]
929929
test_list.append(cavity)
930930

931931
# Spinning cylinder
932932
spinning_cylinder = TestCase('spinning_cylinder')
933933
spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder"
934934
spinning_cylinder.cfg_file = "spinning_cylinder.cfg"
935935
spinning_cylinder.test_iter = 25
936-
spinning_cylinder.test_vals = [-7.802803, -2.362844, 1.687705, 1.519676]
936+
spinning_cylinder.test_vals = [-7.806016, -2.364954, 1.683365, 1.517059]
937937
test_list.append(spinning_cylinder)
938938

939939
######################################
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pysu2 # imports the SU2 wrapped module
2+
from mpi4py import MPI
3+
import numpy as np
4+
5+
comm = MPI.COMM_WORLD
6+
rank = comm.Get_rank()
7+
rotation_vector = np.linspace(0,20,10)
8+
SU2Driver = pysu2.CSinglezoneDriver("spinning_cylinder.cfg",1, comm)
9+
10+
for i, rate in enumerate(rotation_vector):
11+
SU2Driver.SetMarkerRotationRate(0,0,0,rate)
12+
SU2Driver.Preprocess(i)
13+
SU2Driver.Run()
14+
SU2Driver.Postprocess()
15+
SU2Driver.Output(i)
16+
SU2Driver.Update()
17+
SU2Driver.Finalize()
18+
19+
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2+
% %
3+
% SU2 configuration file %
4+
% Case description: Laminar flow around a spinning cylinder %
5+
% Author: Thomas D. Economon %
6+
% Institution: Stanford University %
7+
% Date: 2013.08.21 %
8+
% File Version 7.5.1 "Blackbird" %
9+
% %
10+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11+
12+
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
13+
%
14+
SOLVER= NAVIER_STOKES
15+
KIND_TURB_MODEL= NONE
16+
MATH_PROBLEM= DIRECT
17+
RESTART_SOL= NO
18+
19+
% ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------%
20+
%
21+
MACH_NUMBER= 0.1
22+
AOA= 0.0
23+
SIDESLIP_ANGLE= 0.0
24+
FREESTREAM_TEMPERATURE= 288.15
25+
REYNOLDS_NUMBER= 200.0
26+
REYNOLDS_LENGTH= 1.0
27+
28+
% ----------------------- DYNAMIC MESH DEFINITION -----------------------------%
29+
%
30+
SURFACE_MOVEMENT= MOVING_WALL
31+
MACH_MOTION= 0.1
32+
MARKER_MOVING= ( cylinder )
33+
SURFACE_MOTION_ORIGIN= 0.5 0.0 0.0
34+
SURFACE_ROTATION_RATE = 0.0 0.0 -199.0738
35+
36+
% ---------------------- REFERENCE VALUE DEFINITION ---------------------------%
37+
%
38+
REF_ORIGIN_MOMENT_X = 0.00
39+
REF_ORIGIN_MOMENT_Y = 0.00
40+
REF_ORIGIN_MOMENT_Z = 0.00
41+
REF_LENGTH= 1.0
42+
REF_AREA= 1.0
43+
44+
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
45+
%
46+
MARKER_HEATFLUX= ( cylinder, 0.0 )
47+
MARKER_FAR= ( farfield )
48+
MARKER_PLOTTING= ( cylinder )
49+
MARKER_MONITORING= ( cylinder )
50+
51+
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%
52+
%
53+
NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES
54+
CFL_NUMBER= 100.0
55+
CFL_ADAPT= NO
56+
CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 )
57+
ITER= 99999
58+
59+
% ----------------------- SLOPE LIMITER DEFINITION ----------------------------%
60+
%
61+
VENKAT_LIMITER_COEFF= 0.03
62+
ADJ_SHARP_LIMITER_COEFF= 3.0
63+
REF_SHARP_EDGES= 3.0
64+
SENS_REMOVE_SHARP= NO
65+
66+
% ------------------------ LINEAR SOLVER DEFINITION ---------------------------%
67+
%
68+
LINEAR_SOLVER= FGMRES
69+
LINEAR_SOLVER_PREC= LU_SGS
70+
LINEAR_SOLVER_ERROR= 1E-4
71+
LINEAR_SOLVER_ITER= 5
72+
73+
% -------------------------- MULTIGRID PARAMETERS -----------------------------%
74+
%
75+
MGLEVEL= 3
76+
MGCYCLE= V_CYCLE
77+
MG_PRE_SMOOTH= ( 1, 1, 1, 1 )
78+
MG_POST_SMOOTH= ( 0, 0, 0, 0 )
79+
MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 )
80+
MG_DAMP_RESTRICTION= 0.5
81+
MG_DAMP_PROLONGATION= 0.5
82+
83+
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
84+
%
85+
CONV_NUM_METHOD_FLOW= ROE
86+
MUSCL_FLOW= YES
87+
SLOPE_LIMITER_FLOW= NONE
88+
JST_SENSOR_COEFF= ( 0.5, 0.02 )
89+
TIME_DISCRE_FLOW= EULER_IMPLICIT
90+
91+
% --------------------------- CONVERGENCE PARAMETERS --------------------------%
92+
%
93+
CONV_RESIDUAL_MINVAL= -15
94+
CONV_STARTITER= 10
95+
CONV_CAUCHY_ELEMS= 100
96+
CONV_CAUCHY_EPS= 1E-7
97+
98+
% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%
99+
%
100+
MESH_FILENAME= mesh_cylinder_lam.su2
101+
MESH_FORMAT= SU2
102+
MESH_OUT_FILENAME= mesh_out.su2
103+
SOLUTION_FILENAME= solution_flow.dat
104+
SOLUTION_ADJ_FILENAME= solution_adj.dat
105+
TABULAR_FORMAT= CSV
106+
CONV_FILENAME= history
107+
RESTART_FILENAME= restart_flow.dat
108+
RESTART_ADJ_FILENAME= restart_adj.dat
109+
VOLUME_FILENAME= flow
110+
VOLUME_ADJ_FILENAME= adjoint
111+
GRAD_OBJFUNC_FILENAME= of_grad.dat
112+
SURFACE_FILENAME= surface_flow
113+
SURFACE_ADJ_FILENAME= surface_adjoint
114+
OUTPUT_WRT_FREQ= 100
115+
SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG)

TestCases/serial_regression.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,15 +750,15 @@ def main():
750750
cavity.cfg_dir = "moving_wall/cavity"
751751
cavity.cfg_file = "lam_cavity.cfg"
752752
cavity.test_iter = 25
753-
cavity.test_vals = [-5.627934, -0.164470, 0.051972, 2.547039]
753+
cavity.test_vals = [ -5.627868, -0.164405, 0.053283, 2.545817]
754754
test_list.append(cavity)
755755

756756
# Spinning cylinder
757757
spinning_cylinder = TestCase('spinning_cylinder')
758758
spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder"
759759
spinning_cylinder.cfg_file = "spinning_cylinder.cfg"
760760
spinning_cylinder.test_iter = 25
761-
spinning_cylinder.test_vals = [-7.889994, -2.469385, 1.708162, 1.670039]
761+
spinning_cylinder.test_vals = [-7.892807, -2.467378, 1.702819, 1.669208]
762762
test_list.append(spinning_cylinder)
763763

764764
######################################
@@ -1066,6 +1066,7 @@ def main():
10661066
airfoilRBF.cfg_dir = "fea_fsi/Airfoil_RBF"
10671067
airfoilRBF.cfg_file = "config.cfg"
10681068
airfoilRBF.test_iter = 1
1069+
10691070
airfoilRBF.test_vals = [1.000000, -2.786186, -4.977944]
10701071
airfoilRBF.tol = 0.0001
10711072
airfoilRBF.multizone = True

0 commit comments

Comments
 (0)