Problem CfMesh 2D Mesh
Hi,
I'm trying to mesh a car with cfMesh in 2D but I experience some problems. Here is the geometry : https://drive.google.com/file/d/0B0-...ew?usp=sharing https://drive.google.com/file/d/0B0-...ew?usp=sharing Here is my meshDict : Code:
/*--------------------------------*- C++ -*----------------------------------*\ When the ratio between maxCellSize and minCellSize is too large I have the following error : Code:
--> FOAM FATAL ERROR: Code:
Octree nodes 37794 My second problem is that my localRefinement / objectRefinements / boundaryLayers are completely ignored by the program (cartesian2DMesh). At this point I didn,t find my answers anywhere... Thanks a lot |
1 Attachment(s)
Hello,
The case did not produce the expected results because of some incorrect settings (mainly typos), and the crash was due to some bugs in the 1.1 version. Please upgrade to the 1.1.1 version available at SourceForge. We have resolved some problems reported by the people using the 2D mesher. Please check the attached case and please let me know if it generates the required result. There are a few suggestions that I would like to point out: 1. When you generate the features via surfaceFeatureEdges and export the results into an stl or an ftr file, it changes the names of the patches in the surface mesh. You need to use the new names for meshing or simply use the regular expressions. A non-existent patch name in meshDict results in the region being ignored. 2. Please pay attention to use the correct keywords. The settings are case-sensitive so you cannot use cellsize, it has to be cellSize. The same problem is with patchboundaryLayers, it shall be patchBoundaryLayers. This has caused the problem that box refinement region was ignored, and there was only one boundary layer. I hope that this helps you. Regards, Franjo |
2 Attachment(s)
Hi Franjo,
Thanks for your answer. I did upgrade myversion and since I didn't encounter my first error. And you were right about my typo because now it works much better ;) It's not so long that I work in linux environnement and not used to take care so much of the typo !!! Howevers I get a mesh loonking like I want (cf pictures). My checkMesh is not really good and I don't really know how to play with parameters in order to get good quality mesh (I tried optimiseLayer but I didn't find may informations about it). My MeshDict Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*---------------------------------------------------------------------------*\ |
1 Attachment(s)
I found the utility improveMeshQuality
in the userguide but is it possible to constrain it with qulity criteria instead of numbers of iterations ? Is it normal to get the kind of results I attached after using improveMeshQuality ? Thx a lot |
Hi,
Can you please post the content of your controlDict? Do you save the mesh in the binary format? Can you please post the log of cartesian2DMesh? It seems to me that the thickness of the first layer is smaller than the floating-point tolerance. Please increase the number of digits saved in a file or set the writeFormat to binary. Quote:
Quote:
|
Hi Franjo,
Thanks for everything, In fact I changed my wall function so I increase my first layer thickness and everything went well ! For next time I sill remember what you've said but how can I choose the writeFormat (just change ascii to binary in the header ?) It's really great to have the support of the developer while discovering this great tool :) |
Quote:
writeFormat binary; My suggestion is to use the binary format because it does not lose information, that is extremely important for very thin layers. In addition, it also saves disk space. Quote:
|
1 Attachment(s)
Hi Franjo,
I am trying to create a 2D case for flow around a pipe using cfmesh and openfoam v1712. However, it seems that I cannot get it working with "cartesian2DMesh" at all. It seems that the issue is on the stl/fra file as it consider it 3D. Basically, I created a cylinder and mesh it in salome then created boundying box for it using "surfaceGenerateBoundingBox" and use that in the meshDict. Attached please find my case file with the "Allrun" file showing the steps I have taken. I would highly appreciate your input on how to get it to work. many thanks Ashkan |
I managed to resolve my issues and generate the 2D mesh following the very helpful instructions given here
|
cfMesh different behaviour
Hi there foamers,
I didn't want to create a new thread cause the current name is good and applicable to my question as well. I just noticed that for the same geometry when I try to run cfMesh (I use cartesianMesh) for the first time it gave me 103 badCells. Then I just deleted the polymesh folder ($caseFile/constant/polymesh) and tried to run cfMesh for the second time and this time it gave me 64 badCells! this was weird for me and I tried for the third time and I got 115 badCells! I would appreciate if somebody can tell me why this happens? :confused: I also tried to change the format of my original geometry (.stl file) to .fms (using surfaceToFMS). Guess what... after running cfMesh I got a different number of badCells. But at least for this one I can assume that there might be some slight changes during the conversion from one file format to another. However, for the first case all of the trials were completely identical (in .stl format). I'm using OF1712 and latest version of cfMesh, only if that matters! |
No cells in mesh / segmentation fault
Hi dear all,
I'm also having problems with the cartesian2D mesher. The stl file (from Salome): https://drive.google.com/open?id=1X7...lLNXpFyP5PaS2p The refined one: https://drive.google.com/open?id=1Yh...TCcGJ9QGa7UfAr My meshDict only contains: Code:
surfaceFile "Ham2D.stl"; Code:
--> FOAM FATAL ERROR: Then I tried refining the mesh, but still the same error. When I change the maxCellSize parameter to 0.5, it runs but crashes and then gives Code:
segmentation fault I also tried first converting to ftr with surfaceConvert, but this did not help either. Any idea? |
Have a look at the hat case in the tutorial folder and prepare your geometry accordingly. In addition, you can find information about 2D geometries in the user guide.
You need to create a ribbon in order to use cartesian2DMesh. It may help you to try keepCellsIntersectingBoundary 1 option. However, it better to desing your geometry as a set of edges in the x-y plane and extrude it into a ribbon with the extrudeEdgesInto2DSurface utility. |
Hi franjo,
Thank you for the quick reply! I exported only the edges from salome now, but extrudeEdgesInto2DSurface doesn't take it. Problem is that it is a vtk file, which contains VERTICES, causing the fatal error Code:
Unsupported tag VERTICES |
Can you visualize the vtk file in ParaView? Do you see edges, only?
Any edge mesh format readable by OpenFOAM shall suffice. Which version of OF do you use? |
The openfoam version is 2.3.0, cfmesh v1.1.1.
When I visualise the vtk file (https://drive.google.com/open?id=1IK...czL6ccbY2IZuus), I see the edges, but also the vertices. I tried with deleting the vertices part => this visualises in paraview as only edges. But then extrudeEdgesInto2DSurface gives: Code:
--> FOAM FATAL ERROR: |
Quote:
Hi Franjo, Still same trouble here... Maybe there is a problem with the edges file... Some details on what I'm trying to do: I have a closed PolyLine in Salome (which are the edges of my geometry), which I export in the Geometry module as a vtk file. However, this file cannot be read by extrudeEdgesInto2DSurface, as mentioned earlier. Can it be due to the type of element in Salome (PolyLine)? Is there a way to make Edges from a PolyLine? ... Thanks, Jenna |
Hi all,
To by-pass my problem with cartesian2DMesh, I changed the approach as follows: instead of trying to read out edges from salome and later do extrudeEdgesInto2DSurface, I directly extruded the ribbon (in x-y plane) in the z-direction, within salome (for instance a polyline can be extruded with geompy.MakePrism). Then I named the needed patches (geompy.CreateGroup) and also added them to the mesh after meshing (with GroupOnGeom). Finally I exported the mesh as .fms by use of salomeTriSurf.py (notes on this also here). And on this fms file, cartesian2DMesh works smoothly! |
All times are GMT -4. The time now is 14:09. |