CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] nonuniform "valueExpression" in groovyBC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2014, 01:22
Default nonuniform "valueExpression" in groovyBC
  #1
Member
 
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12
Thamali is on a distinguished road
Dear foamers,
I want to put a groovyBC.I am trying to put a temperature boundary condition as initial temperature(time=0) is a nonuniform list of value and then it to change as "zeroGradient".
For that matter i have put it as follows;
Code:
type        groovyBC;
          valueExpression        "nonuniform List<scalar>
    100
    (
    565.739
    672.48
    723.233
    745.909
    760.789
    772.353
    782.215
    791.12
    799.475
    807.515
    815.367
    823.091
    830.699
    838.167
    845.449
    852.482
    859.198
    865.532
    871.431
    876.864
    881.819
    886.311
    890.374
    894.061
    897.434
    900.562
    903.516
    906.366
    909.178
    912.017
    914.941
    918.004
    921.256
    924.744
    928.51
    932.594
    937.035
    941.874
    947.155
    952.928
    959.255
    966.221
    973.935
    982.552
    992.288
    1003.43
    1016.38
    1031.63
    1049.74
    1071.33
    1096.91
    1126.78
    1160.77
    1198.15
    1237.6
    1277.39
    1315.64
    1350.62
    1381.02
    1406.15
    1426.01
    1441.18
    1452.58
    1461.25
    1468.06
    1473.72
    1478.75
    1483.48
    1488.15
    1492.91
    1497.86
    1503.04
    1508.48
    1514.19
    1520.16
    1526.36
    1532.76
    1539.32
    1546.01
    1552.77
    1559.55
    1566.3
    1572.96
    1579.51
    1585.87
    1592.08
    1598
    1603.84
    1609.27
    1614.87
    1619.74
    1625.42
    1629.46
    1636.02
    1638.3
    1647.8
    1645.39
    1663.67
    1648.38
    1698.51    )"
    ;
    gradientExpression    "0";
    fractionExpression    "(time() == 0) ? 1 : 0";
this gives the following error;
HTML Code:
--> FOAM FATAL IO ERROR: 
found '\n' while reading string "nonuniform List<scalar>..."

file: /home/thamali/OpenFOAM/thamali-2.2.2/run/tutorials/combustion/reactingFoam/latest/latestlatest/latestelatestlatest/1stcopy/0/T at line 29.

    From function ISstream::read(string&)
    in file db/IOstreams/Sstreams/ISstream.C at line 545.

FOAM exiting
So,I would like to know how to put this nonuniform "valueExpression" in groovyBC?
Using a data file or something like that?
Thanks a lot.
Thamali
Thamali is offline   Reply With Quote

Old   October 11, 2014, 10:21
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Thamali View Post
Dear foamers,
I want to put a groovyBC.I am trying to put a temperature boundary condition as initial temperature(time=0) is a nonuniform list of value and then it to change as "zeroGradient".
For that matter i have put it as follows;
Code:
type        groovyBC;
          valueExpression        "nonuniform List<scalar>
    100
    (
    565.739
<snip>
    1647.8
    1645.39
    1663.67
    1648.38
    1698.51    )"
    ;
    gradientExpression    "0";
    fractionExpression    "(time() == 0) ? 1 : 0";
this gives the following error;
HTML Code:
--> FOAM FATAL IO ERROR: 
found '\n' while reading string "nonuniform List<scalar>..."

file: /home/thamali/OpenFOAM/thamali-2.2.2/run/tutorials/combustion/reactingFoam/latest/latestlatest/latestelatestlatest/1stcopy/0/T at line 29.

    From function ISstream::read(string&)
    in file db/IOstreams/Sstreams/ISstream.C at line 545.

FOAM exiting
So,I would like to know how to put this nonuniform "valueExpression" in groovyBC?
Using a data file or something like that?
Thanks a lot.
Thamali
That is not possible in this way as this is not a valid groovyBC-expression and there is no way to set individual faces in groovyBC. In fact the pain purpose of groovyBC is to avoid this. Solution to get what you want depends on where you got the values from. If you calculated them by hand then you should be able to express them in an expression (no pun intended). If they are from some measurment then I'd suggest 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
gschaider is offline   Reply With Quote

Old   October 11, 2014, 11:16
Default
  #3
Member
 
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12
Thamali is on a distinguished road
Dear Bernhard,
Thanks a lot for your prompt reply.I used an expression for the matter.
Regards,
Thamali
Thamali is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] groovyBC for oscillatory flow liybzd OpenFOAM Community Contributions 5 November 12, 2018 07:53
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam dani2702 OpenFOAM Community Contributions 0 November 17, 2016 03:30
[swak4Foam] groovyBC - non uniform gradient problem marluc OpenFOAM Community Contributions 0 May 5, 2015 16:40
[swak4Foam] groovyBC: using gradientExpression instead of valueExpression gregdB OpenFOAM Community Contributions 15 September 20, 2013 08:03
groovyBC nonuniform Wall heat flux Shoonya Main CFD Forum 0 August 11, 2010 13:03


All times are GMT -4. The time now is 04:43.