Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
f91cb34f
Commit
f91cb34f
authored
5 months ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
fix linter
parent
9c35f125
No related branches found
No related tags found
1 merge request
!184
Draft: Add Correction factor to outflow boundary
Pipeline
#73500
failed
5 months ago
Stage: pretest
Stage: test
Stage: docs
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lbmpy/boundaries/boundaryconditions.py
+7
-7
7 additions, 7 deletions
src/lbmpy/boundaries/boundaryconditions.py
with
7 additions
and
7 deletions
src/lbmpy/boundaries/boundaryconditions.py
+
7
−
7
View file @
f91cb34f
...
...
@@ -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
))
c
orrection_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
)
c
orrection_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
'
))
+
c
orrection_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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment