CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

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

Register Blogs Community New Posts Updated Threads Search

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2013, 13:27
Default whats wrong with "sqr(internalField(U.x))"?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
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, 17:07
Default
  #2
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
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, 19:10
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Try:
Code:
internalField(U).x
immortality likes this.
__________________
wyldckat is offline   Reply With Quote

Old   February 12, 2013, 12:40
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
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, 17:15
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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, 06:53
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
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, 18:20
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
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, 14:59
Default
  #8
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
udf error srihari FLUENT 1 October 31, 2016 14:18
Wrong wall distance with cyclic boundaries sebastian OpenFOAM Bugs 4 October 31, 2012 10:24
Wrong oriented faces due to opposite face bends? Arnoldinho OpenFOAM 5 August 16, 2012 05:00
BuoyantBoussinesqSimpleFoam and axial-symmetric results wrong mass flow Thomas Baumann OpenFOAM 6 December 21, 2009 10:31
Pressure contour seems wrong??? Harry Qiu FLUENT 1 June 29, 2001 05:53


All times are GMT -4. The time now is 08:58.