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

Rounding Values in Post

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 22, 2013, 11:15
Default Rounding Values in Post
  #1
New Member
 
Join Date: Jan 2013
Posts: 4
Rep Power: 5
stifelistefan is on a distinguished road
Hi Everybody,

I'm trying to get the length of my geometry with the following expressions:

TEXT: X Abmass
Colour = 0, 0, 0
Font = Sans Serif
Position Mode = Three Coords
Text Colour Mode = Default
Text Height = 0.024
Text Position = (maxVal(X)@domair + minVal(X)@domair)/2, maxVal(Y)@domair + 2 [m], maxVal(Z)@domair
Text Rotation = 0 [degree]
Visibility = On
X Justification = Center
Y Justification = None
TEXT ITEM: Text Item 1
Auto Annotation Expression = (maxVal(X)@domair - minVal(X)@domair)
Auto Annotation File Date Format = DD/MM/YY
Auto Annotation File Time Format = h:m:s t
Auto Annotation Filename Format = Filename Only
Auto Annotation Type = Expression
Embed Auto Annotation = On
Text Item Active = On
Text String = <aa>
END
END

Unfortunately "(maxVal(X)@domair - minVal(X)@domair)" gives "33.7966 [m]"

Does anyone know how I can have it rounded to two digits? And if that's possible: to remove the units?

Thanks
stifelistefan is offline   Reply With Quote

Old   January 22, 2013, 16:39
Default
  #2
Senior Member
 
Join Date: Dec 2009
Posts: 129
Rep Power: 11
mjgraf is on a distinguished road
Off the top of my head not sure how to do that in an expression or CEL, but the Power Syntax can easily do it.

Create a session file
2 perl lines

Code:
! ($extent, $extent_units) = maxVal("X","DEF") - minVal("X", "DEF");
! $extent = sprintf "%.2f", $extent;
Then add the CCL code for the TEXT you already provided.
On the line Auto Annotation Expression
make it
Auto Annotation Expression = $extent

Example:

Code:
! ($extent, $extent_units) = maxVal("X","DEF") - minVal("X", "DEF");
! $extent = sprintf "%.2f", $extent;

TEXT:Text 1
  Colour = 0, 0, 0
  Font = Sans Serif
  Position Mode = Two Coords
  Text Colour Mode = Default
  Text Height = 0.024
  Text Position = 0 , 0.96
  Text Rotation = 0 [degree]
  X Justification = Center
  Y Justification = None
  TEXT ITEM:Text Item 1
    Auto Annotation Expression = $extent
    Auto Annotation File Date Format = DD/MM/YY
    Auto Annotation File Time Format = h:m:s t
    Auto Annotation Filename Format = Filename Only
    Auto Annotation Type = Expression
    Embed Auto Annotation = On
    Text Item Active = On
    Text String = Expression = <aa>
  END
END
Quote:
Originally Posted by stifelistefan View Post
Hi Everybody,

I'm trying to get the length of my geometry with the following expressions:

TEXT: X Abmass
Colour = 0, 0, 0
Font = Sans Serif
Position Mode = Three Coords
Text Colour Mode = Default
Text Height = 0.024
Text Position = (maxVal(X)@domair + minVal(X)@domair)/2, maxVal(Y)@domair + 2 [m], maxVal(Z)@domair
Text Rotation = 0 [degree]
Visibility = On
X Justification = Center
Y Justification = None
TEXT ITEM: Text Item 1
Auto Annotation Expression = (maxVal(X)@domair - minVal(X)@domair)
Auto Annotation File Date Format = DD/MM/YY
Auto Annotation File Time Format = h:m:s t
Auto Annotation Filename Format = Filename Only
Auto Annotation Type = Expression
Embed Auto Annotation = On
Text Item Active = On
Text String = <aa>
END
END

Unfortunately "(maxVal(X)@domair - minVal(X)@domair)" gives "33.7966 [m]"

Does anyone know how I can have it rounded to two digits? And if that's possible: to remove the units?

Thanks
mjgraf is offline   Reply With Quote

Old   January 23, 2013, 03:32
Default
  #3
New Member
 
Join Date: Jan 2013
Posts: 4
Rep Power: 5
stifelistefan is on a distinguished road
Hi mjgraf

That work perfectly! Thanks for the quick reply!
stifelistefan is offline   Reply With Quote

Old   January 23, 2013, 11:21
Default
  #4
New Member
 
Join Date: Jan 2013
Posts: 4
Rep Power: 5
stifelistefan is on a distinguished road
HI again :-)
I have a new problem with probably a similar solution... (something in perl :-))

I would like to have my text position automated
Text Position = (maxVal(X)@domair + minVal(X)@domair)/2, maxVal(Y)@domair + 2 [m], maxVal(Z)@domair
is not good enough...

Is it possible that the text is right alined to the text position? And is it possible that the distance to the text position is constant (when changing the camera position in Post)?

Cheers
stifelistefan is offline   Reply With Quote

Old   March 5, 2014, 09:10
Default
  #5
New Member
 
Zvika
Join Date: Mar 2009
Posts: 2
Rep Power: 0
benadam10 is on a distinguished road
You can use int() and nint() CEL functions
benadam10 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
strange node values @ solid/fluid interface - help JB FLUENT 2 November 1, 2008 13:04
node values or cell values? aPpA FLUENT 0 November 10, 2006 09:56
Plotting raw data values Wilesco CD-adapco 0 January 5, 2006 06:34
post processing CL values Joe Bryant FLUENT 2 October 18, 2004 04:17
Post Processing Koorosh MOHAMMADI FLUENT 1 June 13, 2002 06:54


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