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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
d42bd4f0
Commit
d42bd4f0
authored
May 2, 2017
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Added speed of sound parameter to method creation functions
parent
8788d6a2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
methods/creationfunctions.py
+7
-7
7 additions, 7 deletions
methods/creationfunctions.py
methods/momentbasedsimplifications.py
+1
-1
1 addition, 1 deletion
methods/momentbasedsimplifications.py
with
8 additions
and
8 deletions
methods/creationfunctions.py
+
7
−
7
View file @
d42bd4f0
...
...
@@ -21,7 +21,7 @@ from lbmpy.methods.relaxationrates import relaxationRateFromMagicNumber, default
def
createWithDiscreteMaxwellianEqMoments
(
stencil
,
momentToRelaxationRateDict
,
compressible
=
False
,
forceModel
=
None
,
equilibriumAccuracyOrder
=
2
,
cumulant
=
False
):
equilibriumAccuracyOrder
=
2
,
cumulant
=
False
,
c_s_sq
=
sp
.
Rational
(
1
,
3
)
):
r
"""
Creates a moment-based LBM by taking a list of moments with corresponding relaxation rate. These moments are
relaxed against the moments of the discrete Maxwellian distribution.
...
...
@@ -37,6 +37,7 @@ def createWithDiscreteMaxwellianEqMoments(stencil, momentToRelaxationRateDict, c
:param forceModel: force model instance, or None if no external forces
:param equilibriumAccuracyOrder: approximation order of macroscopic velocity :math:`\mathbf{u}` in the equilibrium
:param cumulant: if True relax cumulants instead of moments
:param c_s_sq: Speed of sound squared
:return: :class:`lbmpy.methods.MomentBasedLbMethod` instance
"""
momToRrDict
=
OrderedDict
(
momentToRelaxationRateDict
)
...
...
@@ -48,11 +49,11 @@ def createWithDiscreteMaxwellianEqMoments(stencil, momentToRelaxationRateDict, c
if
cumulant
:
warn
(
"
Cumulant methods should be created with useContinuousMaxwellianEquilibrium=True
"
)
eqValues
=
getCumulantsOfDiscreteMaxwellianEquilibrium
(
stencil
,
tuple
(
momToRrDict
.
keys
()),
c_s_sq
=
sp
.
Rational
(
1
,
3
)
,
compressible
=
compressible
,
c_s_sq
=
c_s_sq
,
compressible
=
compressible
,
order
=
equilibriumAccuracyOrder
)
else
:
eqValues
=
getMomentsOfDiscreteMaxwellianEquilibrium
(
stencil
,
tuple
(
momToRrDict
.
keys
()),
c_s_sq
=
sp
.
Rational
(
1
,
3
)
,
compressible
=
compressible
,
c_s_sq
=
c_s_sq
,
compressible
=
compressible
,
order
=
equilibriumAccuracyOrder
)
rrDict
=
OrderedDict
([(
mom
,
RelaxationInfo
(
eqMom
,
rr
))
...
...
@@ -64,7 +65,7 @@ def createWithDiscreteMaxwellianEqMoments(stencil, momentToRelaxationRateDict, c
def
createWithContinuousMaxwellianEqMoments
(
stencil
,
momentToRelaxationRateDict
,
compressible
=
False
,
forceModel
=
None
,
equilibriumAccuracyOrder
=
2
,
cumulant
=
False
):
equilibriumAccuracyOrder
=
2
,
cumulant
=
False
,
c_s_sq
=
sp
.
Rational
(
1
,
3
)
):
r
"""
Creates a moment-based LBM by taking a list of moments with corresponding relaxation rate. These moments are
relaxed against the moments of the continuous Maxwellian distribution.
...
...
@@ -78,11 +79,10 @@ def createWithContinuousMaxwellianEqMoments(stencil, momentToRelaxationRateDict,
densityVelocityComputation
=
DensityVelocityComputation
(
stencil
,
compressible
,
forceModel
)
if
cumulant
:
eqValues
=
getCumulantsOfContinuousMaxwellianEquilibrium
(
tuple
(
momToRrDict
.
keys
()),
dim
,
c_s_sq
=
sp
.
Rational
(
1
,
3
),
eqValues
=
getCumulantsOfContinuousMaxwellianEquilibrium
(
tuple
(
momToRrDict
.
keys
()),
dim
,
c_s_sq
=
c_s_sq
,
order
=
equilibriumAccuracyOrder
)
else
:
eqValues
=
getMomentsOfContinuousMaxwellianEquilibrium
(
tuple
(
momToRrDict
.
keys
()),
dim
,
c_s_sq
=
sp
.
Rational
(
1
,
3
)
,
eqValues
=
getMomentsOfContinuousMaxwellianEquilibrium
(
tuple
(
momToRrDict
.
keys
()),
dim
,
c_s_sq
=
c_s_sq
,
order
=
equilibriumAccuracyOrder
)
if
not
compressible
:
...
...
This diff is collapsed.
Click to expand it.
methods/momentbasedsimplifications.py
+
1
−
1
View file @
d42bd4f0
...
...
@@ -9,7 +9,7 @@ from pystencils.sympyextensions import replaceAdditive, replaceSecondOrderProduc
def
replaceSecondOrderVelocityProducts
(
lbmCollisionEqs
):
"""
Replaces mixed quadratic velocity terms like :math:`u_0 * u_1` by :math:`(u_0+u
+
1)^2 - u_0^2 - u_1^2`
Replaces mixed quadratic velocity terms like :math:`u_0 * u_1` by :math:`(u_0+u
_
1)^2 - u_0^2 - u_1^2`
Required simplification hints:
- velocity: sequence of velocity symbols
"""
...
...
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
sign in
to comment