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

Port trivial cases #151

Merged
merged 26 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a568404
Restructure 3D Tube case
davidscn Jan 28, 2021
2c3e5c8
Fix ccx paths and cleaning script
davidscn Jan 28, 2021
0a290cf
Apply new naming conventions to config file
davidscn Jan 28, 2021
06eec11
Format xml in precice style
davidscn Jan 28, 2021
70d82ee
Add first version of multi coupling case
davidscn Jan 28, 2021
6550f81
Adjust paths according to restructure
davidscn Jan 28, 2021
beda3e8
Add the heat exchanger case
davidscn Jan 28, 2021
abc5c13
Add run scripts for fluid cases
davidscn Jan 28, 2021
cf3f585
Adjust download script
davidscn Jan 28, 2021
175d1b0
Add partitioned elastic beam
davidscn Jan 28, 2021
8abcbea
Apply naming conventions and provide cleaning script
davidscn Jan 28, 2021
545d516
Restructure steady state plate
davidscn Jan 28, 2021
3f6c35b
Change 0 dir to 0.orig
davidscn Jan 28, 2021
62b7115
Fix blockMesh in run.sh
davidscn Jan 28, 2021
48f9507
Merge branch 'restructure' into port-trivial
davidscn Feb 5, 2021
a5d11f7
Port heat-exchanger README from preCICE wiki
davidscn Feb 11, 2021
d20c7db
Port partitioned beam README from preCICE wiki
davidscn Feb 11, 2021
b1841d0
Add a README for the 3D tube
davidscn Feb 11, 2021
7231adf
Add code_aster README from code-aster wiki
davidscn Feb 11, 2021
6a4fae3
Apply multiple minor changes to preCICE configs and READMEs
uekerman Feb 15, 2021
fe3b7a1
Adjust naming scheme in multiple flaps case
davidscn Feb 16, 2021
430b959
Adjust naming of partitioned beam
davidscn Feb 16, 2021
88d51fc
Switch dimension in steady state heated plate
davidscn Feb 16, 2021
90bb49e
Merge branch 'port-trivial' of https://github.com/DavidSCN/tutorials …
davidscn Feb 16, 2021
9946367
Remove vtk tag for multiple flap case
davidscn Feb 19, 2021
d909807
Remove vtk tag from remainig mesh
davidscn Feb 19, 2021
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
92 changes: 0 additions & 92 deletions elastic-tube-3d/OpenFOAM-CalculiX/Allrun

This file was deleted.

19 changes: 0 additions & 19 deletions elastic-tube-3d/OpenFOAM-CalculiX/README.md

This file was deleted.

68 changes: 0 additions & 68 deletions elastic-tube-3d/OpenFOAM-CalculiX/precice-config.xml

This file was deleted.

32 changes: 30 additions & 2 deletions elastic-tube-3d/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
---
title: Elastic tube 3D
permalink: tutorials-elastic-tube-3d.html
keywords:
summary:
keywords: FSI, OpenFOAM, CalculiX, nearest-projection, IMVJ
summary: Tutorial for an FSI simulation of a three-dimensional expanding tube scenario
---

{% include important.html content="We have not yet ported the documentation of the preCICE tutorials from the preCICE wiki to here. Please go to the [preCICE wiki](https://github.com/precice/precice/wiki#2-getting-started---tutorials)" %}

## Setup

The expanding tube test case involves a cylindrical fluid domain surrounded by a solid domain. A pressure inlet boundary condition is applied at the inlet for 3 milliseconds, and then 0 set to zero for a further 7 millisecond. The pressure of the fluid expands the tube which then relaxes once the pressure decreases.

The expanding tube test case comes with the interface surface mesh connectivity of the solid domain. This allows the use of nearest-projection mapping of the displacements of the solid domain. In order to run the example with nearest projection mapping, the "node-mesh-with-connectivity" has been specified in the `solid-calculix/config.yml` file. More details can be found in the [CalculiX configuration description](adapter-calculix-config.html#nearest-projection-mapping).

## Available solvers

Fluid participant:

* OpenFOAM. This tutorial is known to work with OpenFOAM 4.1, 5.0, but it should also work with newer versions. The case files are prepared for the latest versions of OpenFOAM and use the solver `pimpleFoam`. In case you are using a previous OpenFOAM version you need to adjust the solver to `pimpleDyMFoam` in the `Fluid/system/controlDict` file. For more information, have a look at the [OpenFOAM adapter documentation](adapter-openfoam-overview.html).

Solid participant:

* CalculiX. This tutorial is known to work with CalculiX 2.15, but it should also work with newer versions. For more information, have a look at the [CalculiX adapter documentation](adapter-calculix-overview.html).

## Running the simulation

You can start the simulation by running the script `./run.sh` located in each participant directory. OpenFOAM can be executed in parallel by using an additional `run.sh -parallel` flag. The default setting uses 4 MPI ranks.

## Post-processing

You can visualize the results using paraView or `cgx`(for native CalculiX resul files), as usual. The total deformation is rather small. Multiplying the deformation by factor of 10 (warp by vector filter in paraView) and visualizing the fluid domain at `t=0.005s` looks as follows:

![result tube](images/tube_result.png)

{% include disclaimer.html content="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." %}
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,43 @@ echo "Cleaning..."
. $WM_PROJECT_DIR/bin/tools/CleanFunctions

# Participant 1: Fluid
Participant1="Fluid"
Participant1="fluid-openfoam"
cd ${Participant1}
# Clean the case
#cleanCase
# prevent cleaning the mesh
mv ./constant/polyMesh ./constant/mesh
cleanCase
rm -rfv 0
# restore mesh files
mv ./constant/mesh ./constant/polyMesh
# Create an empty .foam file for ParaView
# Note: ".foam" triggers the native OpenFOAM reader of ParaView.
# Change to ".OpenFOAM" to use the OpenFOAM reader provided with OpenFOAM.
touch ${Participant1}.foam
rm -fv ${Participant1}_decomposePar.log
rm -fv ${Participant1}.log
rm -fv ${Participant1}_reconstructPar.log
rm -fv precice-*.log
rm -fv precice-*-events.json
cd ..
# Remove the log files
rm -fv ${Participant1}_decomposePar.log
rm -fv ${Participant1}.log
rm -fv ${Participant1}_reconstructPar.log

# Participant 2: Solid
Participant2="Solid"
Participant2="solid-calculix"
cd ${Participant2}
# Clean the case
rm -fv *.log
rm -fv tube.cvg
rm -fv tube.dat
rm -fv tube.frd
rm -fv tube.sta
rm -fv tube.12d
rm -fv spooles.out
rm -fv precice-*.log
rm -fv precice-*-events.json
cd ..
# Remove the log files
rm -fv spooles.out
rm -fv ${Participant2}.log

# Remove the preCICE-related log files
echo "Deleting the preCICE log files..."
rm -fv \
precice-*.log \
precice-postProcessingInfo.log \
precice-*-events.json

# Output files for preCICE versions before 1.2:
rm -fv \
iterations-${Participant1}.txt iterations-${Participant2}.txt \
convergence-${Participant1}.txt convergence-${Participant2}.txt \
Events-${Participant1}.log Events-${Participant2}.log \
EventTimings-${Participant1}.log EventTimings-${Participant2}.log

# Remove the preCICE address files
rm -rfv precice-run
rm -fv .*.address

echo "Cleaning complete!"
#------------------------------------------------------------------------------
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

echo "Looking for any time directories without results (e.g. stray functionObjectProperties files, see issue #26 on GitHub)..."

cd Fluid
for f in [0-9]* [0-9]*.[0-9]*; do
if ! [ -f $f/U ] && ! [ -f $f/T ]; then
rm -rfv $f
Expand Down
39 changes: 39 additions & 0 deletions elastic-tube-3d/fluid-openfoam/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions

# Fluid participant

# Run this script in one terminal and the execute the coupled_elasto_dynamics bindary
# in another terminal.
# These scripts present how the two participants would be started manually.

# Run this script with "-parallel" for parallel simulations

# The script "Allclean" cleans-up the result and log files.

# 1 for true, 0 for false
parallel=0
if [ "$1" = "-parallel" ]; then
parallel=1
fi

echo "Preparing and running the Fluid participant..."

rm -rfv 0/
cp -r 0.orig/ 0/
checkMesh

# Run
solver=$(getApplication)
procs=$(getNumberOfProcessors)
if [ $parallel -eq 1 ]; then
decomposePar -force
mpirun -np $procs $solver -parallel
reconstructPar
else
$solver
fi

# Workaround for issue #26 (OF-adapter, relevant for OF .com versions)
./removeObsoleteFolders.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FoamFile
object preciceDict;
}

preciceConfig "precice-config.xml";
preciceConfig "../precice-config.xml";

participant Fluid;

Expand All @@ -23,7 +23,7 @@ interfaces

readData
(
DisplacementDeltas0
DisplacementDelta
);

writeData
Expand All @@ -43,12 +43,12 @@ interfaces

writeData
(
Forces0
Force
);
};
};

FSI
{
rho rho [1 -3 0 0 0 0 0] 1000;
}
}
File renamed without changes.
Binary file added elastic-tube-3d/images/tube_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading