Groovy BC for lookup Table values
Hello,
i am solving the following problem: - I have a boundary condition for a scalar field 'E' which is dependent to a scalar field 'C'. A lookup table describes this behaviour of C,E (I just attach the first lines of the table). // ( C E) ( ( 0.00000000000000e+000 -0.00000000000000e+000 ) ( 1.00249993687028e-002 -5.11523952089498e+004 ) ( 1.99994949622485e-002 -8.68932017480435e+004 ) ( 2.99234867806367e-002 -1.19566441219959e+005 ) ( 3.97969748238680e-002 -1.50625905429174e+005 ) ( 4.96199590919422e-002 -1.80659748473604e+005 ) ( 5.93924395848590e-002 -2.09976653091197e+005 ) ( 6.91144163026187e-002 -2.38760349142520e+005 ) ( 7.87858892452210e-002 -2.67129314269836e+005 ) --------------------- I guess I need to set this boundary condition using the Groovy BC tool. As far as I know it is possible with this tool to have the boundary condition as a math function for example, but I am wondering how is it possible, during the runtime of the simulation, to make sure that the value of E will be dependent on the value of C. Do you know if there is any tutorial or someone who already solved a problem similar to this? best regards, Alex |
Quote:
To cut a long story short: the feature is already in swak4faom/groovyBC. Have a look at the wobbler-exampleCase that comes with swak4Foam (or the presentation) |
thanks for the hint! I will have a look soon. best regards!
|
Hello Bernhard,
i tried to read the swak4foam slides and I tried to build the script for the boundary condition for the patch 'walls'. The fields which are in the 'table.dat' are first column C and second En. Writing the BC in this way it runs without error but the results are not the expected ones (see below) Do you think I should add some detailsin the script to make sure that during the solving for each value of C it will refer to the appropriate value of En? thanks a lot, Alex --------------- walls { // type fixedValue; // value uniform -1757593; type groovyBC ; fields ( C En ); lookuptables ( { name profile; outOfBounds clamp; fileName "$FOAM_CASE/table.dat"; } ); } |
Just to make it clear. The BC I am putting regards the patch walls for the field 'En' (C is the lookupvalue and it has other BC).
|
Quote:
valueExpression "profile(C)"; should be there, too |
Now it seems to work! thanks a lot for the help.
|
Quote:
|
I guess it's this, even if now I am thinking whether the boundary condition should be properly set. My physical problem is to set up the boundary for the enthalpy on the wall of my burner as a function of the progress variable (which is the measure of the combustion progress for my premixed combustion [gas turbine] ). The behaviour of the enthalpy is decreasing (from a set off value 0 till -1.7e+6) as a function of the PV (which has value included between 0 and 1). Due to the decrease of the enthalpy there will be a heat loss, and, as a consequence of this, the stabilized flame is not attached to the inlet but lifted up. I want to reproduce this problem and that's why I am setting the BC for the enthalpy En as a function of the progress variable C. Unfortunately there are still some problems in the results, that's why I am doubting whether I have done the proper script for the groovyBC.
Anyway the script is the following and it doesn't crash (see below). Thanks for the support. alex ------------------------------------------- walls { // type fixedValue; // value uniform -1757593; type groovyBC ; fields ( C En ); lookuptables ( { name profile; outOfBounds clamp; fileName "$FOAM_CASE/table.dat"; } ); valueExpression "profile(C)"; } |
Hi,
I have a similar problem. I am trying to impose turbulent kinetic energy values from a dat file on my inlet boundary. But I get an error: Code:
--> FOAM FATAL ERROR: { type groovyBC; value uniform 0.0138; variables "yc=pos().y;"; fields ( yc k ); lookuptables ( { name profile; outOfBounds clamp; filename "$FOAM_CASE/k_profile.dat"; } ); valueExpression "profile(yc)"; } k_profile.dat: ( // first column: vertical position, second column k (1 0.1) (10 0.2) (100 0.4) ) ps: I have OpenFOAM v2.0.1 and the latest swak4FOAM |
Quote:
Quote:
As I said: the expression looks OK to me. Some hints for finding the problem: - make sure the lookuptables are really read. For instance remove the "name"-entry. Execution should fail - try a different name for the lookuptable than "profile" (although this should only be a problem if you have a field called "profile") |
When I comment out "name profile;", I still get the same error. Nothing changes. So you think, it never reads inside lookuptables?
I have seen "fields" entry in this post and decided to try, as well. But I tested it now and it does not have any effects either. |
Quote:
Quote:
|
hi Bernhard,
hope you are well! i want to us groovyBC to patch a Fluent inlet profile onto a OF case, and came upon this thread. I guess from above its possible to use a lookup table. Just a couple things: 1) would you mind posting your slides again - i would be very keen to check them out by the link seems to be dead??? 2) have you ever used groovy to patch a (linear / 1D) radial profile (ie such as for a turbine inlet) which can then be rotated across a blade pitch to form a 2D inlet condition??? many thanks and best regards! sincerely Jonathan |
Quote:
Quote:
|
Hi Bernhard,
Quote:
http://www.openfoamworkshop.org/6th_...der_slides.pdf Quote:
Code:
Radius Prof_value thanks for the response, best regards jon |
Quote:
Quote:
"centerOfRotation=vector(1,0,0);" "radius=mag(pos()-centerOfRotation);" and if you specified a lookup-table named profileVsRadius then a valueExpression "profileVsRadius(radius)" should give you the value you want |
n-dim lookup table
Hi,
is there a possibility to use a n-dimensional lookup table? For expample a 3-dim like ( (xx0 yy0 zz0) (xx1 yy0 zz0) (xx2 yy0 zz0) ... (xx0 yy1 zz0) (xx1 yy1 zz0) (xx2 yy1 zz0) ... ) Thanks and regards |
Quote:
|
Hi foamers,
first of all i want to thank everybody who keeps runing this forum; i want to implement a Robin Boundary condition via the groovy Boundary condition, but Tinf should be read out of a .dat file (lookuptable) (Openfoam2.2.0) wall { type groovyBC; variables "k=0.8;alpha=15;Tinf=65;f=1/(1+k(alpha*mag(delta())));"; valueExpression "Tinf"; gradientExpression "0"; fractionExpression "f"; value uniform 0; } I am asking myself how to tell "Tinf" to read the inlet.dat file :) How to combine the type groovyBC with the lookuptables for Tinf? lookuptables ( { name inlet; outOfBounds clamp; fileName "$FOAM_CASE/inlet.dat"; } Thank you |
All times are GMT -4. The time now is 15:50. |