groovyBC - k-profile
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::printStack(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::operator/<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 |
Quote:
What happens is that it implicitly gets expanded to Code:
inlet-gas So you should write Code:
inlet-gas Bernhard |
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! |
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 |
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 |
tracing errors...(call me alice)
1 Attachment(s)
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 |
...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 :D )... |
Quote:
|
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 |
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 |
Quote:
Quote:
I added some things to wiki, plz check if you like it that way... regards |
help about groovyBC
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 |
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 |
All times are GMT -4. The time now is 04:42. |