CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

how can extend character limitation of expressions in groovyBC?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Display Modes
Old   February 19, 2013, 16:22
Default how can extend character limitation of expressions in groovyBC?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
I have a long expression for condition on time but it exceeds from groovyBC limitation in 0.2.0 version.how to extend this limit or solve this problem?
Code:
--> FOAM FATAL IO ERROR:
string "((0<=time()&&time()<=t1)||(t1+c1<=time()&&time()<=t1+c2)||(t1+c3<=time()&&time()..."
is too long (max. 1024 characters)

file: /home/ehsan/Desktop/Thesis_Pimple/WR_Pimple/0/U at line 125.

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

FOAM exiting
immortality is offline   Reply With Quote

Old   February 19, 2013, 17:11
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
I have a long expression for condition on time but it exceeds from groovyBC limitation in 0.2.0 version.how to extend this limit or solve this problem?
Code:
--> FOAM FATAL IO ERROR:
string "((0<=time()&&time()<=t1)||(t1+c1<=time()&&time()<=t1+c2)||(t1+c3<=time()&&time()..."
is too long (max. 1024 characters)

file: /home/ehsan/Desktop/Thesis_Pimple/WR_Pimple/0/U at line 125.

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

FOAM exiting
I've never seen that one. Congratulations. Seems like you found a hardcoded limit in OpenFOAM.

Either
- look for the limit somewhere in $FOAM_SRC/OpenFOAM, increase it and recompile OpenFOAM
- split your expression into something more manageable with variables

Second solution is recommended
immortality likes this.
__________________
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   February 20, 2013, 00:13
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
really? I was thinking you are one of providers of OF but you had not know about that?
I found it and am going to compile.because my expression is a set of conditions.how do you think i can reduce conditions?can they be defined in variables?it shows an error on not knowing them when i define logical conditions in variable list as i propound in other thread.
immortality is offline   Reply With Quote

Old   February 20, 2013, 12:42
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
really? I was thinking you are one of providers of OF but you had not know about that?
I only provide swak4Foam but have nothing to do with the OF-core

Quote:
Originally Posted by immortality View Post
I found it and am going to compile.because my expression is a set of conditions.how do you think i can reduce conditions?can they be defined in variables?it shows an error on not knowing them when i define logical conditions in variable list as i propound in other thread.
Either put "branches" in variables or (if the points in time at which something is happening are fixed and between those there are linear transitions) investigate the use of timelines/lookuptables
__________________
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   February 20, 2013, 12:56
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
a brief expression as instance is as below.how can it be set in variables?(you mean thw conditions or expressions by "branches"?)(my conditions are verbose not expressions)
Code:
valueExpression "((0<=time()&&time()<=t1)||(t1+c1<=time()&&time()<=t1+c2)||(t1+c3<=time()&&time()<=t1+c4)||(t2+c1<=time()&&time()<=t2+c2)||(t2+c3<=time()&&time()<=t2+c4)||(t3+c1<=time()&&time()<=t3+c2)||(t3+c3<=time()&&time()<=t3+c4)||(t4+c1<=time()&&time()<=t4+c2)||(t4+c3<=time()&&time()<=t4+c4)||(t5+c1<=time()&&time()<=t5+c2)||(t5+c3<=time()&&time()<=t5+c4)||(t6+c1<=time()&&time()<=t6+c2)||(t6+c3<=time()&&time()<=t6+c4)||(t7+c1<=time()&&time()<=t7+c2)||(t7+c3<=time()&&time()<=t7+c4)||(t8+c1<=time()&&time()<=t8+c2)||(t8+c3<=time()&&time()<=t8+c4)||(t9+c1<=time()&&time()<=t9+c2)||(t9+c3<=time()&&time()<=t9+c4)||(t10+c1<=time()&&time()<=t10+c2)||(t10+c3<=time()&&time()<=t10+c4)||(t11+c1<=time()&&time()<=t11+c2)||(t11+c3<=time()&&time()<=t11+c4))?vector(0,v_r,0):mag(internalField(U).x)*normal()";
unfortunately the values change at certain times from value to gradient not from value to another value therefor i cant use timeLines if i undersatand its usage correctly.what can do simply without compiling?
immortality is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
groovyBC issue - k and epsilon sagnikmazumdar OpenFOAM Running, Solving & CFD 24 March 1, 2015 08:16
groovyBC and funkySetFields married and got a kid named swak4Foam gschaider OpenFOAM 164 January 13, 2015 03:52
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 07:24
groovyBC and Eqn.setReference() benk OpenFOAM 3 June 2, 2011 08:49
Character expressions in gmsh? ericnutsch Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 January 22, 2010 00:21


All times are GMT -4. The time now is 08:53.