Skip to content

Commit f36b16d

Browse files
LuckabarbeauPierreLaurentinCSblaisboguevremontOGaboriault
authored
Add 3D motion of non spherical objects (chaos-polymtl#979)
Description of the problem This PR aims to add support for the coupled angular motion of any 3D object. This includes the coupling with the fluid and the DEM interaction between these objects. The following elements are added: integration of the Euler angles in the DEM and in the CFD coupling, relevant parameters for the inertia and volume of the objects, A function to evaluate the distance between the two objects using the intersection of their level-set and their bounding box, a set of three boolean parameters that aimed at limiting the number of call to the DEM calculation. While implementing these features, two bugs were found: A bug that affected the evaluation of the force when two particles were in contact. This bug was changing the force evaluation on a particle depending on the number of processors that were used. This bug comes from overconstrained cells (cells with all their DOF imposed by boundary conditions were poorly treated in the force evaluation). This modification changed the results of a few tests where contact played a role. However, the solution's behavior does not change significantly, and new results still agree well with previous results for cases with particle contact. The modification to the function generate_cut_cell_map and force_evaluation only addresses this bug. Another bug for the evaluation of the gradient of superquadric was found. The gradient had a sign error if evaluated inside of the particle. The evaluation of the supequadric was also optimized by avoiding overshoot. The new inertia required a modification of the load particle from the file option. To add the possibility of defining the inertia matrix in the load particle from the file option, we modified the syntax to be semicolon-separated instead of space-separated and added the volume variable. Description of the solution Add support for integrating the Euler angle in the coupling formulation and in the DEM. Move all the DEM calculations for contact force in the ib_particle_dem to take the contact point into account correctly and simplify the code. Add the new function in the shape classes called distance_to_shape. This function looks for the minimum of the level set defined by the intersection of two shapes. Using this minimum, we can evaluate the overlap of the two shapes. This function combines a Cartesian search with a gradient direction search and a numerical gradient descent. How Has This Been Tested? A new test was added that modeled two ellipsoids in contact with each other and a wall. All previous tests were verified, and an investigation was performed when the results were modified (e.g., pp_contact_test). Previous examples were tested and run successfully. A modified example was performed to test multiple superquadric shapes (64). Documentation The documentation was updated to reflect the new options and add some tips on using the new feature. Future changes This feature version remains experimental, and more tests and validation should be performed. An example with a validation case should be added. Co-authored-by: Pierre <[email protected]> Co-authored-by: Bruno Blais <[email protected]> Co-authored-by: Olivier Guévremont <[email protected]> Co-authored-by: OGaboriault <[email protected]> Co-authored-by: Victor Oliveira Ferreira <[email protected]> Co-authored-by: PierreLaurentinCS <[email protected]> Former-commit-id: 72412e7
1 parent 668a3d6 commit f36b16d

File tree

55 files changed

+4954
-2537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4954
-2537
lines changed

applications_tests/lethe-fluid-sharp/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ file(COPY check_point.triangulation DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/che
1313
file(COPY check_point.triangulation.info DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/check_point.${_build_type}/mpirun=1/")
1414
file(COPY check_point.triangulation_fixed.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/check_point.${_build_type}/mpirun=1/")
1515
file(COPY ib_force.00.dat DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/check_point.${_build_type}/mpirun=1/")
16-
file(COPY particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/load_particles_from_file_test.${_build_type}/mpirun=1/")
16+
file(COPY particles.input DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/load_particles_from_file_test.${_build_type}/mpirun=1/")
1717
file(COPY rbf_test_shape.input DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/flow_around_rbf.${_build_type}/mpirun=1/")
1818
file(COPY helix_composite_shape DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavatappi_composite_test.${_build_type}/mpirun=1/")
1919
file(COPY spooky_composite_shape DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/spooky_composite_test.${_build_type}/mpirun=1/")
@@ -29,4 +29,5 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
2929
set_tests_properties(lethe-fluid-sharp/pp_lubrication_test.debug PROPERTIES TIMEOUT 2000)
3030
set_tests_properties(lethe-fluid-sharp/coupled_moving_stokes.mpirun=2.debug PROPERTIES TIMEOUT 2000)
3131
set_tests_properties(lethe-fluid-sharp/pw_contact_test.debug PROPERTIES TIMEOUT 2000)
32+
set_tests_properties(lethe-fluid-sharp/two_non_sphere_contact.debug PROPERTIES TIMEOUT 2000)
3233
endif()

applications_tests/lethe-fluid-sharp/almost_blocked_channels.output

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ Steady iteration: 2/2
2525
+------------------------------------------+
2626
particle_ID time T_x T_y T_z f_x f_y f_z f_xv f_yv f_zv f_xp f_yp f_zp
2727
0 2.0000 0.000000 0.000000 0.000224 0.006343 0.000008 0.000000 0.001028 0.000000 0.000000 0.005315 0.000008 0.000000
28-
1 2.0000 0.000000 0.000000 -0.000082 0.006045 0.000205 0.000000 0.000703 0.000000 0.000000 0.005342 0.000205 0.000000
28+
1 2.0000 0.000000 0.000000 -0.000078 0.006030 -0.000184 0.000000 0.000689 0.000000 0.000000 0.005341 -0.000184 0.000000
2929
2 2.0000 0.000000 0.000000 -0.000003 0.006767 -0.000333 0.000000 0.000019 0.000000 0.000000 0.006748 -0.000333 0.000000
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ID p_x p_y p_z v_x v_y v_z f_x f_y f_z f_xv f_yv f_zv f_xp f_yp f_zp omega_x omega_y omega_z T_x T_y T_z
2-
0 4.9999999990595612 12.7494136219654450 4.9999996232383346 -0.0000003761755033 -0.2345512138217047 -0.0001507046661186 -0.0000002973607462 0.0916813938745119 -0.0001193103214246 -0.0000004352142015 0.0067522410450954 -0.0000012355260728 0.0000001378534553 0.0849291528294165 -0.0001180747953518 -0.0000000925905109 0.0000000000054050 -0.0000000180642693 -0.0000370364945512 0.0000000021641789 -0.0000072258579833
3-
0 5.0000000000000000 12.7500000000000000 5.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000002973607462 0.0916813938745119 -0.0001193103214246 -0.0000004352142015 0.0067522410450954 -0.0000012355260728 0.0000001378534553 0.0849291528294165 -0.0001180747953518 0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000370364945512 0.0000000021641789 -0.0000072258579833
4-
0 5.0000000000000000 12.7500000000000000 5.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000002973607462 0.0916813938745119 -0.0001193103214246 -0.0000004352142015 0.0067522410450954 -0.0000012355260728 0.0000001378534553 0.0849291528294165 -0.0001180747953518 0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000370364945512 0.0000000021641789 -0.0000072258579833
1+
ID p_x p_y p_z v_x v_y v_z f_x f_y f_z f_xv f_yv f_zv f_xp f_yp f_zp omega_x omega_y theta_x theta_y omega_z theta_z T_x T_y T_z
2+
0 4.9999999990491526 12.7494122380370598 4.9999999990518997 -0.0000003803388930 -0.2351047851757901 -0.0000003792401519 -0.0000003030496276 0.0912431404139310 -0.0000003034800620 -0.0000004409559984 0.0068324972097559 -0.0000004409875651 0.0000001379063708 0.0844106432041751 0.0000001375075031 0.0000000182775778 -0.0000000000000049 0.0000000000456939 -0.0000000000000000 -0.0000000182776528 -0.0000000000456941 0.0000073145528819 -0.0000000000000270 -0.0000073145531960
3+
0 5.0000000000000000 12.7500000000000000 5.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000003030496276 0.0912431404139310 -0.0000003034800620 -0.0000004409559984 0.0068324972097559 -0.0000004409875651 0.0000001379063708 0.0844106432041751 0.0000001375075031 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000073145528819 -0.0000000000000270 -0.0000073145531960
4+
0 5.0000000000000000 12.7500000000000000 5.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 -0.0000003030496276 0.0912431404139310 -0.0000003034800620 -0.0000004409559984 0.0068324972097559 -0.0000004409875651 0.0000001379063708 0.0844106432041751 0.0000001375075031 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000073145528819 -0.0000000000000270 -0.0000073145531960

applications_tests/lethe-fluid-sharp/check_point.mpirun=1.output

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Running on 1 MPI rank(s)...
1010
Volume of triangulation: 1600
1111

1212
*********************************************************************************
13-
Transient iteration: 2 Time: 0.005 Time step: 0.0025 CFL: 0.00378095
13+
Transient iteration: 2 Time: 0.005 Time step: 0.0025 CFL: 0.00378987
1414
*********************************************************************************
15-
Number of active cells: 6815
16-
Number of degrees of freedom: 33652
15+
Number of active cells: 6808
16+
Number of degrees of freedom: 33596
1717
Volume of triangulation: 1600
1818
particle 0 position 5 12.7483 5
19-
particle 0 velocity -8.57092e-07 -0.452353 -0.000107099
19+
particle 0 velocity -8.61756e-07 -0.45284 -8.60545e-07
2020
+------------------------------------------+
2121
| Force summary particles |
2222
+------------------------------------------+
23-
particle_ID time T_x omega_x T_y omega_y T_z omega_z f_x v_x p_x f_y v_y p_y f_z v_z p_z f_xv f_yv f_zv f_xp f_yp f_zp
24-
0 0.0050 -0.000019 0.000000 0.000000 0.000000 -0.000012 0.000000 0.000000 -0.000001 5.000000 0.104942 -0.452353 12.748283 0.000035 -0.000107 4.999999 -0.000001 0.012389 -0.000001 0.000000 0.092552 0.000036
23+
particle_ID time T_x omega_x theta_x T_y omega_y theta_y T_z omega_z theta_z f_x v_x p_x f_y v_y p_y f_z v_z p_z f_xv f_yv f_zv f_xp f_yp f_zp
24+
0 0.0050 0.000012 0.000000 0.000000 0.000000 0.000000 0.000000 -0.000012 0.000000 0.000000 0.000000 -0.000001 5.000000 0.104994 -0.452840 12.748280 0.000000 -0.000001 5.000000 -0.000001 0.012447 -0.000001 0.000000 0.092547 0.000000

applications_tests/lethe-fluid-sharp/check_point.simulationcontrol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ dt_0 0.0025
33
dt_1 0.0025
44
dt_2 0.0025
55
dt_3 0.0025
6-
CFL 0.00378095
6+
CFL 0.00378987
77
Time 0.0025
88
Iter 1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
88e6400dc7f1fed59b7dac376737a33cac1ddc78
1+
6e3e0351c989cdc8da9f2567fa20edbcf9a17f17

applications_tests/lethe-fluid-sharp/coupled_moving_stokes.mpirun=2.output

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ Initial refinement in box - Step 1 of 1
1010
*******************************************************************************
1111
Transient iteration: 1 Time: 0.05 Time step: 0.05 CFL: 0
1212
*******************************************************************************
13-
div u : 1.51111759282e-12
14-
error at the weak BC : 0.000124532067334
15-
L2 error velocity : 0.00158956635639 L2 error pressure: 0.0369356315003
16-
particle 0 position 0.997440813995 3.1785691023e-08 3.17858210487e-08
17-
particle 0 velocity -0.0511837200951 6.35713820461e-07 6.35716420975e-07
13+
div u : 2.43466360896e-12
14+
error at the weak BC : 0.000124532071685
15+
L2 error velocity : 0.00158956636743 L2 error pressure: 0.0369356375109
16+
particle 0 position 0.997440813986 3.18006235858e-08 3.1777347325e-08
17+
particle 0 velocity -0.0511837202703 6.36012471716e-07 6.355469465e-07
1818
+------------------------------------------+
1919
| Force summary particles |
2020
+------------------------------------------+
21-
particle_ID time T_x omega_x T_y omega_y T_z omega_z f_x v_x p_x f_y v_y p_y f_z v_z p_z f_xv f_yv f_zv f_xp f_yp f_zp
22-
0 0.0500 0.000000000003 -0.000000000001 0.000452352958 0.000022626318 -0.000452352983 -0.000022626308 0.444942072384 -0.051183720095 0.997440813995 0.000013318039 0.000000635714 0.000000031786 0.000013317934 0.000000635716 0.000000031786 0.297188540782 0.000030193254 0.000030193209 0.147753531602 -0.000016875215 -0.000016875275
21+
particle_ID time T_x omega_x theta_x T_y omega_y theta_y T_z omega_z theta_z f_x v_x p_x f_y v_y p_y f_z v_z p_z f_xv f_yv f_zv f_xp f_yp f_zp
22+
0 0.0500 -0.000000000009 0.000000000008 0.000000000001 0.000452372620 0.000022619123 0.000001130956 -0.000452372613 -0.000022619130 -0.000001130956 0.444942080268 -0.051183720270 0.997440813986 0.000013306229 0.000000636012 0.000000031801 0.000013325152 0.000000635547 0.000000031777 0.297188544175 0.000030187635 0.000030195825 0.147753536094 -0.000016881406 -0.000016870673
2323

2424
********************************************************************************
2525
Transient iteration: 2 Time: 0.125 Time step: 0.075 CFL: 0.0165057
2626
********************************************************************************
27-
div u : 2.52610974673e-13
28-
error at the weak BC : 0.000587329285947
29-
L2 error velocity : 0.00405753965331 L2 error pressure: 0.120586738881
30-
particle 0 position 0.990003390197 9.87350627607e-08 9.87268312447e-08
31-
particle 0 velocity -0.127954808973 1.04682497146e-06 1.04664503159e-06
27+
div u : -3.1632465744e-13
28+
error at the weak BC : 0.000587329285964
29+
L2 error velocity : 0.00405753969248 L2 error pressure: 0.120586739061
30+
particle 0 position 0.99000339018 9.78804030564e-08 9.7824826966e-08
31+
particle 0 velocity -0.127954809041 1.02809447901e-06 1.02768473111e-06
3232
+------------------------------------------+
3333
| Force summary particles |
3434
+------------------------------------------+
35-
particle_ID time T_x omega_x T_y omega_y T_z omega_z f_x v_x p_x f_y v_y p_y f_z v_z p_z f_xv f_yv f_zv f_xp f_yp f_zp
36-
0 0.1250 0.000000000008 -0.000000000001 0.001065407562 0.000085270095 -0.001065407586 -0.000085270082 1.142169660134 -0.127954808973 0.990003390197 -0.000000026369 0.000001046825 0.000000098735 -0.000000018913 0.000001046645 0.000000098727 0.746122264854 0.000021299506 0.000021302689 0.396047395281 -0.000021325875 -0.000021321602
35+
particle_ID time T_x omega_x theta_x T_y omega_y theta_y T_z omega_z theta_z f_x v_x p_x f_y v_y p_y f_z v_z p_z f_xv f_yv f_zv f_xp f_yp f_zp
36+
0 0.1250 -0.000000000020 0.000000000012 0.000000000030 0.001065372636 0.000085281721 0.000007527085 -0.001065372583 -0.000085281728 -0.000007527086 1.142169660645 -0.127954809041 0.990003390180 0.000000749759 0.000001028094 0.000000097880 0.000000759448 0.000001027685 0.000000097825 0.746122265860 0.000021631083 0.000021637296 0.396047394785 -0.000020881324 -0.000020877848
3737
time error_velocity error_pressure
38-
0.0500 1.589566356387e-03 0.0369
39-
0.1250 4.057539653314e-03 0.1206
38+
0.0500 1.589566367434e-03 0.0369
39+
0.1250 4.057539692476e-03 0.1206

applications_tests/lethe-fluid-sharp/flow_around_ellipsoid_rectangle.output

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Steady iteration: 1/2
1414
| Force summary particles |
1515
+------------------------------------------+
1616
particle_ID time T_x T_y T_z f_x f_y f_z f_xv f_yv f_zv f_xp f_yp f_zp
17-
0 1.0000 -0.506350 -2.821483 2.355642 18.846185 -4.486911 -2.481077 6.564591 -0.286348 0.142814 12.281594 -4.200563 -2.623891
18-
1 1.0000 2.234653 -8.563906 14.526490 37.624523 -2.431316 0.858565 16.087240 -0.775825 1.705423 21.537283 -1.655491 -0.846858
17+
0 1.0000 -0.319224 -2.790041 2.919969 18.452830 -3.919410 -2.393904 6.543322 -0.280789 0.137993 11.909508 -3.638621 -2.531897
18+
1 1.0000 2.674703 -8.038619 14.141736 38.603082 -2.852982 1.053311 16.318084 -0.718644 1.718840 22.284997 -2.134338 -0.665529
1919

2020
*****************************
2121
Steady iteration: 2/2
@@ -28,4 +28,4 @@ Steady iteration: 2/2
2828
+------------------------------------------+
2929
particle_ID time T_x T_y T_z f_x f_y f_z f_xv f_yv f_zv f_xp f_yp f_zp
3030
0 2.0000 -0.896705 -3.070480 4.070378 24.561449 -5.315848 -2.531452 10.575164 -0.140790 0.784065 13.986285 -5.175058 -3.315518
31-
1 2.0000 3.387772 -8.472651 14.771933 45.887976 -3.065652 0.564865 19.744992 -0.546630 0.981405 26.142984 -2.519022 -0.416539
31+
1 2.0000 3.561520 -8.413456 14.508845 46.100476 -3.205490 0.625000 19.752743 -0.541710 0.986115 26.347733 -2.663781 -0.361114

applications_tests/lethe-fluid-sharp/flow_around_torus.output

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Steady iteration: 1/1
1414
| Force summary particles |
1515
+------------------------------------------+
1616
particle_ID time T_x T_y T_z f_x f_y f_z f_xv f_yv f_zv f_xp f_yp f_zp
17-
0 1.0000 -46.057942 -57.151966 -43.196935 62.585201 2.391831 -45.330981 33.185057 -1.141109 -0.086008 29.400144 3.532939 -45.244974
17+
0 1.0000 -45.046800 -56.583090 -38.752022 61.084700 2.230158 -44.936232 32.246668 -1.253914 -0.157118 28.838032 3.484073 -44.779115
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
particle_ID time T_x omega_x T_y omega_y T_z omega_z f_x v_x p_x f_y v_y p_y f_z v_z p_z f_xv f_yv f_zv f_xp f_yp f_zp
2-
0.0000 0.0025 -0.000037 -0.000000 0.000000 0.000000 -0.000007 -0.000000 -0.000000 -0.000000 5.000000 0.091681 -0.234551 12.749414 -0.000119 -0.000151 5.000000 -0.000000 0.006752 -0.000001 0.000000 0.084929 -0.000118
1+
particle_ID time T_x omega_x theta_x T_y omega_y theta_y T_z omega_z theta_z f_x v_x p_x f_y v_y p_y f_z v_z p_z f_xv f_yv f_zv f_xp f_yp f_zp
2+
0 0.0025 0.000007 0.000000 0.000000 -0.000000 -0.000000 -0.000000 -0.000007 -0.000000 -0.000000 -0.000000 -0.000000 5.000000 0.091243 -0.235105 12.749412 -0.000000 -0.000000 5.000000 -0.000000 0.006832 -0.000000 0.000000 0.084411 0.000000

0 commit comments

Comments
 (0)