Commit ddea6da8 authored by Markus Holzer's avatar Markus Holzer
Browse files

Added more documentation

parent 7c1a5ae9
Pipeline #34321 failed with stages
in 43 minutes and 35 seconds
......@@ -16,10 +16,10 @@ It even comes with an integrated Chapman Enskog analysis based on sympy!
Common test scenarios can be set up quickly:
```python
from lbmpy.scenarios import create_channel
from pystencils import Target
from lbmpy.session import *
ch = create_channel(domain_size=(300, 100, 100), force=1e-7, method="trt",
ch = create_channel(domain_size=(300, 100, 100), force=1e-7, method=Method.TRT,
equilibrium_order=2, compressible=True,
relaxation_rates=[1.97, 1.6], optimization={'target': Target.GPU})
```
......
......@@ -140,7 +140,7 @@
" "
],
"text/plain": [
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f0d442c0fa0>"
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f49aed671c0>"
]
},
"execution_count": 2,
......@@ -291,7 +291,7 @@
" "
],
"text/plain": [
"<lbmpy.stencils.LBStencil at 0x7f0d442f2a90>"
"<lbmpy.stencils.LBStencil at 0x7f49aedd27c0>"
]
},
"execution_count": 5,
......@@ -380,7 +380,7 @@
" "
],
"text/plain": [
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f0d39ecaee0>"
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f49aea33850>"
]
},
"execution_count": 6,
......@@ -459,7 +459,7 @@
" "
],
"text/plain": [
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f0d39f23760>"
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f49aeb64fa0>"
]
},
"execution_count": 7,
......@@ -579,7 +579,7 @@
" "
],
"text/plain": [
"<lbmpy.methods.momentbased.centralmomentbasedmethod.CentralMomentBasedLbMethod at 0x7f0d39c84d90>"
"<lbmpy.methods.momentbased.centralmomentbasedmethod.CentralMomentBasedLbMethod at 0x7f49aeadb0a0>"
]
},
"execution_count": 9,
......@@ -799,7 +799,7 @@
" "
],
"text/plain": [
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f0d39cceac0>"
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f49ae9359d0>"
]
},
"execution_count": 12,
......@@ -883,7 +883,7 @@
" "
],
"text/plain": [
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f0d39bf1c10>"
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f49ae8e9c10>"
]
},
"execution_count": 13,
......@@ -993,7 +993,7 @@
" "
],
"text/plain": [
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f0d39bfbc70>"
"<lbmpy.methods.momentbased.momentbasedmethod.MomentBasedLbMethod at 0x7f49ae8ca190>"
]
},
"execution_count": 14,
......
......@@ -9,9 +9,11 @@ Method parameters
General:
- ``stencil='D2Q9'``: stencil name e.g. 'D2Q9', 'D3Q19'. See :func:`pystencils.stencils.get_stencil` for details
- ``method='srt'``: name of lattice Boltzmann method. This determines the selection and relaxation pattern of
moments/cumulants, i.e. which moment/cumulant basis is chosen, and which of the basis vectors are relaxed together
- ``stencil=Stencil.D2Q9``: All stencils are defined in :class: `lbmpy.enums.Stencil`.
From that :class:`lbmpy.stencils.LBStenil` class will be created.
- ``method=Method.SRT``: name of lattice Boltzmann method. Defined by :class: `lbmpy.enums.Method`.
This determines the selection and relaxation pattern of moments/cumulants, i.e. which moment/cumulant
basis is chosen, and which of the basis vectors are relaxed together
- ``srt``: single relaxation time (:func:`lbmpy.methods.create_srt`)
- ``trt``: two relaxation time, first relaxation rate is for even moments and determines the viscosity (as in SRT),
......@@ -46,10 +48,7 @@ General:
compressible.
- ``equilibrium_order=2``: order in velocity, at which the equilibrium moment/cumulant approximation is
truncated. Order 2 is sufficient to approximate Navier-Stokes
- ``force_model=None``: possible values: ``None``, ``'simple'``, ``'luo'``, ``'guo'``/``'schiller'``,
``'buick'``/``'silva'``, ``'edm'``/``'kupershtokh'``, ``'he'``, ``'shanchen'``, ``'cumulant'``,
or an instance of a class implementing the same methods as the classes in :mod:`lbmpy.forcemodels`.
For details, see :mod:`lbmpy.forcemodels`
- ``force_model=None``: possibilities are defined in :class: `lbmpy.enums.ForceModel`
- ``force=(0,0,0)``: either constant force or a symbolic expression depending on field value
- ``maxwellian_moments=True``: way to compute equilibrium moments/cumulants, if False the standard
discretized LBM equilibrium is used, otherwise the equilibrium moments are computed from the continuous Maxwellian.
......@@ -182,6 +181,11 @@ Kernel functions are created in three steps:
The function :func:`create_lb_function` runs the whole pipeline, the other functions in this module
execute this pipeline only up to a certain step. Each function optionally also takes the result of the previous step.
Each of those functions is configured with three data classes. One to define the lattice Boltzmann method itself.
This class is called `LBMConfig`. The second one determines optimisations which are specific to the LBM. Optimisations
like the common supexpression elimination. The config class is called `LBMOptimisation`. The third
data class determines hardware optimisation. This can be found in the pystencils module as `CreateKernelConfig`.
With this class for example the target of the generated code is specified.
For example, to modify the AST one can run::
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment