|
[Sponsors] |
November 24, 2013, 14:09 |
Algeabraic operation with #calc
|
#1 |
Senior Member
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13 |
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. |
|
November 25, 2013, 04:54 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
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. |
|
November 25, 2013, 05:34 |
|
#3 |
Senior Member
Join Date: Dec 2011
Posts: 111
Rep Power: 19 |
You could try to define b, c and d as scalars:
Code:
b 4.0; c 3.0; d 10.0; |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
complex number operation in udf? | hongxiao | FLUENT | 5 | June 14, 2017 15:11 |
operation pressure and pressure outlet BC | Lilly | FLUENT | 4 | May 8, 2013 10:57 |
How to define the edge after Boolean Operation | Jeffrey | FLUENT | 0 | May 14, 2007 07:51 |
Initalization fails with Operation Pressure = 0 Pa | Tobias | FLUENT | 3 | October 31, 2005 10:02 |
Rotation flow calc. II. Andy | Christian | Main CFD Forum | 2 | April 10, 2003 05:06 |