In OF23x, the multiphase models specify the variables of the different phases using a dot, such as U.water, alpha.air. This dot can not by parsed by the swak4foam parser, for example when the following is calculated
UwaterSF
{
type expressionField;
outputControlMode outputTime;
outputInterval 1;
fieldName UwaterSF;
expression "U*alpha.water";
autowrite true;
}
~
---- additional_information ----
Output of the parse of the above expressionFiel is
--> FOAM FATAL ERROR:
Parser Error for driver FieldValueExpressionDriver at "1.3-7" :"field alpha not existing or of wrong type"
"U*alpha.water"
^^^^^
----|
Context of the error:
- Driver constructed from scratch
Evaluating expression "U*alpha.water"
From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 1188.
FOAM exiting
And example based on the weirOverflow interFoam tutorial is added to the report
This is known. The problem is that OpenFOAM-words allow a lot of characters that the parser uses for other purposes (I think even +). Letting the parser accept these would either result in a rather weird expression syntax or a very ugly parser code. For this reason there is a workaround implemented in the parser since two versions back: the aliases-table (this is documented in the incomplete reference manual).
In your example add
aliases {
alphaWater alpha.water;
}
to the specification directory. Then alphaWater in your expression will transparently use alpha.water