CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[mesh manipulation] Using refineMesh for a unstructured mesh where direction is hard to define

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Giantsda

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 9, 2018, 15:49
Smile Using refineMesh for a unstructured mesh where direction is hard to define
  #1
New Member
 
Chen Shen
Join Date: Sep 2018
Posts: 14
Rep Power: 8
Giantsda is on a distinguished road
Hello,
I have a mesh that is generated from fluent.
The 2D mesh looks like this:

Using the following refineMeshdict:
Code:
set             c1; 

// Type of coordinate system:
// - global : coordinate system same for every cell. Usually aligned with
//   x,y,z axis. Specify in globalCoeffs section below.
// - patchLocal : coordinate system different for every cell. Specify in
//   patchLocalCoeffs section below.
coordinateSystem global;

// Specifies 2 directions by a name and a vector. The normal direction is
// calculated as tan1^tan2
globalCoeffs
{
    tan1            ( 1 0 0 );
    tan2            ( 0 1 0 );
}

patchLocalCoeffs
{
    // Normal direction is face normal of zero'th face of patch
    patch           frontAndBackPlanes;
    tan1            ( 1 0 0 );
    tan2            ( 0 1 0 );
}

// Specifies the direction to be refined by the name used above
// To refine in the third direction, use the keyword 'normal'
directions      
(
    tan1
    tan2
    // normal
);

// Whether to use hex topology. This will
// - if patchLocal: all cells on selected patch should be hex
// - split all hexes in 2x2x2 through the middle of edges.
useHexTopology  yes; 

// Cut purely geometric (will cut hexes through vertices) or take
// topology into account. Incompatible with 'useHexTopology'
geometricCut    no;

// Write meshes from intermediate steps
The results looks like:


which will not pass the checkMesh.

what is the correct approach to refine this mesh?

I have tried using different value for tan1 and tan2, selecting patchLocal rather then global etc.. but with no luck.

I have attached the test case. To run it, run:
fluentMeshToFoam refineMesh.msh
topoSet
refineMesh



Thanks,

Chen
Attached Files
File Type: gz refineMesh.tar.gz (7.2 KB, 6 views)
Giantsda is offline   Reply With Quote

Old   November 12, 2018, 11:28
Default
  #2
New Member
 
Lorena Fernández Fernández
Join Date: May 2016
Location: Spain
Posts: 21
Rep Power: 10
Lorena2fdez is on a distinguished road
Hi Chen,


I think that your problem it is because your mesh is no-structured. One edge have five cells as neighbour, it is not usual for this utility. You could try to change at "true": "useHexTopology", "geometricCut" or/and "writeMesh.


Best regards,
Lorena
Lorena2fdez is offline   Reply With Quote

Old   November 12, 2018, 19:13
Default
  #3
New Member
 
Chen Shen
Join Date: Sep 2018
Posts: 14
Rep Power: 8
Giantsda is on a distinguished road
Quote:
Originally Posted by Lorena2fdez View Post
Hi Chen,


I think that your problem it is because your mesh is no-structured. One edge have five cells as neighbour, it is not usual for this utility. You could try to change at "true": "useHexTopology", "geometricCut" or/and "writeMesh.


Best regards,
Lorena


Thanks for the suggestion. I have tried played with those options with no luck. However if I try to refine them adaptively at the run time (choose limits that all cells will fail into) all cells will be cut into 8 small cells without deformation.
I tried to write my code to refine the mesh but I find it is hard to reording the old cells faces and vertices and insert new cell infos into them and make sure the connectivity remains correct.

I plan to have a deep look into the adaptive mesh refinement code and modify refineMesh when I got the time.

Chen
kk415 likes this.
Giantsda is offline   Reply With Quote

Old   January 21, 2019, 08:29
Smile
  #4
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
Hello All,


I have a very simple question to ask, suppose I want to refine my mesh 16 or 40 times. Can I do it with refineMesh in one run ? or I need to keep on doing it for n number of times?
kk415 is offline   Reply With Quote

Old   January 21, 2019, 09:55
Default
  #5
New Member
 
Lorena Fernández Fernández
Join Date: May 2016
Location: Spain
Posts: 21
Rep Power: 10
Lorena2fdez is on a distinguished road
Quote:
Originally Posted by kk415 View Post
Hello All,


I have a very simple question to ask, suppose I want to refine my mesh 16 or 40 times. Can I do it with refineMesh in one run ? or I need to keep on doing it for n number of times?


Hi Krishna,


As far as I know, you could not do it with a single run. Use recursively "topoSet" and "refineMesh" for each level of refinement you need.



Regards,
Lorena
Lorena2fdez is offline   Reply With Quote

Old   January 28, 2019, 02:44
Default
  #6
Senior Member
 
krishna kant
Join Date: Feb 2016
Location: Hyderabad, India
Posts: 133
Rep Power: 10
kk415 is on a distinguished road
I have generated an unstructured mesh in icemcfd and I use refineMesh to mesh make it refine. It work fine when run in serial but shows problem in parallel mode. The error message is number of faces in communication is not same. Is this a general problem, ever reported before for refineMesh ?
kk415 is offline   Reply With Quote

Reply

Tags
refinemesh, unstructured mesh


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gambit problems Althea FLUENT 22 January 4, 2017 03:19
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55
unstructured vs. structured grids Frank Muldoon Main CFD Forum 1 January 5, 1999 10:09


All times are GMT -4. The time now is 23:53.