CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

No heat transfer with fixedGradient/groovyBC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2018, 14:40
Default No heat transfer with fixedGradient/groovyBC
  #1
Member
 
Join Date: Jun 2017
Posts: 58
Rep Power: 8
sturgeon is on a distinguished road
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:



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
sturgeon is offline   Reply With Quote

Old   April 27, 2018, 13:04
Default
  #2
Senior Member
 
Join Date: Jul 2013
Posts: 124
Rep Power: 12
wildfire230 is on a distinguished road
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.
wildfire230 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Flow around heatsink with heat transfer S Mughal FLUENT 0 April 13, 2018 13:06
Heat transfer using all modes bhups45 FLUENT 0 June 19, 2016 07:02
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Question about heat transfer simulation Anna Tian Main CFD Forum 0 January 25, 2013 18:53
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


All times are GMT -4. The time now is 03:32.