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

Implementing a boundary condition with a probe

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 9, 2010, 13:14
Default Implementing a boundary condition (wall function) that depends on velocity profile
  #1
New Member
 
Daniel
Join Date: Jun 2010
Posts: 7
Rep Power: 7
DVSoares is on a distinguished road
Hi Foamers,

I use OF for quite a while, and have also implemented some simple functions and boundary conditions, specially wall functions.

Recently I have a new wall model which depends on the maximum streamwise velocity of the local profile, but I really don't know how to implement... I need a sort of probe to calculate the maximum velocity magnitude for a given station of measurement, like so:

1- At given point of a wall, the wall function specifies the wall shear (parallel to the wall).
2- This specific model depends on the maximum velocity magnitude of the profile for that given point (needs a function, on that point, of velocity magnitude x normal wall distance).

I know this is probably trivial, but I don't have the experience in programming beyond simple modifications to the source files (I am not used to the programming model of OF, yet - I have a code made by me, but the philosophy is quite different...).

Can anyone give me some light?

Thanks

Last edited by DVSoares; August 10, 2010 at 16:48. Reason: Set the title to better reflect the matter
DVSoares is offline   Reply With Quote

Old   August 10, 2010, 10:14
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
(I was waiting for others to respond because I don't do much with wall functions.)

I'm not sure what you need to implement. Do you need to find the velocity at an arbitrary point in the internal field? If so, you could use the interpolation classes in finiteVolume... these are the ones used by sample (the application). See:

http://openfoamwiki.net/index.php/In..._%28by_cell%29

These algorithms only work within a given cell volume, so you first have to find which index is the cell volume. I think sample should show you how to do this.
marupio is offline   Reply With Quote

Old   August 10, 2010, 14:38
Default
  #3
New Member
 
Daniel
Join Date: Jun 2010
Posts: 7
Rep Power: 7
DVSoares is on a distinguished road
Hi David,

Thank you for your reply. I'll check the link you sent and see if it fits.

What I want to implement is a wall function that depends on the maximum streamwise velocity magnitude.

One of the parameters scale with local U_max, being this U_max evaluated as the max(U) for the velocity profile normal to the wall at the point where the wall function is evaluated.

The problem is that (due to my inexperience with OF) I can't figure how to do this - which variables would point me to the profile. The loop used by wall functions is for all indexes at the wall.

I needed a way to say "at this point, evaluate the velocity profile in the direction normal to the wall and give me the maximum streamwise velocity magnitude" but I don't even know what variables/pointers in OF tell me which point I am.

Sorry for being that much noob, but this is not so obvious in the documentation... When I get this done I'll certainly post a step-by-step guide...

Another question: is it necessary to recompile the entire incompressible/RAS libs? When I tried to compile only the wall function (after setting Make/files and Make/options based on those found in RAS/Make) wmake gave me a lot of errors, but when compiling the entire RAS I had no problems.

Thank you once again.

Cheers,
DVSoares is offline   Reply With Quote

Old   August 10, 2010, 18:28
Default
  #4
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
Quote:
Originally Posted by DVSoares View Post
What I want to implement is a wall function that depends on the maximum streamwise velocity magnitude.
I haven't worked with fields much myself... Bernhard Gschaider (username gschaider) would be an excellent person to ask this. He wrote funkySetFields and groovyBC, both which handle field interpolation, exactly the sort of thing you are looking for.

You probably don't even have to interpolate, just take the maximum cell.

Quote:
Originally Posted by DVSoares View Post
The problem is that (due to my inexperience with OF) I can't figure how to do this - which variables would point me to the profile. The loop used by wall functions is for all indexes at the wall.
You can get access to the velocity field through the objectRegistry using the lookupObject function. I believe wall functions access their parent objectRegistry through a member variable reference named db_. The syntax would be db().lookupObject(fieldName) - what ever field name you want.

But this would be the whole field. You need to find the cells that are lined up perpendicular to the wall at that point. You could do a forAll(fieldName, i) and check their location... probably a fieldName[i].x() or something like that. Then you can use whatever specifications you choose. But as I said, I don't deal with fields much.

Quote:
Originally Posted by DVSoares View Post
Sorry for being that much noob, but this is not so obvious in the documentation... When I get this done I'll certainly post a step-by-step guide...
You could help us out with the programmer's guide...

http://openfoamwiki.net/index.php/Ca...OpenFOAM_guide

Quote:
Originally Posted by DVSoares View Post
Another question: is it necessary to recompile the entire incompressible/RAS libs? When I tried to compile only the wall function (after setting Make/files and Make/options based on those found in RAS/Make) wmake gave me a lot of errors, but when compiling the entire RAS I had no problems.
Are you changing the core source (i.e. adding / modifying stuff in the OpenFOAM directories)? If so, you need to find out which library you are modifying (go up directories until you find Make) and recompile that whole library. If you are creating your own stand-alone libraries, you don't need to recompile any OpenFOAM stuff.

Good luck!

-Dave
marupio is offline   Reply With Quote

Old   August 11, 2010, 11:53
Default
  #5
New Member
 
Daniel
Join Date: Jun 2010
Posts: 7
Rep Power: 7
DVSoares is on a distinguished road
Hi Dave, thank you once again!

I'll study and post my results - I believe that db lookup will do, now just trying to figure how to loop through. I've read something about defining a normal direction somewhere. Guess I have some hard work to do now.

I'll be glad to contribute to the guides and whatever I can with OF.

Thanks again.

Cheers,

Daniel
DVSoares is offline   Reply With Quote

Old   January 13, 2012, 13:43
Default
  #6
Senior Member
 
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 7
deji is on a distinguished road
Hey Daniel, hope all is well. Did you ever resolve that problem? I am implementing an LES wall function and will need to use probe to acquire the value at a certain wall normal height, but over my 3D mesh. I was thinking of using probe & surfaces to acheive this, how did you resolve your issue?
deji 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
Wind turbine simulation Saturn CFX 34 October 16, 2014 05:27
inlet velocity boundary condition murali CFX 5 August 3, 2012 08:56
External Radiation Boundary Condition (Two sided wall), Grid Interface CFD XUE FLUENT 0 July 8, 2010 06:49
boundary condition for flat plate Ardalan Main CFD Forum 0 June 18, 2010 17:49
how to set up a wall boundary condition according to calculated wall shear stress? gameoverli OpenFOAM Pre-Processing 1 May 21, 2009 08:28


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