Repository navigation
Add OpenRadioss tutorial #947
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
Open
MakisH
wants to merge
36
commits into
develop
Choose a base branch
from
openradioss
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,870
−0
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
eafa4fb
Add default argument values to the Dockerfile
MakisH 24f1780
Add OpenCourant to the Dockerfile
MakisH c9ad096
Migrate pulsating-flow-over-flexible-flap-case1 from openradioss-cases
MakisH ce0e426
Add and update setup-openradioss.sh
MakisH e5bcb91
Increase the numberOfSudomains to 8
MakisH 5efe352
Remove unrelated changes from Dockerfile
MakisH 046b39d
Adjust comments in OpenFOAM dict files
MakisH 08993d2
Modify setup-openradioss.sh to be consistent with the Dockerfile
MakisH a0df207
Add plot-displacement.sh
MakisH e14d06d
Update README.md, add reference pictures
MakisH 48acd93
Add the tutorial to the system tests
MakisH 1cc44c8
Fix component name
MakisH 6af19e1
Fix paths in the Dockerfile
MakisH db07379
Fix path in the Dockerfile
MakisH 797e72c
Make toVTK optional
MakisH daa94e9
Add reference version
MakisH ba3511a
Remove hard-coded export
MakisH 6a5db69
Add changelog entry
MakisH c39b1d6
Move openradioss test from extra to nightly
MakisH 4a45559
Add reference results for perpendicular-flap-3d_fluid-openfoam_solid-…
8ca7ba7
Pin the OpenCourant version
MakisH ce6c7cc
Relax the comparison tolerance
MakisH 2037df5
Set tolerance to 1e-2
MakisH ec0af1a
Skip the comparison entirely
MakisH 145955c
Remove another hardcoded vtk export node
MakisH 954f16f
Merge branch 'develop' into openradioss
MakisH defea8b
Update perpendicular-flap-3d/README.md
MakisH 43e6af3
Update perpendicular-flap-3d/README.md
MakisH 353dceb
Mark anim_to_vtk as optional
MakisH 91edd94
Merge branch 'develop' into openradioss
MakisH 6c6a151
Remove toCSV
MakisH f436ce6
Document expected runtime
MakisH 426d528
Remove radiossCSV from setup-openradioss.sh
MakisH 7994e07
Document where anim_to_vtk is expected
MakisH eb91707
Document implicit coupling limitation
MakisH 2d24c0c
Add a link to the reference versions for OpenCourant
MakisH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Added a new tutorial perpendicular-flap-3d, with OpenFOAM and OpenRadioss (OpenCourant) [#947](https://github.com/precice/tutorials/pull/947) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| --- | ||
| title: Perpendicular flap 3D | ||
| permalink: tutorials-perpendicular-flap-3d.html | ||
| aliases: | ||
| - /tutorials-perpendicular-flap-3d.html | ||
| keywords: fluid-structure interaction, FSI, OpenFOAM, OpenRadioss, OpenCourant | ||
| summary: This tutorial describes how to run a 3D fluid-structure interaction using OpenFOAM and OpenRadioss. | ||
| --- | ||
|
|
||
| {% note %} | ||
| Get the [case files of this tutorial](https://github.com/precice/tutorials/tree/develop/perpendicular-flap-3d), as continuously rendered here, or see the [latest released version](https://github.com/precice/tutorials/tree/master/perpendicular-flap-3d) (if there is already one). Read how in the [tutorials introduction](https://precice.org/tutorials.html). | ||
| {% endnote %} | ||
|
|
||
| ## Setup | ||
|
|
||
| This tutorial is derived from the "Pulsating flow over flexible flap" test case discussed in the [OpenFOAM-preCICE paper](https://doi.org/10.51560/ofj.v3.88) (comparing to a [benchmark from the literature](https://doi.org/10.1002/nme.6072)), | ||
| and it was originally designed to validate OpenRadioss as a solid participant in fluid-structure interaction. | ||
| In contrast to the discussed case, this is using an explicit coupling scheme (the OpenRadioss adapter does not support implicit coupling) with a smaller coupling time window / solver time step. | ||
|
|
||
| Overall, this tutorial consists of a 3D flow channel with an elastic flap perpendicular to the flow, anchored from the bottom. The inlet velocity oscillates over time, and the flap deforms in all dimensions. | ||
|
|
||
| ## Configuration | ||
|
|
||
| preCICE configuration (image generated using the [precice-config-visualizer](https://precice.org/tooling-config-visualization.html)): | ||
|
|
||
|  | ||
|
|
||
| ## Available solvers | ||
|
|
||
| Fluid participant: | ||
|
|
||
| * OpenFOAM (pimpleFoam). For more information, have a look at the [OpenFOAM adapter documentation](https://precice.org/adapter-openfoam-overview.html). This tutorial needs the OpenFOAM adapter v1.4.0 or later. | ||
|
|
||
| Solid participant: | ||
|
|
||
| * OpenRadioss. While [OpenRadioss is no longer maintained](https://en.wikipedia.org/wiki/Radioss), the community fork [OpenCourant](https://opencourant.org/) is actively maintained and works with this tutorial (see the [reference versions used in tests](https://github.com/precice/tutorials/blob/develop/tests/reference_versions.yaml)). OpenCourant needs to [be built with preCICE enabled](https://github.com/OpenCourant/OpenCourant/tree/main/engine/source/coupling). | ||
| In addition to the `starter` and `engine`, you will optionally need to build the [`anim_to_vtk` tool](https://github.com/OpenCourant/Tools/tree/main/output_converters/anim_to_vtk) for visualization (the `setup-openradioss.sh` script expects it under `$OPENRADIOSS_PATH/exec`). | ||
|
|
||
| ## Mesh configuration | ||
|
|
||
| The test case implemented within this repository implements what the [OpenFOAM-preCICE paper](https://doi.org/10.51560/ofj.v3.88) refers to as `coarse` mesh: | ||
| The OpenRadioss `Solid` domain is discretized with 48 `HEX20` solid elements, arranged with a 2 x 4 x 6 cell resolution along the three spatial directions. | ||
|
|
||
| ## 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: | ||
|
|
||
| ```sh | ||
| # Terminal 1 | ||
| cd fluid-openfoam | ||
| ./run.sh -parallel | ||
|
|
||
| # Terminal 2 | ||
| cd solid-openradioss | ||
| ./run.sh | ||
| ``` | ||
|
|
||
| The scripts rely on tools found in `../tools/`. | ||
|
|
||
| OpenFOAM can be executed in parallel using `run.sh -parallel`. | ||
| The default setting uses 8 MPI ranks, but you can increase the number of subdomains in `system/decomposeParDict`. | ||
| Since this case takes a long time to complete, you probably want to run the fluid case in parallel. | ||
| With the default configuration (8 MPI ranks), expect approximately 2h on a laptop. | ||
|
|
||
| ## Post-processing | ||
|
|
||
| OpenCourant (same as OpenRadioss) writes `.anim` files, which can be converted to VTK using the [`anim_to_vtk` tool](https://github.com/OpenCourant/Tools/tree/main/output_converters/anim_to_vtk) tool. This tool can be called (commented out by default) at the end of `solid-openradioss/run.sh` using the alias `toVTK`, defined in `tools/setup-openradioss.sh`. | ||
|
MakisH marked this conversation as resolved.
Resolved
|
||
|
|
||
| OpenFOAM results can directly be loaded in ParaView ([visualization details](https://precice.org/tutorials/visualization/)). | ||
|
|
||
| At `t=2.5 s`, the flap should deform as follows: | ||
|
|
||
|  | ||
|
|
||
| Two watchpoints are defined: one in the center of the flap, and one on its left tip. These can be visualized using the provided gnuplot script: | ||
|
|
||
| ```shell | ||
| ./plot-displacement.sh solid-openradioss | ||
| ``` | ||
|
|
||
| Expected results for the two watchpoints (left and center of the flap): | ||
|
|
||
|  | ||
|  | ||
|
|
||
| Detailed results can be found in the [`openradioss-cases` repository](https://github.com/elisa-santoro/openradioss-cases) and in the [Master's thesis of Elisa Santoro](https://webthesis.biblio.polito.it/id/eprint/40822). | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../tools/clean-tutorial-base.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class volVectorField; | ||
| location "0"; | ||
| object U; | ||
| } | ||
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
|
||
| dimensions [0 1 -1 0 0 0 0]; | ||
|
|
||
| internalField uniform (0 0 0); | ||
|
|
||
| boundaryField | ||
| { | ||
| inlet | ||
| { | ||
| type codedFixedValue; | ||
| value uniform (0 0 0); | ||
| name timeVaryingParabolic; | ||
|
|
||
| code | ||
| #{ | ||
| const vectorField& Cf = patch().Cf(); // face centres | ||
| const vectorField& n = patch().nf(); // face normals (unit normals) | ||
| vectorField& field = *this; | ||
|
|
||
| const scalar pi = constant::mathematical::pi; | ||
| const scalar t = this->db().time().value(); | ||
|
|
||
| forAll(Cf, faceI) | ||
| { | ||
| const scalar y = Cf[faceI].y(); | ||
| const scalar z = Cf[faceI].z(); | ||
|
|
||
| // Equivalent of: | ||
| // para = -2*((2500/81)*y*(y-0.6)*(z+0.6)*(z-0.6))*normal(); | ||
|
|
||
| const scalar poly = | ||
| -2.0 * (2500.0/81.0) | ||
| * y * (y - 0.6) | ||
| * (z + 0.6) | ||
| * (z - 0.6); | ||
|
|
||
| vector para = poly * n[faceI]; | ||
|
|
||
| if (t < 10.0) | ||
| { | ||
| scalar ramp = 0.5 * (1.0 - cos(pi * t)); | ||
| field[faceI] = ramp * para; | ||
| } | ||
| else | ||
| { | ||
| field[faceI] = vector::zero; | ||
| } | ||
| } | ||
| #}; | ||
| } | ||
|
|
||
| outlet | ||
| { | ||
| type zeroGradient; | ||
| } | ||
| flap | ||
| { | ||
| type movingWallVelocity; | ||
| value uniform (0 0 0); | ||
| } | ||
| upperWall | ||
| { | ||
| type noSlip; | ||
| } | ||
| lowerWall | ||
| { | ||
| type noSlip; | ||
| } | ||
| frontAndBack | ||
| { | ||
| type noSlip; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| 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 zeroGradient; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class surfaceScalarField; | ||
| location "0"; | ||
| 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 calculated; | ||
| value uniform 0; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| 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 fixedValue; | ||
| value uniform (0 0 0); | ||
| } | ||
|
|
||
| frontAndBack | ||
| { | ||
| type fixedValue; | ||
| value uniform (0 0 0); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 . |
22 changes: 22 additions & 0 deletions
22
perpendicular-flap-3d/fluid-openfoam/constant/dynamicMeshDict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class dictionary; | ||
| location "constant"; | ||
| object dynamicMeshDict; | ||
| } | ||
|
|
||
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
|
||
| dynamicFvMesh dynamicMotionSolverFvMesh; | ||
|
|
||
| motionSolverLibs ("libfvMotionSolvers.so"); | ||
|
|
||
| solver displacementLaplacian; | ||
|
|
||
| displacementLaplacianCoeffs { | ||
|
|
||
| diffusivity quadratic inverseDistance (flap); | ||
|
|
||
| } |
13 changes: 13 additions & 0 deletions
13
perpendicular-flap-3d/fluid-openfoam/constant/transportProperties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class dictionary; | ||
| location "constant"; | ||
| object transportProperties; | ||
| } | ||
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
|
||
| transportModel Newtonian; | ||
|
|
||
| nu nu [ 0 2 -1 0 0 0 0 ] 0.01; |
11 changes: 11 additions & 0 deletions
11
perpendicular-flap-3d/fluid-openfoam/constant/turbulenceProperties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| FoamFile | ||
| { | ||
| version 2.0; | ||
| format ascii; | ||
| class dictionary; | ||
| location "constant"; | ||
| object turbulenceProperties; | ||
| } | ||
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
|
||
| simulationType laminar; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.