CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Calculator problems (https://www.cfd-online.com/Forums/paraview/185506-calculator-problems.html)

niko992 March 27, 2017 11:03

Calculator problems
 
I have to use the formula
Code:

gradient(f-velocity_X)
where f-velocity_X is a number
but when i use this there appears the error message

HTML Code:

ERROR: In C:\bbd\df0abce0\source-paraview\VTK\Common\Misc\vtkFunctionParser.cxx, line 1244
vtkFunctionParser (000001C154368D50): Syntax error: expecting a variable name;  see position 0


Warning: In C:\bbd\df0abce0\source-paraview\VTK\Filters\Core\vtkArrayCalculator.cxx, line 405
vtkPVArrayCalculator (000001C154448380): An error occurred when parsing the calculator's function.  See previous errors.

Someone can tells me what i do wrong?

floquation March 27, 2017 11:27

You're saying that f-velocity_X is one variable?
Then I'm guessing the hyphen '-' is interpreted as a minus, rather than as part of the variable name. This appears to be consistent with the error message: "expecting a variable name".
Can you change the variable name?

niko992 March 27, 2017 11:32

Quote:

Originally Posted by floquation (Post 642498)
You're saying that f-velocity_X is one variable?
Then I'm guessing the hyphen '-' is interpreted as a minus, rather than as part of the variable name. This appears to be consistent with the error message: "expecting a variable name".
Can you change the variable name?

Yes f-velocity_X is a variable but i have no idea how to change the name... I have received a simulation with this name.

floquation March 27, 2017 11:46

You import them into ParaView from all time directories.
Within all time directories you have a file with the variable name.
If you wish ParaView to see a different name, you'll have to change those names... (I don't know of any other way.)

I'm not sure whether you must change the filename, or
Code:

object      f-velocity_X;
which resides in each of those files. So try both one-at-a-time such that you know what ParaView reads to be the variable name.

If I were you, I'd change the file in the 0-directory (or any other time directory) by hand, and see if that works for that specific time.
If it does work, and it should work, you should write a quick script to search and replace the variable name in all time directories.


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