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

Pass value to BC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 23, 2011, 11:36
Default Pass value to BC
  #1
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
Dear all,

this is my first thread, although I have been reading this forum for over a year now, finding always very useful info.

I am currently developing some specific BCs to generate waves for interFoam. In order to do so I have modified interFoam to read the variables I needed and to perform some calculations which have to be done only once.

The problem is how to pass those values (a couple of dimensionedScalar, a word and maybe a scalar) to the BC.

Currently I was looking at a piece of code which does not seem to work for such data types:
Code:
const surfaceScalarField& phi =
        db().lookupObject<surfaceScalarField>(phiName_);
Can anyone give me a hint?

Thanks

Pablo H
Phicau is offline   Reply With Quote

Old   May 24, 2011, 04:35
Default
  #2
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi Pablo,

I'm not a very wavy person, but the first thing that comes to mind is groovyBC's groovyWaveTank ... Hope it's of any help
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   May 24, 2011, 04:53
Default
  #3
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
Thanks a lot gwierink,

of course when I started making waves I used groovyBC and it is indeed very handy, but when you get to a point when solving some equations iteratively is very convenient (i.e. cnoidal waves) and the profiles increase their complexity (Stokes V) then the only way is to code it yourself.

Of course I could make external calculations and add those values to the dictionary, or even hard-code them (as I am doing now) but my goal is to develop a very robust automatic BC to generate waves. I could also read the values from the dictionary and perform all the iterative calculations each time the BC needs correction, but that will be highly inefficient.

So I modified interFoam to calculate iteratively the elliptical parameter on startup, and my only need is to pass it along with wave height and so on (in order to read them only once) and the word which states the wave theory to use.

In other words, my BC has to access a couple of variables created by interFoam in order to be efficient.
Is there any way to define the variables as global or to pass them directly to my BC?

Pablo H
Phicau is offline   Reply With Quote

Reply

Tags
dimensionedscalar, pass


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
additional pass radiatn STAR-CCM+ 3 September 26, 2011 23:58
How to model fluid flow pass over fin nuengao ANSYS Meshing & Geometry 3 November 3, 2010 23:29
How to pass impact angle values in Erosion UDF sravan451 FLUENT 1 September 17, 2010 00:59
How to pass a variable from a define macro... Padian FLUENT 2 May 30, 2008 06:22
How to pass parallel computing by background ? qzhu FLUENT 1 December 14, 2000 22:33


All times are GMT -4. The time now is 06:31.