lbmpy merge requestshttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests2019-11-28T20:34:47+01:00https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/17Use Gram-Schmidt for create_mrt_orthogonal2019-11-28T20:34:47+01:00Michael Kuronmkuron@icp.uni-stuttgart.deUse Gram-Schmidt for create_mrt_orthogonal- orthogonalize automatically if no moments from literature are provided
- must specify whether weighted or unweighted orthogonality is desired
- add `lbmpy.moments.is_bulk_mode` and make `lbmpy.moments.is_shear_mode` also detect the d...- orthogonalize automatically if no moments from literature are provided
- must specify whether weighted or unweighted orthogonality is desired
- add `lbmpy.moments.is_bulk_mode` and make `lbmpy.moments.is_shear_mode` also detect the diagonal modes
- use the bulk mode ($`x^2+y^2+z^2-1`$) in orthogonalization so we get the same physical modes as in literature
We now match the literature MRTs in all the physical moments. The only exception is D3Q27, which chooses a different linear combination for the shear moments. Differences in the higher-order moments remain, but they have no effect on the model.
Fixes #5Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/15Fluctuating MRT: requires weighted-orthogonal method2019-11-27T16:47:42+01:00Michael Kuronmkuron@icp.uni-stuttgart.deFluctuating MRT: requires weighted-orthogonal methodThis merge request makes sure that one gets an error message if an inappropriate LB method is chosen. Currently, `create_mrt_orthogonal` does not allow for explicitly choosing weighted vs. unweighted orthogonalization (see #5), but I int...This merge request makes sure that one gets an error message if an inappropriate LB method is chosen. Currently, `create_mrt_orthogonal` does not allow for explicitly choosing weighted vs. unweighted orthogonalization (see #5), but I intend to fix that soon.
I still need to talk to Ulf Schiller to learn whether his specific orthogonalization of D3Q19 involved any secret tricks.
Closes #6.Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/16Test for fluctuating LB, avg temperature and velocity distribution2019-11-21T19:50:12+01:00RudolfWeeberTest for fluctuating LB, avg temperature and velocity distributionTest the MRT method with 15 equal relaxation times
Closes #4Test the MRT method with 15 equal relaxation times
Closes #4Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/10update phase-field allen cahn2019-11-06T12:41:14+01:00Markus Holzerupdate phase-field allen cahnupdated the functionality and the testcases of the phase-field model conservative allen cahnupdated the functionality and the testcases of the phase-field model conservative allen cahnhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/11Fluctuating MRT: use the correct prefactors2019-11-06T12:41:01+01:00Michael Kuronmkuron@icp.uni-stuttgart.deFluctuating MRT: use the correct prefactorsAs discovered by @rudolfweeber, the temperatures were wrong. This happened because we didn't correctly calculate the normalization prefactors.
I have now confirmed that `stencil="D3Q19", method="mrt"` produces the same prefactors as t...As discovered by @rudolfweeber, the temperatures were wrong. This happened because we didn't correctly calculate the normalization prefactors.
I have now confirmed that `stencil="D3Q19", method="mrt"` produces the same prefactors as the [Ladd/Schiller/Dünweg](https://doi.org/10.1103/PhysRevE.76.036704)-style D3Q19 MRT. Thermalization should probably also work when using any of the other methods (TRT, SRT, MRT3), but there no reference values of these prefactors are available in literature.
That paper also provides reference values for `stencil="D2Q9", method="mrt"`, which we reproduce after switching to their orthogonalization:
```diff
--- a/lbmpy/methods/creationfunctions.py
+++ b/lbmpy/methods/creationfunctions.py
@@ -10,7 +10,7 @@ from lbmpy.maxwellian_equilibrium import (
compressible_to_incompressible_moment_value, get_cumulants_of_continuous_maxwellian_equilibrium,
get_cumulants_of_discrete_maxwellian_equilibrium,
get_moments_of_continuous_maxwellian_equilibrium,
- get_moments_of_discrete_maxwellian_equilibrium)
+ get_moments_of_discrete_maxwellian_equilibrium, get_weights)
from lbmpy.methods.abstractlbmethod import RelaxationInfo
from lbmpy.methods.conservedquantitycomputation import DensityVelocityComputation
from lbmpy.methods.cumulantbased import CumulantBasedLbMethod
@@ -388,9 +388,16 @@ def create_mrt_orthogonal(stencil, relaxation_rate_getter=None, maxwellian_momen
moment_to_relaxation_rate_dict = OrderedDict()
if have_same_entries(stencil, get_stencil("D2Q9")):
moments = get_default_moment_set_for_stencil(stencil)
- orthogonal_moments = gram_schmidt(moments, stencil)
+ weights = get_weights(stencil, sp.Rational(1,3))
+ orthogonal_moments = gram_schmidt(moments, stencil, weights)
orthogonal_moments_scaled = [e * common_denominator(e) for e in orthogonal_moments]
nested_moments = list(sort_moments_into_groups_of_same_order(orthogonal_moments_scaled).values())
+ sq = x ** 2 + y ** 2
+ nested_moments[2][0] = 3 * sq - 2
+ nested_moments[2][1] = 2 * x ** 2 - sq
+ nested_moments[3][0] = (3 * sq - 4) * x
+ nested_moments[3][1] = (3 * sq - 4) * y
+ nested_moments[4][0] = 9 * sq ** 2 - 15 * sq + 2
elif have_same_entries(stencil, get_stencil("D3Q15")):
sq = x ** 2 + y ** 2 + z ** 2
nested_moments = [
```Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/9Shan Chen Issue2019-10-21T16:19:43+02:00Martin BauerShan Chen IssueI cleaned up a TODO that was left in the new Shan Chen Tutorials.
However, I found a new problem: the multi-phase version did not consistently take the force-dependent velocity shift into account during initialization.
Is this intended?...I cleaned up a TODO that was left in the new Shan Chen Tutorials.
However, I found a new problem: the multi-phase version did not consistently take the force-dependent velocity shift into account during initialization.
Is this intended?
When I switch to the seemingly 'correct' initialization the test fails.Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/8Shan-Chen tutorial2019-10-18T12:32:11+02:00Michael Kuronmkuron@icp.uni-stuttgart.deShan-Chen tutorialThere are two different ways to use Shan-Chen, which is why we have two separate tutorials. One can either simulate a two-component fluid (e.g. oil-water) or a two-phase single-component fluid (e.g. water-steam).There are two different ways to use Shan-Chen, which is why we have two separate tutorials. One can either simulate a two-component fluid (e.g. oil-water) or a two-phase single-component fluid (e.g. water-steam).Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/7implemented unconventional D3Q27 stencil by Abbas Fakhari2019-10-01T16:04:03+02:00Markus Holzerimplemented unconventional D3Q27 stencil by Abbas FakhariIn the paper [3D phase-field](https://www.sciencedirect.com/science/article/abs/pii/S0301932217309369) is written :
> As for the discrete velocity set of the D3Q27 lattice used for the hydro-
dynamics, a slightly unconventional orderin...In the paper [3D phase-field](https://www.sciencedirect.com/science/article/abs/pii/S0301932217309369) is written :
> As for the discrete velocity set of the D3Q27 lattice used for the hydro-
dynamics, a slightly unconventional ordering was used in order to align the
first 15 velocity directions with the D3Q15 model.
Therefore I also implemented this stencil with the name fakhari.
For the D3Q15 stencil they used: *premnath*https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/6implemented the phase_field model of Abas Fakhari2019-09-23T10:58:39+02:00Markus Holzerimplemented the phase_field model of Abas Fakharihttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/5Remove obsolete fluctuatinglb.method_with_rescaled_equilibrium_values2019-08-14T14:50:57+02:00Michael Kuronmkuron@icp.uni-stuttgart.deRemove obsolete fluctuatinglb.method_with_rescaled_equilibrium_values@winterhalter said it's not needed anymore, see https://i10chat.cs.fau.de/lssall/pl/m1kheksrgfruinu8dffkq1znwa. In fact, it is wrong since a fluctuating MRT with temperature zero should be identical to a regular LB.@winterhalter said it's not needed anymore, see https://i10chat.cs.fau.de/lssall/pl/m1kheksrgfruinu8dffkq1znwa. In fact, it is wrong since a fluctuating MRT with temperature zero should be identical to a regular LB.Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/4Fluctuating LB needs zero mean and unit variance random numbers2019-08-14T10:45:46+02:00Michael Kuronmkuron@icp.uni-stuttgart.deFluctuating LB needs zero mean and unit variance random numbersMartin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/3Magic block offset symbols for Walberla2019-08-12T16:53:58+02:00Michael Kuronmkuron@icp.uni-stuttgart.deMagic block offset symbols for WalberlaFor https://i10git.cs.fau.de/pycodegen/lbmpy_walberla/merge_requests/1.
Fixes https://i10git.cs.fau.de/pycodegen/lbmpy/issues/2.For https://i10git.cs.fau.de/pycodegen/lbmpy_walberla/merge_requests/1.
Fixes https://i10git.cs.fau.de/pycodegen/lbmpy/issues/2.Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/174Fix usages of deprecated features.2024-07-22T14:39:32+02:00Frederik HennigFix usages of deprecated features.This MR updates the usage points of several deprecated features of our dependencies.
- Scipy subnamespaces `ndimage.filters` and `ndimage.morphology` have been deprecated for a while
- `np.trapz` is replaced by `np.trapezoid` in numpy...This MR updates the usage points of several deprecated features of our dependencies.
- Scipy subnamespaces `ndimage.filters` and `ndimage.morphology` have been deprecated for a while
- `np.trapz` is replaced by `np.trapezoid` in numpy 2.0 (https://numpy.org/doc/stable/numpy_2_0_migration_guide.html#main-namespace)
- Path-like arguments in pytest have been switched to `pathlib` a long time ago
(https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
and
https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path)
- Fix `MatplotlibDeprecationWarning: Auto-close()ing of figures upon backend switching is deprecated since 3.8 and will be removed two minor releases later. To suppress this warning, explicitly call plt.close('all') first.` by closing all open figures before and after any notebook run
Maybe (just maybe) the closing of figures also fixes this spurious error:
```
FAILED tests/test_stokes_setup.ipynb::test_stokes_setup.ipynb - TypeError: Axes3D.quiver() missing 4 required positional arguments: 'Z', 'U', 'V', and 'W'
```
for which I still could not pin down the cause.Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/172Draft: Changes for compatibility with pystencils 2.02024-07-25T15:23:20+02:00Frederik HennigDraft: Changes for compatibility with pystencils 2.0Introduce a significant number of compatibility patches for the upcoming pystencils 2.0.
Test suite depends on the API fixes from pycodegen/pystencils!409.
Status:
- [ ] Fix field duplication in `create_lb_update_rule`: Remove the w...Introduce a significant number of compatibility patches for the upcoming pystencils 2.0.
Test suite depends on the API fixes from pycodegen/pystencils!409.
Status:
- [ ] Fix field duplication in `create_lb_update_rule`: Remove the workaround once field duplication is fixed in pystencilsFrederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/171[BugFix] shear wave test2024-07-09T09:11:02+02:00Markus Holzer[BugFix] shear wave testThe lattice Boltzmann step tries to figure out a stencil on its own, when no stencil is provided in the config class. This did not work in the shear wave test. The suggestion here is to just state the stencil in the config fileThe lattice Boltzmann step tries to figure out a stencil on its own, when no stencil is provided in the config class. This did not work in the shear wave test. The suggestion here is to just state the stencil in the config fileMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/149Draft: Wet Node Boundaries2023-07-19T16:11:52+02:00Markus HolzerDraft: Wet Node BoundariesSupport of wet node boundariesSupport of wet node boundariesMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/138Fix install lbmpy without VCS2022-11-24T10:57:59+01:00Markus HolzerFix install lbmpy without VCSWhen copying lbmpy out of GIT it is not possible to install it because it can not determine its version. In fact, it is impossible to determine the version then. This MR tries to fix the situation.When copying lbmpy out of GIT it is not possible to install it because it can not determine its version. In fact, it is impossible to determine the version then. This MR tries to fix the situation.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/126Fix: float numbers as relaxation rates2022-06-29T06:03:24+02:00Markus HolzerFix: float numbers as relaxation ratesFloat numbers should be written with SymPy to set the relaxation ratesFloat numbers should be written with SymPy to set the relaxation ratesMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/106Draft: Wall law2024-04-02T11:36:53+02:00Markus HolzerDraft: Wall lawImplementation of a wall lawImplementation of a wall lawMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/98Generalisation of Relaxation rate setter2021-10-27T23:34:18+02:00Markus HolzerGeneralisation of Relaxation rate setterAll methods that have a high number of free relaxation rates have different logic for how the list of relaxation rates is set. First of all, this causes a lot of confusing and unnecessary code and second it is confusing for the user.
In...All methods that have a high number of free relaxation rates have different logic for how the list of relaxation rates is set. First of all, this causes a lot of confusing and unnecessary code and second it is confusing for the user.
In this MR the logic for setting the relaxation rate is generalised and then used in all methods.
- If only one relaxation rate is given by the user it is set as the shear relaxation rate.
- If a relaxation rate for all moments is defined they are just used.
- Otherwise, the conserved moments are relaxed with zero, the next two relaxation rates in the list are used for bulk and shear viscosity and the remaining ones are used to relax a complete group of the same order. If too many relaxation rates are given the list is just cut and the remaining ones have no influence.Markus HolzerMarkus Holzer