Skip to content
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

Perpendicular flap (IGA solid participant G+Smo) #603

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
afb8731
Update G+Smo solid participant elasticity file
Crazy-Rich-Meghan Dec 3, 2024
f00d9f9
Merge branch 'precice:develop' into perpendicular-flap-gismo-elasticity
Crazy-Rich-Meghan Dec 3, 2024
52cc0bc
Modified the precice-config.xml to communicate with stress instead of…
Crazy-Rich-Meghan Dec 3, 2024
1a929ab
Update documentation for solid-gismo.cpp
Crazy-Rich-Meghan Dec 3, 2024
f82fa19
Create solid-gismo; Modified fluid-nutils and fluid-openfoam to give …
Crazy-Rich-Meghan Dec 3, 2024
3dd6ac5
Update the README.md file for the tutorial with G+Smo
Crazy-Rich-Meghan Dec 3, 2024
be3a0db
Updated README.md; Uploaded Mesh convergence test and plots
Crazy-Rich-Meghan Dec 3, 2024
b4fca3c
Update README.md
Crazy-Rich-Meghan Dec 3, 2024
e589cbb
Clean up
Crazy-Rich-Meghan Dec 3, 2024
9cf4af5
Update Setup in README.md
Crazy-Rich-Meghan Dec 4, 2024
87d9fcc
Merge branch 'develop' into perpendicular-flap-gismo-elasticity-stress
Crazy-Rich-Meghan Dec 4, 2024
1eb6912
Recover modified file by mistake
Crazy-Rich-Meghan Dec 4, 2024
fe319e6
Update clean.sh
Crazy-Rich-Meghan Dec 4, 2024
38115d6
Merge branch 'precice:develop' into perpendicular-flap-gismo-elastici…
Crazy-Rich-Meghan Dec 10, 2024
766e928
Update README.md; added clean_gismo in tools.sh; update run and clean…
Crazy-Rich-Meghan Dec 16, 2024
c5184d5
Update perpendicular-flap-stress/README.md
Crazy-Rich-Meghan Dec 27, 2024
4ae5359
Update file name
Crazy-Rich-Meghan Jan 17, 2025
afaace6
Delete image folder
uekerman Jan 22, 2025
0a56df7
Extend and enable cleaning scripts
uekerman Jan 22, 2025
f4a2cc7
Fix preCICE and adapter config
uekerman Jan 22, 2025
4fd0a47
Add plotting script
uekerman Jan 22, 2025
d8c6a29
Redo README
uekerman Jan 22, 2025
aa4a3cb
Rename gismo subfolder and delete cpp
uekerman Jan 22, 2025
40c0464
Really delete cpp
uekerman Jan 22, 2025
c3d618e
Specify G#Smo solver
uekerman Jan 22, 2025
1b1e757
Update Post-processing (plotting)
Crazy-Rich-Meghan Feb 4, 2025
a299b79
Added visualization for precice config; add tip-displacement
Crazy-Rich-Meghan Feb 4, 2025
c2ca3ea
Rename
Crazy-Rich-Meghan Feb 4, 2025
920d38b
Update README.md
Crazy-Rich-Meghan Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions perpendicular-flap-stress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: Perpendicular flap with stresses
keywords: G+Smo, fluid-structure interaction, FSI, OpenFOAM
summary: This tutorial is a modified version of the “perpendicular flap” tutorial using stresses instead of forces.

---

{% note %}
Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/master/perpendicular-flap-stresses). Read how in the [tutorials introduction](https://precice.org/tutorials.html).
{% endnote %}

## Setup

The scenario is exactly the same as the one described in the [perpendicular flap tutorial](https://precice.org/tutorials-perpendicular-flap.html). The only difference is that we use stresses instead of forces as data sent from the fluid to the solid participant. This requires changing the mapping constraint from conservative (forces) to consistent (stresses). To avoid a "write-consistent" combination, which [cannot be used in parallel](ttps://precice.org/configuration-mapping.html#restrictions-for-parallel-participants), we exchange both meshes.

## Configuration

preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)):

![preCICE configuration visualization](images/tutorials-perpendicular-flap-stress-precice-config.png)

## Available solvers

Fluid participant:

* OpenFOAM (pimpleFoam). In case you are using a very old OpenFOAM version, you will need to adjust the solver to `pimpleDyMFoam` in the `Fluid/system/controlDict` file. For more information, have a look at the [OpenFOAM adapter documentation](https://precice.org/adapter-openfoam-overview.html).

Solid participant:

* G+Smo. For more information, have a look at the [G+Smo adapter documentation](https://precice.org/adapter-gismo-overview.html).

## Running the Simulation

Open two separate terminals and start the desired fluid and solid participant by calling the respective run script `run.sh` located in the participant directory. For example:

```bash
cd fluid-openfoam
./run.sh
```

and

```bash
cd solid-gismo
./run.sh
```
uekerman marked this conversation as resolved.
Show resolved Hide resolved

## Post-processing

On the OpenFOAM side, you can open the `.foam` file with ParaView, or create VTK files with `foamToVTK`.

TODO: how can we visualize G+Smo results?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO


As we defined a watchpoint on the 'Solid' participant at the flap tip (see `precice-config.xml`), we can plot it with gnuplot using the script `plot-displacement.sh.` You need to specify the directory of the selected solid participant as a command line argument, so that the script can pick-up the desired watchpoint file, e.g. `plot-displacement.sh solid-gismo`. The resulting graph shows the x displacement of the flap tip. You can modify the script to plot the force instead.

![Flap watchpoint](images/tutorials-perpendicular-flap-stress-displacement-watchpoint.png)

TODO: add picture
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a picture once we are happy with the results.


{% disclaimer %}
This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks.
{% enddisclaimer %}
10 changes: 10 additions & 0 deletions perpendicular-flap-stress/clean-tutorial.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh
set -e -u

# shellcheck disable=SC1091
. ../tools/cleaning-tools.sh

clean_tutorial .
clean_precice_logs .
rm -fv ./*.log
rm -fv ./*.vtu
41 changes: 41 additions & 0 deletions perpendicular-flap-stress/fluid-openfoam/0/U
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}

dimensions [0 1 -1 0 0 0 0];

internalField uniform (10 0 0);

boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type zeroGradient;
}
flap
{
type movingWallVelocity;
value uniform (0 0 0);
}
upperWall
{
type noSlip;
}
lowerWall
{
type noSlip;
}
frontAndBack
{
type empty;
}
}
45 changes: 45 additions & 0 deletions perpendicular-flap-stress/fluid-openfoam/0/p
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform 0;
}

flap
{
type zeroGradient;
}

upperWall
{
type zeroGradient;
}

lowerWall
{
type zeroGradient;
}

frontAndBack
{
type empty;
}
}
44 changes: 44 additions & 0 deletions perpendicular-flap-stress/fluid-openfoam/0/phi
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
object phi;
}

dimensions [0 3 -1 0 0 0 0];

internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
flap
{
type calculated;
value uniform 0;
}
upperWall
{
type calculated;
value uniform 0;
}
lowerWall
{
type calculated;
value uniform 0;
}
frontAndBack
{
type empty;
value nonuniform 0;
}
}
47 changes: 47 additions & 0 deletions perpendicular-flap-stress/fluid-openfoam/0/pointDisplacement
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
object pointDisplacement;
}

dimensions [0 1 0 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0);
}

outlet
{
type fixedValue;
value uniform (0 0 0);
}

flap
{
type fixedValue;
value $internalField;
}

upperWall
{
type slip;
}

lowerWall
{
type slip;
}

frontAndBack
{
type empty;
}
}
6 changes: 6 additions & 0 deletions perpendicular-flap-stress/fluid-openfoam/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
set -e -u

. ../../tools/cleaning-tools.sh

clean_openfoam .
18 changes: 18 additions & 0 deletions perpendicular-flap-stress/fluid-openfoam/constant/dynamicMeshDict
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dynamicMeshDict;
}

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");

solver displacementLaplacian;
// OpenFOAM9 or newer: rename "solver" to "motionSolver"

displacementLaplacianCoeffs {
diffusivity quadratic inverseDistance (flap);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}

transportModel Newtonian;

nu nu [ 0 2 -1 0 0 0 0 ] 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}

simulationType laminar;
12 changes: 12 additions & 0 deletions perpendicular-flap-stress/fluid-openfoam/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e -u

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

blockMesh

../../tools/run-openfoam.sh "$@"
. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs

close_log
Loading
Loading