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

Refactor the way the DEM PropertiesIndex are managed using templates #1399

Merged
merged 46 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
dc2cd09
Only the test remaining
OGaboriault Dec 25, 2024
19db9a5
Test are working
OGaboriault Dec 25, 2024
407107d
Integrator, particle-wall, force_chains
OGaboriault Dec 25, 2024
9787faf
Insertion works, doc and restart for the cfd_dem needs to be fixed
OGaboriault Dec 26, 2024
d4b8649
Test are working, new parameter in the model parameter section, need …
OGaboriault Jan 1, 2025
999598d
Remove template parameters from constructor
blaisb Jan 1, 2025
1075a34
Fixed insertion_file_restart test
OGaboriault Jan 1, 2025
73b963b
Rebased tests with master
OGaboriault Jan 1, 2025
b4c9417
Rebase
blaisb Jan 1, 2025
5b2b4e0
Add more comments on the dem_properties
blaisb Jan 1, 2025
77f2797
Rebase + generated new restart files
OGaboriault Jan 2, 2025
15c4663
Comments in include/dem/
OGaboriault Jan 3, 2025
b7bd1a2
Fix compilation
blaisb Jan 3, 2025
ca9e132
Some briefs were added in the dem_properties
blaisb Jan 3, 2025
d248bdf
Update syntax and naming
blaisb Jan 3, 2025
6f532bd
Remove trailing ;
blaisb Jan 3, 2025
c92c138
Fix tests to have DEM properties and not cfd_dem
blaisb Jan 3, 2025
3b5b94d
Lower version of boost archive
blaisb Jan 3, 2025
b284f74
File insertion documentation + preprocessing generator code for the i…
OGaboriault Jan 3, 2025
ad52a85
Add new function to convert particle handlers
blaisb Jan 5, 2025
4a02d74
Add particle_handler_conversion and unit test
blaisb Jan 5, 2025
9106609
Add the temporary particle handler and cfd-dem
blaisb Jan 5, 2025
58ba00a
Update VANS restart files
blaisb Jan 6, 2025
703dc9f
Update lethe-fluid-vans results
blaisb Jan 6, 2025
7710eeb
Add exception check for communicator
blaisb Jan 6, 2025
e5d325c
Indent
blaisb Jan 6, 2025
ec4f2a3
Update spouted_bed_load_balancing test
blaisb Jan 6, 2025
75477bf
Documenting the solver type in the .rst
OGaboriault Jan 6, 2025
427b534
QCM Periodic works
blaisb Jan 7, 2025
54a6642
Update QCM opposite flow test (particle switch)
blaisb Jan 7, 2025
49e44c3
Update adaptive sparse contacts
blaisb Jan 7, 2025
ca476a5
Remove test that we do not have a generator
blaisb Jan 7, 2025
d3dff77
Fix CMakeList
blaisb Jan 7, 2025
a5120ae
Update the liquid fluidized bed test
blaisb Jan 7, 2025
404bb66
Fix all tests now everything works
blaisb Jan 7, 2025
a9263aa
Fix timeout
blaisb Jan 7, 2025
01b3ebc
Got the monster to compile after the refactor
blaisb Jan 7, 2025
3ebe3c9
Fix all unit test and indent
blaisb Jan 8, 2025
69daace
Changed tparam description and renamed PropertiesType to PropertiesIndex
OGaboriault Jan 8, 2025
ffaaee4
Indent
OGaboriault Jan 8, 2025
ee2428d
Add CHANGELOG
blaisb Jan 8, 2025
2e831c2
Erase the extra space after some "PropertiesIndex"
OGaboriault Jan 8, 2025
8fd042e
Indent
OGaboriault Jan 9, 2025
0a2b395
Applied Victor comment
OGaboriault Jan 10, 2025
eb4205e
Update include/core/lethe_grid_tools.h
blaisb Jan 10, 2025
ba3a9bc
Update include/core/dem_properties.h
blaisb Jan 11, 2025
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: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to the Lethe project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [Master] - 2024-01-10

### Changed

- MAJOR The index of properties in the DEM and CFD-DEM simulations are now indexed using a template (PropertiesIndex) instead of using an hardcoded enum. This enables the different solvers to have different number of properties and different properties index. For large simulations, this gives minor performance gain for DEM simulations (e.g. around 5-10%), but this makes the solver significantly more flexible. This is a major change since it breaks DEM and CFD-DEM restart files from previous versions. [#1399](https://github.com/chaos-polymtl/lethe/pull/1399)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add something regarding the potential bug you found along the way regarding the particle handler and vans solver?


## [Master] - 2024-01-02

### Changed
Expand Down
42 changes: 37 additions & 5 deletions applications/lethe-particles/dem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,25 @@ main(int argc, char *argv[])
// Parsing of the file
prm.parse_input(argv[1]);
dem_parameters.parse(prm);
const DEM::SolverType solver_type =
dem_parameters.model_parameters.solver_type;

DEMSolver<2> problem(dem_parameters);
problem.solve();
if (solver_type == DEM::SolverType::dem)
{
DEMSolver<2, DEM::DEMProperties::PropertiesIndex> problem(
dem_parameters);
problem.solve();
}
else
{
AssertThrow(
false,
dealii::ExcMessage(
"While reading the solver type from the input file, "
"Lethe found a value different than \"dem\". As of January 2025, "
"the lethe-particles application requires the uses of "
"\"solver type = dem\", which is the default value."));
}
}

else if (dim == 3)
Expand All @@ -46,9 +62,25 @@ main(int argc, char *argv[])
// Parsing of the file
prm.parse_input(argv[1]);
dem_parameters.parse(prm);

DEMSolver<3> problem(dem_parameters);
problem.solve();
// const DEM::SolverType solver_type =
// dem_parameters.model_parameters.solver_type;
const DEM::SolverType solver_type = DEM::SolverType::dem;
if (solver_type == DEM::SolverType::dem)
{
DEMSolver<3, DEM::DEMProperties::PropertiesIndex> problem(
dem_parameters);
problem.solve();
}
else
{
AssertThrow(
false,
dealii::ExcMessage(
"While reading the solver type from the input file, "
"Lethe found a value different than \"dem\". As of January 2025, "
"the lethe-particles application requires the uses of "
"\"solver type = dem\", which is the default value."));
}
}

else
Expand Down
37 changes: 14 additions & 23 deletions applications_tests/lethe-fluid-particles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ set(TEST_TARGET lethe-fluid-particles)
string(TOLOWER ${CMAKE_BUILD_TYPE} _build_type)

file(COPY particle_sedimentation_files/dem.checkpoint_controller DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_0.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_0.pvdhandler DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_0.simulationcontrol DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_0.triangulation DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_0.triangulation.info DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_0.triangulation_fixed.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_0.triangulation_variable.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_1.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_1.pvdhandler DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_1.simulationcontrol DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_1.triangulation DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_1.triangulation.info DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_1.triangulation_fixed.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY particle_sedimentation_files/dem_1.triangulation_variable.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/particle_sedimentation.${_build_type}/mpirun=1/")

file(COPY restart_particle_sedimentation_files/case.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/restart_particle_sedimentation.${_build_type}/mpirun=1/")
file(COPY restart_particle_sedimentation_files/case.pvdhandler DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/restart_particle_sedimentation.${_build_type}/mpirun=1/")
Expand All @@ -21,21 +21,13 @@ file(COPY restart_particle_sedimentation_files/case.triangulation_fixed.data DES
file(COPY restart_particle_sedimentation_files/case.triangulation_variable.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/restart_particle_sedimentation.${_build_type}/mpirun=1/")

file(COPY dynamic_contact_search_files/dem.checkpoint_controller DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_0.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_0.pvdhandler DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_0.simulationcontrol DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_0.triangulation DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_0.triangulation.info DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_0.triangulation_fixed.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_0.triangulation_variable.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")

file(COPY conserve_phase_volumes_files/dem.checkpoint_controller DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem_0.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem_0.simulationcontrol DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem_0.triangulation DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem_0.triangulation.info DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem_0.triangulation_fixed.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem_0.triangulation_variable.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_1.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_1.pvdhandler DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_1.simulationcontrol DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_1.triangulation DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_1.triangulation.info DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_1.triangulation_fixed.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem_1.triangulation_variable.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")

file(COPY liquid_fluidized_bed_files/dem.checkpoint_controller DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/liquid_fluidized_bed.${_build_type}/mpirun=1/")
file(COPY liquid_fluidized_bed_files/dem_0.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/liquid_fluidized_bed.${_build_type}/mpirun=1/")
Expand Down Expand Up @@ -99,5 +91,4 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_tests_properties(lethe-fluid-particles/restart_particle_sedimentation.mpirun=1.debug PROPERTIES TIMEOUT 1200)
set_tests_properties(lethe-fluid-particles/dynamic_contact_search.mpirun=1.debug PROPERTIES TIMEOUT 1200)
set_tests_properties(lethe-fluid-particles/liquid_fluidized_bed.mpirun=1.debug PROPERTIES TIMEOUT 5000)
set_tests_properties(lethe-fluid-particles/conserve_phase_volumes.mpirun=1.debug PROPERTIES TIMEOUT 5000)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEM contact search at dem step 1
DEM contact search at dem step 49
Finished 50 DEM iterations
---------------------------------------------------------------
Global continuity equation error: 2.803e-09 s^-1
Max local continuity error: 7.07295e-08 s^-1
Global continuity equation error: 2.76979e-09 s^-1
Max local continuity error: 6.88735e-08 s^-1

**********************************************************************************
Transient iteration: 2 Time: 0.002 Time step: 0.001 CFL: 7.48857e-05
Transient iteration: 2 Time: 0.002 Time step: 0.001 CFL: 7.47614e-05
**********************************************************************************
--------------
Void Fraction
Expand All @@ -54,7 +54,7 @@ print_from_processor_0
0 1
0
1 8
4 4 4 4 4 4 4 4
3 3 3 3 3 3 3 3


[deal.II intermediate Patch<3,3>]
Expand All @@ -64,7 +64,7 @@ print_from_processor_0
1 1
0
1 8
4 4 4 4 4 4 4 4
2 2 2 2 2 2 2 2


[deal.II intermediate Patch<3,3>]
Expand All @@ -74,7 +74,7 @@ print_from_processor_0
2 1
0
1 8
3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2


[deal.II intermediate Patch<3,3>]
Expand Down Expand Up @@ -136,5 +136,5 @@ DEM contact search at dem step 1
DEM contact search at dem step 49
Finished 50 DEM iterations
---------------------------------------------------------------
Global continuity equation error: -2.28117e-09 s^-1
Max local continuity error: 6.96484e-07 s^-1
Global continuity equation error: 2.16995e-09 s^-1
Max local continuity error: 6.35415e-07 s^-1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0 0 350 78 350
0 0 350 75 350
Binary file not shown.
Binary file not shown.

This file was deleted.

Loading
Loading