From a9f3a026254c54dc17bc6b10b099a19fce77bc4e Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Thu, 15 Mar 2018 08:52:08 +0100 Subject: [PATCH] Fixed in derivative operator --- chapman_enskog/chapman_enskog.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/chapman_enskog/chapman_enskog.py b/chapman_enskog/chapman_enskog.py index 251345b3..33b82e1b 100644 --- a/chapman_enskog/chapman_enskog.py +++ b/chapman_enskog/chapman_enskog.py @@ -103,10 +103,9 @@ class CeMoment(sp.Symbol): return self.name, self.momentTuple, self.superscript def _latex(self, printer, *args): - coordNames = ['x', 'y', 'z'] coordStr = [] for i, comp in enumerate(self.momentTuple): - coordStr += [coordNames[i]] * comp + coordStr += [str(i)] * comp coordStr = "".join(coordStr) result = "{%s_{%s}" % (self.name, coordStr) if self.superscript >= 0: @@ -384,7 +383,14 @@ def getTaylorExpandedLbEquation(pdfSymbolName="f", pdfsAfterCollisionOperator="\ def useChapmanEnskogAnsatz(equation, timeDerivativeOrders=(1, 3), spatialDerivativeOrders=(1, 2), pdfs=(['f', 0, 3], ['\Omega f', 1, 3]), **kwargs): - + """ + Uses a Chapman Enskog Ansatz to expand given equation. + :param equation: equation to expand + :param timeDerivativeOrders: tuple describing range for time derivative to expand + :param spatialDerivativeOrders: tuple describing range for spatial derivatives to expand + :param pdfs: symbols to expand: sequence of triples (symbolName, startOrder, endOrder) + :return: tuple mapping epsilon order to equation + """ t, eps = sp.symbols("t epsilon") # expand time derivatives -- GitLab