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

Flow through Pipe - OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 17, 2016, 04:46
Default Flow through Pipe - OpenFOAM
  #1
Member
 
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 11
NightWing is on a distinguished road
Hello All,

I am trying to find out some non-dimensional parameters such as Reynolds no, Grashof no and Rayleigh number for my test case.

I am trying to model a flow through a glass tube through which water is flowing. I have used Boussinesq approximation for the analysis (natural convection taking place inside the tube). I have given a fixedGradient condition on the tube walls in my 0/T directory.

TubeWalls
(
type fixedGradient;
graidentValue uniform 700;
);

I approach the problem in this way as described below:
I apply a heat flux on the tube walls (gradient i mentioned above; Q/A = -k dt/dx, using this relation). due to the flux given, the water inside takes in the heat from walls and gets heated up and will begin to move upwards to the top side of the tube like the natural convection phenomenon.

Now i know after running the case., i can print out these non-dimensional numbers by making necessary changes in my solver.

1) for Grashof no , Gr = g*beta*(T-Tref)*pow(D,3)/pow(nu,2) <-- basic formulae , D is diameter of tube and rest are thermal properties of water

what i did is

volScalarField Gr
(
IOobject
(
"Gr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("Gr", dimensionSet(0, 0, 0, 0, 0), scalar(0))
);

Then i added the formulae to calculate Gr as

Gr = g*beta*(T-Tref)*pow(D,3)/pow(nu,2)

Note: here i had a problem, since i have g here as a vectorfield and Gr is defined as volumeScalaField. to overcome this i just assigned the value of g (9.81) in there.

Is there any alternative way to put 'g' in the equation??

Suppose if i want to find Re like the Gr way i followed.
Re should require U value. In this case U is vectorField and my Re is volScalar. Hence it will conflict. Is there any suggestions?


Note: Is the procedure i followed to compute my Gr is ok or is it the right way?

Now I want to calculate Reynolds number. I have some old thread in which people suggested that, it is possible to get Reynolds number from Paraview. May i know, how it is done. I tried reading the user guide but i couldnt get a hand on it.

By using Paraview, Calculator option, i tired to calculate Re and I used cell point and entered the formulae like

(U*D)/(nu); ( i used D and nu as the constant value which i inputed directl)

It gave a Re value which is like 1400, where Re based on my velocity is 1000.

To calculate Re, Should i integrate something before using the formulae directly?
NightWing is offline   Reply With Quote

Old   June 17, 2016, 05:01
Default
  #2
Member
 
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 11
NightWing is on a distinguished road
Based on it, when i compute the Gr value, I get combination of positive and negative values and its highly random values.

What may be the reason?
NightWing is offline   Reply With Quote

Old   June 18, 2016, 03:08
Default
  #3
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
Hi friend
Quote:
Is there any alternative way to put 'g' in the equation??
in the grashof number, g represents the value of gravity acceleration, so you can use mag(g) in your code, for Reynold number use the same method for U
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   June 18, 2016, 11:51
Default
  #4
Member
 
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 11
NightWing is on a distinguished road
Thank you Nima

The procedure what i followed, is it correct?

And I suppose to us magU <-- I should first use foamCalc to find magU? is it that way?
NightWing is offline   Reply With Quote

Old   June 20, 2016, 01:37
Default
  #5
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
it depends

if you want to calculate Re as a post processing procedure. then you should
1-foamCalc mag U
2-open paraview
3- use filter calculator

but also you can add some extra pieces of code in your solver then it write Re in time folders for you. for code you should use mag(U)
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   June 20, 2016, 04:50
Default Thank you Nima for you reply :)
  #6
Member
 
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 11
NightWing is on a distinguished road
Yes, Indeed. Right now I am trying to compute the Grashof no and Re based on a piece of code written in the solver.

I have defined a separate header file as parameterCalc.H. In that I have defined Gr and Re as

Gr = (mag(g)*beta*(T-Tref)*pow(L,3)/pow(nu,2);

Re = (mag(U)*Din)/nu; where Din is the diameter of the inlet.


Moreover, I have defined Re and Gr as a volScalarField (is this the correct way? like is it right to define these Non-dimensional parameters as a volScalarField?)

Info << \n Reading field Gr\n" << endl;
volScalarField Gr
(
IOobject
(
"Gr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("Gr", dimensionSet(0, 0, 0, 0, 0), scalar(0.0))
);

Similarly for Re in the createFields.H

But when i see my run-time files, i see wide variation of values in the results written at the write intervals like:

Gr <--- File obtained due to writing out values

dimensions [0 0 0 0 0 0]

internalField nonuniform List<scalar>
61274
(
18667.6
10940.3
2135.76
-0.518128
0.240865
...
....
......
......
-0.000886643
...
.....

like these values
What could be the possible reason for negative values ?
NightWing is offline   Reply With Quote

Old   June 23, 2016, 11:40
Default
  #7
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
use this expression grashof difinition
Quote:
max(T-Tref,1E-30*Tref);
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam 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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 12:58
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 16:54
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 10:04
setup problems - LES pipe flow with cyclic BC (1) and direct mapped inlet (2) florian_krause OpenFOAM 22 June 13, 2013 22:25
Turbulence in a pipe flow JM Main CFD Forum 4 December 21, 2006 05:04


All times are GMT -4. The time now is 23:29.