CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Calculating Nusselt Number

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 2 Post By Mehdi3031
  • 4 Post By floquation
  • 2 Post By floquation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 6, 2017, 07:07
Default Calculating Nusselt Number
  #1
Member
 
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10
Mehdi3031 is on a distinguished road
Dear Foamers, Hello
I am trying to calculate the nusselt number for a fully developed laminar flow between two parallel plates with constant wall temperature boundary condition.
As it can be found in many books, This value should be 7.55 for plates with infinite width(a) with respect to the distance between the two plates(b):
For a/b > 8 , Nu_fd = 7.55
I have tried many many ways to get this number by calculating the local heat transfer coefficient (h) from the CFD results and then calculating the corresponding local Nusselt number, but no luck so far...

what I have done briefly :
Block Mesh:
Code:
convertToMeters 0.001;
vertices
(
    // inlet region
    ( 0 0  -5000 )  // pt 0 (in1b) 
    ( 0 100  -5000 ) // pt 1 (in2b) 
    ( 0  0  5000 )  // pt 2 (in1f) 
    ( 0 100  5000 ) // pt 3 (in2f) 

    // join inlet->outlet
    ( 5000 0  -5000 )    // pt 4 (join1b) 
    ( 5000 100  -5000 ) // pt 5 (join2b) 
    ( 5000 0  5000 )    // pt 6 (join1f) 
    ( 5000 100  5000 ) // pt 7 (join2f) 
);
a=10[m] , b=0.1[m] , L = 5[m]

Boundary condition:
at the inlet I set the mass flow rate as following to get a laminar flow (low Reynolds) which develops very fast and I get a very nice fully developed flow both hydro dynamically and thermally a bit after the entrance:

Code:
inlet
    {
        type            flowRateInletVelocity;
        massFlowRate    constant 0.375;
        rhoInlet        1;          // estimate for initial rho
    }
Solver:


The solver is rhoPimpleFoam, which I revised a bit to calculate the nusselt on each mesh along the length. so we know that
q = h A ( Tw - Tm )

Nu = h D_h / K

where
Tw = Wall constant temperature [k]
Tm = the mean flow temperature at the length X from the inlet [K]
A = mesh surface [m^2]
h = local heat transfer coefficient [W/m^2/K]
q = heat flow on the wall [W]
k = thermal conductivity of fluid [W/m/k]
D_h = Hydrolic diameter = 4ab/(2b+2a) = 2b [m]

therefore
PHP Code:
Nu = (q/k) (2b/(a(dx)(Tw-Tm))) 
I know b,a,Tw and dx which is the mesh length in X direction.
Tm I calculate after the run is done using paraview
so I added the following code to the solver to calculate "q/k" on each mesh along the length(L) and write it in a text file with it's corresponding coordinate:


Code:
//		Mehdi start:

    volScalarField& h = thermo.he();
	surfaceScalarField heatFlux		//[w/m^2]
	(
            fvc::interpolate
            (
                (
                    turbulence.valid()
                  ? turbulence->alphaEff()()
                  //: thermo->alpha()
                  : thermo.alpha()
                )
            )*fvc::snGrad(h)
	);

	const surfaceScalarField::GeometricBoundaryField& patchHeatFlux = heatFlux.boundaryField();
	surfaceScalarField SurfT = fvc::interpolate(h) / fvc::interpolate(Cpp);
	surfaceScalarField SurfLambda = fvc::interpolate(lambdaa);
	const surfaceScalarField::GeometricBoundaryField& patchLambda = SurfLambda.boundaryField();
	const surfaceScalarField::GeometricBoundaryField& patchT = SurfT.boundaryField();


// for each face Mesh:
	//access boundary elements
	word UpperWall = "UpWall";
	label UpperWallPatchID = mesh.boundaryMesh().findPatchID(UpperWall);
	const fvPatchVectorField& centreUp = mesh.C().boundaryField()[UpperWallPatchID];

// Write the het flux
	ofstream output2;
	output2.open("qOverK.txt");
	forAll(patchHeatFlux, patchi)
        {
            if (UpperWallPatchID == patchi)
            {
		fvPatchScalarField& targetPatchT = h.boundaryField()[patchi];
		forAll(targetPatchT, faceI) 
		{
			const vector& c = centreUp[faceI];
			output2 << mesh.boundary()[patchi].name()
			<< " "
			<< c[0] <<"	," << c[1] <<"	," << c[2]
			<<"	" << (mesh.magSf().boundaryField()[patchi][faceI]*patchHeatFlux[patchi][faceI])/patchLambda[patchi][faceI]	//[m.K]
			<< "\n";
		}
            }
        }
	output2.close();
where Cpp & Lambda are:
Code:
// ADD:
volScalarField lambdaa
(
    IOobject
    (
        "lambdaa",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    thermo.kappa()
);
volScalarField Cpp
(
    IOobject
    (
        "Cpp",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    thermo.Cp()
);
Don't bother why I added Cpp , it was for another purpose, I just used it here to loop over faces of patches, I could do the same for U or P etc. instead ...

Soooo, where am I making a mistake??? I get local Nusselt of 5 - 6 instead of 7.55!! Any help on the logic of my calculation or a better and cleaner way of calculating Nusselt would be very very deeply appreciated, some one is getting crazy here
Luttappy and somia baali like this.
Mehdi3031 is offline   Reply With Quote

Old   August 7, 2017, 04:11
Default
  #2
Member
 
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10
Mehdi3031 is on a distinguished road
Friends, any hints? I assumed that probably I am failing to calculate the correct Nusselt because of my lack of knowledge on OF structure and tools and the fact that I am trying to do it in a dusty way. Isn't there any post processing tool to just calculate and give you the local Nusselt on wall?
Mehdi3031 is offline   Reply With Quote

Old   August 7, 2017, 04:44
Default
  #3
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
1. Code for Nusselt number
2. calculate Nusselt number
floquation is offline   Reply With Quote

Old   August 7, 2017, 05:44
Default
  #4
Member
 
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10
Mehdi3031 is on a distinguished road
Thank you so much Kevin !
Mehdi3031 is offline   Reply With Quote

Old   August 7, 2017, 07:30
Default
  #5
Member
 
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10
Mehdi3031 is on a distinguished road
Quote:
Originally Posted by floquation View Post
Dear Formers and Kevin, I believe there is something wrong in the calculation of the local Nusselt number in these posts! ant that is regarding the mean temperature T_m

I am looking at Incropera, section 8.2.1 "The mean temperature.
it clearly says that in the calculation of Nusselt

Nu = \frac{h D_h}{K}

We should calculate h from:
q^" = h (T_s - T_m)----------------->q^" is the flux on the wall [\frac{W}{m^2}]

where the mean temperature of the flow in each section, perpendicular to the flow direction at the distance X from inlet should be calculated as where we are calculating the LOCAL NUSSELT number:

T_m = \frac{\int\limits_{A_c}^.   \rho U C_p T \mathrm{d}A_c
}{\dot{m} C_p}
But If I understood right, in the mentioned posts, friends are using inlet flow temperature instead of local mean temperature, is that right? and if so, any reasoning for that?


Cheers
Mehdi3031 is offline   Reply With Quote

Old   August 7, 2017, 07:44
Default
  #6
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
Ultimately, it is just how you define it.

#2 is a Nusselt number calculation in Rayleigh-Benard Convection. The equation implemented there perfectly coheres with literature on Rayleigh-Benard Convection: the mean temperature is simply the average temperature of the hot and cold plate.
#1 I did not read in detail, but it also seems to be about Rayleigh-Benard Convection.

For your case, it is not unthinkable that you might prefer to use a different definition. If so, you should adapt either of those codes to suit your purposes.
Mehdi3031 and saidc. like this.
floquation is offline   Reply With Quote

Old   August 7, 2017, 08:08
Default
  #7
Member
 
Mehdi Aminyavari
Join Date: Feb 2016
Location: Milan
Posts: 35
Rep Power: 10
Mehdi3031 is on a distinguished road
you are right, I think your case was the natural convection and that's why it differs, I am talking about a laminar flow in duct where Tm is not simply the average of hot and cold plates, but it is averaged based on the velocity boundary layer development in each section.
Mehdi3031 is offline   Reply With Quote

Old   June 18, 2020, 08:15
Default
  #8
Member
 
...
Join Date: May 2018
Posts: 37
Rep Power: 8
regard is on a distinguished road
hi
are you solve your problem about Calculating Nusselt Number?
regard is offline   Reply With Quote

Old   June 21, 2020, 10:56
Default wallHeatFlux
  #9
New Member
 
Join Date: May 2019
Posts: 2
Rep Power: 0
Kévin. is on a distinguished road
Hello,



I would like to run wallHeatFlux with simpleFoam under openfoam7. anyone have an idea how to modify this utility?

Thank you.
Kévin. is offline   Reply With Quote

Old   June 21, 2020, 10:58
Default
  #10
New Member
 
Join Date: May 2019
Posts: 2
Rep Power: 0
Kévin. is on a distinguished road
Quote:
Originally Posted by regard View Post
hi
are you solve your problem about Calculating Nusselt Number?

Hello!


I am blocked, I cannot compile this in openfoam7. do you have an idea?

Thank you.
Kévin. is offline   Reply With Quote

Old   June 27, 2020, 16:43
Default
  #11
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Hi,

To the participants of the thread:

I wonder the Nusselt number can be computed with a simple modification of the heatTransferCoeff function object?

I assume that we are able to calculate `h` by using `heatTransferCoeff`function object.

By adding two optional scalars, i.e. `K` and `Dh`, we can scale `h` by `h*Dh/K`, hence the Nusselt number field optionally out of `heatTransferCoeff`?

If so, I will modify the function object, and attach it here. Just wanted to make sure this modification makes sense since I am not very familiar with this branch of physics.

Many thanks.
HPE is offline   Reply With Quote

Old   July 24, 2020, 05:50
Default
  #12
New Member
 
Muyiwa
Join Date: Feb 2020
Posts: 12
Rep Power: 6
Muyiwa is on a distinguished road
Hello HPE

I want to calculate heatTransferCoeff using interCondensatingEvaporatingFoam with this function in the controlDict:

functions
{
htc
{
type heatTransferCoeff;
libs ("libfieldFunctionObjects.so");

field T;
patches ("wall");
htcModel fixedReferenceTemperature;
TRef 360;
}
}

I included the function in the controlDict and I'm having this error:

--> FOAM FATAL ERROR:
Unable to find a valid thermo model to evaluate q

From function Foam::tmp<Foam::FieldField<Foam::Field, double> > Foam::heatTransferCoeffModel::q() const
in file heatTransferCoeff/heatTransferCoeffModels/heatTransferCoeffModel/heatTransferCoeffModel.C at line 95.

FOAM exiting
Muyiwa is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
How to determine Nusselt Number (fluent) djodjo FLUENT 2 May 6, 2015 15:23
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 09:14
calculating nusselt number anijdon OpenFOAM 0 March 14, 2011 15:15


All times are GMT -4. The time now is 14:37.