# Calculate Nusslet number along pipe

Nusslet Number is a dimensionless number and usually reported in heat transfer context. It is defined as:

where Ts and Tinf are wall and bulk temperature, respectively. The wall temperature is easy to access, but calculation of bulk temperature needs special treatment.

## 1- Calculate Nusselt using swak4Foam

The bulk temperature for limited number of slices can be conducted using swak4Foam as follow:

 x1_Tb
{
type swakExpression;
valueType surface;
surfaceName x1;
surface {
type plane;
planeType	pointAndNormal;
pointAndNormalDict {
basePoint       (0 0 1);
normalVector    (0 0 1);
interpolate false;
}
}
verbose true;
expression "sum(U.z*Sf().z*T)/sum(U.z*Sf().z)";
accumulations (
min
// max
);
outputControlMode      timeStep;//outputTime;//
outputInterval         1;
writeStartTime        no;
}

when bulk temperature is  obtained. Go a head and calculate Nusselt.

## 2-Calculate Nusselt with programming

In order to calculating the Nusselt number along the pipe, it is inevitable to write some pieces of coding. The program first classifies cells in sections and then calculate the bulk temperature for each section.
The code is written for OpenFOAM220, but with minor revision it can be applied to other OpenFOAM versions.

The Nusselt contour  is shown in Figure 1 from present code.

## 2 Replies to “Calculate Nusslet number along pipe”

1. Dear Nima,
thank you very much for providing the source code of this program for the Nusselt number. I successfully compiled it with OpenFOAM 3.0 after minor modification. Now I am trying to understand how use it. My pipe has 3 different sections with different diameters. Can I use this code to obtain the Nusselt numbers on each pipe section? Can I indicate more that one boundary patch in the command line to get Nusselt number on different patches ?