Skip to content

Commit

Permalink
Formatting for PDF rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
MakisH committed Sep 18, 2024
1 parent 7dc0568 commit d32804a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 32 deletions.
15 changes: 11 additions & 4 deletions fsi-workflow/00_geometry/tasks.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Community course on preCICE: FSI Workflow

A training module showcasing how to setup an FSI simulation from scratch.
Introductory course at the preCICE Workshop 2024, Stuttgart, September 24-27, 2024

\vspace{2em}

Claudio Caccia, Politecnico di Milano\newline `<claudiogiovanni.caccia@polimi.it>`
Gerasimos Chourdakis, University of Stuttgart `<gerasimos.chourdakis@ipvs.uni-stuttgart.de>`

This is a community-contributed part of the course. Contribute on GitHub: https://github.com/precice/community-training
Gerasimos Chourdakis, University of Stuttgart\newline `<gerasimos.chourdakis@ipvs.uni-stuttgart.de>`

This is a community-contributed part of the course: [Contribute on GitHub](https://github.com/precice/community-training).

## Dependencies

Expand All @@ -21,7 +22,11 @@ We will use the following software:
## Task 0: Prepare the geometry

We will simulate fluid-structure interaction of a very simple airfoil, in 3D. [NACA airfoils](https://en.wikipedia.org/wiki/NACA_airfoil) are standardized designs that are popular in designing aircraft wings.
Our case is slightly derived from the paper by *S. Heathcote, Z. Wang, I. Gursul, **Effect of spanwise flexibility on flapping wing propulsion**, Journal of Fluids and Structures, Volume 24, Issue 2, 2008*. In the paper, they considered a *NACA0012* profile, while our training involves a **NACA2312** profile wing (to have some lift at 0° angle of attack) with:
Our case is slightly derived from the following paper:

*S. Heathcote, Z. Wang, I. Gursul, **Effect of spanwise flexibility on flapping wing propulsion**, Journal of Fluids and Structures, Volume 24, Issue 2, 2008*.

In the paper, they considered a *NACA0012* profile, while our training involves a **NACA2312** profile wing (to have some lift at 0° angle of attack) with:

- *chord* $c=100mm$
- *span* $b=300mm$
Expand All @@ -34,6 +39,8 @@ You'll notice that two different file formats are provided: a `.stl` file and a

When meshing a flow domain, we need to consider whether we are simulating external or internal flow. In this case, we are considering an external flow: we will use the solid geometry to generate the **solid mesh**, and we will subtract it from a sufficiently large box to generate the **fluid mesh**.

\newpage

### Notes on file formats

You might wonder: "Why two formats?".
Expand Down
12 changes: 7 additions & 5 deletions fsi-workflow/01_solidMesh/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Select the `FEM Workbench`:

![FreeCAD: FEM Workbench](./images/FEM_WB.png)

\newpage

Go to:

- Click `Edit` -> `Preferences...`.
Expand All @@ -22,7 +24,7 @@ Go to:

Configure as follows:

- Which elements to export `All`.
- Which elements to export: `All`.
- Export group data: (check).

Then, click `Apply` and `OK`.
Expand All @@ -34,7 +36,7 @@ The first task consists in importing the wing:
- Create a new project: Click `File` -> `New`.
- Give the model a name: In the `Combo View/Model` tab on the left, select the unnamed model and change the `Label`: click on the `Unnamed` and rename it to `Wing`.

![FreeCAD: Rename model label](./images/PD_rename.png)
![FreeCAD: Rename model label to `Wing`](./images/PD_rename.png)

- Select the `Part design` workbench from the drop-down menu and click `create body`:

Expand All @@ -61,12 +63,12 @@ Now we can generate a mesh for the `Wing`.
- Switch again to the FEM Workbench from the drop-down menu.
- From the menu bar, click `Model` -> `Analysis container` (or select the `A` symbol from the toolbar):

![FreeCAD: Analysis container](./images/FEM_Analysis.png)
![FreeCAD: Add an Analysis container](./images/FEM_Analysis.png)

- We want to mesh the `BaseFeature`: Select it from the sidebar.
- From the menu bar, click `Mesh` -> `FEM Mesh from shape by GMSH`. The FEM Workbench can generate meshes using different backends; we use [GMSH](https://gmsh.info/) here.

![FreeCAD: Add Analysis container](./images/FEM_Mesh01.png)
![FreeCAD: Add a mesh](./images/FEM_Mesh01.png)

- In the `Tasks` tab, use the following parameters:
- Element dimension: `3D`
Expand Down Expand Up @@ -115,7 +117,7 @@ Now that we have a mesh, we also need to create the boundaries. We will need to

- In the `Model` tab, select the `MeshGroup` and rename its `Label` to `Nroot`. This will help us define the boundary condition in the Solid domain.

**NOTE**: Node group names need to start with `N`.
**NOTE**: Node group names need to start with `N`.

![FreeCAD: Rename mesh group](./images/Groups05.png)

Expand Down
3 changes: 1 addition & 2 deletions fsi-workflow/02_solidSimulation/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,4 @@ Note that we are a bit lazy here, as the $x, y$ axes are not *principal axes*. N

## References

- CalculiX user manual: https://www.dhondt.de/ccx_2.20.pdf
- Web version (possibly outdated): https://web.mit.edu/calculix_v2.7/CalculiX/ccx_2.7/doc/ccx/ccx.html
- CalculiX 2.20 user manual: [https://www.dhondt.de/ccx_2.20.pdf](https://www.dhondt.de/ccx_2.20.pdf)
19 changes: 4 additions & 15 deletions fsi-workflow/03_fluidMesh/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,13 @@ In case you get an error that there are not enough slots in your system to run e

Once `snappyHexMesh` has finished, you can reconstruct your domain from the decomposed ones by running `reconstructParMesh`.

When finished, you will see three time folders (0.001, 0.002, 0.003) in the root directory of the case. Each one corresponds to a stage of `snappyHexMesh`:
When finished, you will see three time folders (0.001, 0.002, 0.003) in the root directory of the case. Each one corresponds to a stage of `snappyHexMesh`. The time step size depends on the `deltaT` parameter in the `controlDict` file, but it is not relevant. You can obtain the final mesh in the `constant` directory, without the intermediate steps, by adding the `-overwrite` option to `snappyHexMesh`. In the next step (fluid simulation), we will use and rename the `0.003` directory.

- 0.001: castellatedMesh
![snappyHexMesh output: Castellation stage (`0.001` directory)](./images/01_cast.png)

![castellation](./images/01_cast.png)
![snappyHexMesh output: Snap stage (`0.002` directory)](./images/02_snap.png)

- 0.002: snap

![snap](./images/02_snap.png)

- 0.003: addLayers

![BL](./images/03_BL.png)

Notes:

- The time step size depends on the `deltaT` parameter in the `controlDict` file, but it is not relevant.
- You can obtain the final mesh in the `constant` directory, without the intermediate steps, by adding the `-overwrite` option to `snappyHexMesh`. In the next step (fluid simulation), we will use and rename the `0.003` directory.
![snappyHexMesh output: Boundary layer stage (`0.003` directory)](./images/03_BL.png)

## Checking the mesh

Expand Down
2 changes: 1 addition & 1 deletion fsi-workflow/04_fluidSimulation/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ To check the simulation progress and plot the residuals over time, you can use [
pyFoamPlotWatcher log.solver
```
Two pop-up windows with residual graphs should appear:
A pop-up window with residual graphs should appear:
![residuals](./images/pyFoam.png)
Expand Down
10 changes: 5 additions & 5 deletions fsi-workflow/05_FSI/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ You can monitor the ongoing simulation by running the following scripts from the

Two windows with the following graphs should appear:

![tip displacement](./images/Tip_disp_damp.png)
![Montoring: Tip displacement (`plotDisplacement.sh`)](./images/Tip_disp_damp.png)

![convergence](./images/convergence.png)
![Montoring: Convergence (`plotConvergence.py`)](./images/convergence.png)

### Cleaning

Expand All @@ -159,17 +159,17 @@ Open a terminal in the `Fluid` folder and type `paraFoam`
2. In `Case type` select `Decomposed Case`
3. Then press `Apply`

![open](./images/open_fluid.png)
![ParaView: Open `Fluid.foam`](./images/open_fluid.png)

You will then have access to the `OpenFOAM` fluid simulation results.

![fluid](./images/parafoam.png)
![ParaView: Surface plot of flow velocity](./images/parafoam.png)

### Solid results

In the same ParaView window, select `File->Open...` and point to the `Solid/convert/solidModel.pvd` file.

![FSI](./images/result_FSI.png)
![ParaView: Combined FSI results](./images/result_FSI.png)

To see the displacement more easily, you can apply a `WarpByVector` filter, using the displacement (`U`) as vector, and a scale factor of your choice.

Expand Down

0 comments on commit d32804a

Please sign in to comment.