Code for Nusselt number
4 Attachment(s)
I have used the following code created by Johan Magnusson. It creates the tool NusseltCalc. Only problem is, when I run NusseltCalc then I got the error:
Command not found. Could you please help me? I am adding the code as an attachment. 
Hi,
have you correctly compiled the tool? You need to do a "wmake", see the Wiki for more information on that topic. Markus 
Dear Members,
This is the code for local Nusselt number: volScalarField wall_localNusselt ( IOobject ( "wall_localNusselt", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("wall_localNusselt ",dimless,0.0) ); forAll(wall_localNusselt.boundaryField(),patchi) { wall_localNusselt.boundaryField()[patchi] = length*patchHeatFlux[patchi]/((T_hotT_ini)*k); } wall_localNusselt.write(); } I want to write a code for Average Nusselt Number. 
Solved !!!
The code was correct. NusseltCalc is working now.

Problem !!!
How to calculate average Nusselt number?

DearGoutam,
I have not used the code but it would be helpful to see the error message. Markus 
Looking for a response?

Hello Goutam,
please be a bit more precise. As far as I understand, the code you posted above calculates the patchaveraged Nusselt number. Because patchHeatFlux should be the heat flux over the patch in [W/m2], right? Markus 
Average Nusselt Number
Dear Markus,
This code will calculate heat flux and Local Nusselt NUmber at each patch. I am using this code and its working properly. If you want to calculate average Nusselt number, then just write in the terminal window: patchAverage wall_localNusselt your_patch_name You will get your average Nusselt number. Cheers !!! 
How can I alter your code?
Quote:
 wall_localNusselt.boundaryField()[patchi] = length*patchHeatFlux[patchi]/((T_hotT_ini)*k);  I want to calculate the localNusselt number at a wall which is called "right". I have a rectangular cavity which has 4 walls with the following names: bottom, right, left and top. So, the Nusselt number is calculated as the integration of dT/dx for limits from y=0 to 1, at x=0, which is the "right" wall. How can I alter your code? I am using an incompressible Magnetohydrodynamics` solver. Thanks a lot for your help! 
2 Attachment(s)
Quote:
I have used the same code and terminal command for calculating the nusselt number for a case of fin tube heat exchanger using chtMultiRegionSimpleFoam solver but i am getting: Code:
Create time 
Hi,
From what i understand from code, this is not a post processing utility rather a runtime utility and i need to create a volumetric scalar field NusseltNumber for it to work. Plz let me know your views. 
Quote:

Nusseltcalc.C
1 Attachment(s)
Hello there,
I'm trying to compile the tool but I keep receiving this error: Code:
NusseltCalc.C: In function 'int main(int, char**)': Any ideas why? Thanks. 
Hi,
RASModel is class name, did you mean turbulence>alphaEff()? (also this method is available only for compressible turbulence models, in case of incompressible model you have to calculate is as nu/Pr + nut/Prt) 
Thanks for the quickly reply. That killed that error but now I can't find a way to link the libraries I need. The error is this:
Code:
/usr/bin/ld: cannot find lcompressibleTurbulenceModel My options file in /Make dir is this: Code:
EXE_INC = \ 
Hi,
it looks much like you've forgotten to set up environment variables. 
I´m kind of new at this. How can I do that?

basically we can calculate local nusselt numbers over a patch as we've seen in the discussion above. To get an average nusselt number, you must do some area weighting in the case of a non uniform mesh. Below, you calculate the local nusselt number at each face on heatedPatchID and multiply by the faces area. You must also calculate the total patch area. Once each local nusselt number is weighted by its own area of its face on the boundary, you divide the entire sum of area weighted nusselt numbers by the total area. This results in an averaged nusselt number.
Take a uniform mesh for example: e.g. (A1*Nu1 +A2*Nu2 +... An*Nun)/Atotal = NUM/DEN where A1 is the face area of face 1 on heatedPatchID and Atotal is the entire patch area and if A1 = A2 = An (uniform mesh), then A1 = Atotal/n = A2 = .. = An resulting in Atotal(Nu1 + Nu2 + ... +Nun)/(Atotal*n) = (Nu1 + Nu2 + ... +Nun)/n), which quite simply in a basic average of n components. This is how we integrate numerically along a dimension in most cases where we divide the area weighted sum by the total area of that boundary of interest whether it be length, area or volume. Code:
label heatedPatchID = mesh.boundaryMesh().findPatchID("heatedBoundaryName"); Any comments are welcome. James 
error compiling
Hi,
I'm facing this problem when i type wmake Code:
michele@micheleXubuntu:~/OpenFOAM/michele2.3.1/run/nusseltCalc$ wmake thanks a lot Michele 
All times are GMT 4. The time now is 08:02. 