CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Timedependent 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   November 28, 2013, 09:59
Default Timedependent groovybc
  #1
New Member
 
Join Date: Nov 2013
Posts: 20
Rep Power: 3
Jakob1 is on a distinguished road
Hey, I am just doing my first baby steps with groovybc and as a start I want to set a T boundary condition to a simple time dependent function. Not sure what I am doing wrong, this is the code:

Code:
oben    
    {
        type            groovyBC;
	valueExpression "313-(20*exp(a*time())";
	variables	"a=(-2.1/(0.001*2400))";
	timelines	();
    }
paraFoam tells me:

Code:
--> FOAM Warning : 
    From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(const fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
    in file groovyBCFvPatchField.C at line 131
    No value defined for T on oben therefore using 66{0}
When I try to run the simulation I get

Code:
--> FOAM FATAL ERROR: 
 Parser Error for driver PatchValueExpressionDriver at "1.22-21" :"syntax error, unexpected $end"
"313-(20*exp(a*time())"
                       
-----------------------

Context of the error:


- From dictionary: /home/jakob/OpenFOAM/jakob-2.2.x/run/setCyl20k_10/0/T.boundaryField.oben
  Evaluating expression "313-(20*exp(a*time())"


    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 1081.

FOAM exiting
What am I doing wrong here? I added the libs into the controlDict and set the boundary type to groovyBC. Thanks guys
Jakob1 is offline   Reply With Quote

Old   November 28, 2013, 16:33
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,889
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Jakob1 View Post
Hey, I am just doing my first baby steps with groovybc and as a start I want to set a T boundary condition to a simple time dependent function. Not sure what I am doing wrong, this is the code:

Code:
oben    
    {
        type            groovyBC;
	valueExpression "313-(20*exp(a*time())";
	variables	"a=(-2.1/(0.001*2400))";
	timelines	();
    }
paraFoam tells me:

Code:
--> FOAM Warning : 
    From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(const fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
    in file groovyBCFvPatchField.C at line 131
    No value defined for T on oben therefore using 66{0}
When I try to run the simulation I get

Code:
--> FOAM FATAL ERROR: 
 Parser Error for driver PatchValueExpressionDriver at "1.22-21" :"syntax error, unexpected $end"
"313-(20*exp(a*time())"
                       
-----------------------

Context of the error:


- From dictionary: /home/jakob/OpenFOAM/jakob-2.2.x/run/setCyl20k_10/0/T.boundaryField.oben
  Evaluating expression "313-(20*exp(a*time())"


    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 1081.

FOAM exiting
What am I doing wrong here? I added the libs into the controlDict and set the boundary type to groovyBC. Thanks guys
There's two things here:
- the syntax error: count the ( and the ) and you will be enlightened
- "no value defined": groovyBC does not evaluate valueExpression during loading (the reason is that the expression might use a field that has not yet been loaded) so it falls back 'value' - if that is there. If it is not there it falls back to '0' - which it tells you in the warning. That is "good enough" for many applications. In your case (temperature) it is not so good (unless your physics make sense at 0 K). Solution is to provide a 'value' for the initialization with a sensible value ("value $internalField" is always a good guess)
Jakob1 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

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 and funkySetFields married and got a kid named swak4Foam gschaider OpenFOAM 162 December 18, 2014 07:38
groovyBC issue - k and epsilon sagnikmazumdar OpenFOAM Running, Solving & CFD 23 February 23, 2014 09:47
Boundary condition with a non-uniform gradient - groovyBC? STiss OpenFOAM Programming & Development 3 October 11, 2013 03:04
switch between existing BCs with groovyBC?! michielm OpenFOAM Pre-Processing 3 September 4, 2013 09:01
groovyBC and Eqn.setReference() benk OpenFOAM 3 June 2, 2011 09:49


All times are GMT -4. The time now is 09:31.