Skip to content

Commit 23b6847

Browse files
authored
Merge pull request #79 from precice/dealii_update
Update dealii tutorials for new solver
2 parents 32e1041 + 3f75a61 commit 23b6847

38 files changed

+874
-2987
lines changed

FSI/cylinderFlap/OpenFOAM-deal.II/Allclean

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ cd ./Solid/dealii_output
3030
# Clean the case
3131
echo "Cleaning Solid case"
3232
rm -fv solution-*.vtk
33-
cd ../..
34-
# Remove the log files
35-
rm -fv ${Participant2}.log
33+
cd ..
34+
rm -fv solution-*.vtk
35+
cd ..
3636

3737
# Remove the preCICE-related log files
3838
echo "Deleting the preCICE log files..."

FSI/cylinderFlap/OpenFOAM-deal.II/Allrun

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ Participant1="Fluid"
5858

5959
# =============== Participant 2: Solid ===========================
6060
Participant2="Solid"
61-
Solver2="coupled_elasto_dynamics"
61+
Solver2="nonlinear_elasticity"
6262

6363
# Run
6464
echo " Starting the ${Participant2} participant..."
65-
${Participant2}/${Solver2} ${Participant2}/parameters.prm > ${Participant2}.log 2>&1 &
65+
./runSolid -nonlinear > ${Participant2}.log 2>&1 &
6666
PIDParticipant2=$!
6767

6868

FSI/cylinderFlap/OpenFOAM-deal.II/Fluid/system/controlDict

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ startTime 0;
1919

2020
stopAt endTime;
2121

22-
endTime 10;
22+
endTime 15;
2323

24-
deltaT 0.005;
24+
deltaT 0.002;
2525

2626
writeControl adjustableRunTime;
2727

28-
writeInterval 0.1;
28+
writeInterval 100;
2929

3030
purgeWrite 0;
3131

FSI/cylinderFlap/OpenFOAM-deal.II/Fluid/system/preciceDict

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interfaces
2727

2828
writeData
2929
(
30-
Force
30+
Stress
3131
);
3232
};
3333

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Listing of Parameters
2+
# Dimensional quantities are in SI units
3+
# --------------------------------------
4+
5+
subsection Time
6+
# End time
7+
set End time = 15
8+
9+
# Time step size
10+
set Time step size = 0.002
11+
12+
# Write results every x timesteps
13+
set Output interval = 100
14+
end
15+
16+
subsection Discretization
17+
# Time integration scheme
18+
# 0 = forward, 1 = backward
19+
set theta = 0.5
20+
21+
# Polynomial degree of the FE system
22+
set Polynomial degree = 2
23+
end
24+
25+
subsection System properties
26+
# mu (shear modulus)
27+
set mu = 2e6
28+
29+
# lambda
30+
set lambda = 8e6
31+
32+
# density
33+
set rho = 1000
34+
35+
# body forces x,y,z
36+
set body forces = 0.0,0.0,0.0
37+
end
38+
39+
subsection Linear solver
40+
# Linear solver iterations (multiples of the system matrix size)
41+
set Max iteration multiplier = 1
42+
43+
# Linear solver residual (scaled by residual norm)
44+
set Residual = 1e-6
45+
46+
# Linear solver: CG or Direct
47+
set Solver type = Direct
48+
end
49+
50+
subsection precice configuration
51+
# Cases: FSI3 or PF for perpendicular flap
52+
set Scenario = FSI3
53+
54+
# Name of the precice configuration file
55+
set precice config-file = precice-config.xml
56+
57+
# Name of the participant in the precice-config.xml file
58+
set Participant name = Solid
59+
60+
# Name of the coupling mesh in the precice-config.xml file
61+
set Mesh name = Solid_mesh
62+
63+
# Name of the read data in the precice-config.xml file
64+
set Read data name = Stress
65+
66+
# Name of the write data in the precice-config.xml file
67+
set Write data name = Displacement
68+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Listing of Parameters
2+
# Dimensional quantities are in SI units
3+
# --------------------------------------
4+
5+
subsection Time
6+
# End time
7+
set End time = 15
8+
9+
# Time step size
10+
set Time step size = 0.002
11+
12+
# Output interval
13+
set Output interval = 100
14+
end
15+
16+
subsection Discretization
17+
# Newmark beta
18+
set beta = 0.25
19+
20+
# Newmark gamma
21+
set gamma = 0.5
22+
23+
# Polynomial degree of the FE system
24+
set Polynomial degree = 2
25+
end
26+
27+
subsection System properties
28+
# Poisson's ratio
29+
set Poisson's ratio = 0.4
30+
31+
# Shear modulus
32+
set Shear modulus = 2.0e6
33+
34+
# Density
35+
set rho = 1000
36+
37+
# Body forces x,y,z
38+
set body forces = 0.0,0.0,0.0
39+
end
40+
41+
subsection Linear solver
42+
# Linear solver iterations (multiples of the system matrix size)
43+
set Max iteration multiplier = 1
44+
45+
# Linear solver residual (scaled by residual norm)
46+
set Residual = 1e-6
47+
48+
# Linear solver: CG or Direct
49+
set Solver type = Direct
50+
end
51+
52+
subsection Nonlinear solver
53+
# Number of Newton-Raphson iterations allowed
54+
set Max iterations Newton-Raphson = 10
55+
56+
# Displacement error tolerance
57+
set Tolerance displacement = 1.0e-6
58+
59+
# Force residual tolerance
60+
set Tolerance force = 1.0e-9
61+
end
62+
63+
subsection precice configuration
64+
# Cases: FSI3 or PF for perpendicular flap
65+
set Scenario = FSI3
66+
67+
# Name of the precice configuration file
68+
set precice config-file = precice-config.xml
69+
70+
# Name of the participant in the precice-config.xml file
71+
set Participant name = Solid
72+
73+
# Name of the coupling mesh in the precice-config.xml file
74+
set Mesh name = Solid_mesh
75+
76+
# Name of the read data in the precice-config.xml file
77+
set Read data name = Stress
78+
79+
# Name of the write data in the precice-config.xml file
80+
set Write data name = Displacement
81+
end

FSI/cylinderFlap/OpenFOAM-deal.II/Solid/parameters.prm

-66
This file was deleted.

FSI/cylinderFlap/OpenFOAM-deal.II/precice-config.xml

+37-28
Original file line numberDiff line numberDiff line change
@@ -8,66 +8,75 @@
88

99
<solver-interface dimensions="3">
1010

11-
<data:vector name="Force"/>
11+
<data:vector name="Stress"/>
1212
<data:vector name="Displacement"/>
1313

1414
<mesh name="Fluid-Mesh-Centers">
15-
<use-data name="Force"/>
15+
<use-data name="Stress"/>
1616
</mesh>
1717
<mesh name="Fluid-Mesh-Nodes">
1818
<use-data name="Displacement"/>
1919
</mesh>
2020

21-
<mesh name="Solid_nodes">
21+
<mesh name="Solid_mesh">
2222
<use-data name="Displacement"/>
23-
</mesh>
24-
<mesh name="Solid_faces">
25-
<use-data name="Force"/>
23+
<use-data name="Stress"/>
2624
</mesh>
2725

2826
<participant name="Fluid">
29-
<use-mesh name="Fluid-Mesh-Centers" provide="yes"/>
3027
<use-mesh name="Fluid-Mesh-Nodes" provide="yes"/>
31-
<use-mesh name="Solid_nodes" from="Solid"/>
32-
<use-mesh name="Solid_faces" from="Solid"/>
33-
<read-data name="Displacement" mesh="Fluid-Mesh-Nodes"/>
34-
<write-data name="Force" mesh="Fluid-Mesh-Centers"/>
28+
<use-mesh name="Fluid-Mesh-Centers" provide="yes"/>
29+
<use-mesh name="Solid_mesh" from="Solid"/>
30+
<read-data name="Displacement" mesh="Fluid-Mesh-Nodes"/>
31+
<write-data name="Stress" mesh="Fluid-Mesh-Centers"/>
3532
<!--export:vtk directory="coupling_data" /-->
36-
<mapping:rbf-thin-plate-splines direction="write" from="Fluid-Mesh-Centers" to="Solid_faces" constraint="conservative" z-dead="true"/>
37-
<mapping:rbf-thin-plate-splines direction="read" from="Solid_nodes" to="Fluid-Mesh-Nodes" constraint="consistent"/>
33+
<mapping:rbf-thin-plate-splines direction="read" from="Solid_mesh" to="Fluid-Mesh-Nodes" constraint="consistent"/>
3834
</participant>
3935

4036
<participant name="Solid">
41-
<use-mesh name="Solid_nodes" provide="yes"/>
42-
<use-mesh name="Solid_faces" provide="yes"/>
43-
<read-data name="Force" mesh="Solid_faces"/>
44-
<write-data name="Displacement" mesh="Solid_nodes"/>
45-
<watch-point mesh="Solid_nodes" name="flap_tip" coordinate="0.6;0.2;0." />
37+
<use-mesh name="Solid_mesh" provide="yes"/>
38+
<use-mesh name="Fluid-Mesh-Centers" from="Fluid"/>
39+
<use-mesh name="Fluid-Mesh-Nodes" from="Fluid"/>
40+
<read-data name="Stress" mesh="Solid_mesh"/>
41+
<write-data name="Displacement" mesh="Solid_mesh"/>
42+
<watch-point mesh="Solid_mesh" name="flap_tip" coordinate="0.6;0.2;0" />
43+
<mapping:rbf-thin-plate-splines direction="read" from="Fluid-Mesh-Centers" to="Solid_mesh" constraint="consistent" z-dead="true"/>
4644
</participant>
4745

48-
<m2n:sockets from="Fluid" to="Solid"/>
46+
<m2n:sockets from="Fluid" to="Solid" />
4947

50-
<coupling-scheme:serial-implicit>
51-
<time-window-size value="0.005"/>
52-
<max-time value="10"/>
48+
<coupling-scheme:parallel-implicit>
49+
<time-window-size value="0.002"/>
50+
<max-time value="15"/>
5351
<participants first="Fluid" second="Solid"/>
54-
<exchange data="Force" mesh="Solid_faces" from="Fluid" to="Solid"/>
55-
<exchange data="Displacement" mesh="Solid_nodes" from="Solid" to="Fluid" initialize="0"/>
52+
<exchange data="Stress" mesh="Fluid-Mesh-Centers" from="Fluid" to="Solid"/>
53+
<exchange data="Displacement" mesh="Solid_mesh" from="Solid" to="Fluid" initialize="0"/>
5654

5755
<max-iterations value="100"/>
58-
<absolute-convergence-measure limit="1e-6" data="Displacement" mesh="Solid_nodes"/>
59-
<relative-convergence-measure limit="1e-4" data="Force" mesh="Solid_faces"/>
56+
<relative-convergence-measure limit="5e-5" data="Stress" mesh="Fluid-Mesh-Centers"/>
57+
<relative-convergence-measure limit="5e-5" data="Displacement" mesh="Solid_mesh"/>
6058
<extrapolation-order value="2"/>
6159

6260
<acceleration:IQN-ILS>
63-
<data name="Displacement" mesh="Solid_nodes"/>
61+
<data name="Displacement" mesh="Solid_mesh"/>
6462
<preconditioner type="residual-sum"/>
6563
<filter type="QR1" limit="1e-6"/>
6664
<initial-relaxation value="0.1"/>
6765
<max-used-iterations value="50"/>
6866
<time-windows-reused value="10"/>
6967
</acceleration:IQN-ILS>
70-
</coupling-scheme:serial-implicit>
68+
69+
</coupling-scheme:parallel-implicit>
70+
71+
72+
<!--coupling-scheme:serial-explicit>
73+
<time-window-size value="0.01"/>
74+
<max-time value="5"/>
75+
<participants first="Fluid" second="Solid"/>
76+
<exchange data="Stress" mesh="Solid_mesh" from="Fluid" to="Solid"/>
77+
<exchange data="Displacement" mesh="Solid_mesh" from="Solid" to="Fluid" initialize="0"/>
78+
79+
</coupling-scheme:serial-explicit-->
7180

7281
</solver-interface>
7382

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Fluid
2+
!Fluid/0
3+
!Fluid/0.orig
4+
!Fluid/constant
5+
!Fluid/system
6+
!Fluid/Fluid.foam
7+
*.vtk
8+
*.log
9+
~

FSI/cylinderFlap_2D/OpenFOAM-deal.II/Allclean

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ cd ./Solid/dealii_output
3030
# Clean the case
3131
echo "Cleaning Solid case"
3232
rm -fv solution-*.vtk
33-
cd ../..
33+
cd ..
34+
rm -fv solution-*.vtk
35+
cd ..
36+
3437
# Remove the log files
3538
rm -fv ${Participant2}.log
3639

0 commit comments

Comments
 (0)