CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [blockMesh] Axisymmetric pipe expansion flow (https://www.cfd-online.com/Forums/openfoam-meshing/155115-axisymmetric-pipe-expansion-flow.html)

daniel.almeida June 24, 2015 14:18

Axisymmetric pipe expansion flow
 
Hello everybody,

I am trying to simulate the axisymmetric expansion flow in a pipe but I am having trouble to select the boundaries for my blockMeshDict and to set the conditions for such boundaries. Especially the faces at the expansion. Can anyone help me? I am uploading the blockMeshDict, p and U at 0. Without the boundary I was talking about.

convertToMeters 1;

vertices
(
(0 0 0) //vertex number 0
(8 0 0) //vertex number 1
(0 -0.0043619 0.099905) //vertex number 2
(8 -0.0043619 0.099905) //vertex number 3
(8 0.0043619 0.099905) //vertex number 4
(0 0.0043619 0.099905) //vertex number 5
(8 -0.0087238 0.19981) //vertex number 6
(16 -0.0087238 0.19981) //vertex number 7
(16 0.0087238 0.19981) //vertex number 8
(8 0.0087238 0.19981) //vertex number 9
(16 0 0) //vertex number 10


);

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

edges
(
arc 2 5 (0 0 0.1)n
arc 3 4 (8 0 0.1)
arc 6 9 (8 0 0.2)
arc 7 8 (16 0 0.2)
);

patches
(
patch
inlet
(
(0 2 5 0)
)

patch
outlet
(
(10 7 8 10)
)

wedge -f
(
(0 1 3 2)
(1 10 7 6)
)

wedge
(
(0 1 4 5)
(1 10 8 9)
)

wall
wall
(
(2 3 4 5)
(6 7 8 9)

)
);

mergePatchPairs
(
);

p:
internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform 0;
}

wall
{
type zeroGradient;
}

axi_symm-f
{
type wedge;
}

axi_symm-r
{
type wedge;
}
}


U:

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0.5 0 0); //uniform incoming flow of 1m/s
}

outlet
{
type zeroGradient;
}

wall
{
type fixedValue;
value uniform (0 0 0); //no slip condition, 0m/s velocity
}

axi_symm-f
{
type wedge;
}

axi_symm-r
{
type wedge;
}
}

alexB June 26, 2015 06:41

Hi Daniel,

can you draw a little sketch how it should look like and post your error message?

regards
Alex

daniel.almeida June 26, 2015 10:11

1 Attachment(s)
Hello Alex,

Thanks for your attention!

I was trying to make something like in the image.

When I run the blockMesh with the code I first uploaded it works, but when I try to declare the face (3 6 9 4) as a wall it gives me the following error message:

--> FOAM FATAL ERROR:
face 2 in patch 4 does not have neighbour cell face: 4(3 6 9 4)

From function polyMesh::facePatchFaceCells(const faceList& patchFaces,const labelListList& pointCells,const faceListList& cellsFaceShapes,const label patchID)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 127.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::polyMesh::facePatchFaceCells(Foam::List<Foam ::face> const&, Foam::List<Foam::List<int> > const&, Foam::List<Foam::List<Foam::face> > const&, int) const at ??:?
#3 Foam::polyMesh::setTopology(Foam::List<Foam::cellS hape> const&, Foam::List<Foam::List<Foam::face> > const&, Foam::List<Foam::word> const&, Foam::List<int>&, Foam::List<int>&, int&, int&, Foam::List<Foam::cell>&) at ??:?
#4 Foam::polyMesh::polyMesh(Foam::IOobject const&, Foam::Xfer<Foam::Field<Foam::Vector<double> > > const&, Foam::List<Foam::cellShape> const&, Foam::List<Foam::List<Foam::face> > const&, Foam::List<Foam::word> const&, Foam::PtrList<Foam::dictionary> const&, Foam::word const&, Foam::word const&, bool) at ??:?
#5 Foam::blockMesh::createTopology(Foam::IOdictionary const&, Foam::word const&) at ??:?
#6 Foam::blockMesh::blockMesh(Foam::IOdictionary const&, Foam::word const&) at ??:?
#7
at ??:?
#8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9
at ??:?
Aborted

The new code I tried declaring the wall is this:

[CODE]

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

convertToMeters 1;

vertices
(
(0 0 0) //vertex number 0
(8 0 0) //vertex number 1
(0 -0.0043619 0.099905) //vertex number 2
(8 -0.0043619 0.099905) //vertex number 3
(8 0.0043619 0.099905) //vertex number 4
(0 0.0043619 0.099905) //vertex number 5
(8 -0.0087238 0.19981) //vertex number 6
(16 -0.0087238 0.19981) //vertex number 7
(16 0.0087238 0.19981) //vertex number 8
(8 0.0087238 0.19981) //vertex number 9
(16 0 0) //vertex number 10


);

blocks
(
hex (0 1 1 0 2 3 4 5) //vertex number, using 5 vertices creating a wedge (slice)
(100 1 20) //number of cells in each direction, 1 element in y because it's a 2D flow
simpleGrading (1 1 1) //cell expansion ratio, stands for the ratio of the size of the last and first element iin that direction, in this case all of them have the same size
hex (1 10 10 1 6 7 8 9) (100 1 40) simpleGrading (1 1 1)
);

edges
(
arc 2 5 (0 0 0.1) //connects vertices 2 and 5 through the interpolation point given
arc 3 4 (8 0 0.1) //connects vertices 3 and 4 through the interpolation point given
arc 6 9 (8 0 0.2)
arc 7 8 (16 0 0.2)
);

patches
(
patch //type of boundary, patch is the most generic type
inlet //name of the patch
(
(0 2 5 0) //block face in the patch
)

patch
outlet
(
(10 7 8 10)
)

wedge //used for front and back of the wedge in an axi-symetric geometry
axi_symm-f
(
(0 1 3 2)
(1 10 7 6)
)

wedge //used for front and back of the wedge in an axi-symetric geometry
axi_symm-r
(
(0 1 4 5)
(1 10 8 9)
)

wall //used when wall needs to be identified (sometimes in turbulent flows)
wall
(
(2 3 4 5)
(6 7 8 9)
(3 6 9 4)
)



);

mergePatchPairs //merge faces from patches created
(
);


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



Thanks in advance

alexB June 27, 2015 17:43

Hi Daniel,

thats an easy problem...
Its just the same like here: http://www.cfd-online.com/Forums/ope...ace-block.html

you have to define another block, so that blocks which touch each other have the same faces and grading.

I hope that helps... I am to tired to show it in your sketch. ;)

good night and regards
Alex

daniel.almeida June 29, 2015 10:00

Thanks very much for the help! I think I got it! I defined more blocks and the results look good!

cedric_duprat July 1, 2015 08:10

Daniel,

I think you'll find the following website also interesting.
You'll find automatic routine to generate blockMesh file for axisymetric diffuser.
You'll have to adapt the m4 routines to your case but they are really convenient to play with.

http://openfoamwiki.net/index.php/Si...nical_diffuser

http://sourceforge.net/p/openfoam-ex...iffuser/cases/

I hope this will help you to generate meshes for your configuration,

regards,

Cedric


All times are GMT -4. The time now is 05:51.