Skip to content
Snippets Groups Projects
Commit 98350acd authored by Martin Bauer's avatar Martin Bauer
Browse files

Extended scaling tutorial & more documentation cleanup

parent 44dd53d7
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ General: ...@@ -11,7 +11,7 @@ General:
- ``stencil='D2Q9'``: stencil name e.g. 'D2Q9', 'D3Q19'. See :func:`pystencils.stencils.get_stencil` for details - ``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 - ``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 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`) - ``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), - ``trt``: two relaxation time, first relaxation rate is for even moments and determines the viscosity (as in SRT),
the second relaxation rate is used for relaxing odd moments, and controls the bulk viscosity. the second relaxation rate is used for relaxing odd moments, and controls the bulk viscosity.
...@@ -66,7 +66,7 @@ Entropic methods: ...@@ -66,7 +66,7 @@ Entropic methods:
LES methods: LES methods:
- ``smagorinsky=False``: set to Smagorinsky constant to activate turbulence model, `omega_output_field` can be set to - ``smagorinsky=False``: set to Smagorinsky constant to activate turbulence model, 'omega_output_field' can be set to
write out adapted relaxation rates write out adapted relaxation rates
......
...@@ -146,10 +146,10 @@ def cumulants_from_pdfs(stencil, cumulant_indices=None, pdf_symbols=None): ...@@ -146,10 +146,10 @@ def cumulants_from_pdfs(stencil, cumulant_indices=None, pdf_symbols=None):
"""Transformation of pdfs (or other discrete function on a stencil) to cumulant space. """Transformation of pdfs (or other discrete function on a stencil) to cumulant space.
Args: Args:
stencil: stencil: stencil object
cumulant_indices: sequence of cumulant indices, could be tuples or polynomial representation cumulant_indices: sequence of cumulant indices, could be tuples or polynomial representation
if left to default and a full stencil was passed, if left to default and a full stencil was passed,
the full set i.e. `moments_up_to_component_order(2)` is used the full set i.e. `moments_up_to_component_order` with 'order=2' is used
pdf_symbols: symbolic values for pdf values, if not passed they default to :math:`f_0, f_1, ...` pdf_symbols: symbolic values for pdf values, if not passed they default to :math:`f_0, f_1, ...`
Returns: Returns:
......
...@@ -4,7 +4,7 @@ r""" ...@@ -4,7 +4,7 @@ r"""
Get started: Get started:
----------- ------------
This module offers different models to introduce a body force in the lattice Boltzmann scheme. This module offers different models to introduce a body force in the lattice Boltzmann scheme.
If you don't know which model to choose, use :class:`lbmpy.forcemodels.Guo`. If you don't know which model to choose, use :class:`lbmpy.forcemodels.Guo`.
......
...@@ -26,6 +26,13 @@ def add_box_boundary(boundary_handling, boundary=NoSlip(), replace=True): ...@@ -26,6 +26,13 @@ def add_box_boundary(boundary_handling, boundary=NoSlip(), replace=True):
return flag return flag
def add_sphere(boundary_handling, midpoint, radius, boundary=NoSlip(), replace=True):
"""Sets boundary in spherical region."""
def set_sphere(x, y):
return (x - midpoint[0]) ** 2 + (y - midpoint[1]) ** 2 < radius ** 2
return boundary_handling.set_boundary(boundary, mask_callback=set_sphere, replace=replace)
def add_pipe_inflow_boundary(boundary_handling, u_max, slice_obj, flow_direction=0, diameter=None): def add_pipe_inflow_boundary(boundary_handling, u_max, slice_obj, flow_direction=0, diameter=None):
"""Adds velocity inflow UBB boundary for pipe flow. """Adds velocity inflow UBB boundary for pipe flow.
......
...@@ -57,7 +57,7 @@ def discrete_maxwellian_equilibrium(stencil, rho=sp.Symbol("rho"), u=tuple(sp.sy ...@@ -57,7 +57,7 @@ def discrete_maxwellian_equilibrium(stencil, rho=sp.Symbol("rho"), u=tuple(sp.sy
:param stencil: tuple of directions :param stencil: tuple of directions
:param rho: sympy symbol for the density :param rho: sympy symbol for the density
:param u: symbols for macroscopic velocity, only the first `dim` entries are used :param u: symbols for macroscopic velocity, only the first 'dim' entries are used
:param order: highest order of velocity terms (for hydrodynamics order 2 is sufficient) :param order: highest order of velocity terms (for hydrodynamics order 2 is sufficient)
:param c_s_sq: square of speed of sound :param c_s_sq: square of speed of sound
:param compressible: compressibility :param compressible: compressibility
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment