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
3efcd283
Commit
3efcd283
authored
8 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
lbmpy: bugfix in pressure/density boundary for incompressible methods
parent
62db0e2d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
boundaries/boundaryconditions.py
+9
-3
9 additions, 3 deletions
boundaries/boundaryconditions.py
with
9 additions
and
3 deletions
boundaries/boundaryconditions.py
+
9
−
3
View file @
3efcd283
...
@@ -56,7 +56,8 @@ def fixedDensity(pdfField, direction, lbMethod, density):
...
@@ -56,7 +56,8 @@ def fixedDensity(pdfField, direction, lbMethod, density):
neighbor
=
offsetFromDir
(
direction
,
lbMethod
.
dim
)
neighbor
=
offsetFromDir
(
direction
,
lbMethod
.
dim
)
inverseDir
=
invDir
(
direction
)
inverseDir
=
invDir
(
direction
)
velocity
=
lbMethod
.
conservedQuantityComputation
.
definedSymbols
()[
'
velocity
'
]
cqc
=
lbMethod
.
conservedQuantityComputation
velocity
=
cqc
.
definedSymbols
()[
'
velocity
'
]
symmetricEq
=
removeAsymmetricPartOfMainEquations
(
lbMethod
.
getEquilibrium
(),
dofs
=
velocity
)
symmetricEq
=
removeAsymmetricPartOfMainEquations
(
lbMethod
.
getEquilibrium
(),
dofs
=
velocity
)
substitutions
=
{
sym
:
pdfField
(
i
)
for
i
,
sym
in
enumerate
(
lbMethod
.
preCollisionPdfSymbols
)}
substitutions
=
{
sym
:
pdfField
(
i
)
for
i
,
sym
in
enumerate
(
lbMethod
.
preCollisionPdfSymbols
)}
symmetricEq
=
symmetricEq
.
copyWithSubstitutionsApplied
(
substitutions
)
symmetricEq
=
symmetricEq
.
copyWithSubstitutionsApplied
(
substitutions
)
...
@@ -64,12 +65,17 @@ def fixedDensity(pdfField, direction, lbMethod, density):
...
@@ -64,12 +65,17 @@ def fixedDensity(pdfField, direction, lbMethod, density):
simplification
=
createSimplificationStrategy
(
lbMethod
)
simplification
=
createSimplificationStrategy
(
lbMethod
)
symmetricEq
=
simplification
(
symmetricEq
)
symmetricEq
=
simplification
(
symmetricEq
)
densitySymbol
=
lbMethod
.
conservedQuantityComputation
.
definedSymbols
()[
'
density
'
]
densitySymbol
=
cqc
.
definedSymbols
()[
'
density
'
]
densityEq
=
cqc
.
equilibriumInputEquationsFromInitValues
(
density
=
density
).
insertSubexpressions
().
mainEquations
[
0
]
assert
densityEq
.
lhs
==
densitySymbol
transformedDensity
=
densityEq
.
rhs
conditions
=
[(
eq_i
.
rhs
,
sp
.
Equality
(
direction
,
i
))
conditions
=
[(
eq_i
.
rhs
,
sp
.
Equality
(
direction
,
i
))
for
i
,
eq_i
in
enumerate
(
symmetricEq
.
mainEquations
)]
+
[(
0
,
True
)]
for
i
,
eq_i
in
enumerate
(
symmetricEq
.
mainEquations
)]
+
[(
0
,
True
)]
eq_component
=
sp
.
Piecewise
(
*
conditions
)
eq_component
=
sp
.
Piecewise
(
*
conditions
)
subExprs
=
[
sp
.
Eq
(
eq
.
lhs
,
density
if
eq
.
lhs
==
densitySymbol
else
eq
.
rhs
)
for
eq
in
symmetricEq
.
subexpressions
]
subExprs
=
[
sp
.
Eq
(
eq
.
lhs
,
transformedDensity
if
eq
.
lhs
==
densitySymbol
else
eq
.
rhs
)
for
eq
in
symmetricEq
.
subexpressions
]
return
subExprs
+
[
sp
.
Eq
(
pdfField
[
neighbor
](
inverseDir
),
2
*
eq_component
-
pdfField
(
direction
))]
return
subExprs
+
[
sp
.
Eq
(
pdfField
[
neighbor
](
inverseDir
),
2
*
eq_component
-
pdfField
(
direction
))]
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