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

Algeabraic operation with #calc

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 24, 2013, 14:09
Default Algeabraic operation with #calc
  #1
Member
 
Join Date: Aug 2012
Posts: 74
Rep Power: 5
HakikiCanakkaleli is on a distinguished road
Hi

== 1 ==
#calc, used in blockMeshDict context, seems to give different answers for the following:

== 2 ==

b 4;
c 3;
d 10;

// First one-line calculation
a #calc "b / d * c";

// Second one-line calculation
a #calc "(b * c) / d";

== 3 ==
I could not find any reasoning behind the difference; therefore, I thought it would be better to consider it as a small bug.
HakikiCanakkaleli is offline   Reply With Quote

Old   November 25, 2013, 04:54
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
You don't include the answers you get in your post, which would help debugging a lot. I'm guessing integer division is to blame.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   November 25, 2013, 05:34
Default
  #3
Senior Member
 
Håkon Strandenes
Join Date: Dec 2011
Location: Norway
Posts: 111
Rep Power: 10
haakon will become famous soon enough
You could try to define b, c and d as scalars:

Code:
b 4.0;
c 3.0;
d 10.0;
and follow up with a detailed description of the input files and the error if it does not solve your problem.
haakon 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
operation pressure and pressure outlet BC Lilly FLUENT 4 May 8, 2013 09:57
How to define the edge after Boolean Operation Jeffrey FLUENT 0 May 14, 2007 06:51
Initalization fails with Operation Pressure = 0 Pa Tobias FLUENT 3 October 31, 2005 10:02
complex number operation in udf? hongxiao FLUENT 4 April 9, 2005 07:50
Rotation flow calc. II. Andy Christian Main CFD Forum 2 April 10, 2003 04:06


All times are GMT -4. The time now is 21:57.