|
[Sponsors] |
[Gmsh] Mesh flattening and fluid assignment not possible. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 2, 2011, 08:16 |
Mesh flattening and fluid assignment not possible.
|
#1 |
Senior Member
Join Date: Mar 2009
Posts: 225
Rep Power: 18 |
Good day to everyone,
I managed to install Gmsh. I also managed to create desired geometry and export it to OpenFOAM. I can view it in paraView and everything seems is fine. The trouble starts when I try to assign 'setFields' (for interFoam solver). setFields finishes without any error, however, the fluid is not assigned to the domain at all. Side note: Actually it behaves the same way as if for the fluid is assigned coarser mesh and in the next step one tries to refine that mesh. The fluid assignment will not be displayed, so the correct way is to define empty initial coarse mesh, then refine, and then fluid assigned. I tried to test different things, to make sure the mesh is OK. checkMesh does not show any errors. refineMesh seems to work too. However, while trying flattenMesh errors show up. Below please find the output. Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.x | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 1.7.x-b044b56632f2 Exec : flattenMesh Date : Apr 02 2011 Time : 01:15:28 Host : hostname.local PID : 3177 Case : /Users/user/Desktop/gmsh/test nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create polyMesh for time = 0 bounding box: min = (0 0 0) max = (1 1 1) meters. --> FOAM Warning : From function twoDPointCorrector::twoDPointCorrector(const polyMesh& mesh, const vector& n) in file twoDPointCorrector/twoDPointCorrector.C at line 156 the number of vertices in the geometry is odd - this should not be the case for a 2-D case. Please check the geometry. --> FOAM Warning : From function twoDPointCorrector::twoDPointCorrector(const polyMesh& mesh, const vector& n) in file twoDPointCorrector/twoDPointCorrector.C at line 168 The number of points in the mesh is not equal to twice the number of edges normal to the plane - this may be OK only for wedge geometries. Please check the geometry or adjust the orthogonality tolerance. Number of normal edges: 121 number of points: 1331 Writing points into directory "/Users/user/Desktop/gmsh/test/constant/polyMesh" Thanks! |
|
April 2, 2011, 09:53 |
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 225
Rep Power: 18 |
I'm confused. I managed to obtain fine mesh without any errors, but still water domain through setFields cannot be assigned. Nothing happens. I also tried to use funkySetFields with the same effect.
Attached please find zipped case, so you can give a try. I would appreciate your help. |
|
April 3, 2011, 06:09 |
|
#3 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings paka,
See the file attached. It looks fine to me! The mesh is very coarse and you're trying to set the water level right through the middle of the cells. So what happens is that due to an error of something like 1e-14 around the center of each cell, only some of those cells in the middle are set as "alpha1=1". Now, if you wanted the mesh to be more refined, then the problem is in the refinement workflow that went off somewhere Best regards, Bruno
__________________
|
|
April 4, 2011, 07:22 |
|
#4 |
Senior Member
Join Date: Mar 2009
Posts: 225
Rep Power: 18 |
Strange. I don't understand. I even tried to refine my mesh and I get the same results. All the cells are empty. See attached screenshot. I'm not sure what I'm doing wrong.
The other thing, while refining the mesh using refineMesh I get following mesh check error: ***Number of edges not aligned with or perpendicular to non-empty directions: 40 <<Writing 65 points on non-aligned edges to set nonAlignedEdges I'm working on Mac, but I don't think it makes any difference. Any other tips? Anyone? I'm just trying to find some efficient free mesher which runs on mac. Thanks, K |
|
April 4, 2011, 07:30 |
|
#5 |
Senior Member
Join Date: Mar 2009
Posts: 225
Rep Power: 18 |
Overall, I think gmsh (or rather gmshToFoam) has some issues while exporting meshes to OpenFOAM. It really depends how you define the mesh within gmsh.
There are different ways to create your mesh. The most elegant one, I would say, is to extrude your mesh starting from the point. However, that kind of mesh does not export well to OpenFOAM. Then the one which works the most and produces generally none or I think some no calculation effecting errors is the mesh created from line extrusion. Nonetheless, the thing which I'm struggling with now is volume of fluid assignment, which for some reason doesn't work. Does anyone have some script or "elegant" and efficient way of defining a mesh within gmsh for OpenFOAM export? Thanks, K |
|
April 4, 2011, 09:21 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi paka,
OK, yesterday I assumed the mesh you had posted was already refined. I've just done a few more tests and it seems that your gmshToFoam is not working as intended. After refining the converted mesh you posted, it also gives me nonAlignedEdges. But if I run gmshToFoam myself, then refine it, the resulting mesh is perfectly fine. On the other hand, setFields does indeed look like its not working on the refined version. But the problem here I think is because the refined mesh has 2 cells in the Z direction, which is a big no-no for 2D cases. Nonetheless, the real problem doesn't look like to be on the side setFields, it seems to be on the side of the plugin reader for ParaView. Because I just saw the alpha1 file and it does have different values assigned to the internal mesh. I suggest a few things:
Best regards, Bruno
__________________
|
|
April 4, 2011, 09:53 |
|
#7 |
Senior Member
Join Date: Mar 2009
Posts: 225
Rep Power: 18 |
Yes, I figured the gmshToFoam must not read the gmsh mesh well. Maybe the version of Mac is not much up to date.
Thanks a lot for validating the steps. At this point, I cannot really spend time to set it up from beginning and set up whole linux box installation. I will just try to use resources which I have at this point. Later though I'll try to play with refineMeshDict, but I pretty sure the trouble lies in how the mesh is actually defined in gmsh. All in all, it should not really mater if mesh is 2D or 3D, refinement should work for both of those cases. refineMesh based on the number of initial cells should figure out that the mesh is 2D, if not, flattenMesh should do the trick. This said, the mesh on its own is not exported well (blame it on gmshToFoam). As I refine my mesh it goes from 45 hex elements to 360 hex, which is wrong. If all was OK, it should go to 180. This just confirms my suspicions that some additional vertices must be defined which overlap with one of the sides of the domain. When I view the mesh in paraView you cannot really see any double cells in Z direction. I'm not finding any other reasonable explanation. If I can ask, what I kind of meshing software do you use? Many very thanks for your time and prompt answers! K |
|
|
|