|
[Sponsors] |
[swak4Foam] Groovy BC for lookup Table values |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 27, 2012, 13:08 |
Groovy BC for lookup Table values
|
#1 |
Member
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 16 |
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 |
|
April 27, 2012, 13:50 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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) |
||
April 27, 2012, 23:02 |
|
#3 |
Member
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 16 |
thanks for the hint! I will have a look soon. best regards!
|
|
May 1, 2012, 10:37 |
|
#4 |
Member
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 16 |
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"; } ); } |
|
May 1, 2012, 10:38 |
|
#5 |
Member
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 16 |
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).
|
|
May 1, 2012, 18:44 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
valueExpression "profile(C)"; should be there, too |
||
May 3, 2012, 06:12 |
|
#7 |
Member
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 16 |
Now it seems to work! thanks a lot for the help.
|
|
May 3, 2012, 07:59 |
|
#8 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
||
May 3, 2012, 08:49 |
|
#9 |
Member
Alex
Join Date: Apr 2010
Posts: 48
Rep Power: 16 |
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)"; } |
|
May 14, 2012, 09:49 |
|
#10 |
Member
Join Date: Jun 2011
Posts: 42
Rep Power: 15 |
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: Parser Error at "1.1-7" :"field profile not existing or of wrong type" "profile(yc)" " ^^^^^^^ " From function parsingValue in file PatchValueExpressionDriver.C at line 192. FOAM exiting { 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 |
|
May 14, 2012, 18:47 |
|
#11 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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") |
|||
May 15, 2012, 04:53 |
|
#12 |
Member
Join Date: Jun 2011
Posts: 42
Rep Power: 15 |
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. |
|
May 15, 2012, 06:34 |
|
#13 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
That is only needed in utilities that have to be forced to load fields into memory |
||
September 30, 2012, 20:36 |
|
#14 |
Senior Member
Join Date: Mar 2010
Posts: 181
Rep Power: 17 |
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 |
|
September 30, 2012, 21:06 |
|
#15 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
No. But if I understand you correctly it shouldn't be too hard: calculate the radius of a point (distance from the center) and with that go into a lookup table
__________________
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 Last edited by gschaider; September 30, 2012 at 21:08. Reason: Typo |
||
October 1, 2012, 09:15 |
|
#16 | |
Senior Member
Join Date: Mar 2010
Posts: 181
Rep Power: 17 |
Hi Bernhard,
thanks for your response - i am meaning the link posted earlier ... http://www.openfoamworkshop.org/6th_...der_slides.pdf Quote:
Code:
Radius Prof_value xxx yyy xxx yyy etc thanks for the response, best regards jon |
||
October 1, 2012, 10:08 |
|
#17 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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
__________________
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 9, 2013, 06:13 |
n-dim lookup table
|
#18 |
New Member
Join Date: Dec 2012
Posts: 13
Rep Power: 13 |
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 |
|
July 9, 2013, 06:52 |
|
#19 | |
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 |
||
July 21, 2013, 13:32 |
|
#20 |
New Member
sebastian n
Join Date: Nov 2012
Posts: 17
Rep Power: 14 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Values for nu t and nu tilda | Phizz82 | OpenFOAM Running, Solving & CFD | 1 | March 2, 2020 07:00 |
What is the table values for amplitude in uniformFixedvalue bc? | sinhavivekananda318 | OpenFOAM Running, Solving & CFD | 0 | May 5, 2017 03:11 |
Field Function for interpolating a table to regulate a mass-flow | Eike | STAR-CCM+ | 0 | August 7, 2012 04:59 |
strange node values @ solid/fluid interface - help | JB | FLUENT | 2 | November 1, 2008 13:04 |
Generating table values in a loop | Jarrod Sinclair | Siemens | 1 | November 26, 2003 20:26 |