CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Post-Processing (
-   -   Calculating heat flux (

hugo17 August 22, 2011 04:17

Calculating heat flux

I'm dealing with heat conduction in solids using laplacianFoam and want to calculate the heat flux through walls from Openfoam results. However, unexpected difficulties are arising which I want to explain with the following example:

The analytical result for the heat flux through the walls of the annulus shown in the figure is q"=2460.01 W/m (related to length in z direction).

1. Using wallHeatFluxLaminar (from this thread:, the following values are calculated:
Outside: q"_a=780.284 W/m^2 --> multiplication by inner circumference gives q"=2451.3 W/m
Inside: q"_i=-1299.32 W/m^2 --> q"=-2449.2 W/m
Compared to the analytical solution, these values are too small.

2. Using foamCalc magGrad T, the following values are calculated:
Outside: magGrad T=78.0284 K/m --> multiplication by k and the inner circumference gives q"=2451.3 W/m (same value as given by wallHeatFluxLaminar)
Inside: magGrad T=129.932 K/m --> q"=-2449.2 W/m
Thus, using magGrad T leads to the same heat flux as wallHeatFluxLaminar for the present example. However, this is not the case for all geometries I dealt with.

3. Calculating the gradient magnitude for myself from mag(grad T) = sqrt(gradTx^2 + gradTy^2), I obtain different heat fluxes:
Outside: sqrt(gradTx^2 + gradTy^2)=78.307 K/m --> q"=2460.09 W/m
Inside: sqrt(gradTx^2 + gradTy^2) --> q"=2460.07 W/m
These heat fluxes are very close to the analytical value.

Now, my questions are:
- Why does the gradient magnitude calculated as sqrt(gradTx^2 + gradTy^2) differ from magGrad T calculated by foamCalc?
- Why is the heat flux value calculated from sqrt(gradTx^2 + gradTy^2) apparantly "better" than this one calculated from WallHeatFluxLaminar or magGrad T?

I really appreciate any comment on this problem.


hugo17 August 22, 2011 05:18

I found the reason for the different results: I had writePrecision set to 6. When I increase it to 8, also wallHeatFluxLaminar and magGrad T give the correct values.


All times are GMT -4. The time now is 13:19.