CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   blockmesh arc, no curves, no arc, only straight lines (https://www.cfd-online.com/Forums/openfoam-meshing/73426-blockmesh-arc-no-curves-no-arc-only-straight-lines.html)

 heavy_user March 8, 2010 11:56

blockmesh arc, no curves, no arc, only straight lines

1 Attachment(s)
HI Folks,

i have been trying to create a slice of a cylinder (like a peace of cake).

But blockmesh is not making curved lines for me.
I tried to figure why, but i am stuck.
I made a really simple case, which is symmetric to the y-axis.
On the -y side he is making an arc, on the +y side not...and i dont know why..(attached picture, it is supposed to be half a circle)
Did I overlook something simple??

Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  1.6                                  | |  \\  /    A nd          | Web:      http://www.OpenFOAM.org              | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      dictionary;     object      blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices        (        (0    0    0)      (1 0 0)     (0 1 0)     (-1  0 0)     (0    0    2)      (1 0 2)     (0 1  2)     (-1 0  2) ); edges (           //(1/sqrt (2) 1/sqrt (2) 0 ) arc 1 2 (0.70710678 0.70710678 0) arc 2 3 (-0.70710678 0.70710678 0) arc 5 6 (0.70710678 0.70710678 2) arc 6 7 (-0.70710678 0.70710678 2) ); blocks          (      hex (0 1 2 3 4 5 6 7)      (10 1 60) simpleGrading (3 1 3) ); patches        (     patch inlet     (         (0 3 2 1)     )          wall sidewall     (       (2 6 5 1)       (3 7 6 2)     )     wall wedge     (     (0 1 5 4)     (4 7 3 0)     )         patch outlet        (     (4 7 6 5)     ) ); mergePatchPairs ( ); // ************************************************************************* //```

 pg22 March 22, 2010 06:58

I think that the block definition is wrong here. There is only one block which would lead to highly skewed cells.

It would be better to use an O-type grid. The semi-circular region would be split into four sub-regions. In this layout there would be a central rectangular region surrounded by three outer regions. The outer regions would have curved outer edges to fit the semi-circular geometry.

 psk July 27, 2013 05:11

Draw the geometry in blockmesh

Good Day Folks,

I am trying to draw my wing geometry inside blockMesh [ ie. wing is locate inside the domain] for that i create domain,
-----------------------------------------------------------------------------------------------------------------------
Domain (Rectangular )
(
(0 0 0) // vertex 0
(100 0 0) // vertex 1
(100 0 25) // vertex 2
(0 100 0) // vertex 3

(0 100 0) // vertex 4
(100 100 0) // vertex 5
(100 100 25) // vertex 6
(0 100 25) // vertex 7
);

blocks
(
hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
)
------------------------------------------------------------------------------------------------------------------------
wing Geometry coordinates

points[1] = point(11.03188, 3.534115, 6.404323);
points[2] = point(3.190682, 4.892467, 5.764356);
points[3] = point(9.559749, -5.47123, 2.317475);
__________________________________________________ ___________________

I took example of blockMesh from potentialFoam cylinder tutorial, kindly help me how I can built wing inside the domain using blockMeshDict.kindly see my attached wing & blockMeshDict for your kind perusal.while running blockmesh I got erroe like this,

toshiba@ubuntu:~/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder\$ blockMesh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.1.0-0bc225064152
Exec : blockMesh
Date : Jul 27 2013
Time : 15:07:51
Host : "ubuntu"
PID : 4111
Case : /home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Creating block mesh from
"/home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder/constant/polyMesh/blockMeshDict"
Using #codeStream at line 19 in file "/home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder/constant/polyMesh/blockMeshDict"
Using #codeStream with "/home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder/dynamicCode/platforms/linuxGccDPOpt/lib/libcodeStream_257d30184e57a5c9c2f645de53bc3f5b42c8 fb53.so"
Creating new library in "dynamicCode/_257d30184e57a5c9c2f645de53bc3f5b42c8fb53/platforms/linuxGccDPOpt/lib/libcodeStream_257d30184e57a5c9c2f645de53bc3f5b42c8 fb53.so"
Invoking "wmake -s libso /home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder/dynamicCode/_257d30184e57a5c9c2f645de53bc3f5b42c8fb53"
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file codeStreamTemplate.C
/home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder/constant/polyMesh/blockMeshDict::#codeStream: In function ‘void Foam::codeStream_257d30184e57a5c9c2f645de53bc3f5b4 2c8fb53(Foam::Ostream&, const Foam::dictionary&)’:
/home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder/constant/polyMesh/blockMeshDict::#codeStream:34:8: error: ‘line’ was not declared in this scope
/home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder/constant/polyMesh/blockMeshDict::#codeStream:36:6: error: ‘lines’ was not declared in this scope
make: *** [Make/linuxGccDPOpt/codeStreamTemplate.o] Error 1

--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/_257d30184e57a5c9c2f645de53bc3f5b42c8fb53/platforms/linuxGccDPOpt/lib/libcodeStream_257d30184e57a5c9c2f645de53bc3f5b42c8 fb53.so"

file: /home/toshiba/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder/constant/polyMesh/blockMeshDict from line 17 to line 17.

From function functionEntries::codeStream::execute(..)
in file db/dictionary/functionEntries/codeStream/codeStream.C at line 195.

FOAM exiting

toshiba@ubuntu:~/OpenFOAM/toshiba-2.1.0/run/openfoam210/tutorials/basic/potentialFoam/testcylinder/cylinder\$

 manuelffonseca January 20, 2017 17:49

dude, you have this

edges
(
//(1/sqrt (2) 1/sqrt (2) 0 )
arc 1 2 (0.70710678 0.70710678 0)
arc 2 3 (-0.70710678 0.70710678 0)
arc 5 6 (0.70710678 0.70710678 2)
arc 6 7 (-0.70710678 0.70710678 2)

);

but the arc have to have a point between vertice 1 and 2, that mean you need a pont that satisfy the circunference equacion, 2ndf you have to reconfigurate the vertices to a real coordinates, because i see between the Parentheses (), looks like the cube coords as sown below
vertices
(
(0 0 0)
(1 0 0)
(0 1 0)
(-1 0 0)

(0 0 2)
(1 0 2)
(0 1 2)
(-1 0 2)
);

i think the real vertices are

(
(0 0 0)
(1 0 0)
(0.70710678 0.70710678 0)
(0 0 z)
(1 0 z)
(0.70710678 0.70710678 z)
)

whre z can to be a small number

Best regards
Manuel Fermin Fonseca

Quote:
 Originally Posted by heavy_user (Post 248984) HI Folks, i have been trying to create a slice of a cylinder (like a peace of cake). But blockmesh is not making curved lines for me. I tried to figure why, but i am stuck. I made a really simple case, which is symmetric to the y-axis. On the -y side he is making an arc, on the +y side not...and i dont know why..(attached picture, it is supposed to be half a circle) Did I overlook something simple?? Code: ```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  1.6                                  | |  \\  /    A nd          | Web:      http://www.OpenFOAM.org              | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      dictionary;     object      blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices        (        (0    0    0)      (1 0 0)     (0 1 0)     (-1  0 0)     (0    0    2)      (1 0 2)     (0 1  2)     (-1 0  2) ); edges (           //(1/sqrt (2) 1/sqrt (2) 0 ) arc 1 2 (0.70710678 0.70710678 0) arc 2 3 (-0.70710678 0.70710678 0) arc 5 6 (0.70710678 0.70710678 2) arc 6 7 (-0.70710678 0.70710678 2) ); blocks          (      hex (0 1 2 3 4 5 6 7)      (10 1 60) simpleGrading (3 1 3) ); patches        (     patch inlet     (         (0 3 2 1)     )          wall sidewall     (       (2 6 5 1)       (3 7 6 2)     )     wall wedge     (     (0 1 5 4)     (4 7 3 0)     )         patch outlet        (     (4 7 6 5)     ) ); mergePatchPairs ( ); // ************************************************************************* //```

 manuelffonseca January 20, 2017 22:50

using this

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

convertToMeters 0.1;

vertices
(
(0 0 0)
(1 0 0)
(0.70710678 0.70710678 0)
(0 0 0.1)
(1 0 0.1)
(0.70710678 0.70710678 0.1)
);

blocks
(
hex (0 1 2 3 4 5) (20 20 1) simpleGrading (1 1 1)
);

edges
(
arc 1 2 (0.8 0.6 0)
arc 4 5 (0.8 0.6 0.1)
);

boundary
(
paredmovil
{
type wall;
faces
(
(0 1 4 3)
);
}
paredfija
{
type wall;
faces
(
(1 2 5 4)
(0 3 5 2)
);
}
frontalyposterior
{
type empty;
faces
(
(0 1 2)
(3 4 5)
);
}
);

mergePatchPairs
(
);

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

i got this

D:\Pruebas cfd\torta>checkmesh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
/* Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt *\
| Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com |
\*---------------------------------------------------------------------------*/
Build : 2.1-88b2f2ae3a0b
Exec : checkmesh
Date : Jan 20 2017
Time : 22:27:33
Host : "Lg"
PID : 1280
Case : D:/Pruebas cfd/torta
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMas
ter
allowSystemOperations : Disallowing user-supplied system call operations

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

Create polyMesh for time = 0

--> FOAM FATAL ERROR:
Cannot find file "points" in directory "polyMesh" in times 0 down to constant

From function Time::findInstance(const fileName&, const word&, const IOobjec
in file db/Time/findInstance.C at line 188.

FOAM exiting

 Antimony January 22, 2017 21:38

Hi,

I suspect your blockMesh did not finish properly. Looking at the blockMeshDict, the hex block is not properly defined. You need to have 8 vertices (if you are trying to get wedges, then you can have repeated vertices), but you have only 6. As a result, your blockMesh would have terminated with errors and consequently you have no mesh that checkMesh can find.

Hope this helps.

Cheers,
Antimony

 manuelffonseca January 23, 2017 09:21

sure

You right thanks for answer, i dont know how to build mesh with wedges.:(

Quote:
 Originally Posted by Antimony (Post 634316) Hi, I suspect your blockMesh did not finish properly. Looking at the blockMeshDict, the hex block is not properly defined. You need to have 8 vertices (if you are trying to get wedges, then you can have repeated vertices), but you have only 6. As a result, your blockMesh would have terminated with errors and consequently you have no mesh that checkMesh can find. Hope this helps. Cheers, Antimony

 Antimony January 23, 2017 21:04

Hi,

Look at section 5.3.3 in this link: http://cfd.direct/openfoam/user-guide/blockMesh/

Cheers,
Antimony

 manuelffonseca January 25, 2017 14:13

mesh an arc

Thanks you sr, it mean if i need an arc as a section cake, i need to build an wedge plus an arc. ill try with it. its the reason the indy professor of the spoken tutorial buils a pipe using a splitter circle in salome.

Quote:
 Originally Posted by Antimony (Post 634458) Hi, Look at section 5.3.3 in this link: http://cfd.direct/openfoam/user-guide/blockMesh/ Cheers, Antimony

 manuelffonseca January 26, 2017 21:48

Solved it

I can see the circle's section, but the checkmesh fail.

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

convertToMeters 0.1;

vertices
(
(0 0 0)
(0.5 0 0)
(1 0 0)
(0.5 0.5 0)
(0.707 0.707 0)
(0 0 0.1)
(0.5 0 0.1)
(1 0 0.1)
(0.5 0.5 0.1)
(0.707 0.707 0.1)
);

blocks
(
hex (0 1 3 3 5 6 8 8) (20 20 1) simpleGrading (1 1 1)
hex (1 2 4 3 6 7 9 8) (20 20 1) simpleGrading (1 1 1)
);

edges
(
arc 2 4 (0.858 0.514 0)
arc 7 9 (0.858 0.514 0.1)
);

boundary
(
paredmovil
{
type wall;
faces
(
(0 1 6 5)
(1 2 7 6)
);
}
paredfija
{
type wall;
faces
(
(0 5 8 3)
(3 8 9 4)
(2 4 9 7)
);
}
frontalyposterior
{
type empty;
faces
(
(0 1 3 3)
(5 6 8 8)
(1 2 4 3)
(6 7 9 8)
);
}
);

mergePatchPairs
(
);

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

Quote:
 Originally Posted by Antimony (Post 634458) Hi, Look at section 5.3.3 in this link: http://cfd.direct/openfoam/user-guide/blockMesh/ Cheers, Antimony

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