GroovyBC
Hi
I'm trying to use groovybc to specify an inflow condition, however i'm kinda stuck with it. my c++ knowledge is very limited. the velocity profile i'm trying to implement is U=min(y,kln(y)+B) , 0 , 0 where k and B are constants, y is the y coordinate of the point. Velocity is only streamwise, the other 2 components at the inlet are 0. I can create yp=y and kln=k*log(yp)+B, however I don't how to choose the minimum of these two. I'm using OF 1.7 thanks for any help |
Quote:
The minimum of two fields a and b can be taken with the ?:-notation: (a < b ? a : b) |
thanks
:D
thanks gschaider, that worked like a charm. kudos on the groovyBC app, great tool. |
Groovy BC
Hi, its me again. Upgraded to OF 2.0 and installed swak4foam, however the notations has changed a bit. This is the entry for the boundary "Entrada"
Code:
Entrada Code:
--> FOAM FATAL ERROR: David |
Quote:
In my opinion this should not be the cause of your problem, but could you try it anyway? BTW: Using the external-variables syntax might lead to strange results if used on the "same" patch as external variables always get only one value (which is used for all faces). |
That was it, y1{Entrada}=pos().y was supposed to be a vector and it wasn't
thanks |
Elegance Help
Hail all,
My c++ skill is quite low. Much like the original post I wish to compare to vector fields and get the minimum. Basically I want: U=(min(1,pos()z),0,0) I was wondering how I would go about generating a field of uniform values 1. At the moment my work around is to use field2=(pos().z/pos().z). And seeing as this produces the result I want I'm not exactly complaining as much as I wish to know the 'correct' way to do it in the future. And so i use: variables "d=pos().z/pos().z;e=pos().z;profile=(e < d ? e : d)*vector(1,0,0);"; valueExpression "profile"; Its probably something really obvious or implied that I'm not aware of, Striving for elegance, and Cheers |
Quote:
vector(min(pos().z,1),0,0) should work |
All times are GMT -4. The time now is 17:16. |