-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Found no facets matching domain for boundary condition.(TF_csm) #56
Comments
I can see that you're using your own solver. Can you check if the same error happens with the original solver by only changing the way of marking the boundary? If the error happens with the original solver, please post the problem here that can reproduce the error so that I can test it. Without minimum working example, it is hard to debug the code. |
Yes, sure. The same error happens with the original solver by only changing the way of marking the boundary.
Although it will go on calculating, the contour result is wrong. I think the proposed TF_csm.xml.gz file has some problems with identifying the top boundary.
Then the top boundary can be chosen using:
|
Thank you for supplying the code! In fact, the original csm mesh is not actually rectangular (left boundary is curved), but if you only need rectangular domain, I would suggest to use |
Dear @keiyamamo |
This is down to the numerical accuracy of the mesh. from dolfin import *
mesh = Mesh("TF_cfd.xml.gz")
R = 0.05 # Radius of the circle
c_x = 0.2 # Center of the circle x-direction
c_y = 0.2 # Center of the circle y-direction
mesh = refine(mesh)
Barwall = AutoSubDomain(lambda x: (
(x[0] - c_x)**2 + (x[1] - c_y)**2 < R**2 + DOLFIN_EPS * 1e8))
def Down(x, on_boundary):
return near(x[1], 0.19) and on_boundary
def Up(x, on_boundary):
return near(x[1], 0.21, DOLFIN_EPS) and on_boundary
def Right(x, on_boundary):
return near(x[0], 0.60) and on_boundary
Downwall = AutoSubDomain(Down)
Upwall = AutoSubDomain(Up)
Rightwall = AutoSubDomain(Right)
boundaries = MeshFunction("size_t", mesh, mesh.geometry().dim() - 1)
boundaries.set_all(0)
#Barwall.mark(boundaries, 1)
#Downwall.mark(boundaries, 2)
Upwall.mark(boundaries, 3)
#Rightwall.mark(boundaries, 4)
File("facet_function.pvd") << boundaries if you change def Up(x, on_boundary):
return near(x[1], 0.21, DOLFIN_EPS) and on_boundary to def Up(x, on_boundary):
return near(x[1], 0.21, 1e8*DOLFIN_EPS) and on_boundary the boundary will be marked correctly. Similarly, you should use tolerances for the other near operators Barwall = AutoSubDomain(lambda x: (
(x[0] - c_x)**2 + (x[1] - c_y)**2 < R**2 + DOLFIN_EPS * 1e8))
def Down(x, on_boundary):
return near(x[1], 0.19, DOLFIN_EPS*1e8) and on_boundary
def Up(x, on_boundary):
return near(x[1], 0.21, DOLFIN_EPS*1e8) and on_boundary
def Right(x, on_boundary):
return near(x[0], 0.60, DOLFIN_EPS*1e8) and on_boundary |
Dear @jorgensd Thank you! I see! |
Dear everyone
When testing TF_csm, I tried to change the fixed boundary conditions for the solid domain by modifying the
def get_mesh_domain_and_boundaries
But it seems it can't be found during calculating.
And actually, in the four boundaries, both top and right can't be found but left and bottom seem work fine. Is there anything wrong for the boundary conditions I defined?
The text was updated successfully, but these errors were encountered: