CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Paraview & paraFoam

an error in Calculator's equation

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 19, 2013, 16:12
Default an error in Calculator's equation
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 15
immortality is on a distinguished road
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.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 20, 2013, 01:45
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 787
Rep Power: 11
Bernhard is on a distinguished road
Looks like you are trying some funkyDoCalc kind of expression in ParaView, that won't work.
Bernhard is offline   Reply With Quote

Old   August 20, 2013, 03:25
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 15
immortality is on a distinguished road
Hi Bernhard
what do you mean by "trying some funkyDoCalc kind"?
then can't do averaging in paraView?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 20, 2013, 03:28
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 787
Rep Power: 11
Bernhard is on a distinguished road
Quote:
Originally Posted by immortality View Post
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)
Bernhard is offline   Reply With Quote

Old   August 24, 2013, 01:52
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 15
immortality is on a distinguished road
is there a way to contribute area or volume of cells in the formulas in paraview?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 24, 2013, 12:20
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,122
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Greetings to all!

@Ehsan:
Quote:
Originally Posted by immortality View Post
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
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 View Post
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
wyldckat is offline   Reply With Quote

Old   August 24, 2013, 15:30
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 15
immortality is on a distinguished road
Hi Bruno
yes I grasped that problem,I just put here the full error message.
could you clarify a bit about the filter?
thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 24, 2013, 16:37
Default
  #8
Senior Member
 
cfdonline2mohsen's Avatar
 
Mohsen KiaMansouri
Join Date: Jan 2010
Location: CFD Lab
Posts: 107
Rep Power: 6
cfdonline2mohsen is on a distinguished road
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!
__________________
Best Regards
Mohsen
(Don't forget the Like button! )
cfdonline2mohsen is offline   Reply With Quote

Old   August 24, 2013, 17:00
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 15
immortality is on a distinguished road
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.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.

Last edited by immortality; August 24, 2013 at 18:11.
immortality is offline   Reply With Quote

Old   September 3, 2013, 10:27
Default
  #10
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 15
immortality is on a distinguished road
Hi
how can I define two fields with calculator?
when I define second field it replaces to previous one!
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 3, 2013, 12:36
Default
  #11
Senior Member
 
cfdonline2mohsen's Avatar
 
Mohsen KiaMansouri
Join Date: Jan 2010
Location: CFD Lab
Posts: 107
Rep Power: 6
cfdonline2mohsen is on a distinguished road
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
__________________
Best Regards
Mohsen
(Don't forget the Like button! )
cfdonline2mohsen is offline   Reply With Quote

Old   September 3, 2013, 16:18
Default
  #12
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 15
immortality is on a distinguished road
I was using one calculator branch only!it resolved,thanks for consideration.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error message cuteapathy CFX 14 March 20, 2012 07:45
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07
Calculation of the Governing Equations Mihail CFX 5 July 25, 2008 17:29
continuity equation Rafal Main CFD Forum 4 November 29, 2006 09:27


All times are GMT -4. The time now is 02:48.