From ef1072bad66c36e40947a147b3fb010b7fb96186 Mon Sep 17 00:00:00 2001 From: D Schneider <dav.schneider@tum.de> Date: Sat, 7 Nov 2020 10:22:56 +0100 Subject: [PATCH 1/8] Change precice config, resolves #94 --- .../OpenFOAM-deal.II/precice-config.xml | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml index e9752efed..f2b7ee274 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml @@ -29,7 +29,9 @@ <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="read" from="Solid_mesh" to="Fluid-Mesh-Nodes" constraint="consistent"/> + <!--mapping:rbf-compact-tps-c2 direction="read" from="Solid_mesh" to="Fluid-Mesh-Nodes" support-radius="0.011" constraint="consistent"/--> </participant> <participant name="Solid"> @@ -40,42 +42,44 @@ <write-data name="Displacement" mesh="Solid_mesh"/> <watch-point mesh="Solid_mesh" name="flap_tip" coordinate="0.6;0.2" /> <mapping:rbf-thin-plate-splines direction="read" from="Fluid-Mesh-Centers" to="Solid_mesh" constraint="consistent" /> + <!--mapping:rbf-compact-tps-c2 direction="read" from="Fluid-Mesh-Centers" to="Solid_mesh" support-radius="0.011" constraint="consistent" /--> </participant> <m2n:sockets from="Fluid" to="Solid" /> <coupling-scheme:parallel-implicit> - <time-window-size value="0.002"/> + <time-window-size value="1e-3"/> <max-time value="15"/> <participants first="Fluid" second="Solid"/> <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"/> - <relative-convergence-measure limit="5e-5" data="Stress" mesh="Fluid-Mesh-Centers"/> - <relative-convergence-measure limit="5e-5" data="Displacement" mesh="Solid_mesh"/> + <relative-convergence-measure limit="1e-4" data="Stress" mesh="Fluid-Mesh-Centers"/> + <relative-convergence-measure limit="1e-4" data="Displacement" mesh="Solid_mesh"/> <extrapolation-order value="2"/> <acceleration:IQN-ILS> - <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"/> + <data name="Displacement" mesh="Solid_mesh"/> + <data name="Stress" mesh="Fluid-Mesh-Centers"/> + <preconditioner type="residual-sum"/> + <filter type="QR2" limit="1.2e-3"/> + <initial-relaxation value="0.1"/> + <max-used-iterations value="60"/> + <time-windows-reused value="15"/> </acceleration:IQN-ILS> - </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"/> + <!--acceleration:IQN-IMVJ> + <data name="Displacement" mesh="Solid_mesh" scaling="1.0"/> + <data name="Stress" mesh="Fluid-Mesh-Centers" scaling="100"/> + <initial-relaxation value="0.1"/> + <preconditioner type="residual-sum"/> + <filter type="QR2" limit="1.2e-3"/> + <max-used-iterations value="60"/> + <time-windows-reused value="0"/> + </acceleration:IQN-IMVJ--> - </coupling-scheme:serial-explicit--> + </coupling-scheme:parallel-implicit> </solver-interface> From f6f447b82719c637599ac641dc7121bcb79c7d47 Mon Sep 17 00:00:00 2001 From: D Schneider <dav.schneider@tum.de> Date: Sat, 7 Nov 2020 10:31:33 +0100 Subject: [PATCH 2/8] Synchronize simulation control settings --- .../OpenFOAM-deal.II/Fluid/system/controlDict | 19 ++++++++++++++++--- .../Solid/linear_elasticity.prm | 4 ++-- .../Solid/nonlinear_elasticity.prm | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/controlDict b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/controlDict index bfc387ea7..e41a45e50 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/controlDict +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/controlDict @@ -13,6 +13,8 @@ FoamFile application pimpleFoam; // OpenFOAM v1806, OpenFOAM 6, or newer // application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older +libs ( "libgroovyBC.so" ) ; + startFrom startTime; startTime 0; @@ -21,11 +23,11 @@ stopAt endTime; endTime 15; -deltaT 0.002; +deltaT 1e-3; writeControl adjustableRunTime; -writeInterval 100.; +writeInterval 0.1; purgeWrite 0; @@ -37,10 +39,21 @@ writeCompression off; timeFormat general; -timePrecision 12; +timePrecision 8; functions { + forces + { + type forces; + libs ( "libforces.so" ); + patches (cylinder flap); + rho rhoInf; + log true; + rhoInf 1000; + CofR (0 0 0); + } + preCICE_Adapter { type preciceAdapterFunctionObject; diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Solid/linear_elasticity.prm b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Solid/linear_elasticity.prm index b71f48598..7a1cd6c9e 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Solid/linear_elasticity.prm +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Solid/linear_elasticity.prm @@ -7,10 +7,10 @@ subsection Time set End time = 15 # Time step size - set Time step size = 0.002 + set Time step size = 0.001 # Write results every x timesteps - set Output interval = 100 + set Output interval = 100 end subsection Discretization diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Solid/nonlinear_elasticity.prm b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Solid/nonlinear_elasticity.prm index 303f42c05..f01a4c78b 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Solid/nonlinear_elasticity.prm +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Solid/nonlinear_elasticity.prm @@ -7,7 +7,7 @@ subsection Time set End time = 15 # Time step size - set Time step size = 0.002 + set Time step size = 0.001 # Output interval set Output interval = 100 From 63f2ccd7dd1ccf822ed659630ec96db9c5e5ca1a Mon Sep 17 00:00:00 2001 From: D Schneider <dav.schneider@tum.de> Date: Sat, 7 Nov 2020 10:46:23 +0100 Subject: [PATCH 3/8] Add different meshes and new decomposition --- .../Fluid/system/blockMeshDict | 34 +- .../Fluid/system/blockMeshDict_double_refined | 346 ++++++++++++++++++ .../Fluid/system/blockMeshDict_refined | 346 ++++++++++++++++++ .../Fluid/system/decomposeParDict | 4 +- 4 files changed, 711 insertions(+), 19 deletions(-) create mode 100644 FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict_double_refined create mode 100644 FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict_refined diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict index 24eb36623..425ae6864 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict @@ -7,28 +7,28 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 1; +scale 1; -// Geometry parameters -f -0.5; // z-front -b 0.5; // z-back +f -0.1; // z-front +b 0.1; // z-back // Grid refinement parameters -H1 13; // Nx first block -H2 17; // Nx second block -H3 34; // Nx third block -H4 65; // Nx last block -H5 9; // amount of cells above/below flap - -V1 13; // Ny first inlet/outlet block -V2 17; // Ny second inlet block -V3 10; // Amount of cells in radius -V4 9; // Ny above/blow flap to back -V5 14; // Ny top inlet/outlet block -V6 2; // Ny after flap +H1 21; // Nx first block +H2 35; // Nx second block +H3 78; // Nx third block flap in x +H4 120; // Nx last block +H5 14; // amount of cells above/below flap + +V1 22; // Ny first inlet/outlet block: Bottom wall to flap block +V2 35; // Ny second inlet block +V3 20; // Amount of cells in radius +V4 14; // Ny above/blow flap to back +V5 23; // Ny top inlet/outlet block: Top wall to flap block +V6 5; // Ny after flap GR 2.5; // Circular mesh gradient -GO 8; // Outlet grading +GO 11.5; // Outlet grading + vertices ( diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict_double_refined b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict_double_refined new file mode 100644 index 000000000..537e359e2 --- /dev/null +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict_double_refined @@ -0,0 +1,346 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +// Geometry parameters +f -0.1; // z-front +b 0.1; // z-back + +// Grid refinement parameters +H1 34; // Nx first block +H2 50; // Nx second block +H3 125; // Nx third block flap in x +H4 150; // Nx last block +H5 25; // amount of cells above/below flap + +V1 34; // Ny first inlet/outlet block: Wall to flap block +V2 50; // Ny second inlet block +V3 26; // Amount of cells in radius +V4 25; // Ny above/blow flap to back +V5 33; // Ny top inlet/outlet block: Wall to flap block +V6 8; // Ny after flap + +GR 2.5; // Circular mesh gradient +GO 11; // Outlet grading + + +vertices +( + // Block 0 + (0 0 $f) // vertex 0 + (0.119526 0 $f) + (0.119526 0.119526 $f) + (0 0.119526 $f) // vertex 3 + + (0 0 $b) // vertex 4 + (0.119526 0 $b) + (0.119526 0.119526 $b) + (0 0.119526 $b) // vertex 7 + + // Block 1 + (0.280474 0 $f) // vertex 8 + (0.280474 0.119526 $f) + + (0.280474 0 $b) // vertex 10 + (0.280474 0.119526 $b) + + // Block 2 + (0.6 0 $f) // vertex 12 + (0.6 0.119526 $f) + + (0.6 0 $b) // vertex 14 + (0.6 0.119526 $b) + + // Block 3 + (2.5 0 $f) // vertex 16 + (2.5 0.119526 $f) + + (2.5 0 $b) // vertex 18 + (2.5 0.119526 $b) + + // Block 4 + (0.119526 0.280474 $f) // vertex 20 + (0 0.280474 $f) + + (0.119526 0.280474 $b) // vertex 22 + (0 0.280474 $b) + + // Block 5 + (0.164645 0.164645 $f) // vertex 24 + (0.164656 0.235355 $f) + + (0.164645 0.164645 $b) // vertex 26 + (0.164656 0.235355 $b) + + // Block 6 + (0.231623 0.16127 $f) // vertex 28 + (0.231623 0.16127 $b) + + // Block 7 + (0.299528 0.19 $f) // vertex 30 + (0.24899 0.19 $f) + + (0.299528 0.19 $b) // vertex 32 + (0.24899 0.19 $b) + + // Block 8 + (0.6 0.19 $f) // vertex 34 + (0.6 0.19 $b) + + // Block 9 + (2.5 0.19 $f) // vertex 36 + (2.5 0.19 $b) + + // Block 10 + (0.280474 0.280474 $f) // vertex 38 + (0.231623 0.238730 $f) + + (0.280474 0.280474 $b) // vertex 40 + (0.231623 0.238730 $b) + + // Block 11 + (0.299528 0.21 $f) // vertex 42 + (0.24899 0.21 $f) + + (0.299528 0.21 $b) // vertex 44 + (0.24899 0.21 $b) + + // Block 12 + (0.6 0.21 $f) // vertex 46 + (0.6 0.280474 $f) + + (0.6 0.21 $b) // vertex 48 + (0.6 0.280474 $b) + + // Block 14 + (2.5 0.21 $f) // vertex 50 + (2.5 0.280474 $f) + + (2.5 0.21 $b) // vertex 52 + (2.5 0.280474 $b) + + // Block 15 + (0.119526 0.41 $f) // vertex 54 + (0 0.41 $f) + + (0.119526 0.41 $b) // vertex 56 + (0 0.41 $b) + + // Block 16 + (0.280474 0.41 $f) // vertex 58 + (0.280474 0.41 $b) + + // Block 17 + (0.6 0.41 $f) // vertex 60 + (0.6 0.41 $b) + + // Block 18 + (2.5 0.41 $f) // vertex 62 + (2.5 0.41 $b) +); + + +blocks +( + // Block 0 - 4 + hex ( 0 1 2 3 4 5 6 7) ($H1 $V1 1) simpleGrading (1 1 1) + hex ( 1 8 9 2 5 10 11 6) ($H2 $V1 1) simpleGrading (1 1 1) + hex ( 8 12 13 9 10 14 15 11) ($H3 $V1 1) simpleGrading (1 1 1) + hex (12 16 17 13 14 18 19 15) ($H4 $V1 1) simpleGrading ($GO 1 1) + hex ( 3 2 20 21 7 6 22 23) ($H1 $V2 1) simpleGrading (1 1 1) + + // Block 5 - 9 + hex (24 25 20 2 26 27 22 6) ($H2 $V3 1) simpleGrading (1 $GR 1) + hex (28 24 2 9 29 26 6 11) ($H2 $V3 1) simpleGrading (1 $GR 1) + hex (31 28 9 30 33 29 11 32) ($H5 $V3 1) simpleGrading (1 $GR 1) + hex ( 9 13 34 30 11 15 35 32) ($H3 $V4 1) simpleGrading (1 1 1) + hex (13 17 36 34 15 19 37 35) ($H4 $V4 1) simpleGrading ($GO 1 1) + + // Block 10 - 14 + hex (25 39 38 20 27 41 40 22) ($H2 $V3 1) simpleGrading (1 $GR 1) + hex (39 43 42 38 41 45 44 40) ($H5 $V3 1) simpleGrading (1 $GR 1) + hex (42 46 47 38 44 48 49 40) ($H3 $V4 1) simpleGrading (1 1 1) + hex (34 36 50 46 35 37 52 48) ($H4 $V6 1) simpleGrading ($GO 1 1) + hex (46 50 51 47 48 52 53 49) ($H4 $V4 1) simpleGrading ($GO 1 1) + + // Block 15 - 18 + hex (21 20 54 55 23 22 56 57) ($H1 $V5 1) simpleGrading (1 1 1) + hex (20 38 58 54 22 40 59 56) ($H2 $V5 1) simpleGrading (1 1 1) + hex (38 47 60 58 40 49 61 59) ($H3 $V5 1) simpleGrading (1 1 1) + hex (47 51 62 60 49 53 63 61) ($H4 $V5 1) simpleGrading ($GO 1 1) +); + +edges +( + arc 9 2 (0.2 0.1 $f) // Block 1 + arc 11 6 (0.2 0.1 $b) + + arc 2 20 (0.1 0.2 $f) // Block 4 + arc 6 22 (0.1 0.2 $b) + + arc 24 25 (0.15 0.2 $f) // Block 5 + arc 26 27 (0.15 0.2 $b) + + arc 24 28 (0.2 0.15 $f) // Block 6 + arc 26 29 (0.2 0.15 $b) + + arc 9 30 (0.293144 0.156475 $f) // Block 7 + arc 28 31 (0.243369 0.175117 $f) + arc 11 32 (0.293144 0.156475 $b) // Block 7 + arc 29 33 (0.243369 0.175117 $b) + + arc 20 38 (0.2 0.3 $f) // Block 10 + arc 25 39 (0.2 0.25 $f) + arc 22 40 (0.2 0.3 $b) // Block 10 + arc 27 41 (0.2 0.25 $b) + + arc 39 43 (0.24092 0.228733 $f) // Block 11 + arc 41 45 (0.24092 0.228733 $b) + arc 38 42 (0.291756 0.248208 $f) // Block 11 + arc 40 44 (0.291756 0.248208 $b) +); + +boundary +( + front + { + type empty; + faces + ( + (0 1 2 3) + (3 2 20 21) + (21 20 55 54) + (1 8 9 2) + (2 9 28 24) + (2 24 25 20) + (25 39 38 20) + (20 38 58 54) + (9 30 31 28) + (43 42 38 39) + (8 12 13 9) + (9 13 34 30) + (42 46 47 38) + (38 47 60 58) + (12 16 17 13) + (13 17 36 34) + (34 36 50 46) + (46 50 51 47) + (47 51 62 60) + ); + } + + back + { + type empty; + faces + ( + (4 5 6 7) + (7 6 22 23) + (23 22 56 57) + (5 10 11 6) + (6 11 29 26) + (6 26 27 22) + (27 41 40 22) + (22 40 59 56) + (11 32 33 29) + (45 44 40 41) + (10 14 15 11) + (11 15 35 32) + (44 48 49 40) + (40 49 61 59) + (14 18 19 15) + (15 19 37 35) + (35 37 52 48) + (48 52 53 49) + (49 53 63 61) + ); + } + + inlet + { + type patch; + faces + ( + ( 0 4 7 3) + ( 3 7 23 21) + (21 23 57 55) + ); + } + + outlet + { + type patch; + faces + ( + (16 18 19 17) + (17 19 37 36) + (36 37 52 50) + (50 52 53 51) + (51 53 63 62) + ); + } + + top + { + type wall; + faces + ( + (55 54 56 57) + (54 58 59 56) + (58 60 61 59) + (60 62 63 61) + ); + } + + bottom + { + type wall; + faces + ( + (0 1 5 4) + (1 8 10 5) + (8 12 14 10) + (12 16 18 14) + ); + } + + flap + { + type wall; + faces + ( + (31 30 32 33) + (30 34 35 32) + (34 35 48 46) + (42 46 48 44) + (43 42 44 45) + ); + } + + cylinder + { + type wall; + faces + ( + (24 28 29 26) + (28 31 33 29) + (43 39 41 45) + (39 25 27 41) + (25 24 26 27) + ); + } +); + +mergePatchPairs +( +); + + +// ************************************************************************* // diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict_refined b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict_refined new file mode 100644 index 000000000..735b3418b --- /dev/null +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/blockMeshDict_refined @@ -0,0 +1,346 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +// Geometry parameters +f -0.1; // z-front +b 0.1; // z-back + +// Grid refinement parameters +H1 34; // Nx first block +H2 45; // Nx second block +H3 88; // Nx third block flap in x +H4 130; // Nx last block +H5 24; // amount of cells above/below flap + +V1 34; // Ny first inlet/outlet block: Wall to flap block +V2 45; // Ny second inlet block +V3 26; // Amount of cells in radius +V4 24; // Ny above/blow flap to back +V5 37; // Ny top inlet/outlet block: Wall to flap block +V6 5; // Ny after flap + +GR 2.5; // Circular mesh gradient +GO 8; // Outlet grading + + +vertices +( + // Block 0 + (0 0 $f) // vertex 0 + (0.119526 0 $f) + (0.119526 0.119526 $f) + (0 0.119526 $f) // vertex 3 + + (0 0 $b) // vertex 4 + (0.119526 0 $b) + (0.119526 0.119526 $b) + (0 0.119526 $b) // vertex 7 + + // Block 1 + (0.280474 0 $f) // vertex 8 + (0.280474 0.119526 $f) + + (0.280474 0 $b) // vertex 10 + (0.280474 0.119526 $b) + + // Block 2 + (0.6 0 $f) // vertex 12 + (0.6 0.119526 $f) + + (0.6 0 $b) // vertex 14 + (0.6 0.119526 $b) + + // Block 3 + (2.5 0 $f) // vertex 16 + (2.5 0.119526 $f) + + (2.5 0 $b) // vertex 18 + (2.5 0.119526 $b) + + // Block 4 + (0.119526 0.280474 $f) // vertex 20 + (0 0.280474 $f) + + (0.119526 0.280474 $b) // vertex 22 + (0 0.280474 $b) + + // Block 5 + (0.164645 0.164645 $f) // vertex 24 + (0.164656 0.235355 $f) + + (0.164645 0.164645 $b) // vertex 26 + (0.164656 0.235355 $b) + + // Block 6 + (0.231623 0.16127 $f) // vertex 28 + (0.231623 0.16127 $b) + + // Block 7 + (0.299528 0.19 $f) // vertex 30 + (0.24899 0.19 $f) + + (0.299528 0.19 $b) // vertex 32 + (0.24899 0.19 $b) + + // Block 8 + (0.6 0.19 $f) // vertex 34 + (0.6 0.19 $b) + + // Block 9 + (2.5 0.19 $f) // vertex 36 + (2.5 0.19 $b) + + // Block 10 + (0.280474 0.280474 $f) // vertex 38 + (0.231623 0.238730 $f) + + (0.280474 0.280474 $b) // vertex 40 + (0.231623 0.238730 $b) + + // Block 11 + (0.299528 0.21 $f) // vertex 42 + (0.24899 0.21 $f) + + (0.299528 0.21 $b) // vertex 44 + (0.24899 0.21 $b) + + // Block 12 + (0.6 0.21 $f) // vertex 46 + (0.6 0.280474 $f) + + (0.6 0.21 $b) // vertex 48 + (0.6 0.280474 $b) + + // Block 14 + (2.5 0.21 $f) // vertex 50 + (2.5 0.280474 $f) + + (2.5 0.21 $b) // vertex 52 + (2.5 0.280474 $b) + + // Block 15 + (0.119526 0.41 $f) // vertex 54 + (0 0.41 $f) + + (0.119526 0.41 $b) // vertex 56 + (0 0.41 $b) + + // Block 16 + (0.280474 0.41 $f) // vertex 58 + (0.280474 0.41 $b) + + // Block 17 + (0.6 0.41 $f) // vertex 60 + (0.6 0.41 $b) + + // Block 18 + (2.5 0.41 $f) // vertex 62 + (2.5 0.41 $b) +); + + +blocks +( + // Block 0 - 4 + hex ( 0 1 2 3 4 5 6 7) ($H1 $V1 1) simpleGrading (1 1 1) + hex ( 1 8 9 2 5 10 11 6) ($H2 $V1 1) simpleGrading (1 1 1) + hex ( 8 12 13 9 10 14 15 11) ($H3 $V1 1) simpleGrading (1 1 1) + hex (12 16 17 13 14 18 19 15) ($H4 $V1 1) simpleGrading ($GO 1 1) + hex ( 3 2 20 21 7 6 22 23) ($H1 $V2 1) simpleGrading (1 1 1) + + // Block 5 - 9 + hex (24 25 20 2 26 27 22 6) ($H2 $V3 1) simpleGrading (1 $GR 1) + hex (28 24 2 9 29 26 6 11) ($H2 $V3 1) simpleGrading (1 $GR 1) + hex (31 28 9 30 33 29 11 32) ($H5 $V3 1) simpleGrading (1 $GR 1) + hex ( 9 13 34 30 11 15 35 32) ($H3 $V4 1) simpleGrading (1 1 1) + hex (13 17 36 34 15 19 37 35) ($H4 $V4 1) simpleGrading ($GO 1 1) + + // Block 10 - 14 + hex (25 39 38 20 27 41 40 22) ($H2 $V3 1) simpleGrading (1 $GR 1) + hex (39 43 42 38 41 45 44 40) ($H5 $V3 1) simpleGrading (1 $GR 1) + hex (42 46 47 38 44 48 49 40) ($H3 $V4 1) simpleGrading (1 1 1) + hex (34 36 50 46 35 37 52 48) ($H4 $V6 1) simpleGrading ($GO 1 1) + hex (46 50 51 47 48 52 53 49) ($H4 $V4 1) simpleGrading ($GO 1 1) + + // Block 15 - 18 + hex (21 20 54 55 23 22 56 57) ($H1 $V5 1) simpleGrading (1 1 1) + hex (20 38 58 54 22 40 59 56) ($H2 $V5 1) simpleGrading (1 1 1) + hex (38 47 60 58 40 49 61 59) ($H3 $V5 1) simpleGrading (1 1 1) + hex (47 51 62 60 49 53 63 61) ($H4 $V5 1) simpleGrading ($GO 1 1) +); + +edges +( + arc 9 2 (0.2 0.1 $f) // Block 1 + arc 11 6 (0.2 0.1 $b) + + arc 2 20 (0.1 0.2 $f) // Block 4 + arc 6 22 (0.1 0.2 $b) + + arc 24 25 (0.15 0.2 $f) // Block 5 + arc 26 27 (0.15 0.2 $b) + + arc 24 28 (0.2 0.15 $f) // Block 6 + arc 26 29 (0.2 0.15 $b) + + arc 9 30 (0.293144 0.156475 $f) // Block 7 + arc 28 31 (0.243369 0.175117 $f) + arc 11 32 (0.293144 0.156475 $b) // Block 7 + arc 29 33 (0.243369 0.175117 $b) + + arc 20 38 (0.2 0.3 $f) // Block 10 + arc 25 39 (0.2 0.25 $f) + arc 22 40 (0.2 0.3 $b) // Block 10 + arc 27 41 (0.2 0.25 $b) + + arc 39 43 (0.24092 0.228733 $f) // Block 11 + arc 41 45 (0.24092 0.228733 $b) + arc 38 42 (0.291756 0.248208 $f) // Block 11 + arc 40 44 (0.291756 0.248208 $b) +); + +boundary +( + front + { + type empty; + faces + ( + (0 1 2 3) + (3 2 20 21) + (21 20 55 54) + (1 8 9 2) + (2 9 28 24) + (2 24 25 20) + (25 39 38 20) + (20 38 58 54) + (9 30 31 28) + (43 42 38 39) + (8 12 13 9) + (9 13 34 30) + (42 46 47 38) + (38 47 60 58) + (12 16 17 13) + (13 17 36 34) + (34 36 50 46) + (46 50 51 47) + (47 51 62 60) + ); + } + + back + { + type empty; + faces + ( + (4 5 6 7) + (7 6 22 23) + (23 22 56 57) + (5 10 11 6) + (6 11 29 26) + (6 26 27 22) + (27 41 40 22) + (22 40 59 56) + (11 32 33 29) + (45 44 40 41) + (10 14 15 11) + (11 15 35 32) + (44 48 49 40) + (40 49 61 59) + (14 18 19 15) + (15 19 37 35) + (35 37 52 48) + (48 52 53 49) + (49 53 63 61) + ); + } + + inlet + { + type patch; + faces + ( + ( 0 4 7 3) + ( 3 7 23 21) + (21 23 57 55) + ); + } + + outlet + { + type patch; + faces + ( + (16 18 19 17) + (17 19 37 36) + (36 37 52 50) + (50 52 53 51) + (51 53 63 62) + ); + } + + top + { + type wall; + faces + ( + (55 54 56 57) + (54 58 59 56) + (58 60 61 59) + (60 62 63 61) + ); + } + + bottom + { + type wall; + faces + ( + (0 1 5 4) + (1 8 10 5) + (8 12 14 10) + (12 16 18 14) + ); + } + + flap + { + type wall; + faces + ( + (31 30 32 33) + (30 34 35 32) + (34 35 48 46) + (42 46 48 44) + (43 42 44 45) + ); + } + + cylinder + { + type wall; + faces + ( + (24 28 29 26) + (28 31 33 29) + (43 39 41 45) + (39 25 27 41) + (25 24 26 27) + ); + } +); + +mergePatchPairs +( +); + + +// ************************************************************************* // diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/decomposeParDict b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/decomposeParDict index c72a5d50e..59d2ad529 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/decomposeParDict +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/decomposeParDict @@ -8,12 +8,12 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - numberOfSubdomains 6; + numberOfSubdomains 25; method hierarchical; hierarchicalCoeffs { - n (3 2 1); + n (5 5 1); delta 0.001; order xyz; } From cb33712f90276d2b9517a568cfb85e04c09d06bd Mon Sep 17 00:00:00 2001 From: D Schneider <dav.schneider@tum.de> Date: Sat, 7 Nov 2020 10:58:56 +0100 Subject: [PATCH 4/8] Adjust solver settings --- .../OpenFOAM-deal.II/Fluid/system/fvSchemes | 16 +---- .../OpenFOAM-deal.II/Fluid/system/fvSolution | 65 +++++++++++-------- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/fvSchemes b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/fvSchemes index b2d960d05..d95144988 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/fvSchemes +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/fvSchemes @@ -15,13 +15,13 @@ FoamFile gradSchemes { - default Gauss linear; + default cellLimited Gauss linear 1; } divSchemes { default none; - div(phi,U) bounded Gauss linearUpwind limited; + div(phi,U) Gauss linearUpwind grad(U); div((nuEff*dev2(T(grad(U))))) Gauss linear; } @@ -39,15 +39,3 @@ FoamFile { default corrected; } - - wallDist - { - method meshWave; - } - - fluxRequired - { - default no; - p ; - Phi ; - } diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/fvSolution b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/fvSolution index 886a252ec..d559f7d2f 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/fvSolution +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/system/fvSolution @@ -13,24 +13,33 @@ solvers p { solver GAMG; - tolerance 1e-10; - relTol 1e-6; + tolerance 1e-6; + relTol 1e-5; smoother DICGaussSeidel; } pFinal { $p; + tolerance 1e-07; relTol 0; } + pcorr + { + solver GAMG; + tolerance 1e-5; + relTol 1e-4; + smoother GaussSeidel; + } + pcorrFinal { - $p; + $pcorr; relTol 0; } - Phi + phi { $p; } @@ -39,7 +48,7 @@ solvers { solver smoothSolver; smoother symGaussSeidel; - tolerance 1e-10; + tolerance 1e-8; relTol 1e-6; } @@ -52,45 +61,49 @@ solvers PIMPLE { + nOuterCorrectors 50; nCorrectors 2; - nNonOrthogonalCorrectors 0; - tolerance 1.0e-14; - relTol 5e-3; + nNonOrthogonalCorrectors 1; + tolerance 1.0e-12; + + correctPhi yes; + relTol 1e-4; pisoTol 1e-6; consistent true; - nOuterCorrectors 50; - // OpenFOAM (.com), OpenFOAM 5 or older (.org) - /* residualControl { - U - { - tolerance 5e-5; - relTol 0; - } - p - { - tolerance 5e-4; - relTol 0; - } + U + { + tolerance 1e-5; + relTol 0; + } + + p + { + tolerance 1e-5; + relTol 0; + } } - */ // OpenFOAM 6 (.org) or newer /* residualControl { - U 5e-5; - p 5e-4; + U 1e-5; + p 1e-5; } */ -} +} +PISO +{ + nNonOrthogonalCorrectors 1; +} potentialFlow { - nNonOrthogonalCorrectors 5; + nNonOrthogonalCorrectors 1; } From 5f514bcacc9a1196452e92ba94e86364d0e97091 Mon Sep 17 00:00:00 2001 From: D Schneider <dav.schneider@tum.de> Date: Sat, 7 Nov 2020 11:09:42 +0100 Subject: [PATCH 5/8] Add parabolic initial condition and add link in the README --- FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/0.orig/U | 13 +++++-------- .../OpenFOAM-deal.II/Fluid/constant/dynamicMeshDict | 0 FSI/cylinderFlap_2D/OpenFOAM-deal.II/README.md | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) mode change 100755 => 100644 FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/constant/dynamicMeshDict diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/0.orig/U b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/0.orig/U index d5a072d6e..c194d2abe 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/0.orig/U +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/0.orig/U @@ -37,14 +37,11 @@ boundaryField inlet { - // Time-varying inlet velocity - type uniformFixedValue; - uniformValue table - ( - ( 0 ( 0 0 0 ) ) - ( 2. ( 2. 0 0 ) ) - ( 100 ( 2. 0 0 ) ) - ); + // Time-varying parabolic inlet profile + type groovyBC; + variables "yp=pts().y;minY=min(yp);maxY=max(yp);para=-1.5*(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();"; + valueExpression "time()<2 ? 0.5*(1-cos(0.5*pi*time()))*2*para : 2*para"; + value uniform (2 0 0); } outlet diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/constant/dynamicMeshDict b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/Fluid/constant/dynamicMeshDict old mode 100755 new mode 100644 diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/README.md b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/README.md index 08eccd3f7..e5142aebd 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/README.md +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/README.md @@ -1,6 +1,6 @@ # Tutorial for an FSI simulation of a cylinder-flap scenario -This tutorial is described in the [preCICE wiki](https://github.com/precice/precice/wiki/Tutorial-for-FSI-with-deal.II-and-OpenFOAM). Have also a look into our [Notes on OpenFOAM](https://github.com/precice/openfoam-adapter/wiki/Notes-on-OpenFOAM). +This tutorial requires groovyBC for the parabolic inlet profile. groovyBC is part of swak4Foam, which can be cloned from [this repository](https://github.com/Unofficial-Extend-Project-Mirror/openfoam-extend-swak4Foam-dev.git). This tutorial is described in the [preCICE wiki](https://github.com/precice/precice/wiki/Tutorial-for-FSI-with-deal.II-and-OpenFOAM). Have also a look into our [Notes on OpenFOAM](https://github.com/precice/openfoam-adapter/wiki/Notes-on-OpenFOAM). You may run the coupled simulation in serial using the script `Allrun` or (OpenFOAM) in parallel with `Allrun -parallel`. The output of each step will be redirected to log files. You can cleanup the simulation using `Allclean`. From d611eebcb0cb3cb383711e85eb05ac9857ca893d Mon Sep 17 00:00:00 2001 From: D Schneider <dav.schneider@tum.de> Date: Fri, 20 Nov 2020 11:43:44 +0100 Subject: [PATCH 6/8] Remove commented xml sections --- .../OpenFOAM-deal.II/precice-config.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml index f2b7ee274..3df7ddcc2 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml @@ -29,9 +29,7 @@ <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="read" from="Solid_mesh" to="Fluid-Mesh-Nodes" constraint="consistent"/> - <!--mapping:rbf-compact-tps-c2 direction="read" from="Solid_mesh" to="Fluid-Mesh-Nodes" support-radius="0.011" constraint="consistent"/--> </participant> <participant name="Solid"> @@ -42,7 +40,6 @@ <write-data name="Displacement" mesh="Solid_mesh"/> <watch-point mesh="Solid_mesh" name="flap_tip" coordinate="0.6;0.2" /> <mapping:rbf-thin-plate-splines direction="read" from="Fluid-Mesh-Centers" to="Solid_mesh" constraint="consistent" /> - <!--mapping:rbf-compact-tps-c2 direction="read" from="Fluid-Mesh-Centers" to="Solid_mesh" support-radius="0.011" constraint="consistent" /--> </participant> <m2n:sockets from="Fluid" to="Solid" /> @@ -68,17 +65,6 @@ <max-used-iterations value="60"/> <time-windows-reused value="15"/> </acceleration:IQN-ILS> - - <!--acceleration:IQN-IMVJ> - <data name="Displacement" mesh="Solid_mesh" scaling="1.0"/> - <data name="Stress" mesh="Fluid-Mesh-Centers" scaling="100"/> - <initial-relaxation value="0.1"/> - <preconditioner type="residual-sum"/> - <filter type="QR2" limit="1.2e-3"/> - <max-used-iterations value="60"/> - <time-windows-reused value="0"/> - </acceleration:IQN-IMVJ--> - </coupling-scheme:parallel-implicit> </solver-interface> From f6ac97380909dbc99bd6937ba808bd9830fb98c5 Mon Sep 17 00:00:00 2001 From: D Schneider <dav.schneider@tum.de> Date: Fri, 20 Nov 2020 11:48:14 +0100 Subject: [PATCH 7/8] Apply xml formatting --- .../OpenFOAM-deal.II/precice-config.xml | 107 +++++++++--------- 1 file changed, 56 insertions(+), 51 deletions(-) diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml index 3df7ddcc2..777257b01 100644 --- a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/precice-config.xml @@ -1,72 +1,77 @@ -<?xml version="1.0"?> - +<?xml version="1.0" encoding="UTF-8" ?> <precice-configuration> + <log> + <sink + filter="%Severity% > debug and %Rank% = 0" + format="---[precice] %ColorizedSeverity% %Message%" + enabled="true" /> + </log> - <log> - <sink filter="%Severity% > debug and %Rank% = 0" format="---[precice] %ColorizedSeverity% %Message%" enabled="true"/> - </log> - - <solver-interface dimensions="2"> - - <data:vector name="Stress"/> - <data:vector name="Displacement"/> + <solver-interface dimensions="2"> + <data:vector name="Stress" /> + <data:vector name="Displacement" /> <mesh name="Fluid-Mesh-Centers"> - <use-data name="Stress"/> - </mesh> + <use-data name="Stress" /> + </mesh> + <mesh name="Fluid-Mesh-Nodes"> - <use-data name="Displacement"/> + <use-data name="Displacement" /> </mesh> <mesh name="Solid_mesh"> - <use-data name="Displacement"/> - <use-data name="Stress"/> + <use-data name="Displacement" /> + <use-data name="Stress" /> </mesh> <participant name="Fluid"> - <use-mesh name="Fluid-Mesh-Nodes" provide="yes"/> - <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"/> - <mapping:rbf-thin-plate-splines direction="read" from="Solid_mesh" to="Fluid-Mesh-Nodes" constraint="consistent"/> + <use-mesh name="Fluid-Mesh-Nodes" provide="yes" /> + <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" /> + <mapping:rbf-thin-plate-splines + direction="read" + from="Solid_mesh" + to="Fluid-Mesh-Nodes" + constraint="consistent" /> </participant> <participant name="Solid"> - <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" /> - <mapping:rbf-thin-plate-splines direction="read" from="Fluid-Mesh-Centers" to="Solid_mesh" constraint="consistent" /> + <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" /> + <mapping:rbf-thin-plate-splines + direction="read" + from="Fluid-Mesh-Centers" + to="Solid_mesh" + constraint="consistent" /> </participant> <m2n:sockets from="Fluid" to="Solid" /> <coupling-scheme:parallel-implicit> - <time-window-size value="1e-3"/> - <max-time value="15"/> - <participants first="Fluid" second="Solid"/> - <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"/> - <relative-convergence-measure limit="1e-4" data="Stress" mesh="Fluid-Mesh-Centers"/> - <relative-convergence-measure limit="1e-4" data="Displacement" mesh="Solid_mesh"/> - <extrapolation-order value="2"/> - - <acceleration:IQN-ILS> - <data name="Displacement" mesh="Solid_mesh"/> - <data name="Stress" mesh="Fluid-Mesh-Centers"/> - <preconditioner type="residual-sum"/> - <filter type="QR2" limit="1.2e-3"/> - <initial-relaxation value="0.1"/> - <max-used-iterations value="60"/> - <time-windows-reused value="15"/> - </acceleration:IQN-ILS> + <time-window-size value="1e-3" /> + <max-time value="15" /> + <participants first="Fluid" second="Solid" /> + <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" /> + <relative-convergence-measure limit="1e-4" data="Stress" mesh="Fluid-Mesh-Centers" /> + <relative-convergence-measure limit="1e-4" data="Displacement" mesh="Solid_mesh" /> + <extrapolation-order value="2" /> + <acceleration:IQN-ILS> + <data name="Displacement" mesh="Solid_mesh" /> + <data name="Stress" mesh="Fluid-Mesh-Centers" /> + <preconditioner type="residual-sum" /> + <filter type="QR2" limit="1.2e-3" /> + <initial-relaxation value="0.1" /> + <max-used-iterations value="60" /> + <time-windows-reused value="15" /> + </acceleration:IQN-ILS> </coupling-scheme:parallel-implicit> - - </solver-interface> - + </solver-interface> </precice-configuration> From 13b3ff55f758cf5b09f7061b8a1dd270b31a76c5 Mon Sep 17 00:00:00 2001 From: D Schneider <dav.schneider@tum.de> Date: Fri, 20 Nov 2020 12:31:03 +0100 Subject: [PATCH 8/8] Add plotDisplacement script --- FSI/cylinderFlap_2D/OpenFOAM-deal.II/plotDisplacement.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 FSI/cylinderFlap_2D/OpenFOAM-deal.II/plotDisplacement.sh diff --git a/FSI/cylinderFlap_2D/OpenFOAM-deal.II/plotDisplacement.sh b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/plotDisplacement.sh new file mode 100755 index 000000000..7dbdf9efe --- /dev/null +++ b/FSI/cylinderFlap_2D/OpenFOAM-deal.II/plotDisplacement.sh @@ -0,0 +1,9 @@ +#! /bin/bash +gnuplot -p << EOF + set grid + set title 'y-displacement of the flap tip' + set xlabel 'time [s]' + set ylabel 'y-displacement [m]' + set linestyle 1 lt 2 lc 1 # red-dashed + plot "precice-Solid-watchpoint-flap_tip.log" using 1:5 with lines +EOF