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

Update dealii tutorials for new solver #79

Merged
merged 23 commits into from
Jun 23, 2020
Merged
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
6 changes: 3 additions & 3 deletions FSI/cylinderFlap/OpenFOAM-deal.II/Allclean
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ cd ./Solid/dealii_output
# Clean the case
echo "Cleaning Solid case"
rm -fv solution-*.vtk
cd ../..
# Remove the log files
rm -fv ${Participant2}.log
cd ..
rm -fv solution-*.vtk
cd ..

# Remove the preCICE-related log files
echo "Deleting the preCICE log files..."
Expand Down
4 changes: 2 additions & 2 deletions FSI/cylinderFlap/OpenFOAM-deal.II/Allrun
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ Participant1="Fluid"

# =============== Participant 2: Solid ===========================
Participant2="Solid"
Solver2="coupled_elasto_dynamics"
Solver2="nonlinear_elasticity"

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


Expand Down
6 changes: 3 additions & 3 deletions FSI/cylinderFlap/OpenFOAM-deal.II/Fluid/system/controlDict
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ startTime 0;

stopAt endTime;

endTime 10;
endTime 15;

deltaT 0.005;
deltaT 0.002;

writeControl adjustableRunTime;

writeInterval 0.1;
writeInterval 100;

purgeWrite 0;

Expand Down
2 changes: 1 addition & 1 deletion FSI/cylinderFlap/OpenFOAM-deal.II/Fluid/system/preciceDict
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interfaces

writeData
(
Force
Stress
);
};

Expand Down
68 changes: 68 additions & 0 deletions FSI/cylinderFlap/OpenFOAM-deal.II/Solid/linear_elasticity.prm
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Listing of Parameters
# Dimensional quantities are in SI units
# --------------------------------------

subsection Time
# End time
set End time = 15

# Time step size
set Time step size = 0.002

# Write results every x timesteps
set Output interval = 100
end

subsection Discretization
# Time integration scheme
# 0 = forward, 1 = backward
set theta = 0.5

# Polynomial degree of the FE system
set Polynomial degree = 2
end

subsection System properties
# mu (shear modulus)
set mu = 2e6

# lambda
set lambda = 8e6

# density
set rho = 1000

# body forces x,y,z
set body forces = 0.0,0.0,0.0
end

subsection Linear solver
# Linear solver iterations (multiples of the system matrix size)
set Max iteration multiplier = 1

# Linear solver residual (scaled by residual norm)
set Residual = 1e-6

# Linear solver: CG or Direct
set Solver type = Direct
end

subsection precice configuration
# Cases: FSI3 or PF for perpendicular flap
set Scenario = FSI3

# Name of the precice configuration file
set precice config-file = precice-config.xml

# Name of the participant in the precice-config.xml file
set Participant name = Solid

# Name of the coupling mesh in the precice-config.xml file
set Mesh name = Solid_mesh

# Name of the read data in the precice-config.xml file
set Read data name = Stress

# Name of the write data in the precice-config.xml file
set Write data name = Displacement
end
81 changes: 81 additions & 0 deletions FSI/cylinderFlap/OpenFOAM-deal.II/Solid/nonlinear_elasticity.prm
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Listing of Parameters
# Dimensional quantities are in SI units
# --------------------------------------

subsection Time
# End time
set End time = 15

# Time step size
set Time step size = 0.002

# Output interval
set Output interval = 100
end

subsection Discretization
# Newmark beta
set beta = 0.25

# Newmark gamma
set gamma = 0.5

# Polynomial degree of the FE system
set Polynomial degree = 2
end

subsection System properties
# Poisson's ratio
set Poisson's ratio = 0.4

# Shear modulus
set Shear modulus = 2.0e6

# Density
set rho = 1000

# Body forces x,y,z
set body forces = 0.0,0.0,0.0
end

subsection Linear solver
# Linear solver iterations (multiples of the system matrix size)
set Max iteration multiplier = 1

# Linear solver residual (scaled by residual norm)
set Residual = 1e-6

# Linear solver: CG or Direct
set Solver type = Direct
end

subsection Nonlinear solver
# Number of Newton-Raphson iterations allowed
set Max iterations Newton-Raphson = 10

# Displacement error tolerance
set Tolerance displacement = 1.0e-6

# Force residual tolerance
set Tolerance force = 1.0e-9
end

subsection precice configuration
# Cases: FSI3 or PF for perpendicular flap
set Scenario = FSI3

# Name of the precice configuration file
set precice config-file = precice-config.xml

# Name of the participant in the precice-config.xml file
set Participant name = Solid

# Name of the coupling mesh in the precice-config.xml file
set Mesh name = Solid_mesh

# Name of the read data in the precice-config.xml file
set Read data name = Stress

# Name of the write data in the precice-config.xml file
set Write data name = Displacement
end
66 changes: 0 additions & 66 deletions FSI/cylinderFlap/OpenFOAM-deal.II/Solid/parameters.prm

This file was deleted.

65 changes: 37 additions & 28 deletions FSI/cylinderFlap/OpenFOAM-deal.II/precice-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,75 @@

<solver-interface dimensions="3">

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

<mesh name="Fluid-Mesh-Centers">
<use-data name="Force"/>
<use-data name="Stress"/>
</mesh>
<mesh name="Fluid-Mesh-Nodes">
<use-data name="Displacement"/>
</mesh>

<mesh name="Solid_nodes">
<mesh name="Solid_mesh">
<use-data name="Displacement"/>
</mesh>
<mesh name="Solid_faces">
<use-data name="Force"/>
<use-data name="Stress"/>
</mesh>

<participant name="Fluid">
<use-mesh name="Fluid-Mesh-Centers" provide="yes"/>
<use-mesh name="Fluid-Mesh-Nodes" provide="yes"/>
<use-mesh name="Solid_nodes" from="Solid"/>
<use-mesh name="Solid_faces" from="Solid"/>
<read-data name="Displacement" mesh="Fluid-Mesh-Nodes"/>
<write-data name="Force" mesh="Fluid-Mesh-Centers"/>
<use-mesh name="Fluid-Mesh-Centers" provide="yes"/>
<use-mesh name="Solid_mesh" from="Solid"/>
<read-data name="Displacement" mesh="Fluid-Mesh-Nodes"/>
<write-data name="Stress" mesh="Fluid-Mesh-Centers"/>
<!--export:vtk directory="coupling_data" /-->
<mapping:rbf-thin-plate-splines direction="write" from="Fluid-Mesh-Centers" to="Solid_faces" constraint="conservative" z-dead="true"/>
<mapping:rbf-thin-plate-splines direction="read" from="Solid_nodes" to="Fluid-Mesh-Nodes" constraint="consistent"/>
<mapping:rbf-thin-plate-splines direction="read" from="Solid_mesh" to="Fluid-Mesh-Nodes" constraint="consistent"/>
</participant>

<participant name="Solid">
<use-mesh name="Solid_nodes" provide="yes"/>
<use-mesh name="Solid_faces" provide="yes"/>
<read-data name="Force" mesh="Solid_faces"/>
<write-data name="Displacement" mesh="Solid_nodes"/>
<watch-point mesh="Solid_nodes" name="flap_tip" coordinate="0.6;0.2;0." />
<use-mesh name="Solid_mesh" provide="yes"/>
<use-mesh name="Fluid-Mesh-Centers" from="Fluid"/>
<use-mesh name="Fluid-Mesh-Nodes" from="Fluid"/>
<read-data name="Stress" mesh="Solid_mesh"/>
<write-data name="Displacement" mesh="Solid_mesh"/>
<watch-point mesh="Solid_mesh" name="flap_tip" coordinate="0.6;0.2;0" />
<mapping:rbf-thin-plate-splines direction="read" from="Fluid-Mesh-Centers" to="Solid_mesh" constraint="consistent" z-dead="true"/>
</participant>

<m2n:sockets from="Fluid" to="Solid"/>
<m2n:sockets from="Fluid" to="Solid" />

<coupling-scheme:serial-implicit>
<time-window-size value="0.005"/>
<max-time value="10"/>
<coupling-scheme:parallel-implicit>
<time-window-size value="0.002"/>
<max-time value="15"/>
<participants first="Fluid" second="Solid"/>
<exchange data="Force" mesh="Solid_faces" from="Fluid" to="Solid"/>
<exchange data="Displacement" mesh="Solid_nodes" from="Solid" to="Fluid" initialize="0"/>
<exchange data="Stress" mesh="Fluid-Mesh-Centers" from="Fluid" to="Solid"/>
<exchange data="Displacement" mesh="Solid_mesh" from="Solid" to="Fluid" initialize="0"/>

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

<acceleration:IQN-ILS>
<data name="Displacement" mesh="Solid_nodes"/>
<data name="Displacement" mesh="Solid_mesh"/>
<preconditioner type="residual-sum"/>
<filter type="QR1" limit="1e-6"/>
<initial-relaxation value="0.1"/>
<max-used-iterations value="50"/>
<time-windows-reused value="10"/>
</acceleration:IQN-ILS>
</coupling-scheme:serial-implicit>

</coupling-scheme:parallel-implicit>


<!--coupling-scheme:serial-explicit>
<time-window-size value="0.01"/>
<max-time value="5"/>
<participants first="Fluid" second="Solid"/>
<exchange data="Stress" mesh="Solid_mesh" from="Fluid" to="Solid"/>
<exchange data="Displacement" mesh="Solid_mesh" from="Solid" to="Fluid" initialize="0"/>

</coupling-scheme:serial-explicit-->

</solver-interface>

Expand Down
9 changes: 9 additions & 0 deletions FSI/cylinderFlap_2D/OpenFOAM-deal.II/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Fluid
!Fluid/0
!Fluid/0.orig
!Fluid/constant
!Fluid/system
!Fluid/Fluid.foam
*.vtk
*.log
~
5 changes: 4 additions & 1 deletion FSI/cylinderFlap_2D/OpenFOAM-deal.II/Allclean
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ cd ./Solid/dealii_output
# Clean the case
echo "Cleaning Solid case"
rm -fv solution-*.vtk
cd ../..
cd ..
rm -fv solution-*.vtk
cd ..

# Remove the log files
rm -fv ${Participant2}.log

Expand Down
Loading