|
[Sponsors] |
November 28, 2013, 09:59 |
Timedependent groovybc
|
#1 |
New Member
Join Date: Nov 2013
Posts: 20
Rep Power: 12 |
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 (); } 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} 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 |
|
November 28, 2013, 16:33 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
- 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)
__________________
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 |
||
|
|
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 |