|
[Sponsors] |
May 23, 2011, 11:36 |
Pass value to BC
|
#1 |
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19 |
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_); Thanks Pablo H |
|
May 24, 2011, 04:35 |
|
#2 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
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 |
|
May 24, 2011, 04:53 |
|
#3 |
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19 |
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 |
|
Tags |
dimensionedscalar, pass |
|
|
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 |