|
[Sponsors] | |||||
[swak4Foam] Error using groovyBC - 'parser error for expression driver' |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 14 ![]() |
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;
}
Code:
sensorMeasurement
{
type createSampledSet;
outputControl outputTime;
outputInterval 1;
setName vorticity_sensor1;
set {
type cloud;
axis xyz;
points (
(0 -0.5 0.5)
);
} }
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)";
}
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" ---------------------------------------------- Thank you |
|
|
|
|
|
|
|
|
#2 |
|
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 14 ![]() |
No ideas?
|
|
|
|
|
|
|
|
|
#3 |
|
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 14 ![]() |
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 |
|
|
|
|
|
|
|
|
#4 |
|
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 130 ![]() ![]() ![]() ![]() ![]() ![]() |
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 Where did you read about this feature, namely the ability to use the value on a "set"? |
|
|
|
|
|
|
|
|
#5 | |
|
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 14 ![]() |
Quote:
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. |
||
|
|
|
||
![]() |
| Tags |
| groovybc, parser error, valueexpression |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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] whats wrong with this groovyBC expression in parenthesis? | immortality | OpenFOAM Community Contributions | 11 | June 5, 2013 08:54 |
| [swak4Foam] groovyBC and Eqn.setReference() | benk | OpenFOAM Community Contributions | 3 | June 2, 2011 09:49 |