-
Notifications
You must be signed in to change notification settings - Fork 1k
Python interface for updating translation and rotation rates of markers #2095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3e8ba47
5fdc664
ba0e732
e5fde5c
0368765
ce66598
f8a76fe
5d90c34
7331adb
eb21853
269fbc0
c4a781d
99fece9
32dcd85
0396de8
a7f4e92
fc652dd
d0486c1
dfd8dab
00f9f14
4e36eee
ca5f06c
a009c2e
0adab08
d63931b
980551c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import pysu2 # imports the SU2 wrapped module | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks 👍 to make a regression test from this you need to add it to parallel_regression.py
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add our license header to this file please (since it's also code). |
||
| from mpi4py import MPI | ||
| import numpy as np | ||
|
|
||
| comm = MPI.COMM_WORLD | ||
| rank = comm.Get_rank() | ||
| rotation_vector = np.linspace(0,20,10) | ||
| SU2Driver = pysu2.CSinglezoneDriver("spinning_cylinder.cfg",1, comm) | ||
|
|
||
| for i, rate in enumerate(rotation_vector): | ||
| SU2Driver.SetMarkerRotationRate(0,0,0,rate) | ||
| SU2Driver.Preprocess(i) | ||
| SU2Driver.Run() | ||
| SU2Driver.Postprocess() | ||
| SU2Driver.Output(i) | ||
| SU2Driver.Update() | ||
| SU2Driver.Finalize() | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| % % | ||
| % SU2 configuration file % | ||
| % Case description: Laminar flow around a spinning cylinder % | ||
| % Author: Thomas D. Economon % | ||
| % Institution: Stanford University % | ||
| % Date: 2013.08.21 % | ||
| % File Version 7.5.1 "Blackbird" % | ||
| % % | ||
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
|
||
| % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% | ||
| % | ||
| SOLVER= NAVIER_STOKES | ||
| KIND_TURB_MODEL= NONE | ||
| MATH_PROBLEM= DIRECT | ||
| RESTART_SOL= NO | ||
|
|
||
| % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% | ||
| % | ||
| MACH_NUMBER= 0.1 | ||
| AOA= 0.0 | ||
| SIDESLIP_ANGLE= 0.0 | ||
| FREESTREAM_TEMPERATURE= 288.15 | ||
| REYNOLDS_NUMBER= 200.0 | ||
| REYNOLDS_LENGTH= 1.0 | ||
|
|
||
| % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% | ||
| % | ||
| SURFACE_MOVEMENT= MOVING_WALL | ||
| MACH_MOTION= 0.1 | ||
| MARKER_MOVING= ( cylinder ) | ||
| SURFACE_MOTION_ORIGIN= 0.5 0.0 0.0 | ||
| SURFACE_ROTATION_RATE = 0.0 0.0 -199.0738 | ||
|
|
||
| % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% | ||
| % | ||
| REF_ORIGIN_MOMENT_X = 0.00 | ||
| REF_ORIGIN_MOMENT_Y = 0.00 | ||
| REF_ORIGIN_MOMENT_Z = 0.00 | ||
| REF_LENGTH= 1.0 | ||
| REF_AREA= 1.0 | ||
|
|
||
| % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% | ||
| % | ||
| MARKER_HEATFLUX= ( cylinder, 0.0 ) | ||
| MARKER_FAR= ( farfield ) | ||
| MARKER_PLOTTING= ( cylinder ) | ||
| MARKER_MONITORING= ( cylinder ) | ||
|
|
||
| % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% | ||
| % | ||
| NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES | ||
| CFL_NUMBER= 100.0 | ||
| CFL_ADAPT= NO | ||
| CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) | ||
| ITER= 99999 | ||
|
|
||
| % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% | ||
| % | ||
| VENKAT_LIMITER_COEFF= 0.03 | ||
| ADJ_SHARP_LIMITER_COEFF= 3.0 | ||
| REF_SHARP_EDGES= 3.0 | ||
| SENS_REMOVE_SHARP= NO | ||
|
|
||
| % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% | ||
| % | ||
| LINEAR_SOLVER= FGMRES | ||
| LINEAR_SOLVER_PREC= LU_SGS | ||
| LINEAR_SOLVER_ERROR= 1E-4 | ||
| LINEAR_SOLVER_ITER= 5 | ||
|
|
||
| % -------------------------- MULTIGRID PARAMETERS -----------------------------% | ||
| % | ||
| MGLEVEL= 3 | ||
| MGCYCLE= V_CYCLE | ||
| MG_PRE_SMOOTH= ( 1, 1, 1, 1 ) | ||
| MG_POST_SMOOTH= ( 0, 0, 0, 0 ) | ||
| MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) | ||
| MG_DAMP_RESTRICTION= 0.5 | ||
| MG_DAMP_PROLONGATION= 0.5 | ||
|
|
||
| % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% | ||
| % | ||
| CONV_NUM_METHOD_FLOW= ROE | ||
| MUSCL_FLOW= YES | ||
| SLOPE_LIMITER_FLOW= NONE | ||
| JST_SENSOR_COEFF= ( 0.5, 0.02 ) | ||
| TIME_DISCRE_FLOW= EULER_IMPLICIT | ||
|
|
||
| % --------------------------- CONVERGENCE PARAMETERS --------------------------% | ||
| % | ||
| CONV_RESIDUAL_MINVAL= -15 | ||
| CONV_STARTITER= 10 | ||
| CONV_CAUCHY_ELEMS= 100 | ||
| CONV_CAUCHY_EPS= 1E-7 | ||
|
|
||
| % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% | ||
| % | ||
| MESH_FILENAME= mesh_cylinder_lam.su2 | ||
| MESH_FORMAT= SU2 | ||
| MESH_OUT_FILENAME= mesh_out.su2 | ||
| SOLUTION_FILENAME= solution_flow.dat | ||
| SOLUTION_ADJ_FILENAME= solution_adj.dat | ||
| TABULAR_FORMAT= CSV | ||
| CONV_FILENAME= history | ||
| RESTART_FILENAME= restart_flow.dat | ||
| RESTART_ADJ_FILENAME= restart_adj.dat | ||
| VOLUME_FILENAME= flow | ||
| VOLUME_ADJ_FILENAME= adjoint | ||
| GRAD_OBJFUNC_FILENAME= of_grad.dat | ||
| SURFACE_FILENAME= surface_flow | ||
| SURFACE_ADJ_FILENAME= surface_adjoint | ||
| OUTPUT_WRT_FREQ= 100 | ||
| SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) |
| +1 −1 | .github/workflows/codeql-analysis.yml | |
| +4 −4 | README.md | |
| +1 −1 | definitions.hpp | |
| +2 −39 | mel.hpp | |
| +1 −1 | tests.cpp | |
| +5 −11 | tests.hpp |
Uh oh!
There was an error while loading. Please reload this page.