コード例 #1
0
    def test_domain_with_circle(self):
        fname = 'circle.npz'
        dom2d = copy.deepcopy(self.dom2d)
        dom2d['elements'] = [pyLBM.Circle([0.5, 1.], .5, label=10)]
        dom = pyLBM.Domain(dom2d)

        check_from_file(dom, fname)
コード例 #2
0
    def test_domain_with_fluid_circle(self):
        fname = 'fluid_circle.npz'
        dom2d = copy.deepcopy(self.dom2d)
        dom2d['elements'] = [
            pyLBM.Parallelogram([0., 0.], [1., 0], [0., 2.], label=20),
            pyLBM.Circle([0.5, 1.], .5, label=10, isfluid=True)
        ]
        dom = pyLBM.Domain(dom2d)

        check_from_file(dom, fname)
コード例 #3
0
from __future__ import print_function
from __future__ import division
# Authors:
#     Loic Gouarin <*****@*****.**>
#     Benjamin Graille <*****@*****.**>
#
# License: BSD 3 clause
"""
Example of a 2D geometry: the square [0,1]x[0,1] with a circular hole
"""
import pyLBM
dgeom = {
    'box': {
        'x': [0, 1],
        'y': [0, 1],
        'label': 0
    },
    'elements': [pyLBM.Circle((0.5, 0.5), 0.125, label=1)],
}
geom = pyLBM.Geometry(dgeom)
geom.visualize(viewlabel=True)
コード例 #4
0
# Authors:
#     Loic Gouarin <*****@*****.**>
#     Benjamin Graille <*****@*****.**>
#
# License: BSD 3 clause
"""
Example of a square in 2D with a circular hole with a D2Q13
"""
from six.moves import range
import pyLBM
dico = {
    'box': {
        'x': [0, 2],
        'y': [0, 1],
        'label': 0
    },
    'elements': [pyLBM.Circle((0.5, 0.5), 0.2)],
    'space_step': 0.05,
    'schemes': [{
        'velocities': list(range(13))
    }],
}
dom = pyLBM.Domain(dico)
dom.visualize()
dom.visualize(view_distance=True)
コード例 #5
0
# Authors:
#     Loic Gouarin <*****@*****.**>
#     Benjamin Graille <*****@*****.**>
#
# License: BSD 3 clause
"""
Example of a 2D geometry: the square [0,1]x[0,1] with a circular hole
"""
import pyLBM
d = {
    'box': {
        'x': [0, 1],
        'y': [0, 1],
        'label': 0
    },
    'elements': [pyLBM.Circle((.5, .5), .125, label=1)],
}
g = pyLBM.Geometry(d)
g.visualize(viewlabel=True)
コード例 #6
0
# Authors:
#     Loic Gouarin <*****@*****.**>
#     Benjamin Graille <*****@*****.**>
#
# License: BSD 3 clause
"""
Example of a complex geometry in 2D
"""
import pyLBM
square = pyLBM.Parallelogram((.1, .1), (.8, 0), (0, .8), isfluid=False)
strip = pyLBM.Parallelogram((0, .4), (1, 0), (0, .2), isfluid=True)
circle = pyLBM.Circle((.5, .5), .25, isfluid=True)
inner_square = pyLBM.Parallelogram((.4, .5), (.1, .1), (.1, -.1),
                                   isfluid=False)
d = {
    'box': {
        'x': [0, 1],
        'y': [0, 1],
        'label': 0
    },
    'elements': [square, strip, circle, inner_square],
}
g = pyLBM.Geometry(d)
g.visualize()
# rounded inner angles
g.add_elem(pyLBM.Parallelogram((0.1, 0.9), (0.05, 0), (0, -0.05),
                               isfluid=True))
g.add_elem(pyLBM.Circle((0.15, 0.85), 0.05, isfluid=False))
g.add_elem(pyLBM.Parallelogram((0.1, 0.1), (0.05, 0), (0, 0.05), isfluid=True))
g.add_elem(pyLBM.Circle((0.15, 0.15), 0.05, isfluid=False))
g.add_elem(