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

[Technical] Hanging nodes

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By hjasak

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2005, 19:13
Default Hanging nodes
  #1
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
Hi all,
Quick question:
What is the fastest way to generate a mesh (using blockMesh) with hanging nodes?

I built several block but I wanted to use different number of points in z direction in each one of them.

Would mergePatch do the job? It was not clear from manual if hanging nodes are allowed in merged patches. Looks like not.

Thanks,
Luiz
sampaio is offline   Reply With Quote

Old   March 17, 2005, 19:19
Default You need a paradigm shift - no
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
You need a paradigm shift - nobody is getting hanged here :-)

As you know, FOAM supports polyhedral cells, i.e. a cell can have as many faces as it likes. In case of hex cells, this looks like what Fluent describes as "hanging nodes"; however, in FOAM you will get proper polyhedral cells.

The easiest way to create some would be to make two hex blocks in blockMesh with different number of cells and merge up the patches using the mergePatchPairs section - try the simpleFoam/pitzDaily3Blockstutorial - copy the block mesh description and mess about with the number of cells in various blocks.

Enjoy,

Hrv
tiam likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 17, 2005, 21:48
Default Thanks Jasak, But it is compl
  #3
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
Thanks Jasak,
But it is complaining my patchs are internal and thus cannot be merged... Which was not the case in tutorial (at least one of the patches to be merged had an external face...).
Is it still possible in my case?
Thanks again,
Luiz
sampaio is offline   Reply With Quote

Old   March 18, 2005, 04:05
Default Try this: /*---------------
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Try this:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.0 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class dictionary;
object blockMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


convertToMeters 0.1;

vertices
(
// Back plane
(0 0 0)
(1 0 0)
(1 0 0)
(2 0 0)
(0 1 0)
(1 1 0)
(1 1 0)
(2 1 0)

// Front plane
(0 0 0.1)
(1 0 0.1)
(1 0 0.1)
(2 0 0.1)
(0 1 0.1)
(1 1 0.1)
(1 1 0.1)
(2 1 0.1)
);

blocks
(
hex (0 1 5 4 8 9 13 12) (2 2 1) simpleGrading (1 1 1)
hex (2 3 7 6 10 11 15 14) (3 3 1) simpleGrading (1 1 1)
);

edges
(
);

patches
(
wall bottom
(
(0 1 9 8)
(2 3 11 10)
)
wall bottom
(
(4 12 13 5)
(6 14 15 7)
)
wall left
(
(0 8 12 4)
)
wall right
(
(3 7 15 11)
)

patch leftMerge
(
(1 5 13 9)
)
patch rightMerge
(
(2 10 14 6)
)
);

mergePatchPairs
(
( leftMerge rightMerge )
);


// ************************************************** *********************** //


Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 21, 2005, 14:17
Default Thanks Hrv, I tried. It worke
  #5
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
Thanks Hrv,
I tried. It worked. But what if I want to merge 4 pairs of patches that share an edge (like in a cross):

-----------------------------
|12.........13||14.........15|
|................||................|
|................||................|
|8.............9||10.........11|
|========||========|
|4.............5||6.............7|
|................||................|
|................||................|
|0.............1||2............3|
-----------------------------

How can I merge faces 1-5 with 2-6, 4-5 with 8-9, etc...?

I tried to merge altogether and separetely, but blockMesh complain about:


Adding point and face zones
Adding topology modifiers


--> FOAM FATAL ERROR : Face 53 reduced to less than 3 points. Topological/cutting error B.
Old face: 2(8 17) new face: 2(53 69)

Function: void slidingInterface::coupleInterface(polyTopoChange& ref) const
in file: slidingInterface/coupleSlidingInterface.C at line: 1667.

FOAM aborting

Aborted


Thanks a lot.
Luiz
sampaio is offline   Reply With Quote

Old   March 23, 2005, 17:49
Default Or else, if there is a block i
  #6
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
Or else, if there is a block inside my domain (sharing 4 faces with other block in domain)...
How should I merge the pairs? One by one or all together (like the four faces defined in the same patch)? Probably some other option, cause I tried both and it gave the errors posted above.
Thanks,
Luiz
sampaio is offline   Reply With Quote

Old   March 24, 2005, 05:25
Default Hi Luiz, the merging functi
  #7
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Hi Luiz,

the merging functionality in blockMesh is also in a separate application called stitchMesh. Put the faces you want to merge into two separate patches and use

stitchMesh <root> <case> <masterpatch> <slavepatch> [-perfect] [-partial]

Without arguments it requires the faces to cover the same area (same behaviour as mergePatchPairs), -perfect is if the faces and points on the patches match exactly, -partial if the slave side faces do not cover all of the master side (or was it the other way around?)

Mattijs
mattijs is offline   Reply With Quote

Old   March 30, 2005, 03:24
Default Hi Mattijs, But with stitchMe
  #8
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
Hi Mattijs,
But with stitchMesh I can only stitch one pair at a time, right? And when I try to repeat for another patch pair it complains there are coincident points or faces...
Anyway I will double check if I am doing anything wrong... but I wonder if either mergePatch or stitchMesh were originally designed for the purpose I have in mind (merge four adjacent faces sharing a single (geometric) edge, for instance (actually 4 different edges geometrically coincidents)).
Thanks,
Luiz
sampaio is offline   Reply With Quote

Old   March 30, 2005, 05:43
Default Hi Luiz, You are a bit in u
  #9
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Hi Luiz,

You are a bit in uncharted territory here.

If you actually have four topologically different edges and patches there should be no problem. All this coupling (and hence geometric tests) will only be done on a patch by patch basis. Does it work if the edges do not share the same location i.e. you separate the different parts?
mattijs is offline   Reply With Quote

Old   April 6, 2005, 04:39
Default So far I was able to make it w
  #10
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
So far I was able to make it work with simple things like Prof. Hrvoje's example.

But when I try to do it with L-shaped patches, where z direction ("wingspan") spacing does not match (non-perfect faces merging), it complains that two adjacent faces share 3 vertices. (In my case, the fact 2 faces share 3 vertices would not be a problem , since these 3 vertices are aligned...). These vertices are located in the corner of the "L". Inside the "L" (on the upper-right) I am setting 16 divisions in z direction, while on the outside, only 8 divisions. If the difference in the number of divisions is in the x or y direction, there is no problem.

If I switch masterpatch with slavepatch, I get a funny message:


...

Default patch type set to empty

Creating merge patch pairs

Adding point and face zones
Adding topology modifiers


--> FOAM FATAL ERROR : Error in point ordering: mixed used and unused points at the end of point list.
Number of used points: 2881 and point 2882 is used by a live face.

Function: void polyMesh::calcFaceCells() const
in file: meshes/polyMesh/calcPolyMeshFaceCells.C at line: 180.

FOAM aborting

Aborted
[luizebs@localhost oodles]$




Am I doing something wrong, or is there any limitation on what I want to do for safety reasons?

Any ideas/suggestion? Should I move to gambit to do this? (does the gambit or fluent converter works well transforming "hanging nodes" in the foam's polyedra?)

I really like blockMesh, so if i could stick with it, I would feel better...
sampaio is offline   Reply With Quote

Old   April 6, 2005, 07:27
Default Actually, having 3 common poin
  #11
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Actually, having 3 common points is not a problem and the sliding mesh algorithm is designed to work for such cases. The error sounds pretty painless (but should not happen). I can probably give you some more info if you switch some debugging on for me and give me a bigger log file. Try switching on debug for:

polyMesh
polyMeshMorph
primitiveMesh
enrichedPatch
slidingInterface

and see if the log makes more sense.

On the other hand, it may be that you just need some recent bug-fixes. Hmm...
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   April 6, 2005, 14:34
Default Thanks Hrvoje, I can send y
  #12
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
Thanks Hrvoje,

I can send you the big log file, but let me post where it started to go wrong (I think):

-> FOAM FATAL ERROR : Duplicate point found in cut face. Error in the face cutting algorithm for global face 4(1449 2280 2299 1469) local face 16.
Face: 6(1550 1551 1576 1601 1600 1575)
Cut face: 7(1576 1601 1600 1575 1570 1595 1600) local: 7(47 60 59 46 44 57 59)
Points: 7((0.605439 0.5 -1.5) (0.605439 0.5 -1) (0 0.5 -1) (0 0.5 -1.5) (0 0.328982 -1.5) (0 0.328982 -1) (0 0.5 -1))

Function: void enrichedPatch::calcCutFaces() const
in file: slidingInterface/enrichedPatch/enrichedPatchCutFaces.C at line: 544.

FOAM aborting


I must confess I am still running OpenFOAM-1.0, since I have writen some solvers, and I am very tight on schedule and afraid they might not work imediately with newer version of OpenFOAM... And also I still dont understand many new features...

Unless you really think I should update...

Thanks again,
luiz
sampaio is offline   Reply With Quote

Old   April 6, 2005, 16:48
Default Well, up to you. What you a
  #13
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Well, up to you.

What you are looking at is a typical example of a point projection bug in the sliding interface and there are bug fixes both in 1.1 and recently submitted. However, I offer no guarantees that the latest version will run. There are also additional bug fixes in my version, but that's out of reach at the moment. :-)

The only other possibility is for me to try and merge the mesh for you, but you'd have to ask me really nicely. If it fails, I have no time to play with it right now and all you get back is a mesh (I suspect this is not a dynamic mesh case). If there are other ways of producing the mesh you need, I would recommend considering this seriously.

Hmm,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   April 7, 2005, 02:52
Default Well, My mesh is complex (30
  #14
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
Well,
My mesh is complex (30 blocks, 126 vertices), I dont want you to waste your time... (if you want, I can send you the file, but I will try a couple of things more).

I will try update...

Thanks anyway!
Luiz
sampaio is offline   Reply With Quote

Old   April 30, 2005, 18:58
Default If I use the sample the mesh w
  #15
ali
Member
 
Ali Heidari
Join Date: Mar 2009
Location: Surrey, London, United Kingdom
Posts: 39
Rep Power: 17
ali is on a distinguished road
If I use the sample the mesh with hanging nodes as given by Hrv a few posts above (in this address):

http://www.cfd-online.com/OpenFOAM_D....html#POST1491

to the simple CAVITY problem. I get the following error:

--> FOAM FATAL IO ERROR : keyword leftMerge is undefined in dictionary "./cavityVariableMesh/0/p::boundaryField"

file: ./cavityVariableMesh/0/p::boundaryField from line 42 to line 57.

Function: dictionary::lookupEntry(const word& keyword) const
in file: db/dictionary/dictionary.C at line: 141.

-----------------------------------
If I add (for example) this just to test, I get another error:
--------------------

leftMerge
{
type empty;
}

I get this error:

--> FOAM FATAL IO ERROR : patch 4 not empty type. Patch type = patch

file: ./cavityVariableMesh/0/p::leftMerge from line 62 to line 62.

Function: emptyFvPatchField<type>::emptyFvPatchField
(
const fvPatch& p,
const Field<type>& field,
const dictionary& dict
)

in file: fields/fvPatchFields/basicFvPatchFields/empty/emptyFvPatchField.C at line: 95.
--------------------------

What should I do to solve this problem?
ali is offline   Reply With Quote

Old   May 1, 2005, 08:44
Default Have a look at the type of the
  #16
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Have a look at the type of the patches (constant/polyMesh/boundary or in FoamX)

Seems you specified on p that the field type is empty but the leftMerge patch is probably of type 'patch', not 'empty'.

b.t.w. is the leftMerge patch zero size? In which case you can remove it altogether.
mattijs is offline   Reply With Quote

Old   May 7, 2005, 20:27
Default Thanks Mattijs, I just want
  #17
ali
Member
 
Ali Heidari
Join Date: Mar 2009
Location: Surrey, London, United Kingdom
Posts: 39
Rep Power: 17
ali is on a distinguished road
Thanks Mattijs,

I just want to get Htv's example running. I think it's not correct to set "leftMerge" and "leftMerge". But when I set them as patch, I should set an acceptable type of patch which I don't know what to put as none of the options are proper.

How can I solve this? How can I remove it? Plz let me know thx.
ali is offline   Reply With Quote

Old   May 8, 2005, 08:58
Default Remove patch with zero sized f
  #18
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Remove patch with zero sized faces: edit the constant/polyMesh/boundary file. Remove the patch altogether and adapt the counter at the top of the file (before the opening '(')
mattijs is offline   Reply With Quote

Old   May 9, 2005, 14:27
Default Here are the files http://ww
  #19
ali
Member
 
Ali Heidari
Join Date: Mar 2009
Location: Surrey, London, United Kingdom
Posts: 39
Rep Power: 17
ali is on a distinguished road
Here are the files

ali is offline   Reply With Quote

Old   May 9, 2005, 16:26
Default Mattijs, I did try but no
  #20
ali
Member
 
Ali Heidari
Join Date: Mar 2009
Location: Surrey, London, United Kingdom
Posts: 39
Rep Power: 17
ali is on a distinguished road
Mattijs,

I did try but no luck, sorry if it seems stupid, but couldn't get it running . The pressure looks unrealistic. The (imaginary) interface is being treated as a wall?

I have attached it here:

cavityVarGrid.zip

Oh in the previous post, I just wanted to test the attachment and couldn't edit or delete it.
ali 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
Hexpress, move hanging nodes liyifei Fidelity CFD 6 October 12, 2015 22:08
Best way to handle hanging nodes in Fluent for LES? flotus1 FLUENT 4 December 16, 2013 04:32
creating hanging nodes with ICEM CFD zafer CFX 0 May 17, 2006 04:36
hanging boundary nodes aman Main CFD Forum 0 October 18, 2005 11:12
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


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