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/)
-   -   Continuity error cannot be removed by adjusting the outflow - rotating domain case (https://www.cfd-online.com/Forums/openfoam-solving/190191-continuity-error-cannot-removed-adjusting-outflow-rotating-domain-case.html)

Swift July 7, 2017 06:06

Continuity error cannot be removed by adjusting the outflow - rotating domain case
 
Dear Forum,

I am receiving the above mentioned error for the case I am trying to run. The full error message is as follows:
Code:

--> FOAM FATAL ERROR:
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux              : 1516.5
Specified mass inflow  : 0.0007348
Specified mass outflow  : 0.00057401
Adjustable mass outflow : 0


    From function bool Foam::adjustPhi(Foam::surfaceScalarField&, const volVectorField&, Foam::volScalarField&)
    in file cfdTools/general/adjustPhi/adjustPhi.C at line 107.

FOAM exiting

I am running a case similar to the propeller tutorial and am consequently using pimpleDyMFoam. I have an impeller in a rotating domain within a stationary volume. Unlike the propeller tutorial, my impeller is rotating in a tank with wall boundaries for the bottom, top and sides. i.e there are no inlets or outlets.

I have seen the following post:
https://www.cfd-online.com/Forums/op...tml#post613877
which discusses this problem, noting that it could be a problem with my boundary conditions. I am assuming that the problem is with my U and p files. These files are as follows:
U
Code:

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

internalField  uniform (0 0 0);

boundaryField
{
    rotorBottom
    {
        type            movingWallVelocity;
        value          uniform (0 0 0);
    }
    AMIbottom
    {
        type            cyclicAMI;
        value          uniform (0 0 0);
    }
    AMIbottom_slave
    {
        type            cyclicAMI;
        value          uniform (0 0 0);
    }
    baffles
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    tank
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    shaft
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    bottomOfTank
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    topOfTank
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
}

p
Code:

dimensions      [0 2 -2 0 0 0 0];

internalField  uniform 0;
boundaryField
{
    rotorBottom
    {
        type            zeroGradient;
    }
    AMIbottom
    {
        type            cyclicAMI;
        value          uniform 0;
    }
    AMIbottom_slave
    {
        type            cyclicAMI;
        value          uniform 0;
    }
    baffles
    {
        type            zeroGradient;
    }
    tank
    {
        type            zeroGradient;
    }
    shaft
    {
        type            zeroGradient;
    }
    bottomOfTank
    {
        type            zeroGradient;
    }
    topOfTank
    {
        type            zeroGradient;
    }
}

To me it looks like the boundary conditions are correct. The error message notes that there is an inflow and outflow, but I don't understand where this could be coming from. Does anyone have some more suggestions as to how I could resolve this?

I have tried running potentialFoam as suggested but it doesn't resolve the error. In desperation, I have also checked that the rotational axis is correct, I have remeshed to get better agreement between the slave a master AMI patches, I have remeshed using different methods (meshing the whole stator and rotor domains in one operation and again meshing the stator and rotor separately and using mergeMesh). I have run moveDynamicMesh and it runs correctly. I am using the fvSolution and fvSchemes from the propeller case.

I have just tried changing the speed of rotation in dynamicMeshDict. I found that if I made it very big, the mass inflow and outflow values increase in the error message above. If I decrease omega so that it is very small, the mass inflow and outflow values also decrease. This makes me think that the error might due to the rotating domain or perhaps the AMI interface between slave and master patches. Is there anyway that I could troubleshoot this?
The part of the sHM dict that creates the AMI patches and rotating zone looks as follows:

Code:

    AMIbottom
        {
            level      (2 2);
            faceType    baffle;
            cellZone    rotatingDomainBottom;
            faceZone    rotatingDomainBottom;
            cellZoneInside  inside;
        }

I use this when I mesh in a single step, similar to the propeller case. I don't run createInletOutletSets.topoSetDict like in the propeller case because I don't have inlets and outlets. I edited the boundary file manually to make it cyclicAMI as follows:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  4.1                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      binary;
    class      polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

8
(
    AMIbottom
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          51672;
        startFace      5977891;
        transform noOrdering;
        neighbourPatch AMIbottom_slave;
    }
    AMIbottom_slave
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          51672;
        startFace      6029563;
        transform noOrdering;
        neighbourPatch AMIbottom;
    }
    rotorBottom
    {
        type            wall;
        inGroups        1(wall);
        nFaces          30099;
        startFace      6081235;
    }
    baffles
    {
        type            wall;
        inGroups        1(wall);
        nFaces          32160;
        startFace      6111334;
    }
    tank
    {
        type            wall;
        inGroups        1(wall);
        nFaces          87354;
        startFace      6143494;
    }
    shaft
    {
        type            wall;
        inGroups        1(wall);
        nFaces          7779;
        startFace      6230848;
    }
    bottomOfTank
    {
        type            wall;
        inGroups        1(wall);
        nFaces          24822;
        startFace      6238627;
    }
    topOfTank
    {
        type            wall;
        inGroups        1(wall);
        nFaces          24910;
        startFace      6263449;
    }
)

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

Does anyone have any advice or ideas on how to get this working? I've looked at this for two days and am running a blank.

Thanks,
Thomas

saddy July 9, 2017 14:46

i have recieved this error and i have solved it:
one thing i can promise you is ;
error is in your boundary conditions. just be 100% sure of that.
other thing is:
this error pops up when you solve same problem in different openfoam versions. mainly bcz codes evolve overtime.
so adjust your boundary conditions.
problem is most likely to be in P/U files.
have luck!

Swift July 10, 2017 01:55

Hi Saddy,

Thanks for your input.

Do you have any suggestions regarding the U and P BCs? To me they look right but I have been staring at it for days and can't figure it out.

Thanks again,
Thomas

Swift July 10, 2017 05:17

Greetings Saddy and the rest of the Forum,

I resolved the problem. Thanks for the help.

As Saddy mentioned and the error message mentioned the problem was my boundary conditions for U.

The exists in both the stationary and rotating regions of the domains, but I had a 'fixedValue' boundary condition. By changing it to 'movingWallVelocity' as is the case with the rotor, the problem is resolved. I'm not sure if this is a valid boundary condition for the part of the shaft in stationary region so I may remove the shaft altogether or create separate shaft patches in the stationary and rotating domains.

Problem solved. Whew.

Thomas

saddy July 10, 2017 08:36

whoa.......i was just here looking for the problem and in 1 second you solved it!! bravo
yeah i figured this same reason, actually physically we have to imagine whether we are unnecessarily imposing fixed/moving condition to one of our boundaries. this type of boundary conditions sometimes lead to divergence later or solution wont proceed at all.
anyways u got it!


All times are GMT -4. The time now is 22:00.