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

[swak4Foam] Timedependent 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   November 28, 2013, 09:59
Default Timedependent groovybc
  #1
New Member
 
Join Date: Nov 2013
Posts: 20
Rep Power: 12
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: 4,225
Rep Power: 51
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


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 08:53
[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
[swak4Foam] groovyBC issue - k and epsilon sagnikmazumdar OpenFOAM Community Contributions 24 March 1, 2015 08:16
[swak4Foam] groovyBC and Eqn.setReference() benk OpenFOAM Community Contributions 3 June 2, 2011 09:49


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