diff --git a/creationfunctions.py b/creationfunctions.py index 15cf5e5a14ea4e5a9d453d6b8970f50763acf4f6..4d16aab1a4e4cb0cf2b3833655987e23012828fe 100644 --- a/creationfunctions.py +++ b/creationfunctions.py @@ -11,7 +11,7 @@ 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 + 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), the second relaxation rate is used for relaxing odd moments, and controls the bulk viscosity. @@ -66,7 +66,7 @@ Entropic 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 diff --git a/cumulants.py b/cumulants.py index 049d0244d44f673bc76e2942be74b563e75f2955..ef241e816ba0cbd7f2ea2699172f05beb607e0b8 100644 --- a/cumulants.py +++ b/cumulants.py @@ -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. Args: - stencil: + stencil: stencil object cumulant_indices: sequence of cumulant indices, could be tuples or polynomial representation - if left to default and a full stencil was passed, - the full set i.e. `moments_up_to_component_order(2)` is used + if left to default and a full stencil was passed, + 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, ...` Returns: diff --git a/forcemodels.py b/forcemodels.py index 3cdbf5ad5b1858e48886cad0346e0637cf406600..5b65b271ddee6812c2159f4370be67ddd7215000 100644 --- a/forcemodels.py +++ b/forcemodels.py @@ -4,7 +4,7 @@ r""" Get started: ------------ +------------ 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`. diff --git a/geometry.py b/geometry.py index 87f2fe05557fd47f7e434c5bb18e7ccd21a2b7fc..5d8bf2285713d0539ad3d79615e090d9d4e73eac 100644 --- a/geometry.py +++ b/geometry.py @@ -26,6 +26,13 @@ def add_box_boundary(boundary_handling, boundary=NoSlip(), replace=True): 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): """Adds velocity inflow UBB boundary for pipe flow. diff --git a/maxwellian_equilibrium.py b/maxwellian_equilibrium.py index 7ac36b5958e863be367468c56a698e09e32a7f8f..e5d958a5b67c56e895ebd71b8eb5e3c4e87c38fa 100644 --- a/maxwellian_equilibrium.py +++ b/maxwellian_equilibrium.py @@ -57,7 +57,7 @@ def discrete_maxwellian_equilibrium(stencil, rho=sp.Symbol("rho"), u=tuple(sp.sy :param stencil: tuple of directions :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 c_s_sq: square of speed of sound :param compressible: compressibility