|
[Sponsors] |
January 5, 2010, 07:46 |
groovyBC - k-profile
|
#1 |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 17 |
Hi Folks,
I am using groovyBC to implement a profile for different variables. I successfully implemented a profile for velocity and for epsilon on different two different inlets. But when I try do do the same for k (using k-epsilon-model) it crashes right away...i tryed to brake it down to find the problem and I am stuck right now... When I do : inlet-gas { type fixedValue; value uniform 0.000138; } it works fine. when I do: inlet-gas { type groovyBC; value uniform 0.000138; } it crashes.. it says: Courant Number mean: 2.78199e-12 max: 8.8507e-11 DILUPBiCG: Solving for Uy, Initial residual = 0.429436, Final residual = 4.56534e-17, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 0.999302, Final residual = 3.52628e-16, No Iterations 1 DILUPBiCG: Solving for T, Initial residual = 7.09251e-10, Final residual = 7.09251e-10, No Iterations 0 GAMG: Solving for p, Initial residual = 0.00208143, Final residual = 2.05939e-05, No Iterations 122 time step continuity errors : sum local = 1.5495e-15, global = -9.94268e-17, cumulative = 2.50625e-17 GAMG: Solving for p, Initial residual = 0.216801, Final residual = 0.0020369, No Iterations 20 time step continuity errors : sum local = 7.73954e-16, global = -2.65297e-17, cumulative = -1.4672e-18 #0 Foam::error:rintStack(Foam::Ostream&) in "/home/itvns/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so" #1 Foam::sigFpe::sigFpeHandler(int) in "/home/itvns/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so" #2 ?? in "/lib64/libc.so.6" #3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/home/itvns/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so" #4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/itvns/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libfiniteVolume.so" #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:perator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/itvns/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libincompressibleRASModels.so" #6 Foam::incompressible::RASModels::kEpsilon::correct () in "/home/itvns/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libincompressibleRASModels.so" #7 main in "/home/itvns/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/buoyantBoussinesqPisoFoam" #8 __libc_start_main in "/lib64/libc.so.6" #9 _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116 Floating exception is this a bug or am I doing something wrong?? thx for your help! regards |
|
January 5, 2010, 10:52 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
What happens is that it implicitly gets expanded to Code:
inlet-gas { type groovyBC; value uniform 0.000138; valueExpression "0"; fractionExpression "1"; } So you should write Code:
inlet-gas { type groovyBC; value uniform 0.000138; valueExpression "0.000138"; } Bernhard |
||
January 5, 2010, 11:22 |
|
#3 |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 17 |
Hi Bernhard,
thx a lot for the answer...this way it works...BUT i am still confused... The wiki says: "valueExpression String with the value to be used if a Dirichlet-condition is needed. Defaults to zero" Which i associated with assigning a "value". Since Dirichlet- gives the value at the boundary(!?). --Whats the diference between "value" and "valueExpression"?? Somehow in the files for U and epsilon it works only defining: "type, variables and valueExpression" -- why is k different?? I ran into that problem since i am trying to have a profile matching experimental data. I fittet spline to the data and used groovyBC to bring it on.. it should look like this: type groovyBC; variables "MEAN2=0.92;r=sqrt(pos().x*pos().x+pos().y*pos().y );fact2=(-5.9481+21.679*r-33.885*r*r+30.097*r*r*r-16.745*r*r*r*r+6.0916*r*r*r*r*r-1.4707*r*r*r*r*r*r+0.23356*r*r*r*r*r*r*r-0.023442*r*r*r*r*r*r*r*r+0.001348*r*r*r*r*r*r*r*r* r-3.3838e-05*r*r*r*r*r*r*r*r*r*r);vel2=MEAN2*(-30.547+94.958*r-126.17*r*r+96.051*r*r*r-46.331*r*r*r*r+14.823*r*r*r*r*r-3.1929*r*r*r*r*r*r+0.45829*r*r*r*r*r*r*r-0.042037*r*r*r*r*r*r*r*r+0.0022294*r*r*r*r*r*r*r*r *r-5.2003e-05*r*r*r*r*r*r*r*r*r*r);"; valueExpression "r>1 ? (3/2)*(fact2*fact2*vel2*vel2) : 0.00002"; (at least this works for epsilon and U)... How can i make it run? I cant use: value "r>1 ? (3/2)*(fact2*fact2*vel2*vel2) : 0.00002";//doesnt like it! valueExpression "r>1 ? (3/2)*(fact2*fact2*vel2*vel2) : 0.00002"; If I do value 0.12345; valueExpression "r>1 ? (3/2)*(fact2*fact2*vel2*vel2) : 0.00002"; it is running fine, but i dont know what is goin on(which boundary is used)... thx again! regards! |
|
January 5, 2010, 15:19 |
|
#4 | ||||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
In other words: I don't blame anybody if he feels like improving that Wiki-page, but I won't do it, because I understand it Quote:
value is always there. valueExpression is defined by groovyBC Quote:
Quote:
b) "value 0.12345;" is only there as a placeholder before valueExpression is computed for the first time (which should be before any equation is solved). Basically it is only there to keep paraFoam happy (because that usually doesn't know about grovvy) Bernhard |
|||||
January 7, 2010, 05:46 |
|
#5 | |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 17 |
Quote:
a) -> I will do so, thx! b) -> thats the information I have been looking for, thank you soo much!!!!! I might add this information to the wiki, if you dont mind... But thats a thing I dont understand..since you have been able to create groovyBC, i suppose you dont need it. So mostly other people will benefit from it. But without a more detailed documentation it is not as usefull as it could be..but it should be measure up the efford you put in it.. best regards |
||
January 7, 2010, 13:33 |
tracing errors...(call me alice)
|
#6 |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 17 |
Hi Folks (and special greetings to Bernhard ),
i have spend a lovely day with OF and groovyBC tracing errors..and now I am kind of stuck...again... I am dealing with an error that tells me that groovyBC doesnt like negative expressions like sqrt(-value), which i can understand, i dont like them either.. #4 Foam::sqrt(Foam::UList<double> const&) in "/home/itvns/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so" I use: type groovyBC; variables "MEAN2=9.2;R=0.0026;r=(sqrt(pos().x*pos().x+pos(). y*pos().y))/R;vel2=MEAN2*(-29.547 + 94.958 * r - 126.17 * pow(r,2) + 96.051 * pow(r,3) - 46.331 * pow(r,4) + 14.823 * pow(r,5) - 3.1929 * pow(r,6) + 0.45829 * pow(r,7) - 0.042037 * pow(r,8) + 0.0022294 * pow(r,9) - 5.2003e-05 * pow(r,10));"; value uniform 0.053; valueExpression " r>2 && r<3 ? sqrt(vel2*vel2*vel2)/(2*R*0.1) : 35663 "; I fittet a spline to experimental Data (which is used for vel2). Since there seesm to be negative expression where it should not be i finally checked the spline i fitted with xmgrace and xmgrace came up with a different curve. (see attachment, I am saving this fun for tomorrow) But if I specify a region "r>2 && r<3 "in which the spline should give certainly positive values I still end up with a negativ value. At the moment I can see only three possebilities for that: 1. xmgrace (or its user) messed up worse than it shows on graphs 2. funkyBC does strange things solving the equation for r 3. "r>2 && r<3 " doesn not work limiting the range where it uses the equation either way i am screwed...any ideas how to unscrew me?? regards |
|
January 7, 2010, 13:48 |
|
#7 |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 17 |
...one more question, just curious about it..
Is it possible that groovyBC doesnt like "z" ??? When I did (for testing things): type groovyBC; variables "z=0.053;"; value uniform 0.053; valueExpression " z"; he says : Parser Error at "1.1" :"syntax error, unexpected 'z'" but when I do: type groovyBC; variables "g=0.053;"; value uniform 0.053; valueExpression " g"; it works...(yes we had a looot of fun today )... |
|
January 11, 2010, 06:01 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
January 11, 2010, 06:12 |
|
#9 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
I'll have a look at it when I find time and should I then remember it (the process of remembering would be aided by a report at https://sourceforge.net/apps/mantisb...e_status_id=90) Bernhard |
|||
January 11, 2010, 06:29 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
a) inefficient b) leads to that kind of unexpected error The only way to work around that would be to rewrite groovy so that it does some kind of lazy-evaluation on a per-face basis and that would be a major rewrite (which would make cases that don't use conditionals inefficient). So it is quite unlikely to happen The other possibility would be to issue a warning and "fix" negative values before feeding them into sqrt (and similar functions). As a quick fix I would suggest in your case ANOTHER variable (sorry) vel2pos which you set to 0 if vel2 is negative. Bernhard |
||
January 11, 2010, 12:00 |
|
#11 | |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 17 |
, i knew it ...
Quote:
I added some things to wiki, plz check if you like it that way... regards |
||
May 26, 2010, 11:41 |
help about groovyBC
|
#12 |
New Member
Joseph
Join Date: Mar 2010
Posts: 14
Rep Power: 15 |
Hi sir/madam
i simulated polymer in extruder(screw mill) by ViscoElastic fluidFoam,Jovani. According to my geometry, velocity vectors in boundary condition are changed .As result i should code variables condition in 0File>> U>> movingWalls.do you know that GroovyBC was compiled to OpenFoam as defualt or i have to compile it?and how to compile groovyBC to OpenFoam v.1.6?if you coded one geometry by groovyBC this is thanksful to sent it me by tamsilian@gmail.com. Could u help me?if you need more information about my geometry please request me. Thanks in advanced your help |
|
May 26, 2010, 11:56 |
|
#13 | |
Senior Member
Join Date: Dec 2009
Posts: 112
Rep Power: 17 |
Quote:
the answer to most of your questions is here: http://openfoamwiki.net/index.php/Contrib_groovyBC if you have any further questions...I will try to help... regards |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] groovyBC - inlet profile at complex terrain | potac | OpenFOAM Community Contributions | 2 | January 3, 2017 20:18 |
[swak4Foam] Problem with fully developed velocity profile groovyBC in 2D axi-sym mesh | harshad88 | OpenFOAM Community Contributions | 7 | July 24, 2014 15:28 |
[swak4Foam] groovyBC error: velocity profile (2D) >> what's wrong? | vitorspadeto | OpenFOAM Community Contributions | 4 | June 19, 2014 16:31 |
[swak4Foam] parabolic velocity profile with fluctuations (groovyBC?) | newOFuser | OpenFOAM Community Contributions | 17 | July 15, 2013 18:27 |
[swak4Foam] Scale discrete inlet velocity profile with groovyBC | cboss | OpenFOAM Community Contributions | 1 | June 20, 2010 14:02 |