|
[Sponsors] |
[swak4Foam] parabolic velocity profile with fluctuations (groovyBC?) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 17, 2013, 11:53 |
parabolic velocity profile with fluctuations (groovyBC?)
|
#1 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
I would like to implement a parabolic inlet velocity profile, with fluctuation scale specified (like in turbulentInlet).
I tried using groovyBC as below (since I think turbulentInlet allows flat profile only), but am not sure how to specify the fluctuation scale (if possible?): type groovyBC; variables "yp=pts().y;minY=min(yp);maxY=max(yp);para=-(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();"; valueExpression "15*para"; value uniform (15 0 0); Has any one encountered a similar problem or has suggestions on how to proceed? I tried searching the forum but am not sure if including fluctuation scale in groovyBC has been discussed (though there were some posts on parabolic profile). If not groovyBC, is there another way to implement this? I use OF 1.7.1 Many thanks, amit PS. This implementation is required as we are trying to match the experimental conditions which show a parabolic inlet profile and high fluctuations as well... Last edited by newOFuser; June 17, 2013 at 14:00. |
|
June 18, 2013, 13:05 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
June 19, 2013, 12:54 |
|
#3 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
Thanks so much, I'll look into the swak4Foam implementation.
amit Last edited by newOFuser; June 28, 2013 at 13:38. |
|
June 20, 2013, 15:28 |
|
#4 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
Hello,
I am trying to install swak4Foam in OF 1.7.1 and get this error (tried both, the svn link file, and the tar file): make: *** [Make/linux64GccDPOpt/FieldValueExpressionParser.o] Error 1 Parser library did not compile OK. No sense continuing as everything else depends on it Requirements for Library not satisfied. I see no sense in going on Configuration: No 'swakConfiguration'. Python etc won't work Checking swak4Foam-version and generating file Bison is version 2.4.1 Flex is version 2.5.35 (Minor version: 35) OpenFOAM-version: Major 1 Minor 7 Patch 1 No change to swak4FoamParsers/foamVersion4swak.H Any suggestions? |
|
June 20, 2013, 21:18 |
|
#5 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
As for the error message: you've got to give me a bit more information to work with
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
June 20, 2013, 21:35 |
|
#6 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
Thanks for the prompt reply!
Enclosed is the log file. |
|
June 20, 2013, 22:02 |
|
#7 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
I'm travelling and can't look into details. Seems there is a problem wit pointFields of vectors. Try the following: for all lines like
Code:
../FieldValueExpressionParser.yy:4777 If you want a permanent fix write a report on the Mantis at openfoam-extend
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
June 20, 2013, 22:11 |
|
#8 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
Thanks again! I'll look into this.
Pleasant travels! |
|
June 21, 2013, 11:22 |
|
#9 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
It compiled!
All those lines were this statement: $$ = new Foam:ointSymmTensorField(*$1 - *$3); Now, to see how the inlet velocity specification works out... Thanks again, amit |
|
June 21, 2013, 15:32 |
|
#10 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
Another quick question:
Here is what I am trying, based on http://www.cfd-online.com/Forums/ope...b-mesh-10.html inlet { type groovyBC; variables "yp=pts().y;minY=min(yp);maxY=max(yp);para=-(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();para_rms=1-0.5*para;"; valueExpression "15*para + 0.15*15*randNormal()*para_rms"; value uniform (15 0 0); } Since rms profile shown above is a reverse parabola, I am trying 1 - 0.5*para as the parabolic equation that gives a parabola with x=1 at Ymax and Ymin and x=1/2 at Ymiddle. (Later multiplied by random number and magnitude). But this gives an error: --> FOAM FATAL ERROR: Parser Error for driver PatchValueExpressionDriver at "1.11-10" :"syntax error, unexpected $end" "1-0.5*para" Probably because the 1 in "1 - 0.5*para" should to be defined at each y (?) How should this 'unity value at each point' be implemented in the valueExpression term? Sorry if the question is vague or silly! Thanks. |
|
June 23, 2013, 06:37 |
|
#11 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
#define FOAM_INCOMPLETE_OPERATORS
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
June 23, 2013, 06:40 |
|
#12 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
June 25, 2013, 19:49 |
|
#13 |
New Member
EG
Join Date: Jun 2013
Posts: 3
Rep Power: 13 |
Hi guys
I am a very new user of OpenFoam and I am interested in a similar problem as GK. I would like to implement some random fluctuations to a parabolic profile. I have already implemented a parabolic profile as an extra utility based on another thread. (http://openfoamwiki.net/index.php/Tu....28OF-1.4.1.29) For this I provide at the input file 0/U) type parabolicVelocity; n (1 0 0); y (0 1 0); maxValue 1; value (0 0 0); // Dummy for paraFoam, which will NOT show a correct profile at time 0. I know that Open foam has implemented already an utility called turbulent Inlet so I guess that a first quick fix would be some how try to combine these two. I need one extra line at the inlet that will give the level of fluctuations something like fluctuationScale ( 0.1 0.001 0.001 ); and change my code file so for every value of the parabolic profile I add an extra term such as 0.1*Umax*random_number which I guess is already calculated in the turbulent inlet utility. I was wondering if anyone has already done something like this. My C++ knowledge is not great (I come from a fortran background) so if anyone has any advice would be very useful. Which parts of the turbulent inlet utility I need to add to my parabolic profile utility? Thanks |
|
June 26, 2013, 04:57 |
|
#14 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
June 26, 2013, 17:11 |
|
#15 |
New Member
EG
Join Date: Jun 2013
Posts: 3
Rep Power: 13 |
Hi Bernhard
Thanks for your reply. Sorry if I am in the wrong thread but what I want to do is to use a parabolic profile with fluctuations which is the title of the thread. However you are right I do not want to use groovy because to be honest I see this task a bit as good opportunity to get some programming practice in C++ . Any suggestions are welcome. |
|
July 15, 2013, 15:38 |
|
#16 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
I was able to implement the velocity profile as desired, using swak4Foam.
I have a minor query: The value expression is defined as: valueExpression "15*para + 0.15*15*randNormal()*para_rms"; Is there a way by which I can specify valueExpression as "15*para" for time < 0.1s, and "15*para + 0.15*15*randNormal()*para_rms" for time > 0.1s ? thanks so much! amit |
|
July 15, 2013, 18:15 |
|
#17 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
"15*para + time()<0.1 ? vector(0,0,0) : 0.15*15*randNormal()*para_rms" Code:
variables ( ... other variables "factor=time()<0.1 ? 0 : 0.15*15*randNormal();" ); valueExpression "15*para+para_rms*factor";
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
July 15, 2013, 18:27 |
|
#18 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
thanks^1243
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc | ofslcm | OpenFOAM Community Contributions | 25 | March 6, 2017 11:03 |
codeDict Error Parabolic Power Law Inlet Velocity Profile | Sindibad | OpenFOAM Running, Solving & CFD | 0 | January 1, 2017 20:53 |
codeDict Error Parabolic Power Law Inlet Velocity Profile | Sindibad | OpenFOAM Bugs | 0 | January 1, 2017 20:51 |
3D parabolic velocity profile for channel flow | seetaratnam | FLUENT | 1 | August 10, 2016 04:08 |
Parabolic velocity profile at vertical entrance | ztp911 | FLUENT | 2 | September 3, 2013 07:10 |