CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Bug in blockMesh (http://www.cfd-online.com/Forums/openfoam-bugs/62297-bug-blockmesh.html)

feymark March 4, 2009 09:47

Hi, The problem is describ
 
Hi,

The problem is described here: http://www.cfd-online.com/OpenFOAM_D...tml?1236010571 .
I traced it down to the "importance factors", computed in blockPoints.C, which gets too big. My solution to this was to, before the "importance factors" are used, add this piece of code:

scalar impxtot = impx1 + impx2 + impx3 + impx4;
impx1 /= impxtot;
impx2 /= impxtot;
impx3 /= impxtot;
impx4 /= impxtot;

scalar impytot = impy1 + impy2 + impy3 + impy4;
impy1 /= impytot;
impy2 /= impytot;
impy3 /= impytot;
impy4 /= impytot;

scalar impztot = impz1 + impz2 + impz3 + impz4;
impz1 /= impztot;
impz2 /= impztot;
impz3 /= impztot;
impz4 /= impztot;

This works well on the cases I have looked at. Is there a better solution?

/Andreas

hjasak March 4, 2009 10:09

Heya, This is a long-standi
 
Heya,

This is a long-standing bug (mine) and the code simply looked too complex to look at 15 years after it was written.

What you are saying is that the sum of weighting factors is not zero, right? Can you tel me by how much the factors are out and if you can tell why the sum of weights is not equal to one.

Please let me know, this has bothered me for a long time.

Hrv

feymark March 4, 2009 12:12

I pretty sure the error lies w
 
I pretty sure the error lies within the method. I have confirmed by doing calculations by hand that the code does what it's suppose to do. Using the blockMeshDict I posted in the other thread I get values of impx = 0.725, impx2 = 0.375, impx3 = impx4 = 0 for i = 1, j = 1, k = 0.

/Andreas

mattijs March 6, 2009 05:54

I pushed a change to blockPoin
 
I pushed a change to blockPoints.C to 1.5.x. Seems to fix the case from http://www.cfd-online.com/cgi-bin/Op...2873#POST32873

musahossein March 23, 2009 22:49

blockMesh problem in interDyMFoam
 
In the 2D tank sloshing problem, I am modeling the tank as rectangular not the chamfered one in the tutorial. When I run blockMesh, it crashes. My question is blockMesh in interDyMFoam configured to run only the chamfered shape in the tutorial or can it accept any shape?

Musa

mattijs March 24, 2009 05:20

It can accept any (multiblock structured) shape.

musahossein March 24, 2009 15:09

problem with Block mesh in the 2D tank sloshing tutorial
 
My input is included below. I have followed the input format in the 2d sloshing tank:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
( -0.5 -0.5 0.05) // 0
( 0.5 -0.5 0.05) // 1
( 0.5 0.5 0.05) // 2
( -0.5 0.5 0.05) // 3
( -0.5 0.5 -0.05) // 4
( -0.5 -0.5 -0.05) // 5
( 0.5 -0.5 -0.05) // 6
( 0.5 0.5 -0.05) // 7
);

blocks
(
hex (0 1 2 3 5 6 7 4)
(10 10 1)
simpleGrading (1 1 1)
);

patches
(
patch walls
(
(0 1 6 5)
(1 2 7 6)
(2 3 4 7)
(3 0 5 4)
)
empty front
(
(0 1 2 3)
)

empty back
(
(5 4 7 6)
)

);

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

But when I run blockMesh, I get the following warnings. I have no clue as to why. The warning also states that I might have the surfaces inside out. However, I have followed the numbering scheme where the numbers run counterclockwise when looking at the surface from inside the block.

musa@linux-ip9p:~/OpenFOAM/musa-1.5/run/tutorials/interDyMFoam/sloshingTank2Dtest> blockMesh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Exec : blockMesh
Date : Mar 24 2009
Time : 16:01:23
Host : linux-ip9p
PID : 4494
Case : /home/musa/OpenFOAM/musa-1.5/run/tutorials/interDyMFoam/sloshingTank2Dtest
nProcs : 1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time


Reading block mesh description dictionary

Creating block mesh

Creating blockCorners

There are no non-linear edges

Creating blocks

Creating patches

Creating block mesh topology
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 134
zero or negative pyramid volume: -0.0166667 for face 0
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 134
zero or negative pyramid volume: -0.0166667 for face 1
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 134
zero or negative pyramid volume: -0.0166667 for face 2
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 134
zero or negative pyramid volume: -0.0166667 for face 3
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 134
zero or negative pyramid volume: -0.0166667 for face 4
--> FOAM Warning :
From function cellModel::mag(const labelList&, const pointField&)
in file meshes/meshShapes/cellModel/cellModel.C at line 134
zero or negative pyramid volume: -0.0166667 for face 5
--> FOAM Warning :
From function blockMesh::createTopology(IOdictionary&)
in file createTopology.C at line 412
negative volume block : 0, probably defined inside-out

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

Creating cells

Creating patches

Creating mesh from block mesh

Default patch type set to empty

There are no merge patch pairs edges

Writing polyMesh

end

I apologise for the etremely long post. I hope the brevity of the problem will make it easier to review.

Musa

mattijs March 24, 2009 15:45

Your point ordering is wrong. See e.g. Userguide U-21.

musahossein March 24, 2009 23:11

blockmesh issues in interDyMFoam
 
Many thanks for your response.

The point numbering you are refering to on U-21 puts the origin at a corner. The origin in the sloshing tank is at the COG of the tank. I looked at both. In U-21, the number scheme goes counter clockwise on each face with the normal on the outer surface of each face. In the 2d tank sloshing tutorial, the numbering shceme (as well as the dam break problem), the surface normal points into the tank. So the numbering schemes appear to be opposite. I will look at this further..


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