Skip to content

Commit 8e1c819

Browse files
authored
Update Dynamic_FSI_Python.md
1 parent 5c81c63 commit 8e1c819

File tree

1 file changed

+48
-173
lines changed

1 file changed

+48
-173
lines changed

_tutorials/multiphysics/Unsteady_FSI_Python/Dynamic_FSI_Python.md

Lines changed: 48 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ A sketch of the problem at hand is presented below:
3333

3434
### Resources
3535

36-
You can find the resources for this tutorial in the folder [fsi/steady_state](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_fsi) of the [Tutorials repository](https://github.com/su2code/Tutorials). There is a [FSI config file](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_fsi/config_fsi_steady.cfg) and two sub-config files for the [flow](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_fsi/config_channel.cfg) and [structural](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_fsi/config_cantilever.cfg) subproblems.
36+
You can find the resources for this tutorial in [this folder] (https://github.com/su2code/Tutorials/tree/master/multiphysics/unsteady_fsi_python) of the [Tutorials repository](https://github.com/su2code/Tutorials). There is a [matlab file](https://github.com/su2code/Tutorials/tree/master/multiphysics/unsteady_fsi_python/FlatPlateModel.m) that can be used to produce validation data with Theodorsen theory and the [mesh file](https://github.com/su2code/Tutorials/tree/master/multiphysics/unsteady_fsi_python/airfoil.su2).
3737

38-
Moreover, you will need two mesh files for the [flow domain](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_fsi/mesh_channel.su2) and the [cantilever](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_fsi/mesh_cantilever.su2).
38+
In the [main directory] (https://github.com/su2code/Tutorials/tree/master/multiphysics/unsteady_fsi_python), there are other 5 subdirectories containing the configuration files and structural models for the different Mach numbers. Please do not mix those files as the structural models and configurations are different at the different aerodynamic conditions.
3939

4040
### Background
4141

@@ -163,6 +163,18 @@ TIME_DOMAIN = YES
163163
TIME_STEP= 1e-3
164164
```
165165

166+
It is important to set an appropriate convergence criteria for the fluid zone. Indeed, while the structural part is linear and requires no interations, it is important that
167+
the fluid zone correcly converges for accurate results.
168+
169+
The relative residual cannot be used as this is reset at each inner iteration. Thus, aver the first inner loop, it would be difficult to obtain convergence as the absolute
170+
residuals are already quite low. For this reason we will use:
171+
172+
```
173+
CONV_CRITERIA = RESIDUAL
174+
CONV_FIELD= RMS_DENSITY
175+
CONV_RESIDUAL_MINVAL= -9.0
176+
```
177+
166178
#### Configuration File for the solid zone
167179

168180
This configuration file will be read by the structural python solver included in SU2, that will read the preprocessed Nastran model.
@@ -177,7 +189,7 @@ structural deformations when the body is surrounded by the flow
177189

178190
Available keyword for the config file:
179191

180-
NMODES (int): number of modes to use in the analysis -> if n modes are available in
192+
NMODES (int): number of modes to use in the analysis. If n modes are available in
181193
the punch file, but only the first m<n are required, set this to m
182194

183195
IMPOSED_MODE (int): mode with an imposed motion
@@ -238,33 +250,50 @@ The modes are coupled, thus appropriate initial conditions for both can be obtai
238250
The most important interface configuration keywords are:
239251

240252
NDIM (int): 2 or 3 depending if the model is bidimensional or tridimensional
253+
241254
RESTART_ITER (int): Restart iteration
255+
242256
TIME_TRESHOLD (int): Time iteration after which fluid and structure are coupled
243257
in an unsteady simulation
258+
244259
NB_FSI_ITER (int): Number of max internal iterations to couple fluid and structure
260+
245261
RBF_RADIUS (float): Radius for the RBF interpolation. It is dimensional (i.e. in meters)
246262
and must be set so that at least 5 structural points are always
247263
inside a sphere with that radius and centered in any of the
248264
structural nodes. The more nodes are included, the better
249265
the interpolation. However, with larger radius, the interpolation
250-
matrix may become close to singular.
266+
matrix may become close to singular
267+
251268
AITKEN_PARAM (float): Under relaxation parameter, between 0 and 1
269+
252270
UNST_TIMESTEP (float): Physical time step size in unsteady simulations, must match
253-
the one in the other cfg files.
254-
UNST_TIME (float): Physical simulation time for unsteady problems.
255-
FSI_TOLERANCE (float): Tolerance for inner loop convergence between fluid and structure
271+
the one in the other cfg files
272+
273+
UNST_TIME (float): Physical simulation time for unsteady problems
274+
275+
FSI_TOLERANCE (float): Tolerance for inner loop convergence between fluid and structure. This is the maximum average structural displacements, between two inner iterations,
276+
that can be accepted
277+
256278
CFD_CONFIG_FILE_NAME (string): Path of fluid cfg file
279+
257280
CSD_SOLVER (string): Behaviour of the structural solver to be used. AEROELASTIC if
258281
the structural equation of motions must be solved, IMPOSED if
259-
a movement of the structure is imposed.
282+
a movement of the structure is imposed
283+
260284
CSD_CONFIG_FILE_NAME (string): Path to solid cfg file
285+
261286
RESTART_SOL (string): YES or NO
287+
262288
MATCHING_MESH (string): YES or NO, the fluid and structural mesh match at the interface
289+
263290
MESH_INTERP_METHOD (string): Interpolation method in case of nonmatching meshes. TPS or RBF
291+
264292
DISP_PRED (string): Displacement predictor order FIRST_ORDER or SECOND_ORDER. To
265-
be used in unsteady simulations.
266-
AITKEN_RELAX (string): DYNAMIC or STATIC. It can be automatically changed during
267-
the simulation.
293+
be used in unsteady simulations
294+
295+
AITKEN_RELAX (string): DYNAMIC or STATIC
296+
268297
TIME_MARCHING (string): YES or NO
269298

270299
```
@@ -288,185 +317,31 @@ TIME_MARCHING = YES
288317
```
289318
### Running SU2
290319

291-
Follow the links provided to download the [FSI config file](https://github.com/su2code/Tutorials/blob/master/fsi/steady_state/config_fsi_steady.cfg) and the [flow](https://github.com/su2code/Tutorials/blob/master/fsi/steady_state/config_channel.cfg) and [structural](https://github.com/su2code/Tutorials/blob/master/fsi/steady_state/config_cantilever.cfg) sub-config files.
292-
293-
Also, you will need two files for the [channel mesh](https://github.com/su2code/Tutorials/blob/master/fsi/steady_state/mesh_channel.su2) and the [cantilever mesh](https://github.com/su2code/Tutorials/blob/master/fsi/steady_state/mesh_cantilever.su2). Please note that the latter is different from the structural mechanics tutorial due to a different definition of the boundary conditions.
294-
295-
Execute the code with the standard command and using the multi-zone config file
296-
297-
```
298-
$ SU2_CFD config_fsi_steady.cfg
299-
```
300-
301-
which will show the following convergence history:
302-
303-
```
304-
+----------------------------------------------------------------+
305-
| Multizone Summary |
306-
+----------------------------------------------------------------+
307-
| Outer_Iter| avg[bgs][0]| avg[bgs][1]|MinVolume[0]|DeformIter[0|
308-
+----------------------------------------------------------------+
309-
| 0| -0.298306| -2.048554| 8.8212e-10| 0|
310-
| 1| -1.221569| -2.661506| 8.7196e-10| 44|
311-
| 2| -2.176547| -3.088096| 8.7369e-10| 44|
312-
| 3| -2.822207| -3.526246| 8.7331e-10| 44|
313-
| 4| -3.479962| -3.962556| 8.7339e-10| 44|
314-
| 5| -4.134404| -4.399315| 8.7337e-10| 44|
315-
| 6| -4.789556| -4.835974| 8.7338e-10| 44|
316-
| 7| -5.444539| -5.272643| 8.7338e-10| 44|
317-
| 8| -6.099727| -5.709490| 8.7338e-10| 44|
318-
| 9| -6.756832| -6.147703| 8.7338e-10| 44|
319-
| 10| -7.393475| -6.578762| 8.7338e-10| 44|
320-
| 11| -8.032563| -7.003230| 8.7338e-10| 44|
321-
| 12| -8.670813| -7.426572| 8.7338e-10| 44|
322-
| 13| -9.309448| -7.851164| 8.7338e-10| 44|
323-
| 14| -9.949022| -8.277094| 8.7338e-10| 44|
324-
| 15| -10.588983| -8.703770| 8.7338e-10| 44|
325-
| 16| -11.228939| -9.130581| 8.7338e-10| 44|
326-
```
327-
328-
The code is stopped as soon as the values of ```avg[bgs][0]``` and ```avg[bgs][1]``` are below the convergence criteria set in the config file.
329-
330-
The displacement field on the structural domain and the velocity field on the flow domain obtained in ```fsi_steady_1.vtu```_and ```fsi_steady_0.vtu``` respectively are shown below:
331-
332-
![FSI Results1](../../tutorials_files/multiphysics/steady_fsi/images/fsi2.png)
333-
334-
![FSI Results2](../../tutorials_files/multiphysics/steady_fsi/images/fsi3.png)
320+
Follow the links provided to download the [main directory] (https://github.com/su2code/Tutorials/tree/master/multiphysics/unsteady_fsi_python).
335321

336-
#### Relaxing the computation
337-
338-
In order to increase the speed of convergence, it is normally a good option to apply a relaxation
339-
340-
341-
to the sub-iterations of the FSI problem. This is done by adding the following commands
322+
Copy the mesh file in each subdirectory, then run the following command from inside each subdirectory:
342323

343324
```
344-
BGS_RELAXATION= FIXED_PARAMETER
345-
STAT_RELAX_PARAMETER= 0.8
325+
$ python3 /your/path/to/fsi_computation.py -f fsi.cfg
346326
```
347327

348-
to the FSI master config file. Running SU2 now would result in the following convergence history
328+
If you built you version of SU2 in parallel, run instead:
349329

350330
```
351-
+----------------------------------------------------------------+
352-
| Multizone Summary |
353-
+----------------------------------------------------------------+
354-
| Outer_Iter| avg[bgs][0]| avg[bgs][1]|MinVolume[0]|DeformIter[0|
355-
+----------------------------------------------------------------+
356-
| 0| -0.298306| -2.048554| 8.8212e-10| 0|
357-
| 1| -1.316281| -2.740561| 8.4063e-10| 44|
358-
| 2| -2.215592| -3.528252| 8.6618e-10| 44|
359-
| 3| -3.014938| -4.639836| 8.7192e-10| 44|
360-
| 4| -3.732471| -5.402349| 8.7309e-10| 44|
361-
| 5| -4.436227| -5.790750| 8.7332e-10| 44|
362-
| 6| -5.137723| -6.263485| 8.7337e-10| 44|
363-
| 7| -5.840368| -6.711814| 8.7338e-10| 44|
364-
| 8| -6.536232| -7.339662| 8.7338e-10| 44|
365-
| 9| -7.247336| -7.555240| 8.7338e-10| 44|
366-
| 10| -7.946736| -8.297281| 8.7338e-10| 44|
367-
| 11| -8.648240| -8.586354| 8.7338e-10| 44|
368-
| 12| -9.353917| -9.043231| 8.7338e-10| 44|
331+
$ mpirun -np X python3 /your/path/to/fsi_computation.py --parallel -f fsi.cfg
369332
```
370333

371-
where the -9 convergence parameter is reached in almost half the iterations as per the non-relaxed case.
334+
Substituting X with the appropriate number of cores.
372335

373-
#### Printing the inner convergence
374-
375-
Sometimes, especially when things don't work as expected, it's interesting to visualize the convergence of each of the subproblems. This can be achieved enabling
376-
377-
```
378-
WRT_ZONE_CONV = YES
379-
```
336+
Generate validation data running the matlab script. This will produce the required database containing the time history of angle of attack and vertical displacement.
380337

381-
in the main config file of the multizone problem, ```config_fsi_steady.cfg```. In most cases we will not be interested on every single inner iteration of the fluid domain; we can use
382-
383-
```
384-
SCREEN_WRT_FREQ_INNER = 10
385-
```
386-
387-
in ```config_channel.cfg``` to limit the printout to every 10 iterations. The resulting screen output is the following:
388-
389-
390-
```
391-
+----------------------------------------------------------------+
392-
| Zone 0 (Incomp. Fluid) |
393-
+----------------------------------------------------------------+
394-
| Outer_Iter| Inner_Iter| rms[P]| rms[U]| rms[V]|
395-
+----------------------------------------------------------------+
396-
| 0| 0| -4.799717| -19.870540| -32.000000|
397-
| 0| 10| -5.421646| -4.859176| -5.558343|
398-
| 0| 20| -6.200459| -5.584293| -6.120761|
399-
| 0| 30| -6.852188| -6.205093| -6.958953|
400-
| 0| 40| -7.502751| -6.854100| -8.034484|
401-
| 0| 50| -8.316190| -7.662838| -8.492639|
402-
| 0| 60| -9.153994| -8.509430| -9.696622|
403-
| 0| 70| -10.119472| -9.498203| -10.117162|
404-
| 0| 80| -11.035958| -10.448171| -11.143732|
405-
| 0| 90| -11.613994| -10.982943| -11.842820|
406-
| 0| 100| -12.264740| -11.616077| -12.556728|
407-
| 0| 104| -12.684964| -12.046580| -12.778620|
408-
+-----------------------------------------------------------------------------+
409-
| Zone 1 (Structure) |
410-
+-----------------------------------------------------------------------------+
411-
| Outer_Iter| Inner_Iter| rms[U]| rms[R]| rms[E]| VonMises|
412-
+-----------------------------------------------------------------------------+
413-
| 0| 0| -1.121561| -2.706864| -4.419338| 2.2876e+03|
414-
| 0| 1| -1.708123| 1.269382| -1.716845| 2.2429e+03|
415-
| 0| 2| -2.583705| 0.631041| -3.175890| 2.2237e+03|
416-
| 0| 3| -2.508726| -0.795411| -5.686295| 2.0701e+03|
417-
| 0| 4| -2.751613| -1.306797| -6.550284| 2.0544e+03|
418-
| 0| 5| -3.147799| -1.271416| -6.914834| 2.0364e+03|
419-
| 0| 6| -2.962716| -2.664273| -7.800357| 2.0171e+03|
420-
| 0| 7| -4.083257| -2.080066| -8.553973| 2.0155e+03|
421-
| 0| 8| -4.522566| -4.400710| -11.005428| 2.0149e+03|
422-
| 0| 9| -7.252524| -5.240218| -14.876499| 2.0149e+03|
423-
| 0| 10| -10.834476| -10.711888| -23.634504| 2.0149e+03|
424-
+----------------------------------------------------------------+
425-
| Multizone Summary |
426-
+----------------------------------------------------------------+
427-
| Outer_Iter| avg[bgs][0]| avg[bgs][1]|MinVolume[0]|DeformIter[0|
428-
+----------------------------------------------------------------+
429-
| 0| -0.298306| -2.048554| 8.8212e-10| 0|
430-
...
431-
432-
+----------------------------------------------------------------+
433-
| Zone 0 (Incomp. Fluid) |
434-
+----------------------------------------------------------------+
435-
| Outer_Iter| Inner_Iter| rms[P]| rms[U]| rms[V]|
436-
+----------------------------------------------------------------+
437-
| 16| 0| -15.808168| -15.358431| -15.769282|
438-
| 16| 10| -16.714759| -16.074145| -17.174991|
439-
+-----------------------------------------------------------------------------+
440-
| Zone 1 (Structure) |
441-
+-----------------------------------------------------------------------------+
442-
| Outer_Iter| Inner_Iter| rms[U]| rms[R]| rms[E]| VonMises|
443-
+-----------------------------------------------------------------------------+
444-
| 16| 0| -11.937375| -11.637725| -25.999458| 1.8531e+03|
445-
| 16| 1| -15.794016| -11.636749| -28.541279| 1.8531e+03|
446-
| 16| 2| -16.165350| -11.621837| -28.528692| 1.8531e+03|
447-
| 16| 3| -16.056047| -11.608302| -28.544055| 1.8531e+03|
448-
| 16| 4| -16.156344| -11.627675| -28.565975| 1.8531e+03|
449-
| 16| 5| -16.204699| -11.633976| -28.581277| 1.8531e+03|
450-
+----------------------------------------------------------------+
451-
| Multizone Summary |
452-
+----------------------------------------------------------------+
453-
| Outer_Iter| avg[bgs][0]| avg[bgs][1]|MinVolume[0]|DeformIter[0|
454-
+----------------------------------------------------------------+
455-
| 16| -11.228939| -9.130581| 8.7338e-10| 44|
456-
```
457-
458-
where it can be observed that the multizone summary corresponds to the non-relaxed case presented first, and each of the subproblems are converged to a very high accuracy level.
459338

460339
### References
461340
$$^1$$ Sanchez, R. (2018), A coupled adjoint method for optimal design in fluid-structure interaction problems with large displacements, _PhD thesis, Imperial College London_, DOI: [10.25560/58882](https://doi.org/10.25560/58882)
462341

463-
$$^2$$ Matthies H. G. and Steindorf J. (2002), Partitioned but strongly coupled iteration schemes fornonlinear fluid–structure interaction, _Computers & Structures, 80(27–30):199–1999_.
464-
465342
### Attribution
466343

467-
If you are using this content for your research, please kindly cite the following reference in your derived works:
468-
469-
Sanchez, R. _et al._ (2018), [Coupled Adjoint-Based Sensitivities in Large-Displacement Fluid-Structure Interaction using Algorithmic Differentiation](https://spiral.imperial.ac.uk/handle/10044/1/51023), _Int J Numer Meth Engng, Vol 111, Issue 7, pp 1081-1107_. DOI: [10.1002/nme.5700](https://doi.org/10.1002/nme.5700)
344+
Coming soon...
470345

471346
<dl>
472347
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>

0 commit comments

Comments
 (0)