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/)
-   -   Buoyantboussinesq simpleFoam residuals problem (https://www.cfd-online.com/Forums/openfoam-solving/150126-buoyantboussinesq-simplefoam-residuals-problem.html)

Naresh yathuru March 16, 2015 06:11

Buoyantboussinesq simpleFoam residuals problem
 
1 Attachment(s)
Hi foamers,

I m simulating a room with a inlet and outlet and a rectangular patch called lighting on the ceiling and cube inside the room.
As a first basic simulation I wanted to specify heat flux boundary condition for the patch and temperature to the inlet air and velocity at the inlet pressure at outlet by pressure i mean (p_rhg) as p is calculated at the outlet.

problem:
1. i did a couple of simulation but in both the simulations i get a huge fluctuatioin in the residuals graph. i have attached the picture below.
I m attaching my fvscheme and fvsoluion here :

FV scheme

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default leastSquares; // it was Gauss linear
}

divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind grad(U); // was bounded Gauss upwind which is first order but linearupwind is second order
//div(phi,U) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phi,T) bounded Gauss linearUpwind grad(T);
//div(phi,T) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
div(phi,R) bounded Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) bounded Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p_rgh ;
}


// ************************************************** *********************** //
FV solution:
solvers
{
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-8;
relTol 0.001;
}

"(U|T|k|epsilon|omega|R)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-8; // before 1e-05
relTol 0.001;
}
}

SIMPLE
{
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;

/*residualControl
{
p_rgh 1e-2;
U 1e-4;
T 1e-2;

// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}*/
}

relaxationFactors
{
fields
{
p_rgh 0.3; //before it was 0.7
}
equations
{
U 0.7; // before it was 0.3
T 0.5;
"(k|epsilon|omega|R)" 0.7;
}
}

sorry for the long question.

Additionally i didnot get the correct results for the simulation.

could someone please enlighten me.

thankyou

With Regards,
Naresh Yathuru

thiagopl March 16, 2015 09:33

Hi Naresh Yathuru,

It seems that you didn't achieve convergence for your problem. So instead of posting fvSolutions and fvSchemes, it would be better to post your boundary conditions. I suggest you to use the 1st order upwind scheme for the divergence therms unless you achieve convergence.

You may use [ code] text [ /code] (without spaces) when posting pieces of code. :)

Regards,

Naresh yathuru March 17, 2015 03:52

Thank you so much thiago. I think my alphat,epsillon,k,nu,Omega B.C are fine. could you please have a look at my p, p-rgh, u, T

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
       
    }

    outlet
    {
        type            fixedValue;
        value          uniform 0; //before $internalField;
    }

    sideandfloorwalls
    {
        type            calculated;
        value          $internalField;
    }
    innercube
    {
        type            calculated;
        value          $internalField;
    }
    lightingwall
    {
        type            calculated;
        value          $internalField;
    }
    roof
    {
        type            calculated;// before it was calculated;
        value          $internalField;
    }
}

//

This is my p-rgh

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
        //rho            rhok;
        //value          uniform 0;
    }

    outlet
    {
        type            fixedValue;
        value          uniform 0;
    }

    sideandfloorwalls
    {
        type            fixedFluxPressure;
        rho            rhok;
        value          uniform 0;
    }
    innercube
    {
        type            fixedFluxPressure;
        rho            rhok;
        value          uniform 0;
    }
    lightingwall
    {
        type            fixedFluxPressure;
        rho            rhok;
        value          uniform 0;
    }
    roof
    {
        type            fixedFluxPressure;
        rho            rhok;
        value          uniform 0;
    }
}

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

Code:

version    2.0;
    format      ascii;
    class      volScalarField;
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 293; //17C

boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform 293.15; // 20C
    }
    outlet
    {
        type            zeroGradient;
       
    }
    sideandfloorwalls
    {
        type            zeroGradient;
       
    }
    lightingwall
    {
        //type            wallHeatFlux;
        //heatFlux        uniform -200;
        // This did not work for incompressible flows. I read somewhere that this B:C does not exist in OF 230
   
        type            turbulentHeatFluxTemperature;
        heatSource      flux;
        q              uniform -200; // w/m^2 // This is just a check . this would generate a surface temperature of -27 C
        alphaEff        alphaEff;
        value          uniform 273; // place holder
     
    }
    /*{
        type            fixedValue;
        value          uniform 323.15; // for the time being or flux 100 w/m
    }*/
    innercube
    {
        type            zeroGradient;
        //value          uniform 313.15;
    }
    roof
    {
        type            zeroGradient;
        //value          uniform 291.15;
    }
}

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

U was initialised with potentialFoam:

Code:

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

internalField  uniform (0 0 0);

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

    outlet
    {
        type            zeroGradient;
    }

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

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

    lightingwall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    roof
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
}

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

FYI: yesterday i came to know that TurbulentHeatFluxTemperature boundary condition has a bug from the post of Bruno

http://www.cfd-online.com/Forums/ope...le-case-2.html

I may not be good in programming but i m good in sharing information :) Thats all i can contribute for OF users.

regards,
Naresh

Naresh yathuru March 17, 2015 03:56

By the way i m using OF 230. i dont know if the TurbulentHeatFluxTemperature bug is fixed in OF 231.

Naresh

thiagopl March 17, 2015 07:07

Hi Naresh,

Unfortunately I don't have much to contribute, but I woud suggest you to use the fixedFluxPressure as inlet BC for p_rgh (see here and here) and zeroGredient for oulet BC for p_rgh.

I don't know much about the lightingwall BC, but I suggest you to first try a fixedValue BC and see if the problem converges and then change this BC (a step by step thing :))

Regards,

Naresh yathuru March 17, 2015 10:40

2 Attachment(s)
hi thiago,

Thank for your reply. I have a very crucial question i hope you could help me. I m sorry for asking it in the same thread. I m using buoyantBoussinesqsimple Foam. i m using the turbulentHeatFluxTemperature which is not giving me the reselt i expected (image attached)
1. does the turbulentHeatFluxTemperature really has a bug to be concerned about?
If yes then i really surprised that no one found it out untill now except bruno untill nov 2014.

2. if not could u please check if my boundary conditions are correct.

as u can see from my boundar condition for temperature. the temperature cannot be greater than 293 K.

I m totally confused. where is the problem . is it because of the heatflux b.C or any other boundary condition.

I ran the same simulation in fluent the results are fine.

then i tried to simulate with temperature boundary condition for the lightingwall then every thing was fine.

3. is there another possibility to specify the heat flux B.c?
:(
Thank you in advance,

naresh

thiagopl March 20, 2015 14:33

Hi Nares,

Answering your questions:

1. I really don't know, but is always better do use the latest versions to avoid problems with bugs already solved.

2. The suggestions I have were that of my last post. I only solved closed problems in OF, so I've never dealt with inlet or oulet BC.

3. You can use the fixedGradient BC to specify a fixed heat flux.

Regards,


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