CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   buoyantPimpleFoam - Water convection problem (http://www.cfd-online.com/Forums/openfoam-solving/113250-buoyantpimplefoam-water-convection-problem.html)

dav.dap83 February 15, 2013 14:04

buoyantPimpleFoam - Water convection problem
 
Hi everyone,

I am trying to simulate convection into a water-filled horizontal cylinder. One end is kept at a higher temperature than the other boundaries. The solver gives the following error:

Code:

--> FOAM FATAL ERROR:
Maximum number of iterations exceeded

    From function specieThermo<Thermo>::T(scalar f, scalar T0, scalar (specieThermo<Thermo>::*F)(const scalar) const, scalar (specieThermo<Thermo>::*dFdT)(const scalar) const) const
    in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 69.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >::T(double, double, double (Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >::*)(double) const, double (Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >::*)(double) const, double (Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >::*)(double) const) const in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#3  Foam::hRhoThermo<Foam::pureMixture<Foam::polynomialTransport<Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >, 8> > >::calculate() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#4  Foam::hRhoThermo<Foam::pureMixture<Foam::polynomialTransport<Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >, 8> > >::correct() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#5 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
Aborted (core dumped)

My thermophysicalProperties file looks like:

Code:

thermoType hRhoThermo<pureMixture<icoPoly8ThermoPhysics>>;

pRef            100000;

mixture
{
    specie
    {
        nMoles          1;
        molWeight      1;
    }

    equationOfState
    {
        rhoCoeffs<8>  ( 1000 0 0 0 0 0 0 0);
    }
    thermodynamics
    {
        Hf              0;
        Sf              0;
        CpCoeffs<8>    ( 4186 0 0 0 0 0 0 0);
    }
    transport
    {
        Pr              7.01;
        muCoeffs<8>
          ( 1.002e-3 0 0 0 0 0 0 0);
        kappaCoeffs<8>
          ( 0.596 0 0 0 0 0 0 0);
    }
}


Thank you in advance.

olivierG February 18, 2013 06:17

hello,

You didn't give your BC for T (you should), but my gess is you've got a 0 value somewhere for T.

regards,
olivier

dav.dap83 February 18, 2013 07:18

Hello,

Thank you for your answer. The boundary conditions for T are:


Code:

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 293;

boundaryField
{
    pipeWall
    {
        type            fixedValue;
        value          uniform 288.15; // 15 degC
    }

    inlet
    {
        type            fixedValue;
        value          uniform 390;
    }

    outlet
    {
        type            zeroGradient;
    }
}

This setup seemed to work, but I wasn't able to understand whether conduction works correctly, so I tried a slightly different configuration:


Code:

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 293;

boundaryField
{
    pipeWall
    {
        type            fixedValue;
        value          uniform 390;
//        value          uniform 288.15; // 15 degC
    }

    inlet
    {
        type            fixedValue;
        value          uniform 390;
//        value          uniform 307.75; // 34.6 degC
    }

    outlet
    {
        type            fixedValue;
        value          uniform 390;
//        type            zeroGradient;
    }
}

The latter generates the error. Please note that the Courant Number mean is 0.0131906 and the max 0.0955666

tomf February 19, 2013 05:58

Hi,

I guess your fixed temperature outlet is giving you the error. Please change this back to zeroGradient and all will be fine. At the moment you are forcing the flow to advect heat upstream, which won't happen.

Regards,
Tom

dav.dap83 February 19, 2013 06:45

Hi tomf,
I tried, But I still incur in the same error

tomf February 19, 2013 08:25

These boundary conditions for T should work fine if you have only outflow at the outlet and inflow at the inlet.

Other reasons that may give problems:
- Mesh
- settings in fvSchemes, fvSolution,
- boundary conditions for pressure, velocity, turbulence.

Please check those, or share them, maybe someone can help.

Regards,
Tom

dav.dap83 February 19, 2013 12:35

I have run this trial version. It should reproduce am equilibrium state, but it returns the same error:

p
Code:

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

internalField  uniform 1e5;

boundaryField
{
    pipeWall
    {
        type            fixedValue;
        value          uniform 1e5;
    }

    inlet
    {
        type            fixedValue;
        value          uniform 1e5;
    }

    outlet{
        type            fixedValue;
        value          uniform 1e5;
    }
}

T
Code:

internalField  uniform 390;

boundaryField
{
    pipeWall
    {
        type            fixedValue;
        value          uniform 390;
    }

    inlet
    {
        type            fixedValue;
        value          uniform 390;
    }

    outlet
    {
        value          uniform 390;
    }
}

U
Code:

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

internalField  uniform (0 0 0);

boundaryField
{
    pipeWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

    inlet
    {
        type            fixedValue;
        value          uniform (0 0 0);
  }

    outlet
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
}

fvSchemes
Code:

ddtSchemes
{
    default        Euler;
}

gradSchemes
{
    default        Gauss linear;
}

divSchemes
{
    default        none;
    div(phi,U)      Gauss linear;
    div(phi,h)      Gauss linear;
    div(phi,k)      Gauss linear;
    div(phi,epsilon) Gauss linear;
    div(phi,R)      Gauss linear;
    div(phi,K)      Gauss linear;
    div(R)          Gauss linear;
    div((muEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        none;
    laplacian(muEff,U) Gauss linear corrected;
    laplacian((rho*(1|A(U))),p_rgh) Gauss linear corrected;
    laplacian(alphaEff,h) Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
    laplacian(DREff,R) Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p_rgh;
}

fvSolution:
Code:

solvers
{
    "rho.*"
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      0;
        relTol          0;
    }

    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-8;
        relTol          0.01;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

    "(U|h|k|epsilon|R)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-6;
        relTol          0.1;
    }

    "(U|h|k|epsilon|R)Final"
    {
        $U;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor yes;
    nOuterCorrectors 1;
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
}

thermophysicalProperties
Code:

thermoType hRhoThermo<pureMixture<icoPoly8ThermoPhysics>>;


pRef            100000;

mixture
{
    specie
    {
        nMoles          1; // not used since pureMixture and not ideal gas
        molWeight      1; // idem
    }

    equationOfState  // rho(T)
    {
        rhoCoeffs<8>  ( 1000 0 0 0 0 0 0 0);      // coef a + bT+cT˛+...
    }
    thermodynamics
    {
        Hf              0;
        Sf              0;
        CpCoeffs<8>    ( 4186 0 0 0 0 0 0 0);  // Cp(T)
    }
    transport
    {
        Pr              7.01;
        muCoeffs<8>    // viscosity(T)
          ( 1.002e-3 0 0 0 0 0 0 0);
        kappaCoeffs<8>  //conductivity(T)
          ( 0.596 0 0 0 0 0 0 0);
    }
}


tomf February 20, 2013 05:18

Ok, this is just what I think may be the problem. You have an analytically valid solution, basically you have just a stagnant tube of water. However numerically there are small differences, you are now trying to solve for them, but with all the boundary conditions fixed, the solver can not handle this. You have over constrained the problem numerically. This means the solver is trying very hard to find a valid solution, but it can not, returning an error. Furthermore you have the linear scheme on all variables, which is not very robust and would require a very high quality mesh. I would suggest to have:

U,T:
fixedValue at the inlet, zeroGradient at the outlet, walls: fixedValue
p:
zeroGradient at inlet and walls, fixedValue at outlet

If it starts at least one iteration and still fails, change your fvSchemes with bounded schemes.

If you do not have flow, there will be no solution, except the trivial one you already set up.

Good luck,
Tom

dav.dap83 February 20, 2013 09:57

Thank you for your answer, now it doesn't give the error message anymore.

However, I don't understand the solution's behavior.

I slightly changed the boundary condition: T=390 also for the wall, and I oriented the g field in order to have the pipe placed in vertical position, with outlet on the top and inlet on the bottom. I set endTime to 2000 s.

I was expecting to see a progressive heating from the walls towards the centre, and also some convective flows, but I achieved only a partial heating limited to a thin layer next to walls, and no convective motion.

tomf February 20, 2013 10:14

Well with a Prandtl number of 7 I would expect the thermal boundary layer to be even smaller than the velocity boundary layer. Obviously this all relates to the dimensions (Reynolds number) of your pipe flow. If the diameter of your pipe is a lot larger than the boundary layer, than you should see the result you have. If the diameter is small, you would get the result you expect.

dav.dap83 February 20, 2013 14:33

Thank you for your answer.
I took the Prandtl number value from the Prandtl number value for water at room temperature. I removed the line that gives the Prandtl number value in thermophysicalProperties and the simulation runs without problem; the thermal boundary layer becomes a little thicker.

Seems more feasible

dav.dap83 March 5, 2013 11:19

I tried to set up constantGradient boundary condition, but it crashes. The new T file is:
Code:

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 278.15; // 5 degC

boundaryField
{
    pipeWall
    {
        type            fixedGradient;
        gradient        uniform -206218; // Cast iron
    }

    inlet
    {
        type            fixedValue;
        value          uniform 283.15; // 10 degC
    }

    outlet
    {
        type            zeroGradient;
    }
}

The error message is:
Code:

--> FOAM FATAL ERROR:
Maximum number of iterations exceeded

    From function specieThermo<Thermo>::T(scalar f, scalar T0, scalar (specieThermo<Thermo>::*F)(const scalar) const, scalar (specieThermo<Thermo>::*dFdT)(const scalar) const) const
    in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 69.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >::T(double, double, double (Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >::*)(double) const, double (Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >::*)(double) const, double (Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >::*)(double) const) const in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#3  Foam::hRhoThermo<Foam::pureMixture<Foam::polynomialTransport<Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >, 8> > >::calculate() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#4  Foam::hRhoThermo<Foam::pureMixture<Foam::polynomialTransport<Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >, 8> > >::hRhoThermo(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#5  Foam::basicRhoThermo::addfvMeshConstructorToTable<Foam::hRhoThermo<Foam::pureMixture<Foam::polynomialTransport<Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >, 8> > > >::New(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#6  Foam::basicRhoThermo::New(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#7 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
#8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
Aborted (core dumped)

Thank you again.

dav.dap83 March 7, 2013 07:23

Further information: before crashing, temperature near the borders exceeds initial data temperatures

tomf March 8, 2013 05:08

Hi,

Are you absolutely sure, this is the correct gradient?

Quote:

{ type fixedGradient; gradient uniform -206218; // Cast iron }
This translates to -206218 Kelvin per meter, which seems rather large to me.

dav.dap83 March 8, 2013 06:33

Hi tomf,

The problem is that temperature inside the pipe drops very quickly, i.e. about 5 degrees in 5 mm. That is why the gradient is so large.




By the way, I also tried wallHeatTransfer BC:
Code:

        type            wallHeatTransfer;
        Tinf            uniform 258.15;
        alphaWall      uniform 0.4;

but it returns the following error:
Code:

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigSegv::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::wallHeatTransferFvPatchScalarField::updateCoeffs() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#4  Foam::mixedFvPatchField<double>::evaluate(Foam::UPstream::commsTypes) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#5  Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#6  Foam::fvPatchField<double>::adddictionaryConstructorToTable<Foam::wallHeatTransferFvPatchScalarField>::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#7  Foam::fvPatchField<double>::New(Foam::fvPatch const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
#8  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::GeometricBoundaryField(Foam::fvBoundaryMesh const&, Foam::DimensionedField<double, Foam::volMesh> const&, Foam::dictionary const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
#9  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readField(Foam::dictionary const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
#10  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::readField(Foam::Istream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
#11  at basicThermo.C:0
#12  Foam::basicThermo::basicThermo(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#13  Foam::basicRhoThermo::basicRhoThermo(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#14  Foam::hRhoThermo<Foam::pureMixture<Foam::polynomialTransport<Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >, 8> > >::hRhoThermo(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#15  Foam::basicRhoThermo::addfvMeshConstructorToTable<Foam::hRhoThermo<Foam::pureMixture<Foam::polynomialTransport<Foam::specieThermo<Foam::hPolynomialThermo<Foam::icoPolynomial<8>, 8> >, 8> > > >::New(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#16  Foam::basicRhoThermo::New(Foam::fvMesh const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#17 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
#18  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#19 
 in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/buoyantPimpleFoam"
Segmentation fault (core dumped)


tomf March 8, 2013 08:39

I have the feeling the gradient may be too large. Did you try with a smaller gradient? If that works, than maybe you can ramp up the gradient in order to get past the initial phase.

I have not tried the wallHeatTransfer BC myself, so I can not comment on that one.

Regards,
Tom

Questionmark86 October 1, 2015 07:41

Colleagues,

I posted a new thread regarding BuoyantPimpleFoam here:

http://www.cfd-online.com/Forums/ope...tml#post565964

Can any of you take a look at it and offer some advice?


All times are GMT -4. The time now is 14:23.