CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   continuity error (https://www.cfd-online.com/Forums/openfoam/101448-continuity-error.html)

samiam1000 May 4, 2012 05:53

continuity error
 
Dear All,

I am running chtMultiRegionSimpleFoam and I get a continuity error.

At the 3rd time step, in fact, I get this message:

Code:

Time = 3


Solving for fluid region internal_air
DILUPBiCG:  Solving for Ux, Initial residual = 0.04808972, Final residual = 0.0007848449, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0.05127225, Final residual = 0.0006552669, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 0.0729375, Final residual = 0.001066777, No Iterations 1
DILUPBiCG:  Solving for h, Initial residual = 0.02877754, Final residual = 0.001333761, No Iterations 1
Min/max T:273 280.0333
GAMG:  Solving for p_rgh, Initial residual = 0.7510464, Final residual = 0.00749785, No Iterations 12
time step continuity errors : sum local = 0.1550988, global = 1.846758e-16, cumulative = -2.644312e-07
Min/max rho:1.241297 1.277639

Solving for fluid region external_air
DILUPBiCG:  Solving for Ux, Initial residual = 0.08944471, Final residual = 0.0008127495, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0.05704025, Final residual = 0.0005949483, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 0.09658343, Final residual = 0.0007494813, No Iterations 1
DILUPBiCG:  Solving for h, Initial residual = 0.4380229, Final residual = 0.005028673, No Iterations 1
Min/max T:297.621 298.3227


--> 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              : 1564.848
Specified mass inflow  : 0.01700355
Specified mass outflow  : 0.0167709
Adjustable mass outflow : 0


    From function adjustPhi(surfaceScalarField& phi, const volVectorField& U,const volScalarField& p
    in file cfdTools/general/adjustPhi/adjustPhi.C at line 118.

FOAM exiting

It suggests to check the BC on the U field. I think that mine are properly set:
Code:

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

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

internalField  uniform (0 0 0);

boundaryField
{
    wall-external_air-roof
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    wall-door-external_air
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    symmetry_1-external_air
    {
        type            symmetryPlane;
    }
    symmetry_2-external_air
    {
        type            symmetryPlane;
    }
    wall_back-external_air
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    wall_front
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    ceiling
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    floor-external_air
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    /*infinite_air_inlet
    {
        type        fixedValue;
        value      uniform (0 0.05 0);
    }
    infinite_air_outlet
    {
        type        fixedValue;
        value      uniform (0 0.05 0);
    }*/
    infinite_air_inlet
    {
        type        flowRateInletVelocity;
        flowRate    constant 0.017;
        value      uniform (0 0 0);
    }
    infinite_air_outlet
    {
        type        zeroGradient;
    }
}
// ************************************************************************* //

The p file is the following:
Code:

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

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

internalField  uniform 100000;

boundaryField
{
    wall-external_air-roof
    {
        type            calculated;
        value          uniform 100000;
    }
    wall-door-external_air
    {
        type            calculated;
        value          uniform 100000;
    }
    symmetry_1-external_air
    {
        type            symmetryPlane;
    }
    symmetry_2-external_air
    {
        type            symmetryPlane;
    }
    wall_back-external_air
    {
        type            calculated;
        value          uniform 100000;
    }
    wall_front
    {
        type            calculated;
        value          uniform 100000;
    }
    ceiling
    {
        type            calculated;
        value          uniform 100000;
    }
    floor-external_air
    {
        type            calculated;
        value          uniform 100000;
    }
    /*infinite_air_inlet
    {
        type            calculated;
        value          uniform 100000;
    }*/
    infinite_air_inlet
    {
        type            zeroGradient;
    }
    infinite_air_outlet
    {
        type            fixedValue;
        value          uniform 100000;
    }
}

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

Thanks for any help,

Samuele

niaz May 5, 2012 14:47

Dear Samiam
are there any outlet in your test case?
in U field you determine all parameters?:eek:
is it that?:confused:

samiam1000 May 7, 2012 02:49

Dear Niaz,

yeah, I have an outlet
Code:

    infinite_air_outlet
    {
        type            fixedValue;
        value          uniform 100000;
    }

Also, I think that I have set everything properly, haven't I?

What's wrong, to you?

Thanks a lot,

Samuele

Chris Lucas May 7, 2012 03:40

Hi,

why are all BC of your p field of type calculated? I would say that they should be zeroGradient (for the walls).

Best Regards,
Christian

samiam1000 May 7, 2012 03:43

Let me try like that.

The point is that (even tough I recognize that those BC are probably incorrect) I have a very similar case with the same BC that runs.

Let me give a try, then I get back to you.

Thanks,

Samuele.

samiam1000 May 7, 2012 03:46

I've just given a try and nothing changes. If you agree I can send you an email, attaching the case.

Do you agree?

niaz May 7, 2012 06:55

Quote:

Originally Posted by samiam1000 (Post 359660)
Dear Niaz,

yeah, I have an outlet
Code:

    infinite_air_outlet
    {
        type            fixedValue;
        value          uniform 100000;
    }

Also, I think that I have set everything properly, haven't I?

What's wrong, to you?

Thanks a lot,

Samuele

Dear Samiam
you force your outlet to go at fixed value uniformly?:eek:
it is not correct

eysteinn May 8, 2012 07:12

Quote:

Originally Posted by niaz (Post 359705)
Dear Samiam
you force your outlet to go at fixed value uniformly?:eek:
it is not correct

Seems ok to me . . . . unless there is something specific with the cht solver.

You might try to change the outlet type for U to something like fluxCorrectedVelocity or inletOutlet instead of zeroGradient.

Also have you checked that your mesh has type: patch set for inlet and outlet in constant/polymesh/boundary and emtpy for your empty patches. . . . had that problem once after exporting my mesh from ansa or icem.

samiam1000 May 8, 2012 08:27

It's very strange: I created a new case and it now runs.

I can't und why, but everything is ok!

Thanks for help.

Samuele.

sitekss May 9, 2012 03:01

Hi Foamers,
I think that samiam overdefined the model, especially the outlet. But I have similar problem in my case. I observe unexpected temperature rise when 'hot' air hit the outlet. My BC there p_rgh - fixedValue value 100000; U - zerogradient; p - calculated / zeroGradient; T - zeroGradient/ fixedValue. It's strange.
BR
Adam


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