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
67ae36c3
Commit
67ae36c3
authored
1 year ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Implented as real WetNode BC
parent
ed868e32
No related branches found
No related tags found
1 merge request
!149
Draft: Wet Node Boundaries
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lbmpy/boundaries/boundaryconditions.py
+6
-11
6 additions, 11 deletions
lbmpy/boundaries/boundaryconditions.py
with
6 additions
and
11 deletions
lbmpy/boundaries/boundaryconditions.py
+
6
−
11
View file @
67ae36c3
...
...
@@ -604,6 +604,8 @@ class FixedDensity(LbBoundary):
# end class FixedDensity
class
NoslipEquilibriumReconstruction
(
LbBoundary
):
single_link
=
True
inner_or_boundary
=
False
def
__init__
(
self
,
normal_direction
,
velocity
=
None
,
name
=
None
):
if
isinstance
(
normal_direction
,
str
):
...
...
@@ -636,25 +638,18 @@ class NoslipEquilibriumReconstruction(LbBoundary):
return
[
NeighbourOffsetArrays
(
lb_method
.
stencil
)]
def
__call__
(
self
,
f_out
,
f_in
,
dir_symbol
,
inv_dir
,
lb_method
,
index_field
):
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
))
cqc
=
lb_method
.
conserved_quantity_computation
density_symbol
=
sp
.
Symbol
(
"
rho
"
)
pdf_field_accesses
=
[
f_out
[
tangential_offset
](
i
)
for
i
in
range
(
len
(
lb_method
.
stencil
))]
pdf_field_accesses
=
[
f_out
[
self
.
normal_direction
](
i
)
for
i
in
range
(
len
(
lb_method
.
stencil
))]
density_equations
=
cqc
.
output_equations_from_pdfs
(
pdf_field_accesses
,
{
'
density
'
:
density_symbol
})
substitutions
=
{
u_symbolic
:
u
for
u_symbolic
,
u
in
zip
(
cqc
.
velocity_symbols
,
self
.
velocity
)}
conditions
=
list
()
equilibrium_terms
=
lb_method
.
get_equilibrium_terms
().
subs
(
substitutions
)
for
i
,
term
in
enumerate
(
equilibrium_terms
[
1
:]):
conditions
.
append
((
term
,
sp
.
Eq
(
dir_symbol
,
sp
.
Integer
(
i
+
1
))))
expr
=
sp
.
Piecewise
(
*
conditions
,
(
equilibrium_terms
[
0
],
True
))
subexpressions
=
density_equations
.
all_assignments
main_assignments
=
[
Assignment
(
f_in
(
inv_dir
[
dir_symbol
]),
expr
)]
main_assignments
=
list
()
for
i
in
range
(
len
(
lb_method
.
stencil
)):
main_assignments
.
append
(
Assignment
(
f_out
(
i
),
equilibrium_terms
[
i
]))
ac
=
AssignmentCollection
(
main_assignments
,
subexpressions
=
subexpressions
)
ac
=
ac
.
new_without_unused_subexpressions
()
...
...
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