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/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/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/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/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/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/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 Bauer