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

[mesh manipulation] How to use refineHexMesh just in 2 direction?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 28, 2013, 15:58
Post How to use refineHexMesh just in 2 direction?
  #1
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 15
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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 offline   Reply With Quote

Old   October 29, 2013, 09:37
Default
  #3
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 15
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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 offline   Reply With Quote

Old   November 2, 2013, 20:13
Default
  #5
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 15
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, 17:19
Default
  #6
New Member
 
Dr. Chatur Ramalingum
Join Date: Jul 2012
Posts: 5
Rep Power: 14
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, 16:19
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 offline   Reply With Quote

Old   May 21, 2014, 19:53
Default
  #8
Member
 
Lucas Mutti
Join Date: Aug 2013
Posts: 47
Rep Power: 14
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, 14:43
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 offline   Reply With Quote

Reply


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
ERROR: Flow direction on the boundaries must not be tangential to the boundary. turbomax CFX 3 October 27, 2024 07:19
Advective BC with specified direction (outlet-velocity) uckmhnds OpenFOAM Running, Solving & CFD 0 August 19, 2018 21:50
Flow Direction: normal to boundary!!! Atit CFX 1 August 2, 2015 14:42
Changing inflow velocity direction deteriorates lift and drag ziggo FLUENT 3 July 24, 2013 09:39


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