{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import sympy as sp\n", "from lbmpy.chapman_enskog import ChapmanEnskogAnalysis\n", "from lbmpy.creationfunctions import create_lb_method\n", "sp.init_printing()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Demo: Automatic Chapman Enskog Analysis \n", "\n", "\n", "First, we create a SRT lattice Boltzmann method. It is defined as the set of moments, together with one relaxation rate per moment." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
Moment | \n", "Eq. Value | \n", "Relaxation Rate | \n", "
---|---|---|
$1$ | \n", "$\\rho$ | \n", "$\\omega_{0}$ | \n", "
$x$ | \n", "$u_{0}$ | \n", "$\\omega_{1}$ | \n", "
$y$ | \n", "$u_{1}$ | \n", "$\\omega_{1}$ | \n", "
$z$ | \n", "$u_{2}$ | \n", "$\\omega_{1}$ | \n", "
$x^{2}$ | \n", "$\\frac{\\rho}{3} + u_{0}^{2}$ | \n", "$\\omega_{0}$ | \n", "
$y^{2}$ | \n", "$\\frac{\\rho}{3} + u_{1}^{2}$ | \n", "$\\omega_{0}$ | \n", "
$z^{2}$ | \n", "$\\frac{\\rho}{3} + u_{2}^{2}$ | \n", "$\\omega_{0}$ | \n", "
$x y$ | \n", "$u_{0} u_{1}$ | \n", "$\\omega_{0}$ | \n", "
$x z$ | \n", "$u_{0} u_{2}$ | \n", "$\\omega_{0}$ | \n", "
$y z$ | \n", "$u_{1} u_{2}$ | \n", "$\\omega_{0}$ | \n", "
$x^{2} y$ | \n", "$\\frac{u_{1}}{3}$ | \n", "$\\omega_{1}$ | \n", "
$x^{2} z$ | \n", "$\\frac{u_{2}}{3}$ | \n", "$\\omega_{1}$ | \n", "
$x y^{2}$ | \n", "$\\frac{u_{0}}{3}$ | \n", "$\\omega_{1}$ | \n", "
$x z^{2}$ | \n", "$\\frac{u_{0}}{3}$ | \n", "$\\omega_{1}$ | \n", "
$y^{2} z$ | \n", "$\\frac{u_{2}}{3}$ | \n", "$\\omega_{1}$ | \n", "
$y z^{2}$ | \n", "$\\frac{u_{1}}{3}$ | \n", "$\\omega_{1}$ | \n", "
$x^{2} y^{2}$ | \n", "$\\frac{\\rho}{9} + \\frac{u_{0}^{2}}{3} + \\frac{u_{1}^{2}}{3}$ | \n", "$\\omega_{0}$ | \n", "
$x^{2} z^{2}$ | \n", "$\\frac{\\rho}{9} + \\frac{u_{0}^{2}}{3} + \\frac{u_{2}^{2}}{3}$ | \n", "$\\omega_{0}$ | \n", "
$y^{2} z^{2}$ | \n", "$\\frac{\\rho}{9} + \\frac{u_{1}^{2}}{3} + \\frac{u_{2}^{2}}{3}$ | \n", "$\\omega_{0}$ | \n", "