Page 390 - TransAT_Tutorial_Manual
P. 390
TransAT Tutorial Manual 9.2. Forced Convection in an Isothermal Pipe
Tnum = 0;
Tden = 0;
// Integrate along the crossflow direction over the internal cells to get
// the bulk temperature
for (int j = 2; j < nj-3; j++){
ii = iBoundaryCell + j*ni + kBoundaryCell*nij;
Tnum += kblk[ii]*T[ii]*u[ii]*cellvolume[ii];
Tden += kblk[ii]*u[ii]*cellvolume[ii];
}
Tb = Tnum/Tden;
The multiplication by internal cells marker kblk is used to strictly restrict the integrals to the set
of internal cells.
Part 3: data gathering and writing The data gathering and writing is done with the
TransAT parallel toolbox for which more detailed information can be found in the Parallel Post-
processing section of the TransAT User Manual .
The data from each processor is first gathered using the following set of calls:
// Gather data from all processors on the root processor
x_global = tmb::toolbox::parallel_collectVector(x_local);
Nu_global = tmb::toolbox::parallel_collectVector(Nu_local);
Tbulk_global = tmb::toolbox::parallel_collectVector(Tbulk_local);
Next, the sorted accordingly to the x-coordinate on the root processor with the following lines
if(glob_rank==0){
// Sort data by x-coordinate
std::vector<size_t> * indexSorted;
indexSorted = tmb::toolbox::indexMapFromSort (x_global);
std::vector<double>* x_globalSorted;
std::vector<double>* Nu_globalSorted;
std::vector<double>* Tbulk_globalSorted;
x_globalSorted = tmb::toolbox::getVectorSortedByIndexMap(indexSorted,
x_global);
Nu_globalSorted = tmb::toolbox::getVectorSortedByIndexMap(indexSorted,
Nu_global);
Tbulk_globalSorted = tmb::toolbox::getVectorSortedByIndexMap(indexSorted,
Tbulk_global);
...
}
c
Ascomp AG Switzerland 380 Version 5.7

