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

Fix entropic

parent 7847d614
......@@ -27,6 +27,10 @@ class EntropicEquilibriumSRT(AbstractLbMethod):
def weights(self):
return self._weights
@property
def relaxation_rates(self):
return tuple([self._relaxationRate for i in range(len(self.stencil))])
@property
def zeroth_order_equilibrium_moment_symbol(self, ):
return self._cqc.zeroth_order_moment_symbol
......@@ -86,4 +90,8 @@ def create_srt_entropic(stencil, relaxation_rate, force_model, compressible):
if not compressible:
raise NotImplementedError("entropic-srt only implemented for compressible models")
density_velocity_computation = DensityVelocityComputation(stencil, compressible, force_model)
return EntropicEquilibriumSRT(stencil, relaxation_rate, force_model, density_velocity_computation)
......@@ -28,6 +28,16 @@ def test_entropic_methods():
def test_entropic_srt():
stencil = get_stencil("D2Q9")
method = create_srt_entropic(stencil, 1.8, Guo((0, 1e-6)), True)
relaxation_rate = 1.8
method = create_srt_entropic(stencil, relaxation_rate, Guo((0, 1e-6)), True)
assert method.zeroth_order_equilibrium_moment_symbol == sp.symbols("rho")
assert method.first_order_equilibrium_moment_symbols == sp.symbols("u_:2")
eq = method.get_equilibrium()
terms = method.get_equilibrium_terms()
rel = method.relaxation_rates
for i in range(len(terms)):
assert sp.simplify(eq.main_assignments[i].rhs - terms[i]) == 0
assert rel[i] == 1.8
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