Commit b40aeaf1 authored by Markus Holzer's avatar Markus Holzer
Browse files

Implemented different weights

parent 29f8f286
Pipeline #35279 passed with stages
in 38 minutes and 32 seconds
......@@ -32,8 +32,8 @@ get_weights.weights = {
2: sp.Rational(1, 36),
},
7: {
0: sp.Rational(1, 4),
1: sp.Rational(1, 8),
0: sp.simplify(0.0),
1: sp.Rational(1, 6),
},
15: {
0: sp.Rational(2, 9),
......
......@@ -5,10 +5,6 @@ from lbmpy.maxwellian_equilibrium import get_weights
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):
stencil = LBStencil(stencil_name)
hardcoded_weights = get_weights(stencil)
......@@ -17,10 +13,7 @@ def compare_weights(method, maxwellian_moments, stencil_name):
weights = method.weights
for i in range(len(weights)):
if stencil_name == Stencil.D3Q7 and maxwellian_moments is True:
assert hardcoded_weights[i] != weights[i]
else:
assert hardcoded_weights[i] == weights[i]
assert hardcoded_weights[i] == weights[i]
@pytest.mark.parametrize('method', [Method.SRT, Method.TRT])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment