CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Bugs

Algeabraic operation with #calc

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

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

== 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
Senior Member
akidess's Avatar
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,264
Rep Power: 23
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.
akidess is offline   Reply With Quote

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

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


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
complex number operation in udf? hongxiao FLUENT 5 June 14, 2017 14:11
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
Rotation flow calc. II. Andy Christian Main CFD Forum 2 April 10, 2003 04:06

All times are GMT -4. The time now is 23:22.