CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

whats wrong with "sqr(internalField(U.x))"?

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

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By jherb

Reply
 
LinkBack Thread Tools Display Modes
Old   February 5, 2013, 14:27
Default whats wrong with "sqr(internalField(U.x))"?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
why OpenFOAM gives an error about U.x?
Code:
Selecting turbulence model type laminar

Starting time loop

Time = 5.6e-09

Courant Number mean: 2.703201494e-20 max: 1.290382332e-16
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
swak4Foam: Allocating new repository for sampledGlobalVariables
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 2.073282789e-22, No Iterations 2
DILUPBiCG:  Solving for Uy, Initial residual = 1, Final residual = 2.073273772e-22, No Iterations 2
DILUPBiCG:  Solving for e, Initial residual = 0.0006828527063, Final residual = 3.08254255e-26, No Iterations 2


--> FOAM FATAL ERROR:
Parser Error at "1.34" :"syntax error, unexpected '.', expecting ')'"
"1+(gamma-1)/2*sqr(internalField(U.x))/(gamma*R*internalField(T))"
"                                  ^                             "

From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 802.

FOAM exiting
immortality is offline   Reply With Quote

Old   February 5, 2013, 18:07
Default
  #2
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
I've examined other possible types but the error persists.
immortality is offline   Reply With Quote

Old   February 5, 2013, 20:10
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,519
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Try:
Code:
internalField(U).x
immortality likes this.
wyldckat is offline   Reply With Quote

Old   February 12, 2013, 13:40
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
thanks.
are sqr(mag(internalField(U))) and magSqr(internalField(U)) the same?
immortality is offline   Reply With Quote

Old   February 12, 2013, 18:15
Default
  #5
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,519
Blog Entries: 33
Rep Power: 74
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
Hi Ehsan,

Right now I'm too sleepy to properly think. I can't figure out how these operations affect vectors, but I think that for matrix tensors those two are not the same.

But if you take a look at the OpenFOAM Programmers Guide, pages 16, 19 and 20, you'll find more specific information on this. Maybe start reading from the beginning of Chapter 1 is the best. This will give you a better understanding of how OpenFOAM handles math operations, which you might have to document in your thesis.

There is a PDF file of the Programmers Guide in the main OpenFOAM source code folder, specifically at "doc/Guides-a4".
Be careful with this guide, because it has some flaws in it... but I think "mag", "sqr" and "magSqr" should all be properly defined.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   February 13, 2013, 07:53
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
thanks dear Bruno
I had read that before and took a look again.but nothing had write definitely about these terms.I think they are related to groovyBC library.Im going to have a look at its guidance if help.
any idea is appreciated.
immortality is offline   Reply With Quote

Old   February 26, 2013, 19:20
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
have anyone any idea about the expressions?are they different or equivalent certainly?
immortality is offline   Reply With Quote

Old   September 10, 2013, 15:59
Default
  #8
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 249
Rep Power: 9
jherb is on a distinguished road
For the definitions given on http://www.foamcfd.org/Nabla/guides/...sGuidese4.html the two things should be the same.
Quote:
Originally Posted by immortality View Post
thanks.
are sqr(mag(internalField(U))) and magSqr(internalField(U)) the same?
immortality likes this.
jherb 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
Wrong wall distance with cyclic boundaries sebastian OpenFOAM Bugs 4 October 31, 2012 12:24
Wrong oriented faces due to opposite face bends? Arnoldinho OpenFOAM 5 August 16, 2012 06:00
BuoyantBoussinesqSimpleFoam and axial-symmetric results wrong mass flow Thomas Baumann OpenFOAM 6 December 21, 2009 11:31
udf error srihari FLUENT 0 February 9, 2009 10:00
Pressure contour seems wrong??? Harry Qiu FLUENT 1 June 29, 2001 06:53


All times are GMT -4. The time now is 15:26.