-
Notifications
You must be signed in to change notification settings - Fork 60
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
DEM, CFD-DEM periodic boundary fix #1110
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tiny comments
// NOTE This first vector should not be initialized this big. | ||
outlet_boundaries.reserve(DEM_BC_number); | ||
bc_types.reserve(DEM_BC_number); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but how big is DEM_BC_number? Here it is reserved and not initialized btw, so this is not really a big deal...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, DEM_BC_number is really small
@OGaboriault I think this needs a CHANGELOG entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix is good, sorry about that haha.
Just change the log to specify that the bug was only related to PBC in DEM since there are PBC for fluid that were not affected by this bug.
CHANGELOG.md
Outdated
|
||
### Fixed | ||
|
||
- MAJOR Periodic boundary conditions were not working if they weren't the last boundary condition being declare in the parameter file. Now, every boundary condition work in which even order they are being declared. [#1110](https://github.com/chaos-polymtl/lethe/pull/1110) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify that this is related the periodic boundaries for DEM only
|
||
subsection boundary condition 0 | ||
subsection boundary condition 0 | ||
# Choices are fixed_wall|outlet|rotational|translational|periodic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is fixed_wall actually?
Also, maybe (in another pr) we should have a test also for rotational/translational and PBC (like a rotating drum with PBC on flat walls) and make sure all PB match well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, change the name of the PR haha
Description of the problem Periodic boundary conditions were not working when they were not declare as the last BC in the parameter file. BC_type was changing value at every BC being parsed. "BC_type" was being checked later in the code (in dem.cc) to set "has_periodic_boundaries" to true or false. If the periodic BC was being declared before the an other BC, "BC_type" was not set to "BoundaryType::periodic", thus "has_periodic_boundaries = false". Description of the solution We store every BC type in a vector (BC_types). We check each component of that vector, if it's equal to "BoundaryType::periodic", then "has_periodic_boundaries = true" How Has This Been Tested? Every test is passing. I can modify one of our current test to add a dummy BC at the end of a parameter file, so that it check for this kind of problem. Comments Not gonna lie, it was not hard a bug spot in the code... wish I had spot this mistake earlier in my results....
Description of the problem Periodic boundary conditions were not working when they were not declare as the last BC in the parameter file. BC_type was changing value at every BC being parsed. "BC_type" was being checked later in the code (in dem.cc) to set "has_periodic_boundaries" to true or false. If the periodic BC was being declared before the an other BC, "BC_type" was not set to "BoundaryType::periodic", thus "has_periodic_boundaries = false". Description of the solution We store every BC type in a vector (BC_types). We check each component of that vector, if it's equal to "BoundaryType::periodic", then "has_periodic_boundaries = true" How Has This Been Tested? Every test is passing. I can modify one of our current test to add a dummy BC at the end of a parameter file, so that it check for this kind of problem. Comments Not gonna lie, it was not hard a bug spot in the code... wish I had spot this mistake earlier in my results.... Former-commit-id: 59526c4
Description of the problem Periodic boundary conditions were not working when they were not declare as the last BC in the parameter file. BC_type was changing value at every BC being parsed. "BC_type" was being checked later in the code (in dem.cc) to set "has_periodic_boundaries" to true or false. If the periodic BC was being declared before the an other BC, "BC_type" was not set to "BoundaryType::periodic", thus "has_periodic_boundaries = false". Description of the solution We store every BC type in a vector (BC_types). We check each component of that vector, if it's equal to "BoundaryType::periodic", then "has_periodic_boundaries = true" How Has This Been Tested? Every test is passing. I can modify one of our current test to add a dummy BC at the end of a parameter file, so that it check for this kind of problem. Comments Not gonna lie, it was not hard a bug spot in the code... wish I had spot this mistake earlier in my results.... Former-commit-id: 59526c4
Description of the problem
Description of the solution
How Has This Been Tested?
Comments