Esempio n. 1
0
    def test_d3q15_2nd_order_bgk(self):
        """Verifies that the entropic equilibrium for D3Q15 is the same
        as the LBGK equilibrium up to 2nd order in velocity."""
        grid = sym.D3Q15

        bgk = sym_equilibrium.bgk_equilibrium(grid, cfg)
        elbm = sym_equilibrium.elbm_d3q15_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)
Esempio n. 2
0
    def test_d3q15_2nd_order_bgk(self):
        """Verifies that the entropic equilibrium for D3Q15 is the same
        as the LBGK equilibrium up to 2nd order in velocity."""
        grid = sym.D3Q15

        bgk = sym_equilibrium.bgk_equilibrium(grid, cfg)
        elbm = sym_equilibrium.elbm_d3q15_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)
Esempio n. 3
0
 def test_d3q15_moments(self):
     grid = sym.D3Q15
     elbm = sym_equilibrium.elbm_d3q15_equilibrium(grid, order=8)
     self._verify_moments(grid, elbm)
Esempio n. 4
0
 def test_d3q15_moments(self):
     grid = sym.D3Q15
     elbm = sym_equilibrium.elbm_d3q15_equilibrium(grid, order=8)
     self._verify_moments(grid, elbm)