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

Error using groovyBC - 'parser error for expression driver'

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

Like Tree1Likes
  • 1 Post By odellar

Reply
 
LinkBack Thread Tools Display Modes
Old   September 7, 2015, 08:13
Default Error using groovyBC - 'parser error for expression driver'
  #1
Member
 
Olie
Join Date: Oct 2013
Posts: 50
Rep Power: 5
odellar is on a distinguished road
I'm using a valueExpression in my 0/U file in order to implement a boundary condition which is a function of a 'measurement' (probe reading). In the controlDict I have:

Code:
    vorticity
    {
        type expressionField;
        autowrite true;
        dimension [0 0 -1 0 0 0 0];
        fieldName "vorticity";
        expression "curl(U)";
        verbose true;
        autowrite true;
        outputControl timeStep;
    }
in order to compute the vorticity flow field whilst solving, followed by (again in the controlDict):

Code:
 sensorMeasurement
        {
        type createSampledSet;
        outputControl outputTime;
        outputInterval 1;
        setName vorticity_sensor1;
        set {
                type cloud;
                axis xyz;
                points (
                        (0 -0.5 0.5)
                );
        } }
in order to 'measure' the vorticity at a point, (0 -0.5 0.5), using a probe - the setName is vorticity_sensor1.

In my 0/U file I then have something which looks like this:
Code:
BOUNDARY1
{
type groovyBC;
value uniform (0 0 0);
variables (
"vorticityMeasurement{set'vorticity_sensor1}=average(vorticity);"
"w=vorticityMeasurement;"
"wMovingAvg=deltaT()*w/15.4+(1-deltaT()/15.4)*wMovingAvg;" //**** THIS LINE ****
);
storedVariables (
{
name wMovingAvg;
initialValue "0";
}
);
valueExpression "vector(1.4142*wMovingAvg,1.4142*wMovingAvg,0)";
}
However when I try run the solver (pimpleFoam) I get the following error (clearly corresponding to the line I've highlighted above):

Code:
[0] --> FOAM FATAL ERROR:
[0]  Parser Error for driver PatchValueExpressionDriver at "1.45-44" :"syntax error, unexpected $end"
"deltaT()*w/15.4+(1-deltaT()/15.4)*wMovingAvg"

----------------------------------------------

Context of the error:


- From dictionary: /mnt/fastdata/cop13ojd/BFS_H_Infinity/processor0/0/U.boundaryField.actuator
  Evaluating expression "deltaT()*w/15.4+(1-deltaT()/15.4)*wMovingAvg"
[0]
[0]
[0]     From function parsingValue
[0]     in file lnInclude/CommonValueExpressionDriverI.H at line 1181.
[0]
FOAM parallel run exiting
[0]
[3]
[3]
[3] --> FOAM FATAL ERROR:
[3]  Parser Error for driver PatchValueExpressionDriver at "1.45-44" :"syntax error, unexpected $end"
"deltaT()*w/15.4+(1-deltaT()/15.4)*wMovingAvg"

----------------------------------------------
Can anyone help me out here?
Thank you
odellar is offline   Reply With Quote

Old   September 21, 2015, 08:34
Default No ideas?
  #2
Member
 
Olie
Join Date: Oct 2013
Posts: 50
Rep Power: 5
odellar is on a distinguished road
No ideas?
odellar is offline   Reply With Quote

Old   September 21, 2015, 09:25
Default An idea
  #3
Member
 
Olie
Join Date: Oct 2013
Posts: 50
Rep Power: 5
odellar is on a distinguished road
I've just thought - this could potentially because I'm using a quantity I've computed called vorticity, which is a vector quantity - I actually only mean the z-component of the vector - what is the syntax in openFOAM to address a particular element of the variable?

In matlab for example one would write vorticity(3) to access the third element of the vector.

Thanks
odellar is offline   Reply With Quote

Old   September 21, 2015, 11:14
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,745
Blog Entries: 39
Rep Power: 103
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Quick answer: I'm not familiar enough with groovyBC, but I suspect that the problem is in the first line of the expression list, namely this part:
Code:
set'vorticity_sensor1
The separator between "set" and "vorticity_sensor1" is a quote which is opened but not closed.

Where did you read about this feature, namely the ability to use the value on a "set"?
wyldckat is online now   Reply With Quote

Old   September 21, 2015, 11:51
Default
  #5
Member
 
Olie
Join Date: Oct 2013
Posts: 50
Rep Power: 5
odellar is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick answer: I'm not familiar enough with groovyBC, but I suspect that the problem is in the first line of the expression list, namely this part:
Code:
set'vorticity_sensor1
The separator between "set" and "vorticity_sensor1" is a quote which is opened but not closed.

Where did you read about this feature, namely the ability to use the value on a "set"?
Thanks, but that is the correct way of using that expression.

I *think* I've now got it working, by saying average(vorticity.z) in order to access the z-component. It seems to be running fine, so we'll see.
wyldckat likes this.
odellar is offline   Reply With Quote

Reply

Tags
groovybc, parser error, valueexpression

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 for oscillatory flow liybzd OpenFOAM 1 December 15, 2013 08:08
whats wrong with this groovyBC expression in parenthesis? immortality OpenFOAM Running, Solving & CFD 11 June 5, 2013 07:54
groovyBC and Eqn.setReference() benk OpenFOAM 3 June 2, 2011 08:49


All times are GMT -4. The time now is 07:28.