From f91cb34f09d34b0f43da0ec0694754458d61fcee Mon Sep 17 00:00:00 2001
From: Markus Holzer <markus.holzer@onera.fr>
Date: Wed, 5 Feb 2025 13:29:10 +0100
Subject: [PATCH] fix linter

---
 src/lbmpy/boundaries/boundaryconditions.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/lbmpy/boundaries/boundaryconditions.py b/src/lbmpy/boundaries/boundaryconditions.py
index f92e5c45..ca50c363 100644
--- a/src/lbmpy/boundaries/boundaryconditions.py
+++ b/src/lbmpy/boundaries/boundaryconditions.py
@@ -954,6 +954,7 @@ class ExtrapolationOutflow(LbBoundary):
         self.data_type = data_type
         self.density = density
         self.density_correction_factor = density_correction_factor
+        self.zero_centered_pdfs = lb_method.conserved_quantity_computation.zero_centered_pdfs
 
         if initial_density and initial_velocity:
             equilibrium = lb_method.get_equilibrium(conserved_quantity_equations=AssignmentCollection([]))
@@ -997,8 +998,7 @@ class ExtrapolationOutflow(LbBoundary):
             entry['pdf'] = pdf_acc.read_pdf(boundary_data.pdf_array, domain_cell, inv_dir)
             entry['pdf_nd'] = get_boundary_cell_pdfs(domain_cell, outflow_cell, inv_dir)
             if self.density:
-                entry['rho'] = self.density - 1.0 if self.lb_method.conserved_quantity_computation.zero_centered_pdfs else self.density
-
+                entry['rho'] = self.density - 1.0 if self.zero_centered_pdfs else self.density
 
     @property
     def additional_data(self):
@@ -1028,16 +1028,16 @@ class ExtrapolationOutflow(LbBoundary):
             code_nodes.append(LbmWeightInfo(lb_method, self.data_type))
         return code_nodes
     
-
     def __call__(self, f_out, f_in, dir_symbol, inv_dir, lb_method, index_field, force_vector):
         subexpressions = []
         boundary_assignments = []
         dtdx = sp.Rational(self.dt, self.dx)
+        c_s = self.c * dtdx
 
         neighbor_offset = NeighbourOffsetArrays.neighbour_offset(dir_symbol, lb_method.stencil)
         tangential_offset = tuple(offset - normal for offset, normal in zip(neighbor_offset, self.normal_direction))
 
-        correction_term = 0
+        c_t = 0
         if self.density:
             cqc = lb_method.conserved_quantity_computation
             density_symbol = sp.Symbol("rho")
@@ -1048,12 +1048,12 @@ class ExtrapolationOutflow(LbBoundary):
             weight_info = LbmWeightInfo(lb_method, data_type=self.data_type)
             weight_of_direction = weight_info.weight_of_direction
             weight = weight_of_direction(dir_symbol, lb_method)
-            correction_term = self.density_correction_factor * weight * index_field[0]('rho')
+            c_t = self.density_correction_factor * weight * (self.density - index_field[0]('rho'))
 
 
         interpolated_pdf_sym = sp.Symbol('pdf_inter')
-        interpolated_pdf_asm = Assignment(interpolated_pdf_sym, (index_field[0]('pdf') * (self.c * dtdx))
-                                          + ((sp.Number(1) - self.c * dtdx) * index_field[0]('pdf_nd')) + correction_term)
+        interpolated_pdf_asm = Assignment(interpolated_pdf_sym, (index_field[0]('pdf') * c_s)
+                                          + ((sp.Number(1) - c_s) * index_field[0]('pdf_nd')) + c_t)
         subexpressions.append(interpolated_pdf_asm)
 
         asm = Assignment(f_in.center(inv_dir[dir_symbol]), interpolated_pdf_sym)
-- 
GitLab