Comments (6)
This is down to the numerical accuracy of the mesh.
i.e. this can be reproduced with:
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
from turtlefsi.
Thank you for supplying the code!
I can see that the top and right boundary cannot be marked for some reason. As you said, I tested the bottom and it worked fine, so there seems to be something wrong with the top and right boundary. Although it is not immediately clear for me if it comes from the original mesh or the way we try to define the boundary...
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 RectangleMesh
. If not, I can further try to identify why top and right are not working, so please let me know.
from turtlefsi.
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.
from turtlefsi.
Yes, sure. The same error happens with the original solver by only changing the way of marking the boundary.
hwloc/linux: Ignoring PCI device with non-16bit domain.
Pass --enable-32bits-pci-domain to configure to support such devices
(warning: it would break the library ABI, don't enable unless really needed).
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
*** Warning: Found no facets matching domain for boundary condition.
Compute Jacobian matrix
Newton iteration 0: r (atol) = 2.760e-01 (tol = 1.000e-07), r (rel) = 1.674e-03 (tol = 1.000e-07)
Newton iteration 1: r (atol) = 1.712e-11 (tol = 1.000e-07), r (rel) = 2.601e-15 (tol = 1.000e-07)
Distance x: 1.817850e-18
Distance y: -1.000000e-04
Although it will go on calculating, the contour result is wrong.
The not working case file is here, you can run it with original turtleFSI to see the errors.
TF_csm_topfix.txt
I think the proposed TF_csm.xml.gz file has some problems with identifying the top boundary.
Because I tested using different ways to build the mesh for the original TF_CSM case, like:
p1 = Point(0.25, 0.19)
p2 = Point(0.6, 0.21)
mesh = RectangleMesh(p1, p2, 175, 10)
Then the top boundary can be chosen using:
Barwall = AutoSubDomain(lambda x: (near(x[0], 0.25)))
Topwall = AutoSubDomain(lambda x: (near(x[1], 0.21)))
boundaries = MeshFunction("size_t", mesh, mesh.geometry().dim() - 1)
boundaries.set_all(0)
Barwall.mark(boundaries, 1)
Topwall.mark(boundaries, 2)
Then the displacement contour is:
from turtlefsi.
Dear @keiyamamo
Thank you, RectangleMesh
will fit my need for now. I am just testing my code. You don't need to change now. (^_^)
I think it is not an important problem since it goes well for the left fixed condition. And users will use their own mesh files when they solve their own projects.
from turtlefsi.
Dear @jorgensd
Thank you! I see!
from turtlefsi.
Related Issues (20)
- Creating a mesh with markers HOT 2
- Suspended solid in a rotating fluid - dealing with finite rotations HOT 9
- Rotating a flap around a point on a aerofoil every timestamp HOT 2
- Strange numerical divergence in FSI example HOT 12
- Error in visualization of results in paraview (TF_fsi) HOT 11
- Pressure should not be part of save_deg >1 ? HOT 23
- checkpoint is only saving one time step, n-1
- Error in make_womersley_bcs due to numpy.complex removal HOT 2
- pytest missing laplace as mesh moving
- `configparser` convert all key names to lowercase HOT 4
- right hand side vector `b` newly created at every time step? HOT 1
- posssibility to extent the fluid solver to be turbulent HOT 2
- mesh_path is overwritten
- change from .pickle to .json?
- Does this open source project support the study of the effect of surface roughness on the deformation behavior of flexible plates in flow fields? HOT 2
- Remove parameterization over conda versions HOT 2
- accessing external files on docker HOT 16
- Issue new release of TurtleFSI to generate DOI for Nature Comms Paper HOT 11
- test_save_deg2 fails for FEniCS stable HOT 16
- Making a mesh HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turtlefsi.