Fenics:边界条件

计算科学 Python 芬尼克斯
2021-11-30 06:33:34

`我正在解决这里发现的问题“ http://www.caesarsystems.co.uk/NAFEMS_benchmarks/le10.html ” ..我对边界条件感到非常困惑,并尽我所能计算它,但结果完全是不同的

这是我的bcs`

class Left(SubDomain): def inside(self, x, on_boundary):
    return (between (x[1], (1.0,2.75)) and between (x[2], (0.0,0.600000000))

class Right(SubDomain):
def inside(self, x, on_boundary):
    return (between(x[0], (2.0,3.25)) and between (x[2], (0.0,0.600000000)))  

class Outerall(SubDomain):
def inside(self, x, on_boundary):
    return (((x[0]/3.25)**2 + (x[1]/2.75)**2 ) -1.0 < tol) and abs(x[2]-0.600000000)


class Outermid(SubDomain):
def inside(self, x, on_boundary):
    return  (((x[0]/3.25)**2 + (x[1]/2.75)**2 ) -1.0 < tol) and abs(x[2]-0.300000000) < tol

class Top(SubDomain):
def inside(self, x, on_boundary):
    return abs(x[2]-0.600000000) < tol
1个回答

您发布的边界条件看起来很好,我认为只是因为它在这里。我会看看这个http://fenicsproject.org/documentation/dolfin/1.0.0/python/demo/pde/subdomains-poisson/python/documentation.html并检查您稍后是否正确实施边界条件. 例如,对于您的左边界条件,您仍然需要:

left = Left()
boundaries = FacetFunction("uint", mesh) ### size_t replaces uint from 1.1 on
boundaries.set_all(0)
left.mark(boundaries, 1)
bcs = [DirichletBC(V, 5.0, boundaries, 1)
ds = Measure("ds")[boundaries]