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

[swak4Foam] how can extend character limitation of expressions in groovyBC?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread 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,208
Rep Power: 27
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: 4,225
Rep Power: 51
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,208
Rep Power: 27
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: 4,225
Rep Power: 51
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,208
Rep Power: 27
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

Old   November 3, 2015, 12:19
Default
  #6
New Member
 
Pas
Join Date: Nov 2015
Posts: 1
Rep Power: 0
CloarcSaoP is on a distinguished road
Hello,

I am bringing out from the shadows this old post because I am facing the same problem.
In fact, I increased the length of string into /opt/openfoam240/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C file to impose a time-dependent (and x- y-dependent) inlet BC using groovyBC.
However, I did not manage to re-compile OpenFOAM by running ./Allwmake in the /opt/openfoam240/ directory.
With the superuser privileges, I have the following error:
Error: Current directory is not $WM_PROJECT_DIR
The environment variables are inconsistent with the installation.
Check the OpenFOAM entries in your dot-files and source them.

What do I have to do to take into account the changes made in ISstream.C file?

Regards.
CloarcSaoP 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 and funkySetFields married and got a kid named swak4Foam gschaider OpenFOAM Community Contributions 169 August 10, 2023 10:01
[swak4Foam] reactingMultiPhaseEulerFoam problems with groovyBC zanilu70 OpenFOAM Community Contributions 4 December 13, 2016 07:46
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam dani2702 OpenFOAM Community Contributions 0 November 17, 2016 04:30
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 08:24
[Gmsh] Character expressions in gmsh? ericnutsch OpenFOAM Meshing & Mesh Conversion 0 January 22, 2010 00:21


All times are GMT -4. The time now is 10:48.