Skip to content

Commit

Permalink
Solution for solids4foam#150 point 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
iBatistic committed Dec 18, 2024
1 parent 69effeb commit 1b53983
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tutorials/fluidSolidInteraction/3dTube/Allclean
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ else
fi

rm -rf case.foam postProcessing residuals
rm -rf radialDisplacement.pdf fsiConvergence.pdf axialDisplacement.pdf

# Convert case version to FOAM EXTEND
solids4Foam::convertCaseFormatFoamExtend .
Expand All @@ -37,6 +38,6 @@ fi

# Link files back to default with pimpleFluid
for file in $(find ./0 ./constant ./system -name '*.pimpleFluid')
do
do
ln -vnsf ${file##*/} ${file%.*}
done
10 changes: 10 additions & 0 deletions tutorials/fluidSolidInteraction/3dTube/Allrun
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ solids4Foam::runApplication -s fluid blockMesh -region fluid

# Run solver
solids4Foam::runApplication solids4Foam

# Create plots
if command -v gnuplot &> /dev/null
then
echo "Generating plots"
gnuplot -p displacement.gnuplot &> /dev/null
gnuplot -p fsiConvergence.gnuplot &> /dev/null
else
echo "Please install gnuplot if you would like to generate the plots"
fi
27 changes: 27 additions & 0 deletions tutorials/fluidSolidInteraction/3dTube/displacement.gnuplot
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
set terminal pdfcairo enhanced color solid

# Axial displacement

set output "axialDisplacement.pdf"
set title "3dTube: Axial Displacement at Point A"
set xlabel "Time, t [s]"
set ylabel "Axial Displacement [mm]"
set grid
set key top right

set yrange [-0.1:0.1]

plot \
"postProcessing/0/solidPointDisplacement_displacement.dat" u 1:(1000*$4)\
w l lc "red" lw 0.5 lt 1 t "Axial displacement"

# Radial displacement

set output "radialDisplacement.pdf"
set title "3dTube: Radial Displacement at Point A"
set ylabel "Radial Displacement [mm]"
set yrange [-0.1:0.15]

plot \
"postProcessing/0/solidPointDisplacement_displacement.dat" u 1:(1000*$3)\
w l lc "red" lw 0.5 lt 1 t "Radial displacement"
14 changes: 14 additions & 0 deletions tutorials/fluidSolidInteraction/3dTube/fsiConvergence.gnuplot
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set terminal pdfcairo enhanced color solid

set output "fsiConvergence.pdf"

set title "3dTube: Number of FSI iterations"
set xlabel "Time, t [s]"
set ylabel "Number of FSI iterations"
set grid
set key top right

set yrange [0:80]

plot \
"postProcessing/0/fsiConvergenceData.dat" u 1:2 w lp ps 0.3 pt 5 lc "red" lw 0.5 lt 1 t "Number of iterations"
6 changes: 6 additions & 0 deletions tutorials/fluidSolidInteraction/3dTube/system/controlDict
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ functions
CofR (0.5 0.1 0);
region fluid;
}
fsiConvData
{
type fsiConvergenceData;
region fluid;
}

}

DebugSwitches
Expand Down

0 comments on commit 1b53983

Please sign in to comment.