Exemple #1
0
    def test_d3q19_2nd_order_bgk(self):
        """Verifies that the entropic equilibrium for D3Q19 is the same
        as the LBGK equilibrium up to 2nd order in velocity."""
        grid = sym.D3Q19

        bgk = sym_equilibrium.bgk_equilibrium(grid, cfg)
        elbm = sym_equilibrium.elbm_d3q19_equilibrium(grid, order=2)

        for i, (elbm_ex, bgk_ex) in enumerate(zip(elbm.expression, bgk.expression)):
            for x in elbm.local_vars:
                elbm_ex = elbm_ex.subs({x.lhs: x.rhs})

            elbm_trunc = sym_codegen.truncate_velocity(Poly(elbm_ex), order=2).subs({
                'vsq': sym.S.vx**2 + sym.S.vy**2 + sym.S.vz**2})

            self.assertEqual(elbm_trunc.expand(), bgk_ex.expand(),
                            '%d component' % i)
Exemple #2
0
    def test_d3q19_2nd_order_bgk(self):
        """Verifies that the entropic equilibrium for D3Q19 is the same
        as the LBGK equilibrium up to 2nd order in velocity."""
        grid = sym.D3Q19

        bgk = sym_equilibrium.bgk_equilibrium(grid, cfg)
        elbm = sym_equilibrium.elbm_d3q19_equilibrium(grid, order=2)

        for i, (elbm_ex,
                bgk_ex) in enumerate(zip(elbm.expression, bgk.expression)):
            for x in elbm.local_vars:
                elbm_ex = elbm_ex.subs({x.lhs: x.rhs})

            elbm_trunc = sym_codegen.truncate_velocity(
                Poly(elbm_ex),
                order=2).subs({'vsq': sym.S.vx**2 + sym.S.vy**2 + sym.S.vz**2})

            self.assertEqual(elbm_trunc.expand(), bgk_ex.expand(),
                             '%d component' % i)
Exemple #3
0
 def test_d3q19_moments(self):
     grid = sym.D3Q19
     elbm = sym_equilibrium.elbm_d3q19_equilibrium(grid, order=8)
     self._verify_moments(grid, elbm)
Exemple #4
0
 def test_d3q19_moments(self):
     grid = sym.D3Q19
     elbm = sym_equilibrium.elbm_d3q19_equilibrium(grid, order=8)
     self._verify_moments(grid, elbm)