lbmpy merge requestshttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests2024-01-19T09:36:28+01:00https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/162Extend UBB2024-01-19T09:36:28+01:00Markus HolzerExtend UBBFor the UBB boundary condition, the density at the wall is calculated from the PDFs at the wall. With this MR the density can also be prescribed by the userFor the UBB boundary condition, the density at the wall is calculated from the PDFs at the wall. With this MR the density can also be prescribed by the userMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/142Thermocapillary2023-12-27T21:28:49+01:00Markus HolzerThermocapillaryIntroduces Thermocapillary flows to lbmpyIntroduces Thermocapillary flows to lbmpyMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/159Interpolation Boundary condition2023-12-05T12:30:02+01:00Markus HolzerInterpolation Boundary conditionImplements a Linear Bouzidi boundary condition. This is an interpolated version of a NoSlip BC and described here: https://doi.org/10.1063/1.1399290
Implements the quadratic bounce back. This is an interpolated version of a NoSlip BC an...Implements a Linear Bouzidi boundary condition. This is an interpolated version of a NoSlip BC and described here: https://doi.org/10.1063/1.1399290
Implements the quadratic bounce back. This is an interpolated version of a NoSlip BC and described here in Appendix E: https://www.sciencedirect.com/science/article/pii/S0898122115002126
The advantage of the latter is that it does not need a second fluid cell. Thus, all optimizations can be applied as usual.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/153Cast field reads also in BC2023-09-29T10:43:53+02:00Markus HolzerCast field reads also in BCUsing mixed precision, field reads were not isolated in the boundary kernels. This leads to calculations in lower precision in the BCUsing mixed precision, field reads were not isolated in the boundary kernels. This leads to calculations in lower precision in the BCMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/145Replace PyCuda with CuPy2023-06-24T10:10:53+02:00Markus HolzerReplace PyCuda with CuPyReplaces [PyCuda](https://documen.tician.de/pycuda/) with [CuPy](https://cupy.dev/)
Advantages of [CuPy](https://cupy.dev/):
- AMD support
- probably higher maintained due to NVIDIA support
- SciPy compatible.Replaces [PyCuda](https://documen.tician.de/pycuda/) with [CuPy](https://cupy.dev/)
Advantages of [CuPy](https://cupy.dev/):
- AMD support
- probably higher maintained due to NVIDIA support
- SciPy compatible.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/144Introduce Central moment forcing again2023-06-15T15:37:26+02:00Markus HolzerIntroduce Central moment forcing againA force model described like here: https://doi.org/10.1016/j.camwa.2015.05.001
is reintroduced to lbmpy for the usage with the cumulant collision modelA force model described like here: https://doi.org/10.1016/j.camwa.2015.05.001
is reintroduced to lbmpy for the usage with the cumulant collision modelMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/134Simplify equilibrium terms2022-11-08T09:04:23+01:00Markus HolzerSimplify equilibrium termsFor some constellations, the equilibrium terms have grown rather large. This MR simplifies the terms to obtain a more reasonable representation of the EQ again
Fixes #37For some constellations, the equilibrium terms have grown rather large. This MR simplifies the terms to obtain a more reasonable representation of the EQ again
Fixes #37Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/123Short Straming pattern demo2022-06-17T13:44:48+02:00Markus HolzerShort Straming pattern demoThis MR provides a short tutorial on streaming patterns and implements the EsoPull and EsoPush streaming patternThis MR provides a short tutorial on streaming patterns and implements the EsoPull and EsoPush streaming patternMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/118Cassons2022-04-14T10:54:46+02:00Markus HolzerCassonsAdding the Cassons model to lbmpyAdding the Cassons model to lbmpyMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/105Relaxation rates should be floats2021-11-10T20:37:52+01:00Markus HolzerRelaxation rates should be floatsdefault rrs should be floats. Otherwise, this gives problems in the vectorisation.default rrs should be floats. Otherwise, this gives problems in the vectorisation.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/104D3Q7 Stencil2021-11-02T21:58:04+01:00Markus HolzerD3Q7 StencilThis MR adds a D3Q7 stencil to lbmpy which can be used for advection-diffusion equations.This MR adds a D3Q7 stencil to lbmpy which can be used for advection-diffusion equations.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/92Rework force models and central moments transform2021-10-28T13:19:18+02:00Markus HolzerRework force models and central moments transformThis MR provides a complete rework of the force model, so they are functioning in the moment space and the central moment space.
Furthermore, a new implementation for the shift matrix is provided and a rework of the central moment based...This MR provides a complete rework of the force model, so they are functioning in the moment space and the central moment space.
Furthermore, a new implementation for the shift matrix is provided and a rework of the central moment based method.
The central moment transform classes are adapted to be able to work with the changes.
TODOs:
- [x] Test Fixed Density BC when method has a force model
- [x] Forward/Backward Transform for D3Q15
- [x] make cumulants aware of polynomials
- [x] rework cumulants with forceMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/89FreeSlip2021-07-09T10:14:40+02:00Markus HolzerFreeSlipThis MR adds FreeSlip boundary conditions to lbmpy. Fixes #3This MR adds FreeSlip boundary conditions to lbmpy. Fixes #3Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/71Central moments2021-07-01T14:15:55+02:00Markus HolzerCentral momentsThis MR implements the central moment collision operator. Furthermore, some clean-up in the derivation pipeline is provided.
- [x] derivation of the central moments from the continuous equilibrium
- [x] derivation of the central moments...This MR implements the central moment collision operator. Furthermore, some clean-up in the derivation pipeline is provided.
- [x] derivation of the central moments from the continuous equilibrium
- [x] derivation of the central moments via shift matrix for the discrete equilibrium
- [x] implementation of a central moment class
- [x] finish implementation of the collision
- [x] provide test cases for the operator
- [x] add documentationMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/75Add Versioneer2021-05-06T19:40:28+02:00Markus HolzerAdd VersioneerSimilar to pythons version string routineSimilar to pythons version string routineMarkus HolzerMarkus Holzerhttps://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 Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/56Added version String to lbmpy2021-01-26T09:12:35+01:00Markus HolzerAdded version String to lbmpySimilar to pystencils!197Similar to pystencils!197Markus HolzerMarkus Holzer