-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Contact Details
No response
Is your proposal related to a problem?
The boundaries originally implemented prior to lettuce version 0.2.3 where implemented with the following simulation step order in mind:
- Collision
- Streaming
- (Boundary Condition)
- (Reporter)
Now boundaries are only either pre_boundaries (applied before the collision operator) or post_boundaries (applied after the collision operator).
- (Pre_boundary)
- Collision
- (Post_boundary)
- Streaming
- (Reporter)
(and collision and streaming can now be interchanged etc. but I'll not focus on that because of complexity).
The code changes from 0.2.3 to current 2025 lettuce mostly reflect changes in architecture (what is tensor, what is array, make native-CUDA-code possible etc. and NOT changes in mathematical algorithm to adapt the implementation to the new boundary position in the simulation step.
Because populations will be either at a different location (with or without a streaming substep being applied prior to the boundary algorithm), OR populations might be completely altered (by the collision operator). The order of Collision, Streaming and Boundary Algorithm must not be arbitrary.
(!) Results from flows containing boundary conditions are not numerically (and logically) identical now, in an extend that is more pronounced than round-off or parallelization error!
The error might be small (around 0.5 % deviation in the temporal mean drag coefficient of my cylinder flow for Re200 in an arbitrary example) but may become huge in some use cases.
Examples:
- accuracy: when very local observable values close to boundaries are evaluated
- stability: boundaries play a huge role in stability. These small deviations might make a significant difference in stability-critical applications!
- etc.
Describe the solution you'd like
either
the boundary-algorithms should be adapted to work at a different position in the simulation timestep
or
besides the pre_boundaries and post_boundaries option, there should be a post_streaming option for boundary conditions to use the existing boundary condition algorithms as intended when implemented.
Describe alternatives you've considered
see above
Additional context
see description. I'm currently working on implementing HWBB and IBB,which required enhancements to the simulation class, adding post_streaming_boundaries and the buffering of specific populations from between collision and streaming for use by the boundary algorithm after the streaming substep.