CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Regarding error in new expression syntax in openfoam 1912 (https://www.cfd-online.com/Forums/openfoam/228793-regarding-error-new-expression-syntax-openfoam-1912-a.html)

er_ijaz July 15, 2020 12:02

Regarding error in new expression syntax in openfoam 1912
 
Hi I need to model variable flow rate with time depending on the temperature on the particular patch.
If Temp<300.15 K then flow rate is 0.058;
else Temp>300.15K then flow rate is (m*temp)+c

I recently read that expressions can be modelled directly in openfoam 1912.
Initially I tried to model flowrate I'm unable to do so. Hence I used
SERVER_SOURCE
{
type exprFixedValue;
value $internalField;
valueExpr "(tSink<=300.15)?vector(0,value1/area1,0):vector(0,((0.00531*tSink)-0.08485)/area1,0)";
variables
(
"tSink{SERVER_SINK} = weightAverage(T)"
"value1{SERVER_SOURCE} = 0.05852"
"area1{SERVER_SOURCE} = area()"
);
}
But Im getting the following warning while the simulation is running
"--> FOAM Warning :
From function bool Foam::expressions::exprResult::getUniformChecked(F oam::expressions::exprResult&, Foam::label, bool, bool) const [with Type = double; Foam::label = int]
in file expressions/exprResult/exprResultI.H at line 143
Different min/max values: (0.000674827 0.00410428) Using the average 0.00146216
Can any one explain how to fix this error?

er_ijaz July 15, 2020 12:09

updated information
 
for information I changed the expression as below
{
type exprFixedValue;
value $internalField;
valueExpr "(tSink<=300.15)?vector(0,value2/area2,0):vector(0,((0.00531*tSink)-0.08485)/area2,0)";
variables
(
"tSink{SERVER_SINK} = weightAverage(T)"
"value2 = 0.05852"
"area2 = 0.20025"
);
}
The simulation is running fine but still I'm not sure what is the cause of the warning.


All times are GMT -4. The time now is 18:55.