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

non reflective boundary conditions for incompresible flow

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

Like Tree5Likes
  • 1 Post By steph79
  • 2 Post By Pascal_doran
  • 2 Post By Pascal_doran

Reply
 
LinkBack Thread Tools Display Modes
Old   June 17, 2010, 18:20
Default non reflective boundary conditions for incompresible flow
  #1
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
Hi all,

I'm simulating incompressible wake vortices in ground effect and I need non reflective boundary conditions to minimize the deformation of my wake vortices when they come close to the boundary. (right now I'm using zero normal gradient for U and P)

1 - Does OF 1.6.x has any existing boundary conditions that could do this?
I looked in : /OpenFoam-1.6.x/src/finiteVolume/fields/fvPatchFields but found nothing.

2 - If I need to implement new boundary conditions which one should I use as starting point? i.e. which boundary conditions is the most similar to non reflective boundary conditions (I did not try all of them, but some of them)

3 - What the boundary conditions should do is something like this :
dU/dt + Un*dU/dn = 0

where U is the velocity vector
t is the time
Un is the velocity normal to the boundary
n is the normal vector to the boundary

Any ideas?

Thank you,

Pascal
Pascal_doran is offline   Reply With Quote

Old   June 21, 2010, 21:06
Default
  #2
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
Hi all,

Here's what I tried to implement user's define boundary conditions in OF 1.6.x. I started by creating the following folder:

mkdir -p $WM_PROJECT_USER_DIR/src/finiteVolume/fields/fvPatchFields/derived

Then I tried to compile my boundary condition as a new dynamic library. My first try was using the existing BC `zeroGradient` found in :

$FOAM_SRC/finiteVolume/fields/fvPatchFields/

(I copied it in my $WM_PROJECT_USER_DIR/src/finiteVolume/fields/fvPatchFields/derived) Then I created the 'make' folder containing:

the 'files' file:
Code:
zeroGradientFvPatchField.C
LIB = $(FOAM_USER_LIBBIN)/libmyBCs
and the 'option' file:
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
I got the error message:
Code:
ag74290@mec036470:~/OpenFOAM/ag74290-1.6.x/src/finiteVolume/fields/fvPatchFields/derived/zeroGradient$ wmake libso
make: *** No rule to make target `options', needed by `linux64GccDPOpt/options'.  Stop.
/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/wmake/MakefileFiles:40: linux64GccDPOpt/options: No such file or directory
make: *** No rule to make target `linux64GccDPOpt/options'.  Stop.
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created
Advices will be greatly appreciate. Thank you,

Pascal
Pascal_doran is offline   Reply With Quote

Old   August 11, 2010, 07:56
Default
  #3
Member
 
Adam James
Join Date: Jul 2010
Posts: 36
Rep Power: 7
steph79 is on a distinguished road
Hi, I'm currently looking for a solution to a similar problem. I want a non-reflecting boundary condition for an incompressible flow field without any temperature specification.

Have you made any progress with your search?

Thanks.
steph79 is offline   Reply With Quote

Old   August 11, 2010, 11:13
Default
  #4
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
Hi steph79,

Look at advective BC in :
/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/fields/fvPatchFields/derived/advective

It solves D(psi)/Dt = 0 where psi could be U, p, etc. (and probably T)

regards,

Pascal
Pascal_doran is offline   Reply With Quote

Old   August 11, 2010, 12:40
Default
  #5
Member
 
Adam James
Join Date: Jul 2010
Posts: 36
Rep Power: 7
steph79 is on a distinguished road
Thanks for your reply!

I seen one of your follow-up posts where you explicitly wrote out the code you specified your boundary conditions through, notably the following;

Code:
     outlet
    {
        type            advective;
        phi             phi;
    }
Did you make any further modifications to this? I should point out we're using different OpenFOAM versions as I'm on v1.7.
mm.abdollahzadeh likes this.
steph79 is offline   Reply With Quote

Old   August 11, 2010, 13:10
Default
  #6
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
Hi,
I didn't have good result using advective BC, so I change the definition of parameter f which is called valueFraction in the source code (and needed by mixed BC). With f=0.75 I have very good result! (I'm using backward time scheme with Co=1.0)

So I use a modified version of advection (which I called : myAdvection) for U and p and I used f=0.75.

Code:
outlet
    {
        type            myAdvective;
        phi             phi;
    }
Hope this help,

Pascal
Pascal_doran is offline   Reply With Quote

Old   August 12, 2010, 07:02
Default
  #7
Member
 
Adam James
Join Date: Jul 2010
Posts: 36
Rep Power: 7
steph79 is on a distinguished road
Ok, I can see the valueFraction parameter several times in the advectiveFvPatchField.C source code but I lack the experience in coding and compiling to replicate your success. I might ask for some more help but can I ask first what physical argument is this 0.75 value (or any value fraction) based on or is it just of case that it gives what you want, if you know what I mean?

I too would be using backward time-stepping to minimise numerical dissipation. Fluctuations in the flow field are what I'm ultimately interested in, hence the need for a pressure outlet which doesn't simultaneously act like a wall!
steph79 is offline   Reply With Quote

Old   August 12, 2010, 08:34
Default
  #8
Member
 
Adam James
Join Date: Jul 2010
Posts: 36
Rep Power: 7
steph79 is on a distinguished road
Quote:
Originally Posted by Pascal_doran View Post
Hi,
I didn't have good result using advective BC, so I change the definition of parameter f which is called valueFraction in the source code (and needed by mixed BC). With f=0.75 I have very good result! (I'm using backward time scheme with Co=1.0)

So I use a modified version of advection (which I called : myAdvection) for U and p and I used f=0.75.

Code:
outlet
    {
        type            myAdvective;
        phi             phi;
    }
Hope this help,

Pascal
Can't you just do the following? ...

Code:
    outlet
    {
        type            advective;
	valueFraction	0.75;
        phi             phi;
    }
... in line with the fixedValue and fixedGradient specs?

Last edited by steph79; August 12, 2010 at 08:57. Reason: Missed out the fixedValue and fixedGradient line.
steph79 is offline   Reply With Quote

Old   August 12, 2010, 11:49
Default
  #9
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
Hi Stephanie,
Quote:
I can see the valueFraction parameter several times in the advectiveFvPatchField.C source code but I lack the experience in coding and compiling to replicate your success. I might ask for some more help but can I ask first what physical argument is this 0.75 value (or any value fraction) based on or is it just of case that it gives what you want, if you know what I mean?
This post will explain it :
DirectionMixed mixed bc

The valueFraction is define differently depending on the time scheme you use and if you use linf = 0 or linf > 0

Quote:
Can't you just do the following? ...
You could try but I would be surprise if it works. BTW, it is very useful to learn how to modify/create your own BC. To do so, copy the source code there:
/home/ag74290/OpenFOAM/ag74290-1.6.x/src/finiteVolume/fields/fvPatchFields/derived/myAdvective

modify the source code everywhere : advective become myAdvective

In your Make/files :
Code:
myAdvectiveFvPatchFields.C
 LIB = $(FOAM_USER_LIBBIN)/libmyAdvective
In your Make/option :
Code:
EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
    -lfiniteVolume
Compile it with:
Code:
wmake libso
if everything went good you should find : libmyAdvective.so in:
/home/ag74290/OpenFOAM/ag74290-1.6.x/lib/linux64GccDPOpt

Now to use your new BC add this line at the end in your controlDic:
libs ("libOpenFOAM.so" "libmyAdvective.so");

Regards,
Pascal
Pirlu and EhsanMh like this.
Pascal_doran is offline   Reply With Quote

Old   August 12, 2010, 12:16
Default
  #10
Member
 
Adam James
Join Date: Jul 2010
Posts: 36
Rep Power: 7
steph79 is on a distinguished road
That's a great help again and a detailed answer, thanks!

I *think* (subject to change) that the advection boundary condition specified in u and p does the trick because I can't see the reflections anymore and the remaining 'wiggles' can be attributed to the use of higher order spatial and temporal schemes. Is it correct to say that the advection BC is the equivalent of a pressure outlet with a target mass/volume flow rate?

Just wondering, have you been using probes to capture fluctuating velocities in your flow field? I can resolve the u,v and w components of the velocity vector at points using probes but that's more information than required, I would rather just have the magnitude alone. The output files are messy enough to handle! I guess that's another question, what's the best tool to post-process output files from probes? I'm not familiar with gnuplot but I've heard it mentioned in that context before.

Thanks.
steph79 is offline   Reply With Quote

Old   August 12, 2010, 15:45
Default
  #11
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
Quote:
Is it correct to say that the advection BC is the equivalent of a pressure outlet with a target mass/volume flow rate?
I don't know if it's equivalent. Maybe somebody else could help you on that. But, let me know if you find an answer

Quote:
Just wondering, have you been using probes to capture fluctuating velocities in your flow field?
No, I created my own utilities for post-processing the result then I write it into file. I have great flexibility doing it that way, especially for writing only the data I need into a file. Then using Matlab become very easy. Take a look at :
/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/applications/utilities/postProcessing
You could find a good starting point for creating your own utility.

Regards,

Pascal
owayz and Pirlu like this.
Pascal_doran is offline   Reply With Quote

Old   April 1, 2013, 20:56
Default
  #12
New Member
 
Jialin Su
Join Date: Mar 2013
Location: Loughborough
Posts: 29
Rep Power: 4
callumso is on a distinguished road
Hi Pascal,

When you used the (my)advective boundary condition, did you use it for both p and U?

I am struggling to establish a compressible flow from a plenum through an orifice into a long duct. All my simulations blew up after keeping fluctuating for a long time.

I set up the conventional total p and total T at the plenum and fixed p at the outlet of the duct. I am not comfortable with the zero gradient outlet boundary for U.

Do you think I should use the advective boundary just for U or for both U and p and set the 'value' to the pressure I want for p? Could you give me some advice on this? Thank you in advance.
callumso is offline   Reply With Quote

Old   August 4, 2014, 07:22
Default Hello every body
  #13
New Member
 
rabea matouk
Join Date: Aug 2014
Posts: 7
Rep Power: 2
rabea matouk is on a distinguished road
I'm interested in the same subject '' implement non reflecting boundary condition for an incompressible finite element code''
so could you please help me how to start ? if you have references to the subject it would be appreciated.
rabea matouk is offline   Reply With Quote

Old   August 4, 2014, 17:06
Default
  #14
Member
 
Pascal
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 8
Pascal_doran is on a distinguished road
Hi!

You could first take a look here :

/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/fields/fvPatchFields/derived/advective

The advective BC is probably what you are looking for! If not it would be a good starting point.

Regard,
Pascal
Pascal_doran is offline   Reply With Quote

Old   August 6, 2014, 05:57
Default
  #15
New Member
 
rabea matouk
Join Date: Aug 2014
Posts: 7
Rep Power: 2
rabea matouk is on a distinguished road
Hi Pascal_doran,

Thanks for your answer.

I'll try to understand and then implement the advective BC.

Thank you
rabea matouk is offline   Reply With Quote

Old   August 7, 2014, 05:55
Default convective BC
  #16
New Member
 
rabea matouk
Join Date: Aug 2014
Posts: 7
Rep Power: 2
rabea matouk is on a distinguished road
Hi Pascal_doran,

I'm new in implementing BCs so could you please give me some advice to start?

my code is in-house finite elements/spectral code written in Fortran.

I've already implemented a new format and a new SGS model but not yet treating Boundary Conditions.


If you have a reference for the convective BC that will be great.

Regards,
Rabea
rabea matouk 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
Proper Pressure Boundary Conditions for Buoyant Flow mchurchf OpenFOAM 0 March 25, 2010 13:16
Heat Transfer boundary conditions for engine coolant flow simulation rajuks Main CFD Forum 0 February 15, 2010 10:04
Free surface flow settubg boundary conditions and plotting velocity profiles prashanthreddyh FLUENT 1 December 2, 2009 12:06
reflective boundary conditions on generalized coor buaalzr Main CFD Forum 3 January 2, 2008 13:43
boundary conditions for boundary layer flow A. Al-zoubi CFX 0 November 3, 2007 08:11


All times are GMT -4. The time now is 20:28.