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

fix linter

parent 9c35f125
No related branches found
No related tags found
1 merge request!184Draft: Add Correction factor to outflow boundary
Pipeline #73500 failed
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment