lbmpy merge requestshttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests2019-07-23T16:10:21+02:00https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/1WIP: Fluctuating MRT2019-07-23T16:10:21+02:00Michael Kuronmkuron@icp.uni-stuttgart.deWIP: Fluctuating MRTThis merge request copies @winterhalter's effort from the old lbmpy repository (https://i10git.cs.fau.de/software/pystencils/merge_requests/37).
The main things that are still missing are tests and generalization to non-D3Q19.
I gues...This merge request copies @winterhalter's effort from the old lbmpy repository (https://i10git.cs.fau.de/software/pystencils/merge_requests/37).
The main things that are still missing are tests and generalization to non-D3Q19.
I guess this still needs https://i10git.cs.fau.de/software/pystencils/merge_requests/26 to be brought forward from the old repository as it doesn't generate any RNG calls.
Fixes https://i10git.cs.fau.de/pycodegen/lbmpy/issues/2.
Related to https://i10git.cs.fau.de/walberla/walberla/issues/80.Felix WinterhalterFelix Winterhalterhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/2WIP: Fluctuating Equations non-normalized2019-08-12T16:23:02+02:00Felix WinterhalterWIP: Fluctuating Equations non-normalizedNon normalized equations for the variances.
Still need to figure out how to get lattice spacing and whether definition for mu should contain lattice time as well.
Related to walberla/walberla!220 and implements/enhances #2 Non normalized equations for the variances.
Still need to figure out how to get lattice spacing and whether definition for mu should contain lattice time as well.
Related to walberla/walberla!220 and implements/enhances #2 Martin 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/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/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/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/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/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/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/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/12removed power of two in symbolic descriptions in order to make compilation fo...2019-11-28T20:37:04+01:00Markus Holzerremoved power of two in symbolic descriptions in order to make compilation for localhost workhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/13Execute LBM scenario with OpenCL2020-01-09T20:24:34+01:00Stephan SeitzExecute LBM scenario with OpenCLIt compiles, it runs, so it's correct I guess...
:shrug:It compiles, it runs, so it's correct I guess...
:shrug:Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/14Disable cse_global on create_lb_collision_rule for Sympy < 1.22019-12-16T15:05:39+01:00Michael Kuronmkuron@icp.uni-stuttgart.deDisable cse_global on create_lb_collision_rule for Sympy < 1.2I have this weird problem with `cse_global` and the fluctuating LB. It works fine with SymPy 1.2 and produces wrong temperatures with SymPy 1.1.1. I have bisected it down to this change: https://github.com/sympy/sympy/pull/13221. My patc...I have this weird problem with `cse_global` and the fluctuating LB. It works fine with SymPy 1.2 and produces wrong temperatures with SymPy 1.1.1. I have bisected it down to this change: https://github.com/sympy/sympy/pull/13221. My patch disables `cse_global` if it's enabled and displays a warning on the incriminating SymPy version. I used Mathematica to plug the subexpressions back into the main expressions and get the same thing with both SymPy versions, so I have no idea what the actual problem is. Thus I can't rule out that it only occurs with the fluctuating LB. Until we know for sure, it seems safest to just disable `cse_global` on that old SymPy version entirely.Martin 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/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/18Skip some tests if waLBerla is not installed2020-01-09T20:22:42+01:00Stephan SeitzSkip some tests if waLBerla is not installedhttps://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/19update of the kernel equations for the phase field model2019-12-19T23:29:13+01:00Markus Holzerupdate of the kernel equations for the phase field modelWith this update all derivatives are derived automatically with the functionality of pystencils.
Furthermore more testcases are provided.With this update all derivatives are derived automatically with the functionality of pystencils.
Furthermore more testcases are provided.https://i10git.cs.fau.de/pycodegen/lbmpy/-/merge_requests/20Add custom timeloop_creation_function for LatticeBoltzmannStep2020-01-09T20:23:33+01:00Stephan SeitzAdd custom timeloop_creation_function for LatticeBoltzmannStepWe use a custom Timeloop subclass for a student project.We use a custom Timeloop subclass for a student project.