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/)
-   -   [Other] engineFoam: unstable velocity field (https://www.cfd-online.com/Forums/openfoam-meshing/151577-enginefoam-unstable-velocity-field.html)

mmeyer April 13, 2015 09:04

engineFoam: unstable velocity field
 
Hello Foamers,

I'm trying to simulate combustion in a diesel engine, by copying our Kiva mesh to the combustion/engineFoam/kivaTest tutorial case.

Our mesh does not contain the whole 360° cylinder, but a "piece of cake" with cyclic boundary.

Mesh conversion runs just fine, but engineFoam can only compute crank angles from -180° to at most -178° before the velocity field at the center of the piston is getting very unstable and finally janafThermo gives the Fatal Error.

Maybe just copying a cyclic mesh to the (non-cyclic) Tutorial Case isn't enough. Can anyone help me?

Thanks in advance, Max

mmeyer April 14, 2015 01:56

Log Files
 
5 Attachment(s)
I am using Foam-Extend-3.1

These are my logfiles including an attempt to refine the mesh.

mmeyer April 14, 2015 03:02

Update
 
I edited the global controlDict in the following way:

Code:

...
DebugSwitches
  {
    cyclic  1;
    ...
  }
...
Tolerances
  {
    patchFaceMatchTol  1e-3;
    ...
  }
...

Thereby I gained almost 30° of crank angle, but in every step a Serious Error in cyclicPolyPatch occurs:

Code:

cyclicPolyPatch::calcTransforms : Writing half0 faces to file "/home/mmeyer/foam/mmeyer-3.1/run/KIVAgrid/kivaTest/VTK/cyclic_half0_faces"
cyclicPolyPatch::calcTransforms : Writing half1 faces to file "/home/mmeyer/foam/mmeyer-3.1/run/KIVAgrid/kivaTest/VTK/cyclic_half1_faces"
Unknown transform: calculating transform from geometry
--> FOAM Serious Error :
    From function void cyclicPolyPatch::calcTransforms() const
    in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 246
    Transformation tensor is not constant for the cyclic patch cyclic.  Please reconsider your setup and definition of cyclic boundaries.
cyclicPolyPatch::calcTransforms : Writing transform_half0 faces to file "/home/mmeyer/foam/mmeyer-3.1/run/KIVAgrid/kivaTest/VTK/cyclic_transform_half0_faces"

After a couple of these, Foam aborts because of "Too many errors"

mmeyer April 14, 2015 04:05

How can I define the missing Transformation Tensor?
 
2 Attachment(s)
My latest approach is to define the unknown transformation tensor by hand, but I don't know if the faceSets are created and named properly by the kivaToFoam tool.

tsencic May 8, 2015 06:51

Problem with cyclic boundary on engine sector mesh
 
I am trying to simulate a diesel engine using a sector of 51 degree mesh.
I use the foam-extend-3.1 version. The mesh is created with blockMesh.

I obtain the error
--> FOAM FATAL ERROR:
face 2 area does not match neighbour 5 by 179.301% -- possible face ordering problem.
patch:front my area:155.763 neighbour area:2854.34 matching tolerance:0.0001
Mesh face:19 vertices:4((15.4535 -7.43725 -13.65) (22.0764 -10.6246 -19.5) (28.2262 -13.5844 0) (19.7584 -9.50906 0))
Neighbour face:22 vertices:4((28.2262 -13.5844 0) (48.6582 -23.4176 0) (48.6582 -23.4176 125.88) (28.2262 -13.5844 125.88))
Other errors also exist, only the largest is reported. Please rerun with cyclic debug flag set for more information.


This is my blockMeshDict file:
/*--------------------------------------------------------------------------*
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.0 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root ;
case ;
instance ;
local ;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.001;
vertices

(
(0.973163 -0.468352 -17.8) //0
(22.0764 -10.6246 -19.5) //1
(22.0764 10.6246 -19.5) //2
(0.973163 0.468352 -17.8) //3
(0.973163 -0.468352 0) //4
(28.2262 -13.5844 0) //5
(48.6582 -23.4176 0) //6
(48.6582 23.4176 0) //7
(28.2262 13.5844 0) //8
(0.973163 0.468352 0) //9
(0.973163 -0.468352 125.88) //10
(28.2262 -13.5844 125.88) //11
(48.6582 -23.4176 125.88) //12
(48.6582 23.4176 125.88) //13
(28.2262 13.5844 125.88) //14
(0.973163 0.468352 125.88) //15
(15.4535 -7.43725 -13.65) //16
(15.4535 7.43725 -13.65) //17
(19.7584 -9.50906 0) //18
(19.7584 9.50906 0) //19
(19.7584 -9.50906 125.88) //20
(19.7584 9.50906 125.88) //21
(0.973163 -0.468352 -8.9) //22
(0.973163 0.468352 -8.9) //23
);

blocks
(
hex (0 1 2 3 22 16 17 23) (10 25 6) simpleGrading (1 1 1)
hex (22 16 17 23 4 18 19 9) (10 25 14) simpleGrading (1 1 1)
hex (16 1 2 17 18 5 8 19) (6 25 14) simpleGrading (1 1 1)
hex (4 18 19 9 10 20 21 15) (10 25 26) simpleGrading (1 1 1)
hex (18 5 8 19 20 11 14 21) (6 25 26) simpleGrading (1 1 1)
hex (5 6 7 8 11 12 13 14) (16 25 26) simpleGrading (1 1 1)
);

edges
(
arc 0 3 (1.08 0 -17.8)
arc 1 2 (24.5 0 -19.5)
arc 4 9 (1.08 0 0)
arc 5 8 (31.325 0 0)
arc 6 7 (54 0 0)
arc 10 15 (1.08 0 125.88)
arc 11 14 (31.325 0 125.88)
arc 12 13 (54 0 125.88)
arc 22 23 (1.08 0 -8.9)
arc 16 17 (17.15 0 -13.65)
arc 18 19 (21.9275 0 0)
arc 20 21 (21.9275 0 125.88)
spline 0 1( (4.50539 -2.1683 -19) (9.01077 -4.33659 -20) (16.2194 -7.80586 -21) )
spline 3 2( (4.50539 2.1683 -19) (9.01077 4.33659 -20) (16.2194 7.80586 -21) )
spline 1 5( (28.2262 -13.5844 -11) )
spline 2 8( (28.2262 13.5844 -11) )
);

patches
(
wall
piston
(
( 0 1 2 3)
( 1 2 8 5)
(5 6 7 8)
)
wall
liner
(
( 6 12 13 7)
)
wall
cylinderHead
(
( 10 20 21 15)
( 20 11 14 21)
( 11 12 13 14)
)
symmetryPlane
symmetryFaces
(
( 0 22 23 3)
( 22 4 9 23)
( 4 10 15 9)
)
cyclic
front
(
( 0 1 16 22)
( 22 16 18 4)
( 16 1 5 18 )
( 4 18 20 10)
( 18 5 11 20)
( 5 6 12 11)
)

cyclic
back
(
( 3 23 17 2)
( 23 9 19 17)
( 17 19 8 2)
( 9 15 21 19)
( 19 21 14 8)
( 8 14 13 7)
)
);

mergePatchPairs ();
// ************************************************** *********************** //

I also tried to have one cyclic boundary, frontAndBack, then I get:

--> FOAM Serious Error :
From function void cyclicPolyPatch::calcTransforms() const
in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 246
Transformation tensor is not constant for the cyclic patch frontAndBack. Please reconsider your setup and definition of cyclic boundaries.

I remember that I used this kind of mesh on earlier OF versions, like OF-1.4 and 1.5. It should be a simple thing, this is not a complex geometry and is similar for many engine applications, but I see many have problems with cyclics :-(
How could I solve the problem?

mmeyer May 11, 2015 05:49

check your transformation tensor
 
Quote:

--> FOAM FATAL ERROR:
face 2 area does not match neighbour 5 by 179.301% -- possible face ordering problem.
So, you use rotational cyclic boundaries, too (?). The error above could be related to the transformation tensor. In order to simulate a 51° sector of the cylinder, I had to define a 309° transformation tensor in ./constant/polyMesh/boundary:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | foam-extend: Open Source CFD                    |
|  \\    /  O peration    | Version:    3.1                                |
|  \\  /    A nd          | Web:        http://www.extend-project.de      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

4
(
    piston
    {
        type            wall;
        nFaces          2140;
        startFace      165197;
    }
    liner
    {
        type            wall;
        nFaces          460;
        startFace      167337;
    }
    cylinderHead
    {
        type            wall;
        nFaces          1700;
        startFace      167797;
    }
    cyclic
    {
        type            cyclic;
        nFaces          5686;
        startFace      169497;
        featureCos      0.9;
        transform      rotational;
        rotationAxis    (0 0 1);
        rotationCentre  (0 0 0);
        rotationAngle  308.571;
    }
)

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


tsencic May 22, 2015 04:05

Thank You very much. It's working now.

zhouqy1994 August 10, 2017 23:27

Hi mmeyer

I am facing the same problem now...

When using a sector for simulation, the velocity in the center of piston is unstable.

Have you got the solutions or any tips?

I am really confused by that

Thanks in advance


Sent from my iPhone using CFD Online Forum mobile app

zhouqy1994 August 11, 2017 07:55

my simulation runs fine from -180--146,and then the velocity becomes really high and then janafThermo out of range

Any advice is welcome

Thanks in advance


Sent from my iPhone using CFD Online Forum mobile app


All times are GMT -4. The time now is 03:47.