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

Turek & Hron FSI3 solid-fenics #579

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions turek-hron-fsi3/fluid-openfoam/system/decomposeParDict
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ FoamFile
object decomposeParDict;
}

numberOfSubdomains 25;
numberOfSubdomains 3;

method hierarchical;
hierarchicalCoeffs
{
n (5 5 1);
n (3 1 1);
delta 0.001;
order xyz;
}
Expand Down
3 changes: 1 addition & 2 deletions turek-hron-fsi3/fluid-openfoam/system/preciceDict
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ interfaces

writeData
(
Stress
Force
);
};

Interface2
{
mesh Fluid-Mesh-Nodes;
Expand Down
2 changes: 1 addition & 1 deletion turek-hron-fsi3/plot-displacement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ gnuplot -p << EOF
set xlabel 'time [s]'
set ylabel 'y-displacement [m]'
set linestyle 1 lt 2 lc 1 # red-dashed
plot "solid-dealii/precice-Solid-watchpoint-Flap-Tip.log" using 1:5 with lines notitle
plot "solid-fenics/precice-Solid-watchpoint-Flap-Tip.log" using 1:5 with lines notitle
EOF
27 changes: 13 additions & 14 deletions turek-hron-fsi3/precice-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
enabled="true" />
</log>

<data:vector name="Stress" />
<data:vector name="Force" />
<data:vector name="Displacement" />

<mesh name="Fluid-Mesh-Centers" dimensions="2">
<use-data name="Stress" />
<use-data name="Force" />
</mesh>

<mesh name="Fluid-Mesh-Nodes" dimensions="2">
Expand All @@ -20,45 +20,44 @@

<mesh name="Solid-Mesh" dimensions="2">
<use-data name="Displacement" />
<use-data name="Stress" />
<use-data name="Force" />
</mesh>

<participant name="Fluid">
<provide-mesh name="Fluid-Mesh-Nodes" />
<provide-mesh name="Fluid-Mesh-Centers" />
<provide-mesh name="Fluid-Mesh-Nodes" />
<receive-mesh name="Solid-Mesh" from="Solid" />
<read-data name="Displacement" mesh="Fluid-Mesh-Nodes" />
<write-data name="Stress" mesh="Fluid-Mesh-Centers" />
<write-data name="Force" mesh="Fluid-Mesh-Centers" />
<mapping:rbf direction="read" from="Solid-Mesh" to="Fluid-Mesh-Nodes" constraint="consistent">
<basis-function:compact-polynomial-c6 support-radius="0.35" />
</mapping:rbf>
<mapping:rbf direction="write" from="Fluid-Mesh-Centers" to="Solid-Mesh" constraint="conservative">
<basis-function:compact-polynomial-c6 support-radius="0.35" />
</mapping:rbf>
</participant>

<participant name="Solid">
<provide-mesh name="Solid-Mesh" />
<receive-mesh name="Fluid-Mesh-Centers" from="Fluid" />
<read-data name="Stress" mesh="Solid-Mesh" />
<read-data name="Force" mesh="Solid-Mesh" />
<write-data name="Displacement" mesh="Solid-Mesh" />
<watch-point mesh="Solid-Mesh" name="Flap-Tip" coordinate="0.6;0.2" />
<mapping:rbf direction="read" from="Fluid-Mesh-Centers" to="Solid-Mesh" constraint="consistent">
<basis-function:compact-polynomial-c6 support-radius="0.35" />
</mapping:rbf>
</participant>

<m2n:sockets acceptor="Fluid" connector="Solid" exchange-directory=".." />

<coupling-scheme:parallel-implicit>
<time-window-size value="1e-3" />
<max-time value="15" />
<max-time value="5" />
<participants first="Fluid" second="Solid" />
<exchange data="Stress" mesh="Fluid-Mesh-Centers" from="Fluid" to="Solid" />
<exchange data="Force" mesh="Solid-Mesh" from="Fluid" to="Solid" />
<exchange data="Displacement" mesh="Solid-Mesh" from="Solid" to="Fluid" />
<max-iterations value="100" />
<relative-convergence-measure limit="1e-4" data="Stress" mesh="Fluid-Mesh-Centers" />
<relative-convergence-measure limit="1e-4" data="Force" mesh="Solid-Mesh" />
<relative-convergence-measure limit="1e-4" data="Displacement" mesh="Solid-Mesh" />
<acceleration:IQN-ILS>
<data name="Displacement" mesh="Solid-Mesh" />
<data name="Stress" mesh="Fluid-Mesh-Centers" />
<data name="Force" mesh="Solid-Mesh" />
<preconditioner type="residual-sum" />
<filter type="QR2" limit="1.2e-3" />
<initial-relaxation value="0.1" />
Expand Down
6 changes: 6 additions & 0 deletions turek-hron-fsi3/solid-fenics/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_fenics .
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"participant_name": "Solid",
"config_file_name": "../precice-config.xml",
"interface": {
"coupling_mesh_name": "Solid-Mesh",
"write_data_name": "Displacement",
"read_data_name": "Force"
}
}
11 changes: 11 additions & 0 deletions turek-hron-fsi3/solid-fenics/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
fenicsprecice==2.2.0rc1
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
fenicsprecice==2.2.0rc1
fenicsprecice>=2.2

When v2.2.0 is released.

numpy >1, <2
matplotlib

# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
# Use --system-site-packages in venv
fenics-dijitso==2019.2.0.dev0
fenics-dolfin==2019.2.0.13.dev0
fenics-ffc==2019.2.0.dev0
fenics-fiat==2019.2.0.dev0
fenics-ufl-legacy==2022.3.0
13 changes: 13 additions & 0 deletions turek-hron-fsi3/solid-fenics/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e -u

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

python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r requirements.txt

python3 solid.py

close_log
Loading
Loading