Skip to content
Snippets Groups Projects
Commit b40aeaf1 authored by Markus Holzer's avatar Markus Holzer
Browse files

Implemented different weights

parent 29f8f286
No related branches found
No related tags found
No related merge requests found
Pipeline #35279 passed
...@@ -32,8 +32,8 @@ get_weights.weights = { ...@@ -32,8 +32,8 @@ get_weights.weights = {
2: sp.Rational(1, 36), 2: sp.Rational(1, 36),
}, },
7: { 7: {
0: sp.Rational(1, 4), 0: sp.simplify(0.0),
1: sp.Rational(1, 8), 1: sp.Rational(1, 6),
}, },
15: { 15: {
0: sp.Rational(2, 9), 0: sp.Rational(2, 9),
......
...@@ -5,10 +5,6 @@ from lbmpy.maxwellian_equilibrium import get_weights ...@@ -5,10 +5,6 @@ from lbmpy.maxwellian_equilibrium import get_weights
from lbmpy.stencils import LBStencil from lbmpy.stencils import LBStencil
# if the equilibrium for the methods with D3Q7 stencil is derived from the continuous Maxwell Boltzmann equation, we do
# not get the same lattice weights as found in the literature. It is a question weather this is problematic or not.
# Especially, that w_0 is zero is very unusual. However, still the method can be used successfully for thermal
# flow problems as shown in tutorial 7. Thus it might even be correct.
def compare_weights(method, maxwellian_moments, stencil_name): def compare_weights(method, maxwellian_moments, stencil_name):
stencil = LBStencil(stencil_name) stencil = LBStencil(stencil_name)
hardcoded_weights = get_weights(stencil) hardcoded_weights = get_weights(stencil)
...@@ -17,10 +13,7 @@ def compare_weights(method, maxwellian_moments, stencil_name): ...@@ -17,10 +13,7 @@ def compare_weights(method, maxwellian_moments, stencil_name):
weights = method.weights weights = method.weights
for i in range(len(weights)): for i in range(len(weights)):
if stencil_name == Stencil.D3Q7 and maxwellian_moments is True: assert hardcoded_weights[i] == weights[i]
assert hardcoded_weights[i] != weights[i]
else:
assert hardcoded_weights[i] == weights[i]
@pytest.mark.parametrize('method', [Method.SRT, Method.TRT]) @pytest.mark.parametrize('method', [Method.SRT, Method.TRT])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment