CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

Help! How to use refineHexMesh just in 2 direction?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   October 28, 2013, 15:58
Post Help! How to use refineHexMesh just in 2 direction?
  #1
Member
 
Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5
ripperjack is on a distinguished road
Hi all,

I am simulating a case with a very large mesh (>40 million). I need to generate a coarse mesh first, and decompose it, and then refine the mesh using refineMesh.

Unfortunely, refineMesh just "refine" the mesh but it can not interpolate the initial value so I need to use refineHexMesh instead. But again, refineHexMesh will automatically refine the mesh in all x,y,z direction, which is not what I want.

In wall-normal direction (y), I need to control the mesh directly and I will specify the mesh distribution in the coarse mesh and I just want to refine in the x, and z direction. I can just refine in x,z direction using refineMesh (I can add some lines in refineMeshDict), but I can not do similar thing by using refineHexMesh.

So is there any way I can do it? I tried many ways but all failed...

Tons of thanks in advance!

Best regards,

Last edited by ripperjack; November 2, 2013 at 20:14.
ripperjack is offline   Reply With Quote

Old   October 28, 2013, 16:52
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,305
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Ping,

Just a quick question: have you tried looking at the source code of refineMesh and refineHexMesh to see if it would be possible to add the map fields feature to refineMesh?

On the other hand, do you want to only refine in 2 directions because the case is in 2D or is there another reason?

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   October 29, 2013, 09:37
Default
  #3
Member
 
Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5
ripperjack is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings Ping,

Just a quick question: have you tried looking at the source code of refineMesh and refineHexMesh to see if it would be possible to add the map fields feature to refineMesh?

On the other hand, do you want to only refine in 2 directions because the case is in 2D or is there another reason?

Best regards,
Bruno
Dear Bruno,

Thanks very much, I took a look at the source code of refineMesh, refineHexMesh. They are very different, I took a shoot to add something into refineMesh but no success yet, I will keep trying. Anyway it is a good suggestion thanks!

BTW: I want to just refine in x, z direction because in y direction, the mesh is not uniform, and I want to explicitly control the grid distribution, e.g., the first grid above the wall, how many grid below y+=10, etc. I do not know if I can get the same grid distribution by using refineMesh in y direction.

Regards,

Last edited by ripperjack; November 2, 2013 at 20:14.
ripperjack is offline   Reply With Quote

Old   November 2, 2013, 18:17
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,305
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Ping,

I gave it a try myself, but refineMesh uses one way of cutting meshes that seems to be very different from the refineHexMesh one, where the latter relies on polyTopoChange to map the fields from one mesh to the other. Therefore, it's not possible to easily adapt the code from one to another

Nonetheless, have you tried using mapFields with these options?
Code:
mapFields -parallelSource -parallelTarget
It will load and unload one processor-mesh at a time, not all at once, therefore it can run in serial mode (i.e. not parallel).

Best regards,
Bruno
ripperjack and mgg like this.
wyldckat is online now   Reply With Quote

Old   November 2, 2013, 20:13
Default
  #5
Member
 
Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5
ripperjack is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Ping,

I gave it a try myself, but refineMesh uses one way of cutting meshes that seems to be very different from the refineHexMesh one, where the latter relies on polyTopoChange to map the fields from one mesh to the other. Therefore, it's not possible to easily adapt the code from one to another

Nonetheless, have you tried using mapFields with these options?
Code:
mapFields -parallelSource -parallelTarget
It will load and unload one processor-mesh at a time, not all at once, therefore it can run in serial mode (i.e. not parallel).

Best regards,
Bruno
Dear Bruno,

Wow, this works perfect, and it is exact what I need! Tons of thanks!

Have a great weekend!

Regards,
ripperjack is offline   Reply With Quote

Old   April 8, 2014, 16:19
Default
  #6
New Member
 
Dr. Chatur Ramalingum
Join Date: Jul 2012
Posts: 5
Rep Power: 5
Chatur Ramalingum is on a distinguished road
Dear Mr. Wyldcat:
Sir, I would to understand the differences between refineMesh and refineHexMesh. It seems that refineMesh can be run soon after we run blockMesh to create the initial coarse mesh. With refineHexMesh, it appears that we are required to run cellSet before running refineHexMesh. Is this true? Is there an example that shows how to use refineHexMesh and cellSet. I checked the tutorials in OF2.3.x, but was not able to find an example.

Thanking you,
Chatur
Chatur Ramalingum is offline   Reply With Quote

Old   April 13, 2014, 15:19
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,305
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Chatur,

On the wiki there is a bit more information:
Essentially the refineHexMesh utility is a specific implementation of some features used in refineMesh, more specifically, it only takes care of refining hexahedral cells.

As for a tutorial that demonstrates using refineHexMesh, run this command:
Code:
find $FOAM_TUTORIALS -name Allrun | xargs grep refineHexMesh
It will show you that the tutorial "incompressible/simpleFoam/pipeCyclic" uses this utility.

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   May 21, 2014, 18:53
Default
  #8
Member
 
Lucas Mutti
Join Date: Aug 2013
Posts: 47
Rep Power: 4
lramutti is on a distinguished road
Hey guys,

I have a mesh that I have developed in Fluent - roughly 2 million cells - and I was wondering if I could use refineMesh settings to refine it even more in OpenFOAM. The reason why I do not want to refine it in Fluent is because I cannot control the number of elements of refinement. On top of the that I am dealing with an unstructured grid meshed as tets. Would it be possible to do so?

Cheers
lramutti is offline   Reply With Quote

Old   May 31, 2014, 13:43
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,305
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Lucas,

I would advise you against using tetrahedral cells for OpenFOAM simulations cases. They can be used, but additional care must be taken into account when generating the mesh... well, in general, one should be always careful when generating a mesh, but with tets more care is required. To give you an idea of what I'm talking about, have a look into this blog post: OpenFOAM: Interesting cases of bad meshes and bad initial conditions

Nonetheless, although I have not tested this yet, I do believe that refineMesh should be able to refine tetrahedral cells, i.e. decompose them into smaller tetrahedral cells.

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing inflow velocity direction deteriorates lift and drag ziggo FLUENT 3 July 24, 2013 08:39
[ICEM] Changing edge direction la7low ANSYS Meshing & Geometry 2 June 7, 2010 13:26
Flow Direction: normal to boundary!!! Atit CFX 0 June 26, 2007 06:48
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
direction of porosity shin FLUENT 0 February 23, 2005 17:17


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