lbmpy merge requestshttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests2020-03-12T21:17:06+01:00https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/26Add test to compare results from OpenCL, CPU, CUDA in a full LBM simulation2020-03-12T21:17:06+01:00Stephan SeitzAdd test to compare results from OpenCL, CPU, CUDA in a full LBM simulationFor some reason their result does not agree with the calculated reference velocity.
Did not check for the analytical solution.
https://i10git.cs.fau.de/pycodegen/lbmpy/issues/9For some reason their result does not agree with the calculated reference velocity.
Did not check for the analytical solution.
https://i10git.cs.fau.de/pycodegen/lbmpy/issues/9https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/27Fix pip installation2020-02-27T18:57:38+01:00Dominik Thoennesdominik.thoennes@fau.deFix pip installationfix installation with pip where no git is available.fix installation with pip where no git is available.Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/28Mention `opencl` option in README.md2020-06-03T08:52:24+02:00Stephan SeitzMention `opencl` option in README.mdhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/29Update documentation2020-06-07T15:11:06+02:00Markus HolzerUpdate documentation-Updated documentation to remove mrt3
-Entropic is now working with new mrt methods (conserved quantaties are set to first relaxation rate)
-Updated testcases phase-field Allen Cahn
-Implemented more functions to momentbased class-Updated documentation to remove mrt3
-Entropic is now working with new mrt methods (conserved quantaties are set to first relaxation rate)
-Updated testcases phase-field Allen Cahn
-Implemented more functions to momentbased classhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/31Remove mrt32020-06-10T18:59:16+02:00Markus HolzerRemove mrt3https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/32Fix sympy 1.62020-06-15T20:58:14+02:00Markus HolzerFix sympy 1.6fixed bugs caused by upgrading to sympy 1.6fixed bugs caused by upgrading to sympy 1.6https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/33Fix split error2020-06-22T13:48:19+02:00Markus HolzerFix split errorWhen the split algorithm is used in combination with an output field a `KeyError` error was thrown. This error arises because the split simplification is added before the output fields were added to the collision rule. Thus, the simplifi...When the split algorithm is used in combination with an output field a `KeyError` error was thrown. This error arises because the split simplification is added before the output fields were added to the collision rule. Thus, the simplification strategy did not know about the additional assignments.
The error is was fixed by reordering the code in `createfunctions.py`.Helen SchottenhammlHelen Schottenhammlhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/34Schiller force model to be used instead of Guo on non-SRT2020-09-16T22:34:24+02:00Michael Kuronmkuron@icp.uni-stuttgart.deSchiller force model to be used instead of Guo on non-SRTThis is supposed to be equivalent to Guo, but confirmed to be working for non-SRT. Also includes two test cases:
- one that confirms momentum conservation for all available force models
- one that checks that the moments of the force loo...This is supposed to be equivalent to Guo, but confirmed to be working for non-SRT. Also includes two test cases:
- one that confirms momentum conservation for all available force models
- one that checks that the moments of the force look right, but only for Schiller and Simple force models
Fixes #11Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/35Add integration pipeline2020-06-30T12:56:38+02:00Markus HolzerAdd integration pipelineTo make output fields and the split algorithm work, the order of the code in `creationfunctions.py` was changed. This led to a nonworking entropic LBM because the `add_entropy_condition` in `entropic.py` is not able to deal with the addi...To make output fields and the split algorithm work, the order of the code in `creationfunctions.py` was changed. This led to a nonworking entropic LBM because the `add_entropy_condition` in `entropic.py` is not able to deal with the additional Assignments. The error occurred in the integration pipeline with waLBerla.
In this MR the integration pipeline was added to lbmpy to make sure that the waLBerla integration works as it should and the order in `creationfunctions.py` was changed again to make sure all test cases are working.Helen SchottenhammlHelen Schottenhammlhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/36Removed OpenCL parallel Datahandling test case2020-07-10T11:13:06+02:00Markus HolzerRemoved OpenCL parallel Datahandling test caseThere is no OpenCL Backend in waLBerla. Therefore, the parallel Datahandling can not be used with OpenCL at the momentThere is no OpenCL Backend in waLBerla. Therefore, the parallel Datahandling can not be used with OpenCL at the momentStephan SeitzStephan Seitzhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/38Update conftest and readme2020-08-11T12:31:50+02:00Markus HolzerUpdate conftest and readmeDue to the update of the python environment, the conftest is updated to the new pytest version. Further, pages are hosted now on a new URL which is adapted in the readme and some minor changes are done.Due to the update of the python environment, the conftest is updated to the new pytest version. Further, pages are hosted now on a new URL which is adapted in the readme and some minor changes are done.Jan HönigJan Hönighttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/39Thermalized LB: test 4 rel time model velocity and pressure fluctuations2020-10-20T10:29:49+02:00RudolfWeeberThermalized LB: test 4 rel time model velocity and pressure fluctuationsThis changes the fluctuating LB test to match as closely as possible what we are going to use.
Model with 4 relaxation times for shear/bulk/odd/even modes.
Tests:
* mass conservation
* momentum conservation
* <m v^2> = k_B T
* Maxwell ve...This changes the fluctuating LB test to match as closely as possible what we are going to use.
Model with 4 relaxation times for shear/bulk/odd/even modes.
Tests:
* mass conservation
* momentum conservation
* <m v^2> = k_B T
* Maxwell velocity distribution
* average stress tensor
* stress tensor fluctuations accodring to Duenweg, Schiller, LaddMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/40Advanced Streaming Extensions2020-11-09T15:45:16+01:00Frederik HennigAdvanced Streaming ExtensionsThis patch extends lbmpy's support for advanced streaming patterns. In particular, the Push-Collide-Stream, AA-Pattern and Esoteric Twist are considered.
- **Boundary Handling**: The LBM boundary implementations are overhauled complete...This patch extends lbmpy's support for advanced streaming patterns. In particular, the Push-Collide-Stream, AA-Pattern and Esoteric Twist are considered.
- **Boundary Handling**: The LBM boundary implementations are overhauled completely. A new framework for defining and generating boundary kernels is introduced, which makes the symbolic definition independent of the streaming pattern. Boundaries can now be defined symbolically using the proxy fields `f_out` for accessing populations streaming *out* of a cell, and `f_in` for populations streaming *in* to a cell. Those are replaced during the code generation process according to the streaming pattern. The class `BetweenTimestepsIndexing` used herein can also be used to generate other kernels that run on the PDF-field in-between collision steps.
- **Periodicity Handling**: The build-in periodicity synchronization of pystencil's `DataHandling` does not work for advanced LBM streaming. The new class `LBMPeriodicityHandling` extends the `SerialDataHandling` to handle periodicity correctly.
- **Utility**: The patch introduces a few utility functions for the work with advanced streaming patterns.https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/41Fix: Boundary Index List Tests now also check `single_link=True`2020-10-07T11:53:59+02:00Frederik HennigFix: Boundary Index List Tests now also check `single_link=True`The error fixed by pycodegen/pystencils!169 was allowed to pass because the test cases did not check for the `single_link=True` case.The error fixed by pycodegen/pystencils!169 was allowed to pass because the test cases did not check for the `single_link=True` case.https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/42Fix: momentum density calculation2021-03-29T16:31:12+02:00Helen SchottenhammlFix: momentum density calculationFixes the momentum density calculation for compressible methods with force model.
Before the macroscopic velocity shift was used, now we introduce the macroscopic momentum density shift to avoid dividing by the density twice in the force...Fixes the momentum density calculation for compressible methods with force model.
Before the macroscopic velocity shift was used, now we introduce the macroscopic momentum density shift to avoid dividing by the density twice in the force correction step.
Solves issue #14.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/43Allow kernel_creation_args in create_lattice_boltzmann_boundary_kernel2020-10-30T10:48:18+01:00Stephan SeitzAllow kernel_creation_args in create_lattice_boltzmann_boundary_kernelhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/45Extrapolation Outflow Boundary2021-01-08T13:52:46+01:00Frederik HennigExtrapolation Outflow BoundaryThis MR adds an outflow boundary condition to lbmpy which mimics a zero normal gradient in density and velocity across the boundary. To achieve this, the required outbound populations of the boundary node are taken from the neighboring f...This MR adds an outflow boundary condition to lbmpy which mimics a zero normal gradient in density and velocity across the boundary. To achieve this, the required outbound populations of the boundary node are taken from the neighboring fluid node in the normal direction (nx, ny) :
```math
f_{(nx, ny)}^i \leftarrow f_{(0,0)}^i
```
Of course, populations not streaming back into the domain are omitted. For example, for an outflow at max X in the D2Q9 lattice and the pull streaming pattern, these equations are obtained:
```math
{{f}_{(1,0)}^{3}} \leftarrow {{f}_{(0,0)}^{3}},
{{f}_{(1,0)}^{5}} \leftarrow {{f}_{(0,0)}^{5}},
{{f}_{(1,0)}^{7}} \leftarrow {{f}_{(0,0)}^{7}}
```
The normal direction needs to be passed to the boundary object upon construction. This means that if your domain has multiple outflows on different sides or outflows across corners, seperate boundary objects are required for each direction (including the diagonal direction of the corner).https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/46Fix boundary kwargs2020-12-07T16:36:13+01:00Markus HolzerFix boundary kwargsMichael Kuronmkuron@icp.uni-stuttgart.deMichael Kuronmkuron@icp.uni-stuttgart.dehttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/47Allow failure2020-12-08T13:16:09+01:00Markus HolzerAllow failureThe integration pipeline should not be necessary for an MR.
The integration will be checked consequently with the pycodegen repo before releasing. For every MR it should not be necessary due to waLBerlas codegen depending on lbmpy and ...The integration pipeline should not be necessary for an MR.
The integration will be checked consequently with the pycodegen repo before releasing. For every MR it should not be necessary due to waLBerlas codegen depending on lbmpy and not lbmpy depending on waLBerla.Stephan SeitzStephan Seitzhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/48Cumulant LBM2021-02-02T01:03:15+01:00Frederik HennigCumulant LBM## Overview
This merge request introduces a new cumulant-based Lattice Boltzmann Method to *lbmpy*. The new method adheres closely to the D3Q27 cumulant LBM presented by Martin Geier et al. in their 2015 paper ([https://doi.org/10.1016/...## Overview
This merge request introduces a new cumulant-based Lattice Boltzmann Method to *lbmpy*. The new method adheres closely to the D3Q27 cumulant LBM presented by Martin Geier et al. in their 2015 paper ([https://doi.org/10.1016/j.camwa.2015.05.001](https://doi.org/10.1016/j.camwa.2015.05.001)). During the collision step, density and momentum are updated in central moment space while the remainder of the collision is computed in cumulant space. Upon construction, groups of polynomial cumulants for the collision step must be specified. Standard cumulant sets are provided for the D2Q9, D3Q19 and D3Q27 lattices. The momentum update in central moment space enables an implicit forcing scheme, where the equilibrium velocity is shifted by the half-force shift and forcing is realised by maximum overrelaxation of the first-order moments, i.e. by setting `omega_1 = 2`. The usage of an explicit forcing scheme is however still possible.
## Collision Model
The new method is implemented by the class `CenteredCumulantBasedLbMethod` deriving from `AbstractLbMethod`. The name stems from the hybrid-approach of relaxing the conserved modes in central moment space and the remainder in cumulant space. The collision operator is derived in a step-by-step approach:
1. **Transform PDFs to Central Moments** by the recursive fast central moment transform described by Geier et al. Can also be configured to use a matrix-based transformation, which however leads to more complicated equations and slower kernels.
2. **Transform Central Moments to Monomial Cumulants** by expressing the Cumulant-Generating function in terms of the central-moment-generating function, calculating its derivatives and expressing those by derivatives of the central-moment-generating function which are equal to the central moments.
3. **Collision of Polynomial Cumulants**: The monomials are combined to polynomials and relaxed using matrix multiplication. From the post-collision polynomials, the post-collision monomial cumulants are computed.
4. **Backward-Transform from Monomial Cumulants to Central Moments**: By expressing and differentiating the central moment generating function in terms of the cumulant generating function.
5. **Backward-Transform from Central Moments to PDFs** by the fast backward central moment transform, also by Geier et al. Alternatively, a matrix-based approach is configurable, which however inflates the equations significantly.
## Accuracy and Efficiency
The cumulant-method has been shown to be superior to conventional MRT methods in terms of stability and galilean invariance. Almost all cumulants have equilibrium values of zero. Full relaxation (`omega = 1`) for higher-order cumulants is viable as they do not affect hydrodynamic properties at leading order. Full relaxation is also preferable as it leads to the insertion of the zero equilibria in subsequent equations, simplifying those and thus accelerating execution significantly.
On the GPU, with the D3Q27 lattice and full relaxation, this method beats the orthogonal MRT method by a significant margin:
![d3q27_gpu](/uploads/3e1a00d94b35116e468d3ec4024d566f/d3q27_gpu.png)
## To Do
- [x] Galilean Correction
- [x] Automatic Insertion of Zero-Cumulants
- [x] Optimal Simplification Strategy
- [x] Integration with existing method creation framework
- [x] Demo-Notebook
- [x] Integration with waLBerla CodeGenMarkus HolzerMarkus Holzer