Skip to content
Snippets Groups Projects
Commit 8e777304 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

remove obsolete fluctuatinglb.method_with_rescaled_equilibrium_values

parent 4cd1c355
No related branches found
No related tags found
1 merge request!5Remove obsolete fluctuatinglb.method_with_rescaled_equilibrium_values
Pipeline #17219 passed
...@@ -177,7 +177,7 @@ from lbmpy.fieldaccess import ( ...@@ -177,7 +177,7 @@ from lbmpy.fieldaccess import (
AAEvenTimeStepAccessor, AAOddTimeStepAccessor, CollideOnlyInplaceAccessor, AAEvenTimeStepAccessor, AAOddTimeStepAccessor, CollideOnlyInplaceAccessor,
EsoTwistEvenTimeStepAccessor, EsoTwistOddTimeStepAccessor, PdfFieldAccessor, EsoTwistEvenTimeStepAccessor, EsoTwistOddTimeStepAccessor, PdfFieldAccessor,
PeriodicTwoFieldsAccessor, StreamPullTwoFieldsAccessor, StreamPushTwoFieldsAccessor) PeriodicTwoFieldsAccessor, StreamPullTwoFieldsAccessor, StreamPushTwoFieldsAccessor)
from lbmpy.fluctuatinglb import add_fluctuations_to_collision_rule, method_with_rescaled_equilibrium_values from lbmpy.fluctuatinglb import add_fluctuations_to_collision_rule
from lbmpy.methods import ( from lbmpy.methods import (
create_mrt3, create_mrt_orthogonal, create_mrt_raw, create_srt, create_trt, create_trt_kbc) create_mrt3, create_mrt_orthogonal, create_mrt_raw, create_srt, create_trt, create_trt_kbc)
from lbmpy.methods.creationfunctions import create_generic_mrt from lbmpy.methods.creationfunctions import create_generic_mrt
...@@ -307,9 +307,6 @@ def create_lb_collision_rule(lb_method=None, optimization={}, **kwargs): ...@@ -307,9 +307,6 @@ def create_lb_collision_rule(lb_method=None, optimization={}, **kwargs):
if rho_in is not None and isinstance(rho_in, Field): if rho_in is not None and isinstance(rho_in, Field):
rho_in = rho_in.center rho_in = rho_in.center
if params['fluctuating']:
lb_method = method_with_rescaled_equilibrium_values(lb_method)
if u_in is not None: if u_in is not None:
density_rhs = sum(lb_method.pre_collision_pdf_symbols) if rho_in is None else rho_in density_rhs = sum(lb_method.pre_collision_pdf_symbols) if rho_in is None else rho_in
eqs = [Assignment(cqc.zeroth_order_moment_symbol, density_rhs)] eqs = [Assignment(cqc.zeroth_order_moment_symbol, density_rhs)]
......
...@@ -45,19 +45,6 @@ def fluctuating_variance_from_temperature(method, temperature, c_s_sq=sp.Symbol( ...@@ -45,19 +45,6 @@ def fluctuating_variance_from_temperature(method, temperature, c_s_sq=sp.Symbol(
for norm, rr in zip(normalization_factors, method.relaxation_rates)] for norm, rr in zip(normalization_factors, method.relaxation_rates)]
def method_with_rescaled_equilibrium_values(base_method):
"""Re-scales the equilibrium moments by 1 / sqrt(M*w) with moment matrix M and weights w"""
from lbmpy.creationfunctions import create_lb_method_from_existing
sig_k = abs(base_method.moment_matrix) * sp.Matrix(base_method.weights)
def modification_rule(moment, eq, rr):
i = base_method.moments.index(moment)
return moment, eq / sp.sqrt(sig_k[i]), rr
return create_lb_method_from_existing(base_method, modification_rule)
def fluctuation_correction(method, rng_generator, variances=SymbolGen("variance")): def fluctuation_correction(method, rng_generator, variances=SymbolGen("variance")):
"""Returns additive correction terms to be added to the the collided pdfs""" """Returns additive correction terms to be added to the the collided pdfs"""
conserved_moments = {sp.sympify(1), *MOMENT_SYMBOLS} conserved_moments = {sp.sympify(1), *MOMENT_SYMBOLS}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment