Generalisation of Relaxation rate setter
All methods that have a high number of free relaxation rates have different logic for how the list of relaxation rates is set. First of all, this causes a lot of confusing and unnecessary code and second it is confusing for the user.
In this MR the logic for setting the relaxation rate is generalised and then used in all methods.
- If only one relaxation rate is given by the user it is set as the shear relaxation rate.
- If a relaxation rate for all moments is defined they are just used.
- Otherwise, the conserved moments are relaxed with zero, the next two relaxation rates in the list are used for bulk and shear viscosity and the remaining ones are used to relax a complete group of the same order. If too many relaxation rates are given the list is just cut and the remaining ones have no influence.
Merge request reports
Activity
added feature proposal label
added 2 commits
lbmpy/doc/notebooks/00_tutorial_lbmpy_walberla_overview.ipynb
:- lines 199, 215 : remove commas at the end of the lines
lbmpy/doc/notebooks/03_tutorial_lbm_formulation.ipynb
:- lines 62, 106, 112, 135, 175 : it would be nicer to pass a
LBStencil(Stencil.D2Q9)
to the functions, even though a pureStencil.D2Q9
also works - line 161 : remove
get_stencil
import statement as it is deprecated and not used anymore - line 236 : remove comma
101 100 By using the continuous Maxwellian we automatically get a compressible model. 102 101 103 102 Args: 104 stencil: nested tuple defining the discrete velocity space. See `get_stencil` 103 stencil: instance of :class:`lbmpy.stencils.LBStenil` changed this line in version 11 of the diff
162 159 Creates a generic moment-based LB method. 163 160 164 161 Args: 165 stencil: sequence of lattice velocities 162 stencil: instance of :class:`lbmpy.stencils.LBStenil` changed this line in version 11 of the diff
183 181 Creates a moment-based LB method using a given equilibrium distribution function 184 182 185 183 Args: 186 stencil: see create_with_discrete_maxwellian_eq_moments 184 stencil: instance of :class:`lbmpy.stencils.LBStenil` changed this line in version 11 of the diff
63 64 Instance of either :class:`lbmpy.methods.momentbased.MomentBasedLbMethod` or 64 65 :class:`lbmpy.methods.momentbased.CentralMomentBasedLbMethod` 65 66 """ 66 if isinstance(stencil, str): 67 stencil = get_stencil(stencil) 68 67 mom_to_rr_dict = OrderedDict(moment_to_relaxation_rate_dict) 69 68 assert len(mom_to_rr_dict) == len(stencil), \ changed this line in version 11 of the diff
212 209 r"""Creates a single relaxation time (SRT) lattice Boltzmann model also known as BGK model. 213 210 214 211 Args: 215 stencil: nested tuple defining the discrete velocity space. See :func:`lbmpy.stencils.get_stencil` 212 stencil: instance of :class:`lbmpy.stencils.LBStenil` changed this line in version 11 of the diff
260 253 For possible parameters see :func:`lbmpy.methods.create_trt` 261 254 262 255 Args: 263 stencil: nested tuple defining the discrete velocity space. See :func:`lbmpy.stencils.get_stencil` 256 stencil: instance of :class:`lbmpy.stencils.LBStenil` changed this line in version 11 of the diff
278 271 Creates a MRT method using non-orthogonalized moments. 279 272 280 273 Args: 281 stencil: nested tuple defining the discrete velocity space. See :func:`lbmpy.stencils.get_stencil` 274 stencil: instance of :class:`lbmpy.stencils.LBStenil` changed this line in version 11 of the diff
301 293 Creates moment based LB method where the collision takes place in the central moment space. 302 294 303 295 Args: 304 stencil: nested tuple defining the discrete velocity space. See :func:`lbmpy.stencils.get_stencil` 296 stencil: instance of :class:`lbmpy.stencils.LBStenil` changed this line in version 11 of the diff
720 457 r"""Creates a cumulant lattice Boltzmann model. 721 458 722 459 Args: 723 stencil: nested tuple defining the discrete velocity space. See :func:`lbmpy.stencils.get_stencil` 460 stencil: instance of :class:`lbmpy.stencils.LBStenil` changed this line in version 11 of the diff