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

Code for Nusselt number

Register Blogs Community New Posts Updated Threads Search

Like Tree22Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2015, 02:33
Default
  #21
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

You are trying to install software system-wide while being simple user. You should either use 'sudo wmake' (though in this case I am not quite sure about environment variables being set right), or change $(FOAM_APPBIN) to $(FOAM_USER_APPBIN) in Make/files file to install software in user's folder.
student666 likes this.
alexeym is offline   Reply With Quote

Old   April 17, 2015, 12:42
Default
  #22
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
Thank you very much for helping; I change Make/file by changing into FOAM_USER_APPBIN.

Regards.
student666 is offline   Reply With Quote

Old   March 7, 2016, 12:39
Default
  #23
Member
 
Join Date: Oct 2015
Posts: 63
Rep Power: 11
Scram_1 is on a distinguished road
Hi,
I'm new to openFOAM and thought of checking if OF gives the right value of the Nu for laminar flow through a pipe.
I used the buoyantBoussinesqSimpleFoam solver by turning off turbulence and g (so that the buoyancy effects are turned off). The velocity and temperature fields seem correct. Now, I want to check the Nu. I tried creating the function NusseltCalc() as detailed in one of your previous posts. However during compilation, I'm getting an error. I tried compiling the wallHeatFlux function as well just to check if it compiles properly (obviously by creating a copy of it first). Even that is giving the same error. In fact even when I tried adding temperature field to icoFoam and tried compiling, its giving me the same error.

Here's the error message I'm getting

csriram91@SRIRAM-PC /opt/OpenFOAM/OpenFOAM-2.3.x/applications/utilities/postProcessing/wall/wallHeatFlux - Copy (2)
$ wclean

csriram91@SRIRAM-PC /opt/OpenFOAM/OpenFOAM-2.3.x/applications/utilities/postProcessing/wall/wallHeatFlux - Copy (2)
$ wmake
Making dependency files...
In file included from /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/faceZoneMesh.H:33:0,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/polyMesh.H:56,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvMesh.H:50,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvCFD.H:7,
from wallHeatFlux.C:34:
/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/faceZone.H:46:32: fatal error: primitiveFacePatch.H: No such file or directory
#include "primitiveFacePatch.H"
^
compilation terminated.
SOURCE=wallHeatFlux.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/turbulenceModels -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/turbulenceModels/compressible/turbulenceModel/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/thermophysicalModels/specie/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/thermophysicalModels/reactionThermo/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/thermophysicalModels/basic/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/thermophysicalModels/solidThermo/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/wallHeatFlux.o
In file included from /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/faceZoneMesh.H:33:0,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/polyMesh.H:56,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvMesh.H:50,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvCFD.H:7,
from wallHeatFlux.C:34:
/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/faceZone.H:46:32: fatal error: primitiveFacePatch.H: No such file or directory
#include "primitiveFacePatch.H"
^
compilation terminated.
wallHeatFlux.dep:3: recipe for target 'Make/cygwin64mingw-w64DPOpt/wallHeatFlux.o' failed
make: *** [Make/cygwin64mingw-w64DPOpt/wallHeatFlux.o] Error 1


I'm running openFOAM 2.3x on cygwin if that's any help.

Thanks!!
Ram
Scram_1 is offline   Reply With Quote

Old   May 17, 2016, 16:44
Default
  #24
New Member
 
Djamila
Join Date: May 2016
Location: Algeria
Posts: 16
Rep Power: 10
djamila77 is on a distinguished road
hi; all

thank you for the answer,

I'll try your suggestions and I'll share the results with you.

Cordially
djamila77 is offline   Reply With Quote

Old   May 22, 2016, 07:21
Default
  #25
New Member
 
Djamila
Join Date: May 2016
Location: Algeria
Posts: 16
Rep Power: 10
djamila77 is on a distinguished road
Quote:
Originally Posted by giovanni10 View Post
What does (T_hot-T_ini) stand for ?
-- wall_localNusselt.boundaryField()[patchi] = length*patchHeatFlux[patchi]/((T_hot-T_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!
Dear Sir
I don't know exactly what your kind of problem research but the Code Fluent is useful in kind of convection in a box headed by the below wall and cladded by the top
you can use it for calculate the Nusselt number and other thing
djamila77 is offline   Reply With Quote

Old   June 14, 2016, 10:54
Default Same problem
  #26
acs
New Member
 
Join Date: Apr 2016
Posts: 4
Rep Power: 10
acs is on a distinguished road
Quote:
Originally Posted by Scram_1 View Post
Hi,
I'm new to openFOAM and thought of checking if OF gives the right value of the Nu for laminar flow through a pipe.
I used the buoyantBoussinesqSimpleFoam solver by turning off turbulence and g (so that the buoyancy effects are turned off). The velocity and temperature fields seem correct. Now, I want to check the Nu. I tried creating the function NusseltCalc() as detailed in one of your previous posts. However during compilation, I'm getting an error. I tried compiling the wallHeatFlux function as well just to check if it compiles properly (obviously by creating a copy of it first). Even that is giving the same error. In fact even when I tried adding temperature field to icoFoam and tried compiling, its giving me the same error.

Here's the error message I'm getting

csriram91@SRIRAM-PC /opt/OpenFOAM/OpenFOAM-2.3.x/applications/utilities/postProcessing/wall/wallHeatFlux - Copy (2)
$ wclean

csriram91@SRIRAM-PC /opt/OpenFOAM/OpenFOAM-2.3.x/applications/utilities/postProcessing/wall/wallHeatFlux - Copy (2)
$ wmake
Making dependency files...
In file included from /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/faceZoneMesh.H:33:0,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/polyMesh.H:56,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvMesh.H:50,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvCFD.H:7,
from wallHeatFlux.C:34:
/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/faceZone.H:46:32: fatal error: primitiveFacePatch.H: No such file or directory
#include "primitiveFacePatch.H"
^
compilation terminated.
SOURCE=wallHeatFlux.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/turbulenceModels -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/turbulenceModels/compressible/turbulenceModel/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/thermophysicalModels/specie/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/thermophysicalModels/reactionThermo/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/thermophysicalModels/basic/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/thermophysicalModels/solidThermo/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/wallHeatFlux.o
In file included from /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/faceZoneMesh.H:33:0,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/polyMesh.H:56,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvMesh.H:50,
from /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/fvCFD.H:7,
from wallHeatFlux.C:34:
/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude/faceZone.H:46:32: fatal error: primitiveFacePatch.H: No such file or directory
#include "primitiveFacePatch.H"
^
compilation terminated.
wallHeatFlux.dep:3: recipe for target 'Make/cygwin64mingw-w64DPOpt/wallHeatFlux.o' failed
make: *** [Make/cygwin64mingw-w64DPOpt/wallHeatFlux.o] Error 1


I'm running openFOAM 2.3x on cygwin if that's any help.

Thanks!!
Ram
Hi, Ram, I've got the same problem. Have you solved it? What did you do?

Thanx!
acs is offline   Reply With Quote

Old   December 3, 2016, 09:22
Default
  #27
New Member
 
Djamila
Join Date: May 2016
Location: Algeria
Posts: 16
Rep Power: 10
djamila77 is on a distinguished road
Hi there
I'd like asking about the Lenght in Report - Reference Values.
is it the Depth that means Hydraulic diameter for 3D or note
djamila77 is offline   Reply With Quote

Old   December 12, 2016, 09:30
Default How to add this Nusselt Program to the CFD
  #28
New Member
 
Djamila
Join Date: May 2016
Location: Algeria
Posts: 16
Rep Power: 10
djamila77 is on a distinguished road
Hi there
I'd like add this program to calculate Nusselt number, but I don't know how to do that
please help me
djamila77 is offline   Reply With Quote

Old   December 16, 2016, 11:21
Default
  #29
New Member
 
Djamila
Join Date: May 2016
Location: Algeria
Posts: 16
Rep Power: 10
djamila77 is on a distinguished road
Quote:
Originally Posted by Goutam View Post
The code was correct. NusseltCalc is working now.
Hi
how can I include the program
please with Details
djamila77 is offline   Reply With Quote

Old   February 7, 2017, 12:30
Default changes for OF 4.1
  #30
New Member
 
Join Date: Dec 2010
Posts: 4
Rep Power: 15
pille is on a distinguished road
If someone wants to implement the code of Johan Magnusson (shown in post #3) in OpenFOAM 4.1, one only need to change

Code:
 
forAll(wall_localNusselt.boundaryField(),patchi
{    
     wall_localNusselt.boundaryField()[patchi] = length*
               patchHeatFlux[patchi]/((T_hot-T_ini)*k);     
}
to

Code:
 
forAll(wall_localNusselt.boundaryFieldRef(),patchi
{    
     wall_localNusselt.boundaryFieldRef()[patchi] = length*
               patchHeatFlux[patchi]/((T_hot-T_ini)*k);     
}
and everything works fine.
A detailed description of the implementation is given in his report
("conjugateHeatFoam with explanational tutorial together with a buoyancy driven flow tutorial and a convective conductive tutorial")
student666, djamila77 and Pavithra like this.
pille is offline   Reply With Quote

Old   August 20, 2018, 17:20
Default
  #31
MFN
New Member
 
nbdy
Join Date: May 2018
Posts: 6
Rep Power: 8
MFN is on a distinguished road
Quote:
Originally Posted by pille View Post
If someone wants to implement the code of Johan Magnusson (shown in post #3) in OpenFOAM 4.1, one only need to change

Code:
 
forAll(wall_localNusselt.boundaryField(),patchi
{    
     wall_localNusselt.boundaryField()[patchi] = length*
               patchHeatFlux[patchi]/((T_hot-T_ini)*k);     
}
to

Code:
 
forAll(wall_localNusselt.boundaryFieldRef(),patchi
{    
     wall_localNusselt.boundaryFieldRef()[patchi] = length*
               patchHeatFlux[patchi]/((T_hot-T_ini)*k);     
}
and everything works fine.
A detailed description of the implementation is given in his report
("conjugateHeatFoam with explanational tutorial together with a buoyancy driven flow tutorial and a convective conductive tutorial")
does it work in openfoam 4.x ?
I will test and re check that
MFN is offline   Reply With Quote

Old   May 4, 2019, 21:34
Default wrong in heat flux code
  #32
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
Hi
I modify icoFluid solver of fsiFoam and add this code to it as:
Quote:
wallHeatFlux_
(
IOobject
(
"wallHeatFlux",
runTime().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("wallHeatFlux",dimMass/pow3(dimTime), 0.0)
),

forAll(wallHeatFlux_.boundaryField(),patchi)
{
if (mesh.boundary()[patchi].isWall())
{
wallHeatFlux_.boundaryField()[patchi] = (DT_*rho_*Cp_)*fvc::snGrad(T_);
}
}
to calculate heat flux during the simulation. The problem is that the output file "wallheatFlux" in each timeStep is different size
for example: "size 10441 is not equal to the given value of 117"
the code make same size for each boundary surfaces (for inlet, top,bottom etc with different size, the wallHeatFlux is same size 10441). Do you know what is the mistake?
Hgholami is offline   Reply With Quote

Old   May 4, 2019, 22:04
Default
  #33
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Quote:
Originally Posted by Hgholami View Post
Hi
I modify icoFluid solver of fsiFoam and add this code to it as:

to calculate heat flux during the simulation. The problem is that the output file "wallheatFlux" in each timeStep is different size
for example: "size 10441 is not equal to the given value of 117"
the code make same size for each boundary surfaces (for inlet, top,bottom etc with different size, the wallHeatFlux is same size 10441). Do you know what is the mistake?
Assuming (DT_*rho_*Cp_) results in a dimensionedScalar, what you need is surface normal gradient of temperature at boundaries:

Code:
wallHeatFlux_.boundaryField()[patchi] = (DT_*rho_*Cp_)*T_.boundaryField()[patchi].snGrad();
Hgholami likes this.
Daniel_Khazaei is offline   Reply With Quote

Old   September 4, 2019, 13:09
Default
  #34
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7
Hgholami is on a distinguished road
Quote:
Originally Posted by Goutam View Post
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_hot-T_ini)*k);
}

wall_localNusselt.write();
}

I want to write a code for Average Nusselt Number.
Dear Goutam
Do you have any code for calculation Nusselt number with bulk temperature?

I can't use swak4Foam, in order, I should calculate bulk temperature and add it to Nusselt calculation
Hgholami is offline   Reply With Quote

Old   March 20, 2022, 15:22
Question Local Nusselt with Matlab
  #35
New Member
 
Ammar
Join Date: Jan 2022
Posts: 12
Rep Power: 4
chberbelali is on a distinguished road
hello everyone,

is there anyone who can help me?!

How can i calculate the local Nusselt number for a vertical wall in cavity using a Matlab implimentation?
chberbelali is offline   Reply With Quote

Old   March 20, 2022, 16:00
Default
  #36
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
The Nußelt number is connected to the thickness of the boundary layer d. If you may measure this thickness, you may calculate the Nußelt number stepwise (but not pointwise). You have to select al length along L the surface for which you plan getting Nu. The you have

Nu = L / d
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   March 20, 2022, 16:39
Default More information about my problem
  #37
New Member
 
Ammar
Join Date: Jan 2022
Posts: 12
Rep Power: 4
chberbelali is on a distinguished road
Quote:
Originally Posted by piu58 View Post
The Nußelt number is connected to the thickness of the boundary layer d. If you may measure this thickness, you may calculate the Nußelt number stepwise (but not pointwise). You have to select al length along L the surface for which you plan getting Nu. The you have

Nu = L / d
Details here:

Nusselt number

Matlab: Local nusselt number computing

My problem figure:


Best regards
chberbelali 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
[mesh manipulation] Mesh Refinement Luiz Eduardo Bittencourt Sampaio (Sampaio) OpenFOAM Meshing & Mesh Conversion 42 January 8, 2017 13:55
Problem with decomposePar tool vinz OpenFOAM Pre-Processing 18 January 26, 2011 03:17
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 09:10
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 15:34


All times are GMT -4. The time now is 06:58.