CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   2D engine simulation (https://www.cfd-online.com/Forums/openfoam/114766-2d-engine-simulation.html)

sasanghomi March 17, 2013 09:25

2D engine simulation
 
2 Attachment(s)
Hi foamers ,

I am simulating a 2D engine with sonicTurbDyMEngineFoam and simpleEngineTopoFVmesh library... my simulation is according to the 2D Tutorial case that attached by Prof.Jasak http://www.cfd-online.com/Forums/openfoam/83177-engine-simulation-mesh-motion-topological-changes-4.html

Actually my result is not good.I attached the case and a picture of it at CAD=110.
My problem is that velocity on the slave patch and master patch is zero(in paraview).(two boundaries that created for sliding interface.) these boundaries are valveCurtainCyl and valveCurtainPort.
Boundary condition in my case for velocity on these boundaries is uniform (0 0 0) (similar to the 2D Tutorial ) But in the result of the tutorial case velocity on these boundaries is not zero(in paraview).
How can I overcome this problem?

Thanks and best regards,
Sasan.

GDTech March 20, 2013 03:38

Hi,

I had a similar problem with sliding interfaces (AMI).
In my case, it was a rendering artifact due to paraview. When loading internalMesh alone and choosing "cell data" instead of "point data" the solution looks good.

Best regards.

sasanghomi March 20, 2013 05:28

1 Attachment(s)
Hi Laurent,

I did it . But I haven't got good result...
I think my boundary condition have a problem...
I appreciate any help...

Thanks,
Sasan.

mturcios777 March 21, 2013 11:47

Hey Sasan,

I'd have to look a little deeper at the simpleEngineTopoFvMesh mesh class, but it seems like the sliding patches are set to be walls, when they should be just general patches. Try that and see if it helps, as right now it seems like each port is separated from the rest of the cylinder.

sasanghomi March 21, 2013 12:31

Hey Dear Marco,

Thank you very much . I appreciate your help.
yes,It seems sliding patches have seperated the cylinder to five regions...I don't know where is the problem....

Thanks,
Sasan.

novakm March 29, 2013 04:14

Hi Sasan.

Could you post the whole case somewhere here?
It will be helpful. The correct setup of the case is in the ICE sim. really difficult and without the case I am not able to tell you what is wrong.

However, I think that your problem is hidden in the settings of motionU boundary conditions. For the the outer sliding interface you have to have the commponentMixed bc and for the inner it has to be zeroGradient. You should probably look at the Jasak's case.
¨
I will expect something like
Quote:

piston
{
type componentMixed;
refValue uniform (0 0 0);
valueFraction uniform (0 0 1);
}
liner
{
type componentMixed;
refValue uniform (0 0 0);
valueFraction uniform (1 1 0);
}
cylinderHead
{
type fixedValue;
value uniform (0 0 0);
}
intakePort
{
type fixedValue;
value uniform (0 0 0);
}
presin
{
type fixedValue;
value uniform (0 0 0);
}
valveStem1
{
type componentMixed;
refValue uniform (0 0 0);
valueFraction uniform (1 1 0);
}
exhaustPort
{
type fixedValue;
value uniform (0 0 0);
}
presout
{
type fixedValue;
value uniform (0 0 0);
}
valveStem2
{
type componentMixed;
refValue uniform (0 0 0);
valueFraction uniform (1 1 0);
}
valveCurtainCyl1 // outer
{
type componentMixed;
refValue uniform (0 0 0);
valueFraction uniform (1 1 0);
}

valve1
{
type fixedValue;
value uniform (0 0 0);
}
valve2
{
type fixedValue;
value uniform (0 0 0);
}
valveCurtainPort1 // inner
{
type zeroGradient;
}

valveDetachCyl1
{
type zeroGradient;
}
valveDetachPort1
{
type zeroGradient;
}
valveCurtainCyl2
{
type componentMixed;
refValue uniform (0 0 0);
valueFraction uniform (1 1 0);
}
valve3
{
type fixedValue;
value uniform (0 0 0);
}
valve4
{
type fixedValue;
value uniform (0 0 0);
}
valveCurtainPort2
{
type zeroGradient;
}
valveDetachCyl2
{
type zeroGradient;
}
valveDetachPort2
{
type zeroGradient;
}
defaultFaces
{
type empty;
}

sasanghomi March 29, 2013 05:44

1 Attachment(s)
Hi Martin ,

Thanks for your reply.
I attached the case in the first post of this thread. I attached the case again here .
Actually the motionU file of my case is similar to the jasak's case but my geometry is in the X-Y plane and jasak's case is in the X-Z plane , So I changed some things in my case.
The motionU file for my case:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      tetPointVectorField;
    location    "0";
    object      motionU;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    piston
    {
        type            componentMixed;
        refValue        uniform (0 0 0);
        valueFraction  uniform (0 1 0);
    }
    liner
    {
        type            componentMixed;
        refValue        uniform (0 0 0);
        valueFraction  uniform (1 0 1);
    }
    cylinderHead
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    intakePort
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    presin
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    exhaustPort
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
valveStem1
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
valveStem2
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    presout
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valveCurtainCyl1
    {
        type            componentMixed;
        refValue        uniform (0 0 0);
        valueFraction  uniform (1 0 1);
    }
    valve1
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valve2
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valveCurtainPort1
    {
        type            zeroGradient;
    }
    valveDetachCyl1
    {
        type            zeroGradient;
    }
    valveDetachPort1
    {
        type            zeroGradient;
    }
    valveCurtainCyl2
    {
        type            componentMixed;
        refValue        uniform (0 0 0);
        valueFraction  uniform (1 0 1);
    }
    valve3
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valve4
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valveCurtainPort2
    {
        type            zeroGradient;
    }
    valveDetachCyl2
    {
        type            zeroGradient;
    }
    valveDetachPort2
    {
        type            zeroGradient;
    }
    defaultFaces
    {
        type            empty;
    }
}


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

I appreciate your help Martin.
Thanks and best regards,
Sasan.

novakm March 29, 2013 09:06

Quote:

Originally Posted by sasanghomi (Post 417156)
Hi Martin ,

Thanks for your reply.
I attached the case in the first post of this thread. I attached the case again here .
Actually the motionU file of my case is similar to the jasak's case but my geometry is in the X-Y plane and jasak's case is in the X-Z plane , So I changed some things in my case.
The motionU file for my case:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      tetPointVectorField;
    location    "0";
    object      motionU;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    piston
    {
        type            componentMixed;
        refValue        uniform (0 0 0);
        valueFraction  uniform (0 1 0);
    }
    liner
    {
        type            componentMixed;
        refValue        uniform (0 0 0);
        valueFraction  uniform (1 0 1);
    }
    cylinderHead
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    intakePort
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    presin
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    exhaustPort
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
valveStem1
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
valveStem2
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    presout
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valveCurtainCyl1
    {
        type            componentMixed;
        refValue        uniform (0 0 0);
        valueFraction  uniform (1 0 1);
    }
    valve1
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valve2
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valveCurtainPort1
    {
        type            zeroGradient;
    }
    valveDetachCyl1
    {
        type            zeroGradient;
    }
    valveDetachPort1
    {
        type            zeroGradient;
    }
    valveCurtainCyl2
    {
        type            componentMixed;
        refValue        uniform (0 0 0);
        valueFraction  uniform (1 0 1);
    }
    valve3
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valve4
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    valveCurtainPort2
    {
        type            zeroGradient;
    }
    valveDetachCyl2
    {
        type            zeroGradient;
    }
    valveDetachPort2
    {
        type            zeroGradient;
    }
    defaultFaces
    {
        type            empty;
    }
}


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

I appreciate your help Martin.
Thanks and best regards,
Sasan.


motionU seems fine, but you have made mistake in the naming of the sliding interafaces. valveCurtainCyl is outer (without "hole") and valveCurtainPort is inner (with "hole"). If you take a look in meshModifiers, you will see that just 5 of them have been created insteed of 9. So change the naming and the case should be fine.

sasanghomi March 30, 2013 02:55

2 Attachment(s)
Hi Martin ,

Thank you very much..
I corrected the name of valveCurtainCyl and valveCurtainPort and I created all mesh modifier :
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      polyTopoChanger;
    location    "constant/polyMesh";
    object      meshModifiers;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

9
(
valveSlider1
{
    type slidingInterface;
    masterFaceZoneName curtainPortZoneV1;
    slaveFaceZoneName curtainCylZoneV1;
    cutPointZoneName cutPointsV1;
    cutFaceZoneName cutFaceZoneV1;
    masterPatchName valveCurtainPort1;
    slavePatchName valveCurtainCyl1;
    typeOfMatch integral;
    coupleDecouple true;
    projection visible;
    attached false;
    active true;
}

valveAttachDetach1
{
    type attachDetach;
    faceZoneName detachFaceZoneV1;
    masterPatchName valveDetachCyl1;
    slavePatchName valveDetachPort1;
    triggerTimes 0();
    manualTrigger true;
    active true;
}

valvePoppetLayer1
{
    type layerAdditionRemoval;
    faceZoneName poppetZoneV1;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}

valveBottomLayer1
{
    type layerAdditionRemoval;
    faceZoneName bottomZoneV1;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}

valveSlider2
{
    type slidingInterface;
    masterFaceZoneName curtainPortZoneV2;
    slaveFaceZoneName curtainCylZoneV2;
    cutPointZoneName cutPointsV2;
    cutFaceZoneName cutFaceZoneV2;
    masterPatchName valveCurtainPort2;
    slavePatchName valveCurtainCyl2;
    typeOfMatch integral;
    coupleDecouple true;
    projection visible;
    attached false;
    active true;
}

valveAttachDetach2
{
    type attachDetach;
    faceZoneName detachFaceZoneV2;
    masterPatchName valveDetachCyl2;
    slavePatchName valveDetachPort2;
    triggerTimes 0();
    manualTrigger true;
    active true;
}

valvePoppetLayer2
{
    type layerAdditionRemoval;
    faceZoneName poppetZoneV2;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}

valveBottomLayer2
{
    type layerAdditionRemoval;
    faceZoneName bottomZoneV2;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}

pistonLayer
{
    type layerAdditionRemoval;
    faceZoneName pistonZone;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}
)

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

But when I ran the case I had below error :
Code:

--> FOAM FATAL ERROR:
Error in point ordering: mixed used and unused points at the end of point list.
Last used point: 2176 (-0.013 0 0.00107703)
First unused point: 2177 (-0.013 -0.000900796 0.00107703)
and point 2178 (-0.037 -0.0100088 0.00107703) is used by a live face.
Face 1901 4(2180 2178 2198 2200) with points 4((-0.037 -0.00899545 0.00107703) (-0.037 -0.0100088 0.00107703) (-0.037 -0.0100088 -0.00107703) (-0.037 -0.00899545 -0.00107703))
Done.

    From function void polyMesh::initMesh()
    in file meshes/polyMesh/polyMeshInitMesh.C at line 174.

FOAM aborting

Aborted (core dumped)

Actually this error occurred in the Crank angle = 1.11111 CA-deg .
I attached a picture from grid around the intake valve at this time.The picture shows that the grid is degenerating .....
Also I attached the case..
Can you help me for overcoming this error?
Do you know what is the origin of this error?
I appreciate your help.

Thanks and best regards,
Sasan.

novakm March 30, 2013 15:32

Quote:

Originally Posted by sasanghomi (Post 417287)
Hi Martin ,

Thank you very much..
I corrected the name of valveCurtainCyl and valveCurtainPort and I created all mesh modifier :
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM Extend Project: Open source CFD        |
|  \\    /  O peration    | Version:  1.6-ext                              |
|  \\  /    A nd          | Web:      www.extend-project.de                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      polyTopoChanger;
    location    "constant/polyMesh";
    object      meshModifiers;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

9
(
valveSlider1
{
    type slidingInterface;
    masterFaceZoneName curtainPortZoneV1;
    slaveFaceZoneName curtainCylZoneV1;
    cutPointZoneName cutPointsV1;
    cutFaceZoneName cutFaceZoneV1;
    masterPatchName valveCurtainPort1;
    slavePatchName valveCurtainCyl1;
    typeOfMatch integral;
    coupleDecouple true;
    projection visible;
    attached false;
    active true;
}

valveAttachDetach1
{
    type attachDetach;
    faceZoneName detachFaceZoneV1;
    masterPatchName valveDetachCyl1;
    slavePatchName valveDetachPort1;
    triggerTimes 0();
    manualTrigger true;
    active true;
}

valvePoppetLayer1
{
    type layerAdditionRemoval;
    faceZoneName poppetZoneV1;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}

valveBottomLayer1
{
    type layerAdditionRemoval;
    faceZoneName bottomZoneV1;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}

valveSlider2
{
    type slidingInterface;
    masterFaceZoneName curtainPortZoneV2;
    slaveFaceZoneName curtainCylZoneV2;
    cutPointZoneName cutPointsV2;
    cutFaceZoneName cutFaceZoneV2;
    masterPatchName valveCurtainPort2;
    slavePatchName valveCurtainCyl2;
    typeOfMatch integral;
    coupleDecouple true;
    projection visible;
    attached false;
    active true;
}

valveAttachDetach2
{
    type attachDetach;
    faceZoneName detachFaceZoneV2;
    masterPatchName valveDetachCyl2;
    slavePatchName valveDetachPort2;
    triggerTimes 0();
    manualTrigger true;
    active true;
}

valvePoppetLayer2
{
    type layerAdditionRemoval;
    faceZoneName poppetZoneV2;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}

valveBottomLayer2
{
    type layerAdditionRemoval;
    faceZoneName bottomZoneV2;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}

pistonLayer
{
    type layerAdditionRemoval;
    faceZoneName pistonZone;
    minLayerThickness 0.0005;
    maxLayerThickness 0.001;
    oldLayerThickness -1;
    active true;
}
)

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

But when I ran the case I had below error :
Code:

--> FOAM FATAL ERROR:
Error in point ordering: mixed used and unused points at the end of point list.
Last used point: 2176 (-0.013 0 0.00107703)
First unused point: 2177 (-0.013 -0.000900796 0.00107703)
and point 2178 (-0.037 -0.0100088 0.00107703) is used by a live face.
Face 1901 4(2180 2178 2198 2200) with points 4((-0.037 -0.00899545 0.00107703) (-0.037 -0.0100088 0.00107703) (-0.037 -0.0100088 -0.00107703) (-0.037 -0.00899545 -0.00107703))
Done.

    From function void polyMesh::initMesh()
    in file meshes/polyMesh/polyMeshInitMesh.C at line 174.

FOAM aborting

Aborted (core dumped)

Actually this error occurred in the Crank angle = 1.11111 CA-deg .
I attached a picture from grid around the intake valve at this time.The picture shows that the grid is degenerating .....
Also I attached the case..
Can you help me for overcoming this error?
Do you know what is the origin of this error?
I appreciate your help.

Thanks and best regards,
Sasan.

This is not a degeneration, this is how sliding interface works. It stitch the mesh parts together at each time. I think that the error comes from bad setup of engineGeometry. If I were you, I will check the valves diameter setup and try to change min layer thickness for the valves together with the change of the deformAngle to 0 in order to get layerAR instead of deformation.

I am on vacation, so I can not test it by myself. Do you keep me informed about your progress?

Martin

sasanghomi March 30, 2013 15:47

Dear Martin ,

Thank you very much..
I appreciate your help..
I am very glad that you help me.
I will try to do it and I will report my result and progressing to you.

Thanks and best regards,
Sasan.

sasanghomi March 31, 2013 08:12

Hi Martin ,

I hope you have a happy vacation.
I played with min layer thickness for the valves (several times) and I changed the deform angle to 0..
I corrected the clearance (=0.01) and the bore(=0.1) and I checked the valve diameters (they were correct).
unfortunately I couldn't overcome the error...
I found a thread [ http://www.cfd-online.com/Forums/ope...t-working.html ]
that they have discussed about this error for engine simulation they have said this error occurs when all points on the sliding interface are not on the same radius and they attached a utility that can repair this problem. I compiled the utility but I don't know that how can I use this utility to solve my problem..
I appreciate any help from you.

Thanks and best regards,
Sasan.

sasanghomi April 4, 2013 09:57

I created a small change in geometry and I increased the gap between valve and valve seat and I refined the mesh at this gap and I could run the case... ;)

Thanks,
Sasan.

xianqiejiao April 30, 2015 14:00

Hi guys,

Sorry for hacking into this threads. However, when I tried to run the case shared in the very beginning, some error showed up:

Unknown solver type laplaceFaceDecomposition

Code:

Valid solver types are:

9
(
RBFMotionSolver
displacementComponentLaplacian
displacementInterpolation
displacementLaplacian
displacementSBRStress
laplace
pseudoSolid
velocityComponentLaplacian
velocityLaplacian
)

By the way, I used the case for of3.1-ext. It seems that the laplaceFaceDecomposition solver is not valid anymore. Then which one should I choose instead?


All times are GMT -4. The time now is 19:11.