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

Convective outlet boundary condition for Unsteady flows

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree10Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   July 5, 2006, 17:20
Default Has anyone implemented a bound
  #1
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
Has anyone implemented a boundary condition of the following type in OpenFOAM?



Where (from Ferziger and Peric [page 273]):

phi = any dependent variable (e.g. velocity, pressure etc.)

U = A velocity that is independent of location on the outflow surface and is chosen so that overall conservation is maintained (i.e. it is the velocity required to make the outflow mass flux equal to the incoming mass flux).

If nobody has done this, I would like to do it. However I would appreciate some guidelines. I am farily OK with C; C++ is fairly new to me. Any help in this regard is most appreciated. Thanks
msrinath80 is offline   Reply With Quote

Old   July 6, 2006, 02:34
Default Hello I also need that kind o
  #2
New Member
 
Aurelia Cure
Join Date: Mar 2009
Location: Lund, Sweden
Posts: 18
Rep Power: 8
aurelia is on a distinguished road
Hello
I also need that kind of boundary condition, so if you manage to write it, it would be nice to share ;)
When I thought about writing it, I was told that the pressureTransmissive boundary condition ( even if it is for compressible flow), could help to begin with...
Good luck
Aurelia
aurelia is offline   Reply With Quote

Old   July 6, 2006, 08:57
Default Thanks for the tip Aurelia. I'
  #3
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
Thanks for the tip Aurelia. I'll give it a shot. The only reason I chose OpenFOAM despite my 3-year experience with Fluent is that it offers much more freedom to learn and share
Alhasan and shikamaru like this.
msrinath80 is offline   Reply With Quote

Old   July 7, 2006, 07:35
Default First derive the discretised i
  #4
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
First derive the discretised implementation of the BC using fluxes, face values, etc. If you can come up with something half-decent, I will be glad to help you implement it )on the condition that you do the testing!).
eugene is offline   Reply With Quote

Old   July 7, 2006, 07:49
Default Hi Eugene, You're going to
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
Hi Eugene,

You're going to have fun trying to get the time derivative to be consistent with the temporal disretisation scheme (requires the change of the virtual function interface + you need to implement it in all the schemes). Apart from that, there's no derivation involved - it already tells you what to do. :-)

Have fun,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   July 7, 2006, 09:29
Default Aaarg! I didn't think that far
  #6
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
Aaarg! I didn't think that far ahead.

Time centred was all I had in my head. I have been pining for this BC for quite some time though, so it might just be worth the effort (even if it takes up the rest of my discretionary time this year).

(PS. I know it tells me what to do I just wanted some commitment from the OP!)
eugene is offline   Reply With Quote

Old   July 7, 2006, 09:38
Default If you want it, I can do it in
  #7
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
If you want it, I can do it in a few minutes, but you will need an updated version of the library - at least until the next release. Alternatively, you can get into my bad books and hack it with the first-order ddt term :-)

For all those interested Foam-ers out there, the b.c. will be a fixed gradient type and I get the gradient by rewriting the expression in the following form:

d phi/d n = -ddt \phi |Sf| / F

with the stabilisation for zero flux. And that's it :-)

Hrv
ubald likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   July 7, 2006, 09:53
Default In that case I retract my prev
  #8
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
In that case I retract my previous offer!

Which classes require an updated interface for this to work?

The description of U in the original post also leaves me slightly confused.
eugene is offline   Reply With Quote

Old   July 7, 2006, 12:46
Default Hrv: Indeed if you can do this
  #9
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
Hrv: Indeed if you can do this in a few minutes, it would be great. I am more than willing to test it as soon as possible

Eugene: The description of U is verbatim from the textbook. I have not bothered to get into the details yet

PS: I wonder why Fluent does not have this B/C built-in (given the fact that Ferziger and Peric recommend this B/C, as it appears to work well for most unsteady cases).
msrinath80 is offline   Reply With Quote

Old   July 13, 2006, 13:23
Default @Eugene: I just pulled out
  #10
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
@Eugene:

I just pulled out an excerpt from a very recent paper in Journal of Computational Physics (Vol: 206, page 661), and I can see now what you mean by 'slightly confused'.

"...The Convective Boundary Condition (CBC) has been used by Najjar and Vanka [4] and Najjar and Balachandran [5] in computing uniform flow past a normal flat plate. Cheng and Armfield [6] have employed it in computing uniform, two-dimensional flow past a circular cylinder. It has also been employed by Pauley et al. [7], Arnal et al. [8], Sohankar et al. [9] and Biswas and co-workers [10] for the computations of uniform, two-dimensional flow past a square cylinder. However, it is felt that the CBC lacks in a proper physical basis for elliptic and parabolic problems and it is also somewhat awkward to implement. The quantity U in the Equation is loosely defined in the literature as different authors have defined it in a different manner [4-*7]. The value of U, which yields minimum distortion in the vorticity structure at the exit, has to be determined by trial..."
immortality likes this.
msrinath80 is offline   Reply With Quote

Old   September 29, 2006, 03:23
Default hello I need to use a convect
  #11
New Member
 
Aurelia Cure
Join Date: Mar 2009
Location: Lund, Sweden
Posts: 18
Rep Power: 8
aurelia is on a distinguished road
hello
I need to use a convective boundary and don't manage to make it work like discribed in the thread.
According to Hrvoje, it should be easy...
could you share it if you wrote such a boundary condition?
Thanks
aurelia
aurelia is offline   Reply With Quote

Old   October 4, 2006, 11:39
Default No, I have not written it yet.
  #12
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
No, I have not written it yet. Hrv, if you've written it, can you post it on the forum? Thanks!
msrinath80 is offline   Reply With Quote

Old   January 19, 2007, 22:35
Default Hi again, I did a little math
  #13
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi again, I did a little math and now I've got satisfactory results by applying a predictor-corrector method in patch-normal direction (not in usual temporal direction). The problem seems to be solved.

Regards,
Takuya
7islands is offline   Reply With Quote

Old   January 19, 2007, 22:37
Default Takuya, It would be nice if
  #14
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
Takuya,

It would be nice if you could post your code so others can test it as well.

Thanks!
msrinath80 is offline   Reply With Quote

Old   January 20, 2007, 01:00
Default Hi pUl|, Of course I could do
  #15
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi pUl|,
Of course I could do so but the code is currently a total gabage for CFD people because it can only handle scalar variables (= the velocity potential). To handle vectors I have to rewrite the whole code using C++ templates. My estimate is that it won't take so much effort but at least I need some test cases including unsteady outlet flows (I myself don't have any such cases in handy ) - contribution welcome.

And the most important is, please don't expect too much - I'm not sure if it works for CFD at all.

Regards,
Takuya
7islands is offline   Reply With Quote

Old   January 29, 2007, 05:58
Default Hi all, Here's a generalized
  #16
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi all,
Here's a generalized convectiveOutlet b. c. code which can handle vectors.

convectiveOutlet-20070130.tar.gz

For a quick start write the initial field file (0/U etc.) as the following example. If you want to tweak the behavior of the code see the included README.

boundaryField
{
outlet
{
type convectiveOutlet;
// convectiveVelocity: the boundary-normal component of convective velocity
convectiveVelocity uniform 343.704;
snGradScheme upwind;
ddtScheme Euler;
}
}


Please don't blame me if the code doesn't work at all - as I stated above I don't have an appropreate test case in handy. Propose me a fix (or preferably a patch) instead. Thanks.

Takuya
7islands is offline   Reply With Quote

Old   February 7, 2007, 02:00
Default Hi again and again, I added a
  #17
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi again and again,
I added a new option to snGradScheme called "normal" after doing a little elementary-school algebra which seems to be the most straightforward and reasonable discretization to me (why hasn't the idea come to me first...?). This time the default for snGradScheme is this scheme and the other options are meant for backward compatibility and for cases where the default doesn't work.

For a quick start write the initial field file (0/U etc.) as the following example.

boundaryField
{
outlet
{
type convectiveOutlet;
// convectiveVelocity: the boundary-normal component of convective velocity
convectiveVelocity uniform 343.704;
ddtScheme Euler;
}
}

convectiveOutlet-20070207.tar.gz

Takuya
7islands is offline   Reply With Quote

Old   February 8, 2007, 10:44
Default Hi Takuya, I will be testin
  #18
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
Hi Takuya,

I will be testing you new version soon. Will it work with Crank Nicholson?
msrinath80 is offline   Reply With Quote

Old   February 9, 2007, 06:41
Default Hi pUl|, OK this time I tried
  #19
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 11
7islands is on a distinguished road
Hi pUl|,
OK this time I tried implementation of a ddtScheme which is supposed to be an equivalent discretization to Crank Nicholson.

boundaryField
{
outlet
{
type convectiveOutlet;
// convectiveVelocity: the boundary-normal component of convective velocity
convectiveVelocity uniform 343.704;
ddtScheme CrankNicholson;
}
}

To be honest, however, it's quite difficult to assure it to work in CFD (although it is giving the best results in linear acoustics - thanks to your suggestion) because in my CFD test I experienced some odd oscillations. Anyway I'd be grateful if you have patience to test the code.

convectiveOutlet-20070209.tar.gz

Takuya
7islands is offline   Reply With Quote

Old   February 13, 2007, 03:49
Default I'm also trying to write a new
  #20
Member
 
Luca Gasparini
Join Date: Mar 2009
Location: Italy
Posts: 37
Rep Power: 8
luca_g is on a distinguished road
I'm also trying to write a new characteristic-based boundary condition for my compressible solver centralFoam.
I've taken as an example the pressureTrasmissive and compiled the new bc in a new library and added the new library to the "options" file of the solver. However I can't make the solver finding it at run time: instead the "default" bc is called. In the solver there's no reference to any of the bc functions so I think the library doesn't get linked actually. What am I missing ?

Furthermore, in order to let FoamX know about the new bc type is it necessary to edit e.g. the "patchField/cfd.cfg" file in .OpenFOAM/apps/FoamX/types or is there a way to specify it in the FoamX folder of the application (as done for the application configuration files) ?
That is, can the defined bc types be application-dependent or they must be defined at a global level ?

Regards,

Luca
immortality likes this.
luca_g is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convective boundary condition andrea_barbera OpenFOAM Running, Solving & CFD 4 March 4, 2010 05:36
convective boundary condition Mani CFX 7 February 2, 2008 17:25
Convective Boundary Condition garni FLUENT 0 September 25, 2005 13:00
Convective boundary condition STN Main CFD Forum 5 May 29, 2002 08:47
convective boundary condition frederic felten Main CFD Forum 1 April 25, 2001 01:20


All times are GMT -4. The time now is 17:43.