CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] an error in Calculator's equation (https://www.cfd-online.com/Forums/paraview/122425-error-calculators-equation.html)

immortality August 19, 2013 16:12

an error in Calculator's equation
 
I have written this equation for averaging on p:
Code:

sum(p*area())/sum(area())
but there shown an error:
Code:

ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x19c60a0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/T: Expected number, string or (, found Temperature


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x19c60a0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/U: Expected number, string or (, found Velocity


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x19c60a0): Error reading line 20 of /home/ehsan/Desktop/WR_4/0/k: Expected number, string or (, found turbulentK


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x19c60a0): Error reading line 20 of /home/ehsan/Desktop/WR_4/0/omega: Expected number, string or (, found turbulentOmega


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x19c60a0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/p: Expected number, string or (, found Pressure


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 185
vtkPVArrayCalculator (0xc531ca0): The result array must have a name.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0xc531ca0): An error occured when parsing the calculator's function.  See previous errors.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0xc531ca0): An error occured when parsing the calculator's function.  See previous errors.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0xc531ca0): An error occured when parsing the calculator's function.  See previous errors.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0xc531ca0): An error occured when parsing the calculator's function.  See previous errors.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0xc531ca0): An error occured when parsing the calculator's function.  See previous errors.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0xc531ca0): An error occured when parsing the calculator's function.  See previous errors.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0xc531ca0): An error occured when parsing the calculator's function.  See previous errors.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x3b07920): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0xc531ca0): An error occured when parsing the calculator's function.  See previous errors.


Bernhard August 20, 2013 01:45

Looks like you are trying some funkyDoCalc kind of expression in ParaView, that won't work.

immortality August 20, 2013 03:25

Hi Bernhard
what do you mean by "trying some funkyDoCalc kind"?
then can't do averaging in paraView?

Bernhard August 20, 2013 03:28

Quote:

Originally Posted by immortality (Post 446813)
Hi Bernhard
what do you mean by "trying some funkyDoCalc kind"?
then can't do averaging in paraView?

I am not sure whether or not "area()" is correct notation in the ParaView calculator, I think it is not. I do recognize the notation from the funkyDoCalc utility (by Gschaider)

immortality August 24, 2013 01:52

is there a way to contribute area or volume of cells in the formulas in paraview?

wyldckat August 24, 2013 12:20

Greetings to all!

@Ehsan:
Quote:

Originally Posted by immortality (Post 446759)
Code:

ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/IO/vtkOpenFOAMReader.cxx, line 6481
vtkOpenFOAMReaderPrivate (0x19c60a0): Error reading line 19 of /home/ehsan/Desktop/WR_4/0/T: Expected number, string or (, found Temperature


:confused: I've written about this in the past and reminded you at least once... so this makes it the second time I'll have to remind you:
Quote:

Originally Posted by wyldckat (Post 446210)
The explanation is simple: you are using ParaView 3.12.0 with the internal FOAM reader, namely with the extension ".foam". But your case is using "$Temperature" and other similar variables, which unfortunately this internal reader is not able to handle.
If you use the official OpenFOAM reader, namely with the extension ".OpenFOAM", you no longer have this problem.


As for the area calculation, you'll have to first use the filter "Integrate Variables", which will calculate the area.

Best regards,
Bruno

immortality August 24, 2013 15:30

Hi Bruno
yes I grasped that problem,I just put here the full error message.
could you clarify a bit about the filter?
thanks.

cfdonline2mohsen August 24, 2013 16:37

Dear Ehsan
take the following steps:

1> first define the slice that you want to calculate its area or averaging data on it and click apply.
2> on the filters menu,select the last item i.e. Alphabetics and click on "Integrate Variables" and apply.
3> be sure to select attribute mode: cell data
4>you can see the area of the selected slice and the integral of any variable (e.g P in your case) on this plane. (i.e sum(p*area())). so in order to find the average P; just divide this value by the area.
5>You can also use calculator for this purpose;again on the filters menu,select the last item i.e. Alphabetic and click on calculator. be sure that is on: attribute mode: cell data and define the new variable Pbar by using the values that is on the scalar section.
you can see the new Pbar value on this plane now!
I hope that was useful!:):)

immortality August 24, 2013 17:00

Hi Mohsen
thanks,
I did the way you told in number 5,but it doesn't know area yet:
Code:

ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x1e5fa90): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x1e5fa90): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0x1e5f900): An error occured when parsing the calculator's function.  See previous errors.


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x1e5fa90): Syntax error: expecting a variable name;  see position 0


ERROR: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Common/vtkFunctionParser.cxx, line 1480
vtkFunctionParser (0x1e5fa90): Syntax error: expecting a variable name;  see position 0


Warning: In /home/opencfd/OpenFOAM/ThirdParty-dev/ParaView-3.12.0/VTK/Graphics/vtkArrayCalculator.cxx, line 401
vtkPVArrayCalculator (0x1e5f900): An error occured when parsing the calculator's function.  See previous errors.

I did it by using 1-4 steps nad it was fine,thanks,but step 5 is a bit unclear to me.

immortality September 3, 2013 10:27

Hi
how can I define two fields with calculator?
when I define second field it replaces to previous one!

cfdonline2mohsen September 3, 2013 12:36

Dear Ehsan
Probably they have the same name.
choose a different name for your 2nd field
there shouldn't be any problem with defining more than 2 fields with calculator

immortality September 3, 2013 16:18

I was using one calculator branch only!it resolved,thanks for consideration.

alimea June 29, 2021 00:10

Nusslet calculation in openfoam
 
Hi all

I want to calculate the Nusslet number in ParaView. When I calculate the inner product to normals and grad(T), it gives me this error:

Code:

ERROR: In /home/OpenFOAM/ThirdParty-7/ParaView-5.6.0/VTK/Common/Misc/vtkFunctionParser.cxx, line 1244
vtkFunctionParser (0x5612add94000): Syntax error: expecting a variable name;  see position 0

Do you know how to solve it?

Also, it seems that wallHeatFlux does not work in my solver: rheoHeatFoam.

Thank you!


All times are GMT -4. The time now is 10:22.