CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Temperature Gradient at Wall (https://www.cfd-online.com/Forums/openfoam/65701-temperature-gradient-wall.html)

 sven June 23, 2009 13:48

Temperature Gradient at Wall

I am simulating a laminar channel flow with heated walls. To calculate y nusselt number I first want to calculate the temperature gradient at the wall. Unfortunately I couldnt find some function similar to "WallGradU" which is able to calculate the wall temperature gradient, like "WallGradU" does it for the velocity gradient. Has anyone an idea how I could get the temperature gradient out of OpenFOAM? Can the "WallGradU" function be edited to get the temperature gradient?

 awacs June 23, 2009 22:18

Hi sven,

I am interested in this problem too. I am new to OpenFOAM. I want to simulate the filling process of non-newtonian fluids into a heated cavity.The energy equation was added to the interFoam solver to calculate the temperature field.
At the heated wall:

1) The temperature of non-newtonian fluid is assumed equal to the wall's (in my case，the thermal conductivity of the wall is much larger than that of the non-newtonian fluid ).

2) A coupled solver such as chtMultiRegionFoam can be created to solve this problem. Combination of heatConductionFoam and interHeatFoam (interFoam with energy equation) for conjugate heat transfer between a solid region and fluid region.

I am working on the second part.

If there is any development, please let me know.

Best regards,
Jitao

 santos June 24, 2009 04:27

Hi Sven,

Make a copy of wallGradU, replace U with T, volVectorField with volScalarField and dimensionedVector with dimensionedScalar. It should work!

Regards,
Jose Santos

Quote:
 Originally Posted by sven (Post 220245) I am simulating a laminar channel flow with heated walls. To calculate y nusselt number I first want to calculate the temperature gradient at the wall. Unfortunately I couldnt find some function similar to "WallGradU" which is able to calculate the wall temperature gradient, like "WallGradU" does it for the velocity gradient. Has anyone an idea how I could get the temperature gradient out of OpenFOAM? Can the "WallGradU" function be edited to get the temperature gradient?

 svens June 24, 2009 12:16

Hi Santos - thanks for your reply.

I have the same intention like sven and tried your advise.
Sadly I received some errors while creating the new wallGradT:

Line 80 - error: Expected primary-expressions before '(' token
Line 83 - error: 'scalar' is not a class of namespace

PHP Code:

``` #include "fvCFD.H"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //int main(int argc, char *argv[]){    timeSelector::addOptions();    #include "setRootCase.H"#   include "createTime.H"    instantList timeDirs = timeSelector::select0(runTime, args);#   include "createMesh.H"    forAll(timeDirs, timeI)    {        runTime.setTime(timeDirs[timeI], timeI);        Info<< "Time = " << runTime.timeName() << endl;        IOobject Theader        (            "T",            runTime.timeName(),            mesh,            IOobject::MUST_READ        );        // Check U exists        if (Theader.headerOk())        {            mesh.readUpdate();            Info<< "    Reading T" << endl;            volScalarField T(Theader, mesh);            Info<< "    Calculating wallGradT" << endl;            volScalarField wallGradT            (                IOobject                (                    "wallGradT",                    runTime.timeName(),                    mesh,                    IOobject::NO_READ,                    IOobject::AUTO_WRITE                ),                mesh,                dimensionedScalar                (                                                 <- line 80                    "wallGradT",                    T.dimensions()/dimLength,                    scalar::zero                              <- line 83                )            );            forAll(wallGradT.boundaryField(), patchi)            {                wallGradT.boundaryField()[patchi] =                    -T.boundaryField()[patchi].snGrad();            }            wallGradT.write();        }        else        {            Info<< "    No T" << endl;        }    }    Info<< "End" << endl;    return 0;}  ```
I am an absolutely beginner and I didn't find a solution for these errors so far.

Thanks a lot & regards
svens

 santos June 24, 2009 12:20

Replace scalar::zero with 0 and all should be well.

Regards,
Jose Santos

 svens June 24, 2009 15:23

It works! Perfect - thanks so much.

 deji July 23, 2010 05:04

Question: I am able to compute the mean temperature gradient at a specified patch of my choosing. The is essentially 3D, hence the I have a 2D plane wall temperature gradient. Can anyone give me any feedback or advice as to how I can average the temperature gradient along a wall direction, so that I end with an output that comprises two columns such as: x dTmean/dn
x1 *****
x2 *****

Thanks.

Deji

 farhagim November 1, 2010 18:25

Hello Jitao,

I would like to know if you were successful with your implementation. I am interested in such a coupled solver ( combination of heatConductionFoam and interHeatFoam ). I would be so grateful if you can help me.

Thanks,

Mehran

Quote:
 Originally Posted by awacs (Post 220270) Hi sven, I am interested in this problem too. I am new to OpenFOAM. I want to simulate the filling process of non-newtonian fluids into a heated cavity.The energy equation was added to the interFoam solver to calculate the temperature field. At the heated wall: 1) The temperature of non-newtonian fluid is assumed equal to the wall's (in my case，the thermal conductivity of the wall is much larger than that of the non-newtonian fluid ). 2) A coupled solver such as chtMultiRegionFoam can be created to solve this problem. Combination of heatConductionFoam and interHeatFoam (interFoam with energy equation) for conjugate heat transfer between a solid region and fluid region. I am working on the second part. If there is any development, please let me know. Best regards, Jitao

 All times are GMT -4. The time now is 15:04.