CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

refined mesh

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 28, 2011, 07:54
Default refined mesh
  #1
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 7
OFU is on a distinguished road
Hello,

I want to simulate a flow through a pie-shaped geometry like shown in the attached picture. Therefore I want to refine the mesh near the inflow and the outflow. I tried to do it with the simpleGrading option, but only the mesh near inflow was refined and not near the outflow. Does anybody know how to refine the mesh on both sides? Do I have to split the geometry into two blocks? I don't know how to solve this problem.

Thanks,
Jennifer
Attached Images
File Type: png mesh.png (7.7 KB, 52 views)
OFU is offline   Reply With Quote

Old   July 28, 2011, 13:58
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
Hi Jennifer,

you can use blockMeshDoubleGrading as described and provided in this thread:
http://www.cfd-online.com/Forums/ope...e-grading.html

Or you can split your geometry into two blocks, just as you already mentioned.

Martin
MartinB is offline   Reply With Quote

Old   July 29, 2011, 06:11
Default
  #3
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 7
OFU is on a distinguished road
Hi Martin,

thanks for your answer. I tried to use blockMeshDoubleGrading, but I didn't succeed in refining in the right direction. I inserted

blocks
(
hex (0 2 3 1 4 6 7 5) (45 50 1) doubleGrading (1 -5 1)
);

in the blockMeshDict file and got the mesh shown in the attached picture.
But I want to refine the mesh towards the outflow and inflow and not like in the picture towards the outer and inner wall of the geometry.
So tried to use
doubleGrading (-5 1 1), but then I got errors. Can you tell me how to use it correctly?

Thanks
Jennifer
Attached Images
File Type: jpg netz.jpg (28.8 KB, 76 views)
OFU is offline   Reply With Quote

Old   July 29, 2011, 06:19
Default
  #4
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
Hi Jennifer,

(-5 1 1) should be correct. Can you provide your blockMeshDict?

Martin
MartinB is offline   Reply With Quote

Old   July 29, 2011, 08:19
Default
  #5
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 7
OFU is on a distinguished road
Hi Martin,

when I run blockMeshDoubleGrading no errors occur.
Create time

Creating block mesh from
"/OpenFOAM/ofu-1.7.0/run/2drefined_doubleGrading/constant/polyMesh/blockMeshDict"

Creating blockCorners
Creating curved edges
Creating blocks
Creating patches
Creating block mesh topology
Default patch type set to empty
Check block mesh topology
Basic statistics
Number of internal faces : 0
Number of boundary faces : 6
Number of defined boundary faces : 6
Number of undefined boundary faces : 0
Checking patch -> block consistency
Creating block offsets
Creating merge list .
Creating points with scale 1
Creating cells
Creating patches
Creating mesh from block mesh
Default patch type set to empty
Writing polyMesh
End


But when I run checkMesh an error occurs:
Create time
Create polyMesh for time = 0
Time = 0
Mesh stats
points: 4590
internal points: 0
faces: 8894
internal faces: 4306
cells: 2250
boundary patches: 6
point zones: 0
face zones: 0
cell zones: 0
Overall number of cells of each type:
hexahedra: 2200
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 50
Checking topology...
Boundary definition OK.
Point usage OK.
#0 Foam::error:rintStack(Foam::Ostream&) in "/ofu/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/ofu/OpenFOAM/OpenFOAM-1.7.0//lib/linux64GccDPOpt/libOpenFOAM.so"
#2 in "/lib64/libc.so.6"
#3 Foam:rimitiveMesh::checkUpperTriangular(bool, Foam::HashSet<int, Foam::Hash<int> >*) const in "/ofu/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libOpenFOAM.so"
#4
in "/ofu/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/checkMesh"
#5
in "/ofu/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/checkMesh"
#6 __libc_start_main in "/lib64/libc.so.6"
#7
at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116
Segmentation fault


Because I can not use paraFoam I always use foamToVTK to visualize the results or the mesh. When I try to run the application I get the message:
Create time
Create mesh for time = 0
Deleting old VTK files in "/OpenFOAM/ofu-1.7.0/run/2drefined_doubleGrading/VTK"
Time: 0
volScalarFields : T p
volVectorFields : U
Internal : "/OpenFOAM/ofu-1.7.0/run/2drefined_doubleGrading/VTK/2drefined_doubleGrading_0.vtk"

--> FOAM FATAL ERROR:
bad set size -50
From function List<T>::setSize(const label)
in file /OpenFOAM/OpenFOAM-1.7.0/src/OpenFOAM/lnInclude/List.C at line 340.
FOAM aborting
#0 Foam::error:rintStack(Foam::Ostream&) in "/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::List<int>::setSize(int) in "/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/foamToVTK"
#3
in "/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/foamToVTK"
#4
in "/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/foamToVTK"
#5
in "/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/foamToVTK"
#6 __libc_start_main in "/lib64/libc.so.6"
#7
at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116
Aborted


Do you have any idea, what I do wrong or how to change the values, that it works?


Thanks
Jennifer

Last edited by OFU; August 9, 2011 at 03:20.
OFU is offline   Reply With Quote

Old   July 29, 2011, 09:24
Default
  #6
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
Hi Jennifer,

there seem to be some minor bugs in the blockMeshDoubleGrading. Here is a workaround:
- change the order of your arc definition to:
Code:
    arc 1 3 (0.25 0 0)   // <--- this was "arc 3 1" before
    arc 5 7 (0.25 0 0.001)
    arc 0 2 (0.185 0 0)
    arc 4 6 (0.185 0 0.001)
- choose a pair number of elements for x direction (in general the doubleGrading direction):
hex (0 2 3 1 4 6 7 5) (46 50 1) doubleGrading (-5 1 1) // <--- 46 instead of 45

Now it should work fine.

Martin
MartinB is offline   Reply With Quote

Old   July 29, 2011, 12:49
Default
  #7
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 7
OFU is on a distinguished road
Hi Martin,

thanks again for your answer.
I will try to insert your changes on Monday, when I will be at work again and I will let you know, if it works :-)

Have a nice weekend.
Jennifer
OFU is offline   Reply With Quote

Old   August 2, 2011, 03:24
Default
  #8
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 7
OFU is on a distinguished road
Hello again,

yesterday I changed my blockMeshDict file and blockMeshDoubleGrading seemed to run correctly. But checkMesh gave me two errors:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
Create polyMesh for time = 0
Time = 0
Mesh stats
points: 4794
internal points: 0
faces: 9296
internal faces: 4504
cells: 2300
boundary patches: 6
point zones: 0
face zones: 0
cell zones: 0
Overall number of cells of each type:
hexahedra: 2300
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0
Checking topology...
Boundary definition OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).
Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface topology
inside 46 94 ok (non-closed singly connected)
outside 46 94 ok (non-closed singly connected)
bottom 2300 2397 ok (non-closed singly connected)
top 2300 2397 ok (non-closed singly connected)
outflow 50 102 ok (non-closed singly connected)
inflow 50 102 ok (non-closed singly connected)
Checking geometry...
Overall domain bounding box (0.130815 -0.176777 0) (0.25 0.176777 0.001)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 0)
***Number of edges not aligned with or perpendicular to non-empty directions: 2200
<<Writing 4400 points on non-aligned edges to set nonAlignedEdges
Boundary openness (2.46676e-18 3.85577e-19 5.12864e-16) OK.
Max cell openness = 1.15757e-15 OK.
Max aspect ratio = 31.5465 OK.
Minumum face area = 1.3e-06. Maximum face area = 9.68891e-05. Face area magnitudes OK.
Min volume = 3.3719e-09. Max volume = 1.63389e-08. Total volume = 2.18008e-05. Cell volumes OK.
Mesh non-orthogonality Max: 89.1267 average: 65.8611
*Number of severely non-orthogonal faces: 2222.
Non-orthogonality check OK.
<<Writing 2222 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
***Max skewness = 13.2232, 1702 highly skew faces detected which may impair the quality of the results
<<Writing 1702 skew faces to set skewFaces
Failed 2 mesh checks.


And I think the generated mesh looks a little bit strange. Or is it right?

Jennifer
Attached Images
File Type: jpg netz_neu.jpg (30.0 KB, 52 views)
OFU is offline   Reply With Quote

Old   August 2, 2011, 04:55
Default
  #9
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
Hi Jennifer,

looks like the problem coming from the sequence of the arc definition.

Well, here are my blockMeshDoubleGrading source codes for OF17x and OF2x.

For the OpenFOAM 2.0.x version you must build a library first. Unpack the src_20x.tar.gz file into your users OpenFOAM folder, navigate via shell to the directory containing the "Make" folder, and call "wmake libso".

Good luck

Martin
Attached Files
File Type: gz src_20x.tar.gz (23.7 KB, 10 views)
File Type: gz blockMeshDoubleGrading_20x.tar.gz (3.9 KB, 13 views)
File Type: gz blockMeshDoubleGrading_17x.tar.gz (25.4 KB, 5 views)

Last edited by MartinB; August 9, 2011 at 03:28. Reason: Typos removed...
MartinB is offline   Reply With Quote

Old   August 4, 2011, 04:30
Default
  #10
OFU
New Member
 
Jennifer
Join Date: Aug 2009
Location: Germany
Posts: 28
Rep Power: 7
OFU is on a distinguished road
Hi Martin,

now it works. Thanks for your help :-)

Jennifer
OFU is offline   Reply With Quote

Old   December 21, 2011, 12:22
Default Problems with cells with very high aspect ratios
  #11
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 6
safre is on a distinguished road
I manage to get the blockMeshDG to work. The mesh looks very nice and graded in this simple geometry but I get one layer of cells with very high aspect ratios in the middle of the geometry.

Colud you please give a hint on what the problem might be?

My blockMeshDict file is as:

convertToMeters 1.0;


vertices
(
(-1 -1 0)
( 1 -1 0)
( 1 1 0)
(-1 1 0)

(-1 -1 1)
( 1 -1 1)
( 1 1 1)
(-1 1 1)

);

blocks
(
hex (0 1 2 3 4 5 6 7) (80 80 65) doubleGrading (1 1 -5)
);

edges
(
);

boundary
(
bottom
{
type wall;
faces ((0 3 2 1));
}
surface
{
type wall;
faces ((4 5 6 7));
}
side_half0
{
type cyclic;
neighbourPatch side_half1;
faces
(
(0 4 7 3)
);
}
side_half1
{
type cyclic;
neighbourPatch side_half0;
faces
(
(2 6 5 1)
);
}
frontAndBack_half0
{
type cyclic;
neighbourPatch frontAndBack_half1;
faces
(
(3 7 6 2)
);
}
frontAndBack_half1
{
type cyclic;
neighbourPatch frontAndBack_half0;
faces
(
(1 5 4 0)
);
}
);

mergePatchPairs
(

);

// ************************************************** *********************** //
safre is offline   Reply With Quote

Old   December 21, 2011, 12:41
Default
  #12
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 252
Rep Power: 11
MartinB is on a distinguished road
Hi Sam,

there is a bug in the code, I think... a workaround is to define a pair number of cells in z direction (changed from 65 to 64):
hex (0 1 2 3 4 5 6 7) (80 80 64) doubleGrading (1 1 -5)

Martin
MartinB is offline   Reply With Quote

Old   December 22, 2011, 06:04
Default Thank you - works perfect!
  #13
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 6
safre is on a distinguished road
Thank you - works perfect!
safre is offline   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
[ICEM] Hexa mesh, curve mesh setup, bunching law Anorky ANSYS Meshing & Geometry 4 November 12, 2014 01:27
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
How to Refined mesh ? madhuri STAR-CCM+ 2 January 21, 2011 20:37
external flow with snappyHexMesh chelvistero OpenFOAM 11 January 15, 2010 20:43
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


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