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

Fix first test cases

parent 8f90b576
No related branches found
No related tags found
1 merge request!128Fix longruns
...@@ -626,6 +626,8 @@ class DiffusionDirichlet(LbBoundary): ...@@ -626,6 +626,8 @@ class DiffusionDirichlet(LbBoundary):
return [LbmWeightInfo(lb_method, self._data_type)] return [LbmWeightInfo(lb_method, self._data_type)]
def __call__(self, f_out, f_in, dir_symbol, inv_dir, lb_method, index_field): def __call__(self, f_out, f_in, dir_symbol, inv_dir, lb_method, index_field):
assert lb_method.conserved_quantity_computation.zero_centered_pdfs is False, \
"DiffusionDirichlet only works for methods with normal pdfs storage -> set zero_centered=False"
weight_info = LbmWeightInfo(lb_method, self._data_type) weight_info = LbmWeightInfo(lb_method, self._data_type)
w_dir = weight_info.weight_of_direction(dir_symbol, lb_method) w_dir = weight_info.weight_of_direction(dir_symbol, lb_method)
return [Assignment(f_in(inv_dir[dir_symbol]), return [Assignment(f_in(inv_dir[dir_symbol]),
......
...@@ -38,7 +38,7 @@ def test_steady_state_silva_paper_comparison(): ...@@ -38,7 +38,7 @@ def test_steady_state_silva_paper_comparison():
eps, tau, lambda_plus, f = sp.symbols("epsilon tau Lambda f") eps, tau, lambda_plus, f = sp.symbols("epsilon tau Lambda f")
lbm_config = LBMConfig(stencil=LBStencil(Stencil.D3Q19), compressible=False, relaxation_rate=1 / tau, lbm_config = LBMConfig(stencil=LBStencil(Stencil.D3Q19), compressible=False, relaxation_rate=1 / tau,
continuous_equilibrium=False) continuous_equilibrium=False, zero_centered=False)
method = create_lb_method(lbm_config=lbm_config) method = create_lb_method(lbm_config=lbm_config)
analysis = SteadyStateChapmanEnskogAnalysis(method) analysis = SteadyStateChapmanEnskogAnalysis(method)
......
...@@ -9,7 +9,7 @@ import sympy as sp ...@@ -9,7 +9,7 @@ import sympy as sp
import math import math
from lbmpy.enums import Stencil, Method from lbmpy.enums import Stencil, Method
from lbmpy.methods import RelaxationInfo, create_srt, create_trt, create_trt_kbc, \ from lbmpy.methods import create_srt, create_trt, create_trt_kbc, \
create_with_default_polynomial_cumulants create_with_default_polynomial_cumulants
from lbmpy.methods.momentbased.momentbasedmethod import MomentBasedLbMethod from lbmpy.methods.momentbased.momentbasedmethod import MomentBasedLbMethod
from lbmpy.methods.centeredcumulant.centeredcumulantmethod import CenteredCumulantBasedLbMethod from lbmpy.methods.centeredcumulant.centeredcumulantmethod import CenteredCumulantBasedLbMethod
...@@ -32,7 +32,8 @@ def __change_relaxation_rate_of_conserved_moments(method, new_relaxation_rate=sp ...@@ -32,7 +32,8 @@ def __change_relaxation_rate_of_conserved_moments(method, new_relaxation_rate=sp
elif isinstance(method, CenteredCumulantBasedLbMethod): elif isinstance(method, CenteredCumulantBasedLbMethod):
changed_method = CenteredCumulantBasedLbMethod(method.stencil, method.equilibrium_distribution, rr_dict, changed_method = CenteredCumulantBasedLbMethod(method.stencil, method.equilibrium_distribution, rr_dict,
method.conserved_quantity_computation, method.conserved_quantity_computation,
force_model=method.force_model) force_model=method.force_model,
zero_centered=True)
else: else:
raise ValueError("Not a moment or cumulant-based method") raise ValueError("Not a moment or cumulant-based method")
......
...@@ -103,6 +103,7 @@ def test_diffusion(): ...@@ -103,6 +103,7 @@ def test_diffusion():
# Lattice Boltzmann method # Lattice Boltzmann method
lbm_config = LBMConfig(stencil=stencil, method=Method.MRT, relaxation_rates=[1, 1.5, 1, 1.5, 1], lbm_config = LBMConfig(stencil=stencil, method=Method.MRT, relaxation_rates=[1, 1.5, 1, 1.5, 1],
zero_centered=False,
velocity_input=vel_field, output={'density': con_field}, compressible=True, velocity_input=vel_field, output={'density': con_field}, compressible=True,
weighted=True, kernel_type='stream_pull_collide') weighted=True, kernel_type='stream_pull_collide')
......
...@@ -275,7 +275,7 @@ def test_modes_central_moment(force_model, compressible): ...@@ -275,7 +275,7 @@ def test_modes_central_moment(force_model, compressible):
F = list(sp.symbols(f"F_:{stencil.D}")) F = list(sp.symbols(f"F_:{stencil.D}"))
lbm_config = LBMConfig(method=Method.CENTRAL_MOMENT, stencil=stencil, relaxation_rate=omega_s, lbm_config = LBMConfig(method=Method.CENTRAL_MOMENT, stencil=stencil, relaxation_rate=omega_s,
compressible=True, force_model=force_model, force=tuple(F)) compressible=compressible, force_model=force_model, force=tuple(F))
method = create_lb_method(lbm_config=lbm_config) method = create_lb_method(lbm_config=lbm_config)
subs_dict = method.subs_dict_relxation_rate subs_dict = method.subs_dict_relxation_rate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment