lbmpy merge requestshttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests2022-04-06T20:19:29+02:00https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/113Full Support for Zero-Centered Storage2022-04-06T20:19:29+02:00Frederik HennigFull Support for Zero-Centered StorageThis merge request introduces several changes into the heart of lbmpy to finally allow unrestricted usage of zero-centered PDF storage and to decouple storage format from compressibility. This requires several major incisions:
## Conser...This merge request introduces several changes into the heart of lbmpy to finally allow unrestricted usage of zero-centered PDF storage and to decouple storage format from compressibility. This requires several major incisions:
## Conserved Quantity Computation
The `DensityVelocityComputation` class is updated. It shall now take `compressible` and `zero_centered` as separate arguments and handle populations and macroscopic quantities accordingly. The `x_order_moment_symbol[s]` properties are deprecated in favor of more specific symbol getters. A dedicated `density_deviation_symbol` is introduced to clearly separate density $`\rho`$, background density $`\rho_0`$ and density fluctuation $`\delta \rho`$, s.t. $`\rho = \rho_0 + \delta\rho`$ in all situations. Depending on zero-centering, either $`\rho`$ or $`\delta\rho`$ are computed from PDFs, and the other one is inferred accordingly.
## Equilibrium Formulations
So far, lbmpy separates formulations of its hydrodynamic equilibria into continuous vs. discrete and compressible vs. incompressible. The full-PDF storage format is implicitly assumed for the compressible case, while zero-centered storage is implicitly assumed in the incompressible case. This has been known to lead to a lot of confusion. In particular, the formation of the incompressible equilibrium moment values is quite hacky and not at all obvious.
With this MR, the hydrodynamic equilibrium shall be fully encapsulated in a dedicated class, which hides all technicalities of computing equilibrium moments and derivation of the equilibrium PDF (continuous or discrete). It will fully handle compressibility and zero-centering, and all information about the equilibrium will be held in one place. Once an instance of an equilibrium is created, it shall be immutable.
The hydrodynamic equilbria, both continuous and discrete, are derived from a common base class `AbstractEquilibrium`, which provides a common interface, as well as caching functionality for the computation of moments. It can be extended by custom subclasses for describing custom equilibrium distributions.
To date, instances of the `*Method` classes have only held a set of moments with associated equilibrium values. In the future, however, the method instances shall hold an equilibrium class instance instead of moment equilibrium values. It still manages its own moments and relaxation rate, but equilibrium values of moments are derived on demand, and only through the equilibrium object's interface.
### Full vs. Delta-Equilibrium
The equation governing PDF storage is $`\vec{f} = \vec{w} + \delta\vec{f}`$, where $`\vec{w}`$ are the lattice weights, and $`\delta\vec{f}`$ are the fluctuations, which are the values to be stored in the zero-centered case. Equivalently, both compressible and incompressible equilibria can be expressed both in their absolute form or only by their deviation (delta) from the rest state Let $`\Psi`$ be the continuous Maxwellian equilibrium. Like for the PDFs, the reference state, called background distribution, is $`\Psi (\rho_0, 0)`$. Depending on compressibility and full or delta format, we obtain four different equilibria:
| | compressible | incompressible
|------|-------------------------|-------
| full | $`\Psi(\rho, \vec{u})`$ | $`\Psi(\rho_0, \vec{u}) + \Psi(\delta\rho, 0)`$
| delta| $`\Psi(\rho, \vec{u}) - \Psi(\rho_0, 0)`$ | $`\Psi(\rho_0, \vec{u}) - \Psi(\rho_0, 0) + \Psi(\delta\rho, 0)`$
Regularly stored PDFs may be relaxed immediately to the full equilibria, and zero-centered PDFs can be immediately relaxed to the delta equilibria. To relax zero-centered PDFs against the full equilibria, the constant background part must first be added and subtracted again after the collision. This might be necessary because especially central moments of the delta-equilibria become more complicated, introducing velocity dependencies that degrade the CM method's numerical properties. Furthermore, it will definitely be necessary for cumulant LBMs, as cumulants of the delta-equilibrium are potentially undefined.
Analogously, in theory, you could relax the full PDF vector against the delta-equilibrium, but there isn't really a point to that, hence it is not supported.
## Moment Transform Classes
Depending on zero-centering and choice of equilibrium (delta or full), the transformation of PDFs to moments and back might have to add in the constant background part. The transform classes are adapted accordingly.
## Interface
All of this substructure shall be invisible to the everyday user, while at the same time providing a cleaner and easier to work with an ecosystem for the power user. All possible configurations for equilibrium are encapsulated in three arguments to the creation functions:
- `compressible`, default `False`
- `zero_centered`, default `True`,
- `delta_equilibrium`, default `None`, inferred according to the chosen method.
Supersedes !97. Depends on pycodegen/pystencils!285 and pycodegen/pystencils!286.https://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/119[BugFix] Wrong factor in Casson model2022-04-26T16:36:03+02:00Markus Holzer[BugFix] Wrong factor in Casson modelFixes a wrong factor in the Casson modelFixes a wrong factor in the Casson modelMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/120Adaption to pystencils's new type system2022-05-12T12:15:13+02:00Markus HolzerAdaption to pystencils's new type systemAdapts lbmpy to pystencils's new type systemAdapts lbmpy to pystencils's new type systemMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/122Creationfunctions now update LBMConfig. Small fix to `GenericDiscreteEquilibr...2022-05-24T09:05:45+02:00Frederik HennigCreationfunctions now update LBMConfig. Small fix to `GenericDiscreteEquilibrium`.https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/121Remove entropic srt2022-05-24T12:19:34+02:00Markus HolzerRemove entropic srtRemove Entropic SRT and minor changesRemove Entropic SRT and minor changesMarkus 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/125Fixed headlines in streaming pattern demo2022-06-23T08:58:51+02:00Frederik HennigFixed headlines in streaming pattern demoSubsection headers in the streaming pattern demo notebook were marked `#` instead of `##`, causing Sphinx to treat them as top-level (section) headers and listing them all on the left-hand side panel in the documentation.Subsection headers in the streaming pattern demo notebook were marked `#` instead of `##`, causing Sphinx to treat them as top-level (section) headers and listing them all on the left-hand side panel in the documentation.Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/124Fix: Broken He model population space forcing with zero-centered storage2022-06-23T13:27:04+02:00Frederik HennigFix: Broken He model population space forcing with zero-centered storageThe population-space equations of the He force model were not derived correctly when using zero-centered storage,
introducing $`\rho`$-dependent terms and a nonvanishing zeroth moment.
- Fixed He model in population space
- Extended m...The population-space equations of the He force model were not derived correctly when using zero-centered storage,
introducing $`\rho`$-dependent terms and a nonvanishing zeroth moment.
- Fixed He model in population space
- Extended momentum test case to check for mass conservationFrederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/128Fix longruns2022-07-02T16:02:10+02:00Markus HolzerFix longrunsMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/129Notebooks of PHLBM FSLBM comparison2022-08-30T12:52:44+02:00Markus HolzerNotebooks of PHLBM FSLBM comparisonMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/127Rework of the Cumulant-Based Method2022-09-15T17:24:23+02:00Frederik HennigRework of the Cumulant-Based MethodThis MR updates the cumulant-based LB method to better fit into our updated modelling framework.
Several components are changed:
### Central Moment to Cumulant Transform
- Now derives equations for polynomial cumulants, with monomials...This MR updates the cumulant-based LB method to better fit into our updated modelling framework.
Several components are changed:
### Central Moment to Cumulant Transform
- Now derives equations for polynomial cumulants, with monomials as intermediary values
- No longer ignores cumulants of zeroth and first order
- No longer simplifies according to a-priori assumptions about zeroth and first order cumulants, but emits equations containing logarithms and exponentials that need to be simplified later
### Cumulant-Based Method
- Renamed to `CumulantBasedLbMethod`
- Forces are now applied symmetrically in central moment space according to the given force model, no more 'implicit forcing'
- Zeroth and first order cumulants are now treated regularily
- The Galilean correction was extracted as an a-posteriori-modification
### Force Models
- Introduced interface method `symmetric_central_moment_forcing` for use with the cumulant method and implemented it for `Simple`, `Luo`, `Guo` and `He`
### Central Moment Transform
- Introduced `BinomialChimeraTransform` as a new central moment transform class.
### Method Creation
- Cumulant-based methods are now created like all other methods using `create_with_equilibrium`, and are thus open for use with arbitrary custom equilibria
### Simplification
The changes to the derivation did increase the FLOP count of the cumulant method slightly.
- Added `insert_logs` to eliminate exponentials and logarithms in the cumulant-based method
- Added `expand_post_collision_central_moments` to simplify post-collision equations
- Added `insert_conserved_quantity_products` and `insert_half_force` to simplify expressions in central moment and cumulant based methods that depend only on conserved quantitites or the body forceFrederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/130Fixed extraction of common srt eq term2022-09-23T10:45:40+02:00Frederik HennigFixed extraction of common srt eq termIntegration of zero-centered storage has broken a simplification step central to SRT/TRT methods. This MR fixes it.Integration of zero-centered storage has broken a simplification step central to SRT/TRT methods. This MR fixes it.Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/131Upgrade sympy2022-10-10T13:52:21+02:00Markus HolzerUpgrade sympyUpgrade the maximum SymPy version to 1.11.1
Furthermore, small clean upUpgrade the maximum SymPy version to 1.11.1
Furthermore, small clean upMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/132More tests for fluctuating LB2022-10-25T16:13:12+02:00Markus HolzerMore tests for fluctuating LBDue to Issue 188 in waLBerla, this MR introduces more test cases for the fluctuating LB to make sure it works as intendedDue to Issue 188 in waLBerla, this MR introduces more test cases for the fluctuating LB to make sure it works as intendedMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/133Added demo notebook for the SWE2022-11-02T10:02:02+01:00Frederik HennigAdded demo notebook for the SWEFrederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/135Fix display of coverage in Gitlab2022-11-04T08:11:20+01:00Michael Kuronmkuron@icp.uni-stuttgart.deFix display of coverage in GitlabThis is the same fix that @thoennes made in https://i10git.cs.fau.de/walberla/walberla/-/merge_requests/573 and also the same as https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/310.This is the same fix that @thoennes made in https://i10git.cs.fau.de/walberla/walberla/-/merge_requests/573 and also the same as https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/310.Markus 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/136Fix coverage badge2022-11-10T07:20:04+01:00Michael Kuronmkuron@icp.uni-stuttgart.deFix coverage badgeApply the same change as in https://i10git.cs.fau.de/walberla/walberla/-/merge_requests/574 and https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/311.
If it works, the coverage should appear somewhere below on this page.Apply the same change as in https://i10git.cs.fau.de/walberla/walberla/-/merge_requests/574 and https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/311.
If it works, the coverage should appear somewhere below on this page.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/137Sanity checks for normal directions2022-11-16T14:29:45+01:00Markus HolzerSanity checks for normal directionsAs suggested in https://i10git.cs.fau.de/pycodegen/pystencils/-/issues/63 some minor sanity checks for the normal direction of BC are introducedAs suggested in https://i10git.cs.fau.de/pycodegen/pystencils/-/issues/63 some minor sanity checks for the normal direction of BC are introducedMarkus HolzerMarkus Holzer