CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Diverging simulation (https://www.cfd-online.com/Forums/openfoam-solving/161844-diverging-simulation.html)

czhongrong October 29, 2015 20:20

Diverging simulation
 
Hi, my simulation is diverging. I've tried increasing nNonOrthogonalCorrectors up to 10, and also introducing residualControl in fvSolution, but nothing helps. My checkMesh log is as follows.

The boundary conditions are similar to my other case, which runs perfectly. I have only changed the velocity at the inlet and with a slightly different geometry.

May I know if the "number of severely non-orthogonal faces" is the cause? Otherwise, how can I solve the diverging problem?

Quote:

Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 983340
faces: 2838800
internal faces: 2729200
cells: 928000
boundary patches: 7
point zones: 0
face zones: 0
cell zones: 0

Overall number of cells of each type:
hexahedra: 928000
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
Cell to face addressing 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
inlet 1600 1701 ok (non-closed singly connected)
outlet 1600 1701 ok (non-closed singly connected)
upperWall 34400 34911 ok (non-closed singly connected)
ground_wall 33600 34101 ok (non-closed singly connected)
cylinder 15200 15390 ok (non-closed singly connected)
lateral_front 11600 12140 ok (non-closed singly connected)
lateral_back 11600 12140 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.625 -0.5 0) (1.875 0.5 1.5)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (2.649697203e-16 -2.956581033e-14 -6.494254509e-15) OK.
Max cell openness = 2.890069133e-14 OK.
Max aspect ratio = 728.8145848 OK.
Minumum face area = 2.451588289e-08. Maximum face area = 0.004215342807. Face area magnitudes OK.
Min volume = 4.596728041e-10. Max volume = 7.903767764e-05. Total volume = 3.745717595. Cell volumes OK.
Mesh non-orthogonality Max: 88.46293676 average: 19.90242632
*Number of severely non-orthogonal faces: 110720.
Non-orthogonality check OK.
<<Writing 110720 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
Max skewness = 3.314142436 OK.
Coupled point location match (average 0) OK.

Mesh OK.

End

vishal3 October 30, 2015 01:19

hi czhongrong

By looking at your checkMesh Log, it is seen that the Max Skewness for your mesh is 3.314. This could be the problem why your simulations are diverging. The skewness of the mesh is an indication of the optimum cell size. For accurate solution, the maximum skewness for Hex mesh should not go beyond 0.7 or 0.85. In general, the mesh with max skewness of 0 is considered to be perfect and it should not go beyond 1 in order to have accurate solution or convergence in solution.

So i recommend you to change your mesh and run the simulations once again.

All the best

czhongrong October 30, 2015 02:02

1 Attachment(s)
Hi vishal3,

My geometry is a cylinder with a protruded top on its surface(see attached). I just can't seem to be able to decrease the max skewness. May I know what parameters I could try editing? Below is my blockMeshDict.

Quote:

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

convertToMeters 1;

vertices
(
(-0.625 -0.5 0) //0
(0.625 -0.5 0) //1
(1.875 -0.5 0) //2
(1.875 0.5 0) //3
(0.625 0.5 0) //4
(-0.625 0.5 0) //5
(-0.625 0.5 1.5) //6
(0.625 0.5 1.5) //7
(1.875 0.5 1.5) //8
(-0.625 -0.5 1.5) //9
(0.625 -0.5 1.5) //10
(1.875 -0.5 1.5) //11

//cylinder
(-0.02121 -0.02121 0) //12
(0.02121 -0.02121 0) //13
(0.02121 0.02121 0) //14
(-0.02121 0.02121 0) //15

(-0.02121 -0.02121 1.5) //16
(0.02121 -0.02121 1.5) //17
(0.02121 0.02121 1.5) //18
(-0.02121 0.02121 1.5) //19

//protruded
(-0.005 0.02958 0) //20
(0.005 0.02958 0) //21
(0.005 0.033 0) //22
(-0.005 0.033 0) //23

(-0.005 0.02958 1.5) //24
(0.005 0.02958 1.5) //25
(0.005 0.033 1.5) //26
(-0.005 0.033 1.5) //27
);

blocks
(
hex (0 12 15 5 9 16 19 6) (30 20 80) simpleGrading (0.01 1 1)
hex (1 13 12 0 10 17 16 9) (30 20 80) simpleGrading (0.01 1 1)
hex (13 1 4 14 17 10 7 18) (30 20 80) simpleGrading (100 1 1)
//protruded
hex (14 4 22 21 18 7 26 25) (30 20 80) simpleGrading (100 1 1)
hex (23 22 4 5 27 26 7 6) (30 20 80) simpleGrading (100 1 1)
hex (20 23 5 15 24 27 6 19) (30 20 80) simpleGrading (100 1 1)
hex (1 2 3 4 10 11 8 7) (400 20 80) simpleGrading (1 1 1)

);


edges
(
arc 15 12 (-0.03 0 0)
arc 12 13 (0 -0.03 0)
arc 13 14 (0.03 0 0)
arc 14 21 (0.01475 0.02606 0)
arc 20 15 (-0.01475 0.02606 0)

arc 19 16 (-0.03 0 1.5)
arc 16 17 (0 -0.03 1.5)
arc 17 18 (0.03 0 1.5)
arc 18 25 (0.01475 0.02606 1.5)
arc 24 19 (-0.01475 0.02606 1.5)
);


boundary
(
inlet
{
type wall;
faces
(
(6 5 0 9)
);
}

outlet
{
type wall;
faces
(
(3 8 11 2)
);
}

upperWall
{
type symmetryPlane;
faces
(
(4 5 6 7)
(3 4 7 8)
);
}

ground_wall
{
type wall;
faces
(
(0 1 10 9)
(1 2 11 10)
);
}

cylinder
{
type wall;
faces
(
(15 20 24 19)
(20 23 27 24)
(23 22 26 27)
(22 21 25 26)
(21 14 18 25)
(14 13 17 18)
(13 12 16 17)
(12 15 19 16)
);
}

lateral_front
{
type symmetryPlane;
faces
(
(7 26 25 18)
(6 27 26 7)
(6 19 24 27)
(19 6 9 16)
(17 16 9 10)
(7 18 17 10)
(8 7 10 11)
);
}

lateral_back
{
type symmetryPlane;
faces
(
(22 4 14 21)
(5 4 22 23)
(5 23 20 15)
(5 15 12 0)
(12 13 1 0)
(4 1 13 14)
(4 3 2 1)
);
}

);

mergePatchPairs
(
);


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

akidess October 30, 2015 03:03

If you have an STL of your geometry use snappyHexMesh.

czhongrong October 30, 2015 03:10

Hi akidess,

I can't get my STL to work, that's why I use blockMeshDict to mesh my geometry.

mkraposhin October 30, 2015 04:31

Quote:

Originally Posted by czhongrong (Post 570933)
Mesh non-orthogonality Max: 88.46293676 average: 19.90242632

The problem is in non-orthogonality, in fact OpenFOAM's implementation of FVM will not work with non-orthogonality larger then 60-70 degrees

czhongrong October 30, 2015 04:37

Quote:

Originally Posted by mkraposhin (Post 570974)
The problem is in non-orthogonality, in fact OpenFOAM's implementation of FVM will not work with non-orthogonality larger then 60-70 degrees

So I would need to reduce the "Mesh non-orthogonality Max" to be below 60-70? If so, how can I do that? Do I still need to care about the max skewness?

mkraposhin October 30, 2015 08:58

Quote:

Originally Posted by czhongrong (Post 570977)
So I would need to reduce the "Mesh non-orthogonality Max" to be below 60-70?

Yes

Quote:

Originally Posted by czhongrong (Post 570977)
If so, how can I do that?

You must locate cells where non-orthogonality is high and change geometry of corresponding blocks in blockMeshDict. To locate this cells, run:
Code:

checkMest
then
Code:

foamToVTK -faceSet nonOrthoFaces
Quote:

Originally Posted by czhongrong (Post 570977)
Do I still need to care about the max skewness?

Yes, but in most cases, improvement of non-orthogonality leads to improvement of skewness

czhongrong October 30, 2015 21:16

2 Attachment(s)
Hi mkraposhin,

Is there any rule of thumb or guideline that we can follow to avoid high non-orthogonality? As seen from my geometry in my previous reply #3, I find it difficult to change the geometry of the block. Attached is the schematic sketch diagram of my meshing and what "foamToVTK -faceSet nonOrthoFaces" has shown me in ParaView.

It can be seen that lines 5-23 and 4-22 are the causes of this problem.

vishal3 October 30, 2015 22:49

Hey czhongrong

Why don't you try to create a mesh in other applications like GMSH / SALOME / GAMBIT / ANSYS WORKBENCH / HYPERMESH etc. ? I dont have any idea whether blockmeshdict is that much capable of handling this. Just give it a try. There you have a good control over your mesh when you are using other applications.

All the best!

mkraposhin October 31, 2015 05:52

1 Attachment(s)
I would propose another a bit more complex configuration of blocks - see attachment

czhongrong October 31, 2015 23:59

Thanks for the layout, but just a few questions, I couldn't quite visualise properly:o:

1) I see 2 circles, do I have to model that outer circle? If yes, is the area in-between the 2 circles considered as hex blocks as well?

2) Are the 2 horizontal lines on the right needed?

3) "With this line non-orthogonality can be adjusted" - meaning the BLACK diagonal line on the right?

czhongrong November 1, 2015 10:49

1 Attachment(s)
By the way, I've tried to mesh in a different layout. See attached for layout. But I keep getting the following error from blockMesh - "face 3 in patch 2 does not have neighbour cell face: 4(3 4 7 8)". I can't find the cause of the problem. My blockMesh is as follows.

Quote:

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

Creating block mesh from
"/scratch/wyquek1/gap3mm1/constant/polyMesh/blockMeshDict"
Creating curved edges
Creating topology blocks
Creating topology patches

Creating block mesh topology


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

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&) in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 Foam::polyMesh::facePatchFaceCells(Foam::List<Foam ::face> const&, Foam::List<Foam::List<int> > const&, Foam::List<Foam::List<Foam::face> > const&, int) const in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#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>&) in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#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) in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5 Foam::blockMesh::createTopology(Foam::IOdictionary const&, Foam::word const&) in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/lib/libblockMesh.so"
#6 Foam::blockMesh::blockMesh(Foam::IOdictionary const&, Foam::word const&) in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/lib/libblockMesh.so"
#7 main in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/bin/blockMesh"
#8 __libc_start_main in "/lib64/libc.so.6"
#9 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/usr/local/OpenFOAM/OpenFOAM-2.1.0/platforms/linux64GccDPOpt/bin/blockMesh"
Aborted
Quote:

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

convertToMeters 1;

vertices
(
(-0.625 -0.5 0) //0
(0.625 -0.5 0) //1
(1.875 -0.5 0) //2
(1.875 0.5 0) //3
(0.625 0.5 0) //4
(-0.625 0.5 0) //5
(-0.625 0.5 1.5) //6
(0.625 0.5 1.5) //7
(1.875 0.5 1.5) //8
(-0.625 -0.5 1.5) //9
(0.625 -0.5 1.5) //10
(1.875 -0.5 1.5) //11

//cylinder
(-0.02121 -0.02121 0) //12
(0.02121 -0.02121 0) //13
(0.02121 0.02121 0) //14
(-0.02121 0.02121 0) //15

(-0.02121 -0.02121 1.5) //16
(0.02121 -0.02121 1.5) //17
(0.02121 0.02121 1.5) //18
(-0.02121 0.02121 1.5) //19

//protruded
(-0.005 0.02958 0) //20
(0.005 0.02958 0) //21
(0.005 0.033 0) //22
(-0.005 0.033 0) //23

(-0.005 0.02958 1.5) //24
(0.005 0.02958 1.5) //25
(0.005 0.033 1.5) //26
(-0.005 0.033 1.5) //27

(-0.625 0.033 0) //28
(0.625 0.033 0) //29
(0.005 0.5 0) //30
(-0.005 0.5 0) //31
(-0.625 0.033 1.5) //32
(0.625 0.033 1.5) //33
(0.005 0.5 1.5) //34
(-0.005 0.5 1.5) //35

(1.875 0.033 0) //36
(1.875 0.033 1.5) //37
);

blocks
(
hex (0 12 15 28 9 16 19 32) (30 20 80) simpleGrading (0.01 1 1)
hex (1 13 12 0 10 17 16 9) (30 20 80) simpleGrading (0.01 1 1)
hex (13 1 29 14 17 10 33 18) (30 20 80) simpleGrading (100 1 1)
//protruded
hex (14 29 22 21 18 33 26 25) (30 20 80) simpleGrading (100 1 1)
hex (29 4 30 22 33 7 34 26) (30 20 80) simpleGrading (100 1 1)
hex (22 30 31 23 26 34 35 27) (30 20 80) simpleGrading (100 1 1)
hex (23 31 5 28 27 35 6 32) (30 20 80) simpleGrading (100 1 1)
hex (28 15 20 23 32 19 24 27) (30 20 80) simpleGrading (0.01 1 1)
hex (1 2 36 29 10 11 37 33) (400 20 80) simpleGrading (1 1 1)
hex (4 29 36 3 4 33 37 8 7) (400 20 80) simpleGrading (1 1 1)

);


edges
(
arc 15 12 (-0.03 0 0)
arc 12 13 (0 -0.03 0)
arc 13 14 (0.03 0 0)
arc 14 21 (0.01475 0.02606 0)
arc 20 15 (-0.01475 0.02606 0)

arc 19 16 (-0.03 0 1.5)
arc 16 17 (0 -0.03 1.5)
arc 17 18 (0.03 0 1.5)
arc 18 25 (0.01475 0.02606 1.5)
arc 24 19 (-0.01475 0.02606 1.5)
);


boundary
(
inlet
{
type wall;
faces
(
(6 5 28 32)
(32 28 0 9)
);
}

outlet
{
type wall;
faces
(
(8 3 36 37)
(37 36 2 11)
);
}

upperWall
{
type symmetryPlane;
faces
(
(31 5 6 35)
(30 31 35 34)
(4 30 34 7)
(3 4 7 8)
);
}

ground_wall
{
type wall;
faces
(
(0 1 10 9)
(1 2 11 10)
);
}

cylinder
{
type wall;
faces
(
(15 20 24 19)
(20 23 27 24)
(23 22 26 27)
(22 21 25 26)
(21 14 18 25)
(14 13 17 18)
(13 12 16 17)
(12 15 19 16)
);
}

lateral_front
{
type symmetryPlane;
faces
(
(33 26 25 18)
(26 33 7 34)
(27 26 34 35)
(32 27 35 6)
(32 19 24 27)
(32 9 16 19)
(17 16 9 10)
(33 18 17 10)
(10 11 37 33)
(33 37 8 7)
);
}

lateral_back
{
type symmetryPlane;
faces
(
(29 22 21 14)
(22 29 4 30)
(23 22 30 31)
(28 23 31 5)
(28 15 20 23)
(28 0 12 15)
(12 0 1 13)
(13 1 29 14)
(1 2 36 29)
(29 36 3 4)
);
}

);

mergePatchPairs
(
);


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

mkraposhin November 2, 2015 03:59

1 Attachment(s)
Hi,
I think that with the descretization shown above, you will also get mesh with high non-orthogonality. I made another version of block geometry (see attachment).

Grey regions are blocks

In this geometry you can adjust non-orthogonality with the vertical position of point 6 and horizontal position of point 5.

czhongrong November 2, 2015 04:20

Hi mkraposhin,

Yes, indeed my discretisation still yields 88 deg of non-orthogonality.

1) Are points 4, 6, 8, 9, 13, 14 all arbitrary points on the circle which I can choose on my own?

2) I will need to follow this discretization on the upper left half of the geometry too right (i.e. mirror on the left)?

mkraposhin November 2, 2015 04:37

Quote:

Originally Posted by czhongrong (Post 571387)
Yes, indeed my discretisation still yields 88 deg of non-orthogonality.

Yes, this was expected result, because you must take care of planar angles between edges in each block - they all should be near 90 degrees

Quote:

Originally Posted by czhongrong (Post 571387)
1) Are points 4, 6, 8, 9, 13, 14 all arbitrary points on the circle which I can choose on my own?

Yes, they are arbitrary, and with their position you can adjust non-orthogonality.
For the first iteration, you can assume that line 2-5 have length equal or slighly larger then line 3-2. Line 13-8 inclined to line 12-10 with angle ~ 30 degrees


Quote:

Originally Posted by czhongrong (Post 571387)
2) I will need to follow this discretization on the upper left half of the geometry too right (i.e. mirror on the left)?

Yes, you need to mirror upper right blocks on the upper left to get upper part of your geometry. Then, you must creat lower part of geometry. For this you can look at tutorial tutorials/stressAnalysis/solidDisplacementFoam/plateHole

czhongrong November 2, 2015 04:51

For the lower part of my geometry, can I just model it like how I used to, in my earlier posts? By the diagonals 0-12 and 13-1?

mkraposhin November 2, 2015 04:59

1 Attachment(s)
Quote:

Originally Posted by czhongrong (Post 571398)
For the lower part of my geometry, can I just model it like how I used to, in my earlier posts? By the diagonals 0-12 and 13-1?

Yes, you can, but if you will do lower part of mesh like in example tutorials/stressAnalysis/solidDisplacementFoam/plateHole
or like the top part, you will get better mesh quality, i think.

Also, please note, that in any case you will need to save blocks between outer and inner cylinders

See attachment

czhongrong November 2, 2015 05:03

Save blocks?

mkraposhin November 2, 2015 05:05

1 Attachment(s)
I attached file with lower part of mesh


All times are GMT -4. The time now is 08:24.