You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tutorial uses SU2's python wrapper and its native adjoint solvers for incompressible flow and solid mechanics to solve a steady-state, **adjoint** Fluid-Structure Interaction problem. This document will cover:
18
-
- Operating with the ad version of the pysu2 library
18
+
- Operating with the AD version of the pysu2 library
19
19
- Extracting the adjoints of the flow loads and structural displacements from two different python instances of SU2
20
20
- Exchanging adjoint information between the two instances
21
21
@@ -172,9 +172,9 @@ and the ```flow_filename``` variable previously defined. Next, identifyin the FS
172
172
Now, the major differences with respect to the primal case are presented. First, we need to initialize the cross dependency that is applied as a source term into the flow domain to 0, using
173
173
174
174
```
175
-
fea_sensitivities=[]
176
-
for iVertex in range(nVertex_Marker_Flow):
177
-
fea_sensitivities.append([0.0, 0.0, 0.0])
175
+
fea_sens=[]
176
+
for j in range(nVertex_Marker_Flow):
177
+
fea_sens.append([0.0, 0.0, 0.0])
178
178
```
179
179
180
180
We start the FSI loop and limit it to 15 iterations
@@ -186,73 +186,73 @@ for i in range(15):
186
186
and the source term corresponding to the flow load adjoint is applied to the fluid domain. In the first iteration, this will be a zero-vector, but that will not be the case for subsequent iterations.
Finally, these boundary displacements are imposed to the flow domain in the next iteration. Once the loop is completed, it only remains to write the solution of each domain to file using
The ```flow_loads``` array now contains the loads in all the vertices of the flow FSI interface. Now, we need to set the flow loads to the FEA nodes. By construction for this case, the vertex IDs are matching for both meshes except for vertex 0 and 1, which are inverted. Therefore, we set the flow loads on the structural domain using
You can ensure the vertices are coincidental by the coordinates of the nodes using ```FlowDriver.GetVertexCoordX(FlowMarkerID, iVertex)``` and ```FlowDriver.GetVertexCoordY(FlowMarkerID, iVertex)``` for the flow domain, and ```FEADriver.GetVertexCoordX(FEAMarkerID, iVertex)``` and ```FEADriver.GetVertexCoordY(FEAMarkerID, iVertex)``` for the structural domain.
191
191
192
192
Next, the structural simulation is run with
193
193
194
194
```
195
-
FEADriver.ResetConvergence()
196
-
FEADriver.Preprocess(0)
197
-
FEADriver.Run()
198
-
FEADriver.Postprocess()
199
-
stopCalc = FEADriver.Monitor(0)
195
+
FEADriver.ResetConvergence()
196
+
FEADriver.Preprocess(0)
197
+
FEADriver.Run()
198
+
FEADriver.Postprocess()
199
+
stopCalc = FEADriver.Monitor(0)
200
200
```
201
201
202
202
and the structural displacements at the ```feabound``` interface are retrieved using
0 commit comments