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

buoyantBoussinesqPisoFoam: A detailed explanation

Register Blogs Community New Posts Updated Threads Search

Like Tree10Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 22, 2010, 18:23
Default buoyantBoussinesqPisoFoam: A detailed explanation
  #1
Member
 
Matthew J. Churchfield
Join Date: Nov 2009
Location: Boulder, Colorado, USA
Posts: 49
Rep Power: 19
mchurchf is on a distinguished road
All,

I am beginning to use buoyantBoussinesqPisoFoam. Therefore, I thought it wise to really look at the inner-workings of the code both to understand what it is doing and to get used to OOP in C++. I had to do a lot of digging around, so I wrote up detailed notes of how buoyantBoussinesqPisoFoam works and posted it at http://docs.google.com/fileview?id=0...OTdhNDM4&hl=en. Please note, I was not able to fully understand everything, so if you find any mistakes in my notes, please let me know. I hope this may be helpful.

Matt
mchurchf is offline   Reply With Quote

Old   January 23, 2010, 03:54
Default
  #2
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Quote:
Originally Posted by mchurchf View Post
All,

I am beginning to use buoyantBoussinesqPisoFoam. Therefore, I thought it wise to really look at the inner-workings of the code both to understand what it is doing and to get used to OOP in C++. I had to do a lot of digging around, so I wrote up detailed notes of how buoyantBoussinesqPisoFoam works and posted it at http://docs.google.com/fileview?id=0...OTdhNDM4&hl=en. Please note, I was not able to fully understand everything, so if you find any mistakes in my notes, please let me know. I hope this may be helpful.

Matt
Dear mchurchf,
Your explanation of buoyantBoussinesqPisoFoam is indeed detailed. So the RANS and LES equation are nearly the same ,except in RANS using turbulent viscosity nu, LES use sub-grid viscosity nuSgs. Am I right ? This is a little like pisoFoam. But in OpenFOAM-1.6, buoyantBoussinesqPisoFoam can only be used for RANS model, can't be used for LES. Because I am beginner, I try to modify buoyantBoussinesqPisoFoam in the refference of pisoFoam, But I am affraid mistake will happen. Could you send your solver here ? That would be best. Thank you very much.
panda60 is offline   Reply With Quote

Old   January 23, 2010, 04:11
Default
  #3
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
And if I want to add another passive scalar transport euqtion, for example concentration transport equation, it would be like this:

dC/dt +d/dxj*(C*uj)=(nut/Sct+nu0/Sc)*d/dxk(dC/dxk).
panda60 is offline   Reply With Quote

Old   January 23, 2010, 06:08
Default
  #4
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Good job :-)

P.S. Could you add the link to the wiki so the link does not go lost in the forum? http://openfoamwiki.net/index.php/Main_OFSolvers
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   January 23, 2010, 08:05
Default
  #5
Senior Member
 
Holger Marschall
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 126
Rep Power: 19
holger_marschall is on a distinguished road
Send a message via Skype™ to holger_marschall
Very good work... Thanks a lot for documenting.

best,
__________________
Holger Marschall
web: http://www.holger-marschall.info
mail: holgermarschall@yahoo.de
holger_marschall is offline   Reply With Quote

Old   January 23, 2010, 23:59
Default
  #6
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Quote:
Originally Posted by alberto View Post
Good job :-)

P.S. Could you add the link to the wiki so the link does not go lost in the forum? http://openfoamwiki.net/index.php/Main_OFSolvers
Dear alberto,

In Buoyant problem, I want to use nonuniform value Temperature in Wall. In my problem, my wall temperature is know, but not uniform. my temperature is changing with the hight of the wall. But when I modied the hotRoom/setHotRoom, and generated my own utility, It seems that boundary function can't be used for wall, only can be used for inlet condition. How I can do this ?
Thank you very much.
panda60 is offline   Reply With Quote

Old   January 24, 2010, 01:31
Default
  #7
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by panda60 View Post
Dear alberto,

In Buoyant problem, I want to use nonuniform value Temperature in Wall. In my problem, my wall temperature is know, but not uniform. my temperature is changing with the hight of the wall. But when I modied the hotRoom/setHotRoom, and generated my own utility, It seems that boundary function can't be used for wall, only can be used for inlet condition. How I can do this ?
Thank you very much.
Does the wall temperature vary with the wall height according to a known law? If so, you can use GroovyBC

http://openfoamwiki.net/index.php/Contrib_groovyBC

to specify it.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   January 24, 2010, 23:45
Default
  #8
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Quote:
Originally Posted by alberto View Post
Does the wall temperature vary with the wall height according to a known law? If so, you can use GroovyBC

http://openfoamwiki.net/index.php/Contrib_groovyBC

to specify it.

Best,
Yes, alberto. This is utility is very good. It is better than my own modified utility.my own one can add inflow T profile, but can't add wall T profile, I don't khow why, Mybe my mesh was transformed from fluent, a littile not compatible with OpenFOAM. But groovyBC worked well.

Thank you very much.
panda60 is offline   Reply With Quote

Old   January 25, 2010, 14:20
Default buoyantBoussinesqPisoFoam Wiki and LES-capability
  #9
Member
 
Matthew J. Churchfield
Join Date: Nov 2009
Location: Boulder, Colorado, USA
Posts: 49
Rep Power: 19
mchurchf is on a distinguished road
Alberto: I've posted this description of buoyantBoussinesqPisoFoam to http://openfoamwiki.net/index.php/Bu...sinesqPisoFoam.

Panda60: yes, you are correct in that regardless if it is RANS or LES, the equations look the same. In LES you supply nu_SGS and in RANS you supply nu_t. You are also correct that, out-of-the-box, buoyantBoussinesqPisoFoam only works with a RANS model. If you go to the above wiki posting, section 4, I explain how to modifiy it to be LES-capable just like pisoFoam.

Matt
mchurchf is offline   Reply With Quote

Old   January 26, 2010, 21:38
Default
  #10
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Quote:
Originally Posted by mchurchf View Post
Alberto: I've posted this description of buoyantBoussinesqPisoFoam to http://openfoamwiki.net/index.php/Bu...sinesqPisoFoam.

Panda60: yes, you are correct in that regardless if it is RANS or LES, the equations look the same. In LES you supply nu_SGS and in RANS you supply nu_t. You are also correct that, out-of-the-box, buoyantBoussinesqPisoFoam only works with a RANS model. If you go to the above wiki posting, section 4, I explain how to modifiy it to be LES-capable just like pisoFoam.

Matt
Thanks,mchurchf.
Your explanation is very good. And in the guidence of you, I have modified the solve. But I'm a little confused.buoyant solver seems to converge slowly. and for p boundary condition, It seems very important. My case is a wind engineering problem. in outlet condition , it seems that using " fixedValue" for p is not good, and can't converge. when I change to buoyantPressure, then it slowly converge. I don't khow the what's the meaning of buoyantPressure, if it is only can be used in wall boundary, or also can be used for outlet condition ?

Because it seems not so many people researching on buoyant effect, could you give us some suggestion on buoyant solver ? what we must pay attation to.

Thank you very much.
panda60 is offline   Reply With Quote

Old   January 27, 2010, 10:37
Default
  #11
Member
 
Matthew J. Churchfield
Join Date: Nov 2009
Location: Boulder, Colorado, USA
Posts: 49
Rep Power: 19
mchurchf is on a distinguished road
Jiang,

When you say the solver converges slowly, what exactly do you mean? Do you mean that you are using it with an LES model, and it takes a lot of time for it to come to some sort of steady turbulent state? Or are you using it in RANS mode and trying to come to steady state? If you are using it for RANS, it might be better to use buoyantBoussinesqSimpleFoam which is meant for steady state problems.

My understanding of the bouyantPressure boundary condition is that it is used on walls that are not parallel to the hydrostatic pressure gradient. It appears to then apply dp/dz on the wall that corresponds to the hydrostatic pressure gradient.

What sort of problem are you solving? That may let me better help you.

Matt
mchurchf is offline   Reply With Quote

Old   January 27, 2010, 21:14
Default
  #12
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Quote:
Originally Posted by mchurchf View Post
Jiang,

When you say the solver converges slowly, what exactly do you mean? Do you mean that you are using it with an LES model, and it takes a lot of time for it to come to some sort of steady turbulent state? Or are you using it in RANS mode and trying to come to steady state? If you are using it for RANS, it might be better to use buoyantBoussinesqSimpleFoam which is meant for steady state problems.

My understanding of the bouyantPressure boundary condition is that it is used on walls that are not parallel to the hydrostatic pressure gradient. It appears to then apply dp/dz on the wall that corresponds to the hydrostatic pressure gradient.

What sort of problem are you solving? That may let me better help you.

Matt
Dear mchurchf,
I am very thankfulness for your kind hearted. My problem like this:
I have an rectangular simulation domain, an single building was located in the domain. Wind is coming from left to right, the ground temperature is higher than the air. My solver is buoyantBoussinesqSimpleFoam.

if I use {fixed value; value 0} for p in outlet condition, the flow didn't converge at all. in the outlet position, will have reverse flow in upper domain, and have strong velocity in lower domain.

if I use buoyantPressure for outlet condition, the flow seems converge ,but in the corner of domain, will have strong velocity ,the flow field is not right.

I searched the whole forum, somebody sai could use totalPressure or fixed meanPressure, I don't unstand .

So I think maybe the pressure boundary condition I ues is not right.
Could you tell me what pressure boundary condition you use ? especially in outlet ?
Thanks.
Attached Images
File Type: jpg 建筑.jpg (51.8 KB, 133 views)
File Type: jpg u.jpg (33.3 KB, 165 views)
panda60 is offline   Reply With Quote

Old   January 27, 2010, 22:02
Default
  #13
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
This is my pressure boundary condition:
BUILDING
{
type zeroGradient;
}
INLET
{
type zeroGradient;
}
OUTLET
{
type fixedValue;
value uniform 0;
}
SYM_LEFT
{
type symmetryPlane;
}
SYM_RIGHT
{
type symmetryPlane;
}
SYM_TOP
{
type symmetryPlane;
}
GROUND
{
type zeroGradient;
}
GAS_INLET
{
type zeroGradient;
}

This picture is my U_velocity contour.
I have been struggling this problem for several days. I need your help. Thanks.
Attached Images
File Type: jpg uu.jpg (38.1 KB, 102 views)
panda60 is offline   Reply With Quote

Old   January 28, 2010, 11:07
Default
  #14
Member
 
Matthew J. Churchfield
Join Date: Nov 2009
Location: Boulder, Colorado, USA
Posts: 49
Rep Power: 19
mchurchf is on a distinguished road
Jiang,

At time zero, how do you initialize your pressure field? Do you have a constant pressure throughout the domain? If so, that could be a problem.

Pressure should decrease with height. Note that in buoyantBoussinesqSimpleFoam, I think the pressure variable is really pressure divided by a reference density, and we'll call it p~, so p~ = p/rho_ref. (Please check the equations to make sure.) Therefore, if you specify that some reference p~ at the ground, then p~(z) = p~(z=0) - g*z. In my simulations, I write my own code to create an initial p~ field that follows these hydrostatic conditions.

So then you have some choices for the outflow conditions. You need something to keep the flow moving, so you can either specify a constant value of velocity, U, at the top of the domain, which should drive the flow. Or you can specify a pressure gradient by making the outlet pressure lower than the inlet pressure. If you fix the inlet pressure at the hydrostatic conditions defined by p~(z) = p~(z=0)-g*z, then the outlet conditions could be p~(z) = p~(z=0) - g*z - (dp/dx)*L. The (dp/dx)*L is the pressure drop across the length, L, of your domain due to a pressure gradient dp/dx. You'll have to figure out which dp/dx is necessary to drive the flow at the velocity you want.

I think you are getting flow reversal and acceleration at the outflow because the pressure might be constant across the outflow plane. Can you post a contour plot of pressure, just like the plot of velocity that you show?
mchurchf is offline   Reply With Quote

Old   January 29, 2010, 10:10
Default
  #15
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Yes, I just give a const pressure 0 as initial field.
and I use 290K as refference temperature. in Left ,Right and Top of the domain I use symmetry boundary condition.
This is my pressure field.
Attached Images
File Type: jpg p.jpg (40.4 KB, 84 views)
panda60 is offline   Reply With Quote

Old   January 29, 2010, 10:30
Default
  #16
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Because I can't modify the code, so I can't give hydrostatic initial conditions for pressure. I feel that , in buoyancy driven flow, the outlet condition is very important. In the guidance of you, today I try to use fixed value pressure in outlet like this: p=5-9.8*z. This fixed outlet value is small than internal field, an vary with hight, the flow is a little better, but also not correct.
near ground in outlet, the velocity is also high. And the internal pressure seems to change with the outlet pressure value. My temperature field is completely wrong. In my case , ground temperature is 45 degree, the air is 16 degree.

I try to use constant pressure gradient in outlet, but it doesn't work, have continues problem.
Attached Images
File Type: jpg u2.jpg (38.2 KB, 68 views)
File Type: jpg p2.jpg (30.5 KB, 57 views)
File Type: jpg T2.jpg (29.9 KB, 63 views)
panda60 is offline   Reply With Quote

Old   January 29, 2010, 12:35
Default
  #17
Member
 
Matthew J. Churchfield
Join Date: Nov 2009
Location: Boulder, Colorado, USA
Posts: 49
Rep Power: 19
mchurchf is on a distinguished road
Jiang,

I think it would really help you if you started from initial conditions in which the pressure throughout the field was set to hydrostatic. I think all of your outlet problems are coming from the fact that the flow has a hard time adjusting from a constant 0 pressure to hydrostatic.

You'll have to write your own little code to write out the correct internal field. Once you have that initial condition for p, then you can try out different boundary conditions that you have already tried and see if they work.

If I were you, I would also extend my domain upwind and downwind of the building by a factor of probably 3 times what you already have. This will allow the effects of the building to be minimized at the boundaries.

You also said that your temperatures were 16 and 45 degrees. Do you mean degrees C. Note that OpenFOAM defaults to using Kelvin.

Matt
mchurchf is offline   Reply With Quote

Old   January 31, 2010, 05:45
Default
  #18
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Dear mchurchf ,
I have initialize my pressure field using funkySetFields utilities.
Because my tempeture near ground is about 25 degree, so I estimate the pressure near ground is p=rho*R*T=1.22*287*(273+25)=104342 Pa,
dp=104342-101325=3017 Pa,

so I initilize my pressure field using p=3017-rho*g*z;
in outlet I also use fixed value 0 condition for p.
Now my simulation have going on for 6 hours, 2000 steps, result seems not good. If using SimpleFoam, 2000 steps can get good result . I will let my simulation going on to tomorrow morning ,and then see if can get good result.
If I should initialize my tempeture field using approximate value like pressure?
Attached Images
File Type: jpg ux3.jpg (33.6 KB, 47 views)
File Type: jpg ux32.jpg (44.8 KB, 43 views)
File Type: jpg p3.jpg (69.9 KB, 32 views)
panda60 is offline   Reply With Quote

Old   January 31, 2010, 14:01
Default
  #19
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by mchurchf View Post
Alberto: I've posted this description of buoyantBoussinesqPisoFoam to http://openfoamwiki.net/index.php/Bu...sinesqPisoFoam.
Hi and thanks a lot

I have one note about section 3.1. The pseudo-staggered arrangement is not applied because of the central differencing scheme. It effectively represent an improved version of the Rhie-Chow method (you can take a look at Hannu Karema thesis on multiphase flow to have the details, it is available online at VTT, Finland).
This strategy is very effective when you have rapidly changing source terms, for example.

Best,
Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   January 31, 2010, 22:44
Default
  #20
Senior Member
 
Jiang
Join Date: Oct 2009
Location: Japan
Posts: 186
Rep Power: 17
panda60 is on a distinguished road
Dear mchurchf,

I already initialize my T and p field with good value, because I use RANS model, and in both side of the domain I use symmetry boundary condition, but after 5000 steps, the flow field is not symmetry, my flow field always have high asymmetry. Why this would happen ?
Thank you very much.
Attached Images
File Type: jpg u41.jpg (33.5 KB, 56 views)
File Type: jpg u42.jpg (46.1 KB, 35 views)
panda60 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
Pressure Gradient in channelOodles sega OpenFOAM Running, Solving & CFD 14 August 12, 2009 07:21
Physical explanation of pressure coefficent Ben Main CFD Forum 1 January 21, 2008 10:42
Problem implementing DETAILED REACTION MECHANISM Phil FLUENT 0 May 5, 2007 12:38
Explanation of status report of equation solution nico OpenFOAM Running, Solving & CFD 0 April 15, 2006 06:36
Kiva Subroutine Explanation liqiang Main CFD Forum 1 November 20, 2004 12:27


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