CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Writing a wallGradT (https://www.cfd-online.com/Forums/openfoam/82203-writing-wallgradt.html)

Frithjof November 19, 2010 08:38

Writing a wallGradT
 
Hello fellow openfoam-users,

I'm trying to modify wallGradU to write the sn-gradient of scalar T at the wall calculated by scalarTransportFoam.

It seems to be very straightforward, it compiles and runs but I want to make sure the results are correct.
Here is what I did:

Im creating an IOObject,
and an object wallGradT:
Code:

            volScalarField wallGradT
            (
                IOobject
                (
                    "wallGradT",
                    runTime.timeName(),
                    mesh,
                    IOobject::NO_READ,
                    IOobject::AUTO_WRITE
                ),
                mesh,
                dimensionedScalar
                (
                    "wallGradT",
                    T.dimensions()/dimLength,
                    0
                )
            );

and calculating the surface-normal gradient just as in wallGradU:
Code:

wallGradT.boundaryField()[patchi] = -T.boundaryField()[patchi].snGrad();
Is this the right way?
I want to make sure I'm getting correct results..

Thanks in advance!

boger November 20, 2010 09:47

That looks believable. You can find almost the same logic in applications/utilities/postProcessing/wall/wallGradU/wallGradU.C


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