|
[Sponsors] |
[swak4Foam] About groovyBC to set distributed fixedGradient values for each cell boundary patch |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 5, 2014, 21:45 |
About groovyBC to set distributed fixedGradient values for each cell boundary patch
|
#1 |
Member
Kan
Join Date: Feb 2014
Location: Australia
Posts: 54
Rep Power: 12 |
Hi,
I need to set a distributed fixedGradient value for each cell boundary patch, the boundary setting is as follows: top { type groovyBC; fields ( gt ) gradientExpression "gt"; fractionExpression "0" //gradientExpression is used lookuptables ( { name gt; outOfBounds clamp; fileName "$FOAM_CASE/gt.data"; } ); } and my gt.data is ( (0.0950554) (0.035402) (0.0456968) (0.0371096) (0.0382265) (0.0358306) (0.0355109) (0.0347807) (0.0347118) (0.0342635) (0.0336614) .... ) I have 4608 Faces in the top patch, and when I running this code, I got the following warning No value defined for T on top therefore using 4608{0} Looked like the boundary patch haven't read my defined value, can anyone have a look at my setting? Cheers, Kan |
|
August 6, 2014, 01:42 |
|
#2 |
Member
Kan
Join Date: Feb 2014
Location: Australia
Posts: 54
Rep Power: 12 |
A few comments to my post,
The error is the reason that I didn't set "value", which is used at Startup. My scalar is based on radius and angle, so then I change my input data into ( (2.544053e-02 4.090615e-03 1904.18) (2.544053e-02 1.227185e-02 709.182) (2.544053e-02 2.045308e-02 915.406) (2.544053e-02 2.863431e-02 743.38) (2.544053e-02 3.681554e-02 765.746) (2.544053e-02 4.499677e-02 717.741) (2.544053e-02 5.317800e-02 711.326) (2.544053e-02 6.135923e-02 696.685) ................... ) The boundary setting changes as well, top { type groovyBC; value $internalField variables ( "radius=sqrt(pow(pos().x,2)+pow(pos().x,2));" "angle=atan(pos().y/pos().x);" ); fields ( radius angle grad ) gradientExpression "gt(radius angle)"; fractionExpression "0" //gradientExpression is used lookuptables ( { name gt; outOfBounds clamp; fileName "$FOAM_CASE/gt.data"; } ); } Not sure if GroovyBC can do that??? Cheers, Kan |
|
August 6, 2014, 05:56 |
|
#3 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Anyway: lookuptables only work with one independent variable (so something of the form "gt(radius)" would work). Interpolation from more than one independent variable is currently on my "Nice to have" list (which means it gets done when I need it or when or when someone who pays me needs it. Of course that assumes that I have to implement it. Which is not necessarily the case) If you can separate your function into two independent functions similar to gt(radius,angle)=gtr(radius)*gta(angle) then you're in business again
__________________
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 |
||
August 6, 2014, 23:11 |
|
#4 | |
Member
Kan
Join Date: Feb 2014
Location: Australia
Posts: 54
Rep Power: 12 |
Quote:
Thank you for your reply. The reason that I have the fields entry is I followed this thread here: http://www.cfd-online.com/Forums/ope...le-values.html Is that "fields entry" necessary to groovyBC? I though this is used to set the index to each column at input data file, as you can see, I have my calculated radius and angle, I was wondering I can look-up my input data based on column 1 and 2, However, you said that lookup tables only work with one independent variable, but my value depends on two independent variables. Then, I have also tried to set nonuniform List<scalar> to my boundary patch, which is now working. Cheers, Kan |
||
August 7, 2014, 15:31 |
|
#5 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
http://www.cfd-online.com/Forums/ope...tml#post361133 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 |
|||
August 12, 2014, 03:46 |
|
#6 | |
Member
Kan
Join Date: Feb 2014
Location: Australia
Posts: 54
Rep Power: 12 |
Quote:
For this groovy BC, if I need to calculate gradient for boundary patch based heat transfer coefficient and ambient temperature. see below: type groovyBC; value $internalField gradientExpression "gt"; fractionExpression "0" //gradientExpression is used variables ( "ratational_speed = 50000;" // rotational speed "radius=sqrt(pow(pos().x,2)+pow(pos().x,2));" "vel_rotor = ratational_speed * radius;" "hfc = 30;" // heat transfer coefficient "T_ambinet = 290;" // ambient temperature "k = 16;" // thermal conductivity of solid pad "gt = hfc*(T-T_ambinet)/k" ); at the last euqation, hfc is heat transfer coefficient, T_ambient is ambient temperature, k is thermal conductivity, I assumed that T is the boundary temperature, is that right? Cheers, Kan |
||
August 12, 2014, 07:34 |
|
#7 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
BTW: For large hfc/k (almost instantaneous heating) a gradient-Formulation would overshoot. Consider blending (with fractionExpression) to a T=T_ambient in that case BTW2: The variables till vel_rotor are not used. This is on purpose?
__________________
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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] dynamicTopoFVMesh and pointDisplacement | RandomUser | OpenFOAM Meshing & Mesh Conversion | 6 | April 26, 2018 08:30 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |