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/)
-   -   No heat transfer with fixedGradient/groovyBC (https://www.cfd-online.com/Forums/openfoam-solving/201269-no-heat-transfer-fixedgradient-groovybc.html)

sturgeon April 26, 2018 14:40

No heat transfer with fixedGradient/groovyBC
 
Hi all

I'm trying to replicate the results of this paper: https://www.sciencedirect.com/scienc...60132316300208

It uses a slightly adapted solver (https://link.springer.com/article/10...546-008-9325-7) which I believe I've implemented correctly into OpenFOAM.

Here's a simple schematic of the 2D problem:

https://i.imgur.com/3DPE4yo.png

I've tried using groovyBC to set a gradient and just using fixedGradient to get heat transfer across the red patch. Here's my 0/T file:

Code:

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

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 300;

boundaryField
{
    floor
    {
        type            fixedValue;
        value          uniform 300;
    }
       
            hotWall
    {
                  type            groovyBC;
        value          uniform 300;
        valueExpression "300";
        gradientExpression "gradT";
        fractionExpression "0";
        variables     
                  (
                                "heatFlux=37;"
                                "rho=1.2;"
                                "cp=1.0;"
                                "nutemp=1.0e-5;"
                                "pr=0.9;"
                                "kappa=nutemp/pr;"
                                "gradT=heatFlux/((kappa+alphat)*rho*cp);"
                  );
//                  evaluateDuringConstruction true;
    }

    ceiling
    {
        type            inletOutlet;
        inletValue      uniform 300;
        value          uniform 300;
    }
    fixedWallsX1
    {
        type            symmetry;
    }
    fixedWallsX2
    {
        type            inletOutlet;
        inletValue      uniform 300;
        value          uniform 300;
    }
    defaultFaces
    {
        type            empty;
    }
}


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

However, when I run, the temperature in the domain remains unchanged. In paraView I see some high temperature areas in the cells across the red face, however, there's never any diffusion of temperature or the expected buoyant velocities forming.

Here are the steps I have taken:

I thought perhaps I'd implemented the T equation incorrectly, so I tried using setFields to create a high temperature area in the middle of the domain. This behaved as normally, causing vertical perturbations and the high temperature diffused.

I also thought perhaps the BC itself wasn't working. I modified the hotRoom tutorial to have the same groovyBC and ran it with my custom solver, but the effects of the temperature gradient are quite obvious.

I thought perhaps my mesh was the issue, as that's the main difference between the modified hotRoom and this case. Here is my blockMesh:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  plus                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1000;

vertices
(
    (0 0 0)//0
    (10 0 0)//1
    (10 1 0)//2
    (0 1 0)//3
    (0 0 3)//4
    (10 0 3)//5
    (10 1 3)//6
    (0 1 3)//7
       

       
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (37 1 150) simpleGrading (1 1 1436)

);

edges
(
);

boundary
(
    floor
    {
        type wall;
        faces
        (
                            (0 3 2 1)

        );
    }

    ceiling
    {
        type patch;
        faces
        (
                            (4 5 6 7)


        );
    }
    fixedWallsX1
    {
        type symmetry;
        faces
        (
            (0 4 7 3)


        );
    }
       
            fixedWallsX2
    {
        type patch;
        faces
        (

            (1 5 6 2)

        );
    }
       

);

mergePatchPairs
(
);

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

(I create the hotWall patch using topoSet and createPatch afterwards)

I've tried applying the BC to the ceiling and the right hand outlet and when I execute, the case rapidly explodes, so it's clearly doing something. I thought perhaps the issue was to do with the hotWall patch not working correctly, so I just applied the groovyBC to the floor instead and nothing happens.

Here are my fvSchemes and fvSolutions:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  plus                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-3;
        relTol          0;
    }

    pFinal
    {
        $p;
        relTol          0;
                tolerance 1e-3;
    }

            U
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance      1e-3;
        relTol          0;
    }

    UFinal
    {
        $U;
        relTol          0;
                tolerance 1e-3;
    }
       
    "(T|k|epsilon|R)"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance      1e-3;
        relTol          0;
    }

    "(T|k|epsilon|R)Final"
    {
        $U;
        relTol          0;
                tolerance 1e-3;
    }
}

PIMPLE
{
    momentumPredictor yes;
    nOuterCorrectors 1;
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue      0;
       
            residualControl
    {
        U
        {
                tolerance  1e-3;
                relTol      0;
        }
        p
        {
                tolerance  1e-3;
                relTol      0;
        }
                        T
        {
                tolerance  1e-3;
                relTol      0;

        }
                        k
        {
                tolerance  1e-3;
                relTol      0;
        }
                        epsilon
        {
                tolerance  1e-3;
                relTol      0;
        }
                        R
        {
                tolerance  1e-3;
                relTol      0;
        }
    }
}

relaxationFactors
{
    equations
    {
       
        "(U|T|k|epsilon|R)" 1;
        "(U|T|k|epsilon|R)Final" 1;
    }
}

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

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  plus                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default        Euler;
}

gradSchemes
{
    default        Gauss linear;
}

divSchemes
{
    default        none;
    div(phi,U)      Gauss upwind;
    div(phi,T)      Gauss linear;
    div(phi,k)      Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
    laplacian(nuEff,U) Gauss linear corrected;
    laplacian((1|A(U)),p) Gauss linear corrected;
    laplacian(alphaEff,T) 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        uncorrected;
}


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

So I feel that it is something to do with the mesh, but I am really not sure what. I've tried removing the grading, increasing and decreasing resolution, but nothing seems to help it function properly.

Does anyone have any experience with this? Can provide any other information needed

Cheers

wildfire230 April 27, 2018 13:04

I don't know exactly what's going wrong, but if it were me I would not use a special patch for the hot wall boundary condition and I would just use a conditional statement, i.e. x < 0.1, etc... to define which portion of the wall gets the flux condition. Then you eliminate the extra step of defining multiple blocks or special patches, etc... just a thought.


All times are GMT -4. The time now is 07:29.