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

CFX post-exprestion for reffrencing a case

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

Like Tree6Likes
  • 1 Post By singer1812
  • 1 Post By singer1812
  • 1 Post By brunoc
  • 2 Post By singer1812
  • 1 Post By brunoc

Reply
 
LinkBack Thread Tools Display Modes
Old   September 5, 2013, 03:43
Default CFX post-expression for referencing a case
  #1
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
hi
i have loaded some separate results in CFX post and i need to extract some plots from conturs ,vectors and etc.
would you pleas show me how can i define an annotation in plots which expresses a variable like pressure in every current case views?i have already set an annotation(TEXT) but when i change the case view,the annotation(TEXT) doesn't change. it is very time consuming to change the annotation(Text) for very case views manually.
i think i should define an expression that references 'current case' but i don't know how to ..

best regards

Last edited by hmasenger; September 5, 2013 at 05:05.
hmasenger is offline   Reply With Quote

Old   September 5, 2013, 08:16
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 10,832
Rep Power: 85
ghorrocks has a spectacular aura aboutghorrocks has a spectacular aura aboutghorrocks has a spectacular aura about
You can put variables in the text, such as time step, current time and many others. You can even put CEL expressions in there so it has some smarts. If that does not work you could script it with perl or a session file.

You have lots of options.
ghorrocks is offline   Reply With Quote

Old   September 5, 2013, 08:31
Default
  #3
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
pleas give me a reference to how to use perl or session file.i am not familiar with them
hmasenger is offline   Reply With Quote

Old   September 5, 2013, 08:34
Unhappy
  #4
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
Quote:
Originally Posted by hmasenger View Post
pleas give me a reference to how to use perl or session file.i am not familiar with them
i think there is a bug in CFD -post !just load more than 2 results in cfd-post and then add a text with auto annotation expression in it.then you see the text doesn't change while changing the result view!!.
hmasenger is offline   Reply With Quote

Old   September 5, 2013, 08:41
Default
  #5
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 11
singer1812 is on a distinguished road
Please list the expression you are using within the text object.
singer1812 is offline   Reply With Quote

Old   September 5, 2013, 08:51
Default
  #6
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
the expression is "ave(Total Pressure)@inlet"
i want it to be displayed at any case results while i change the result view to take a picture from contures and vectors
hmasenger is offline   Reply With Quote

Old   September 5, 2013, 09:19
Default
  #7
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 11
singer1812 is on a distinguished road
I have confirmed that behavior using CFX v14.5.7

I even created an expression in the expression editor that evaluated the expression for Case1. Made a text object, it showed that value, then changed the expression to be evaluated on Case2, the expression value updated, but the text object did not.

I tried creating 2 different text objects, with a different one for each view, the expression values remained the same.

I tried creating 2 different expressions, the same type of expression, but with one using Case1 as the case and the other using Case2, and then creating 2 text objects using the 2 different expressions, and the text ojbects remained the same.

I suggest you log this with ANSYS. If you get a solution to this, I would be interested in it.
hmasenger likes this.
singer1812 is offline   Reply With Quote

Old   September 5, 2013, 09:26
Default
  #8
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
i tried this with ansys CFX 14.5.0 and same thing happened!
don't you have any other idea how to get through this instead of time consuming challenge with ansys staff?
hmasenger is offline   Reply With Quote

Old   September 5, 2013, 09:40
Default
  #9
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 11
singer1812 is on a distinguished road
On the quick I don't. Perhaps someone else has a slick solution.

I tried to embed a \Data Reader\Case# type of logic into the expression, but couldnt quickly get it to work in the time that I am willing to spend on this.

Perhaps people smarter than I will come forward
hmasenger likes this.
singer1812 is offline   Reply With Quote

Old   September 5, 2013, 09:51
Default
  #10
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
you are smart enough my Friend.i have posted the problem to ANSYSinfo moments ago. i hope they answer the question.
thanks anyway
hmasenger is offline   Reply With Quote

Old   September 5, 2013, 15:15
Default
  #11
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 236
Rep Power: 12
brunoc is on a distinguished road
I'm not sure you're taking this into account, but when post-processing multiple cases at once the expressions should mention the case name. That means that instead of

massFlowAve(Total Pressure)@inlet

you should use

massFlowAve(Total Pressure)@CASE:casename.inlet

I've tried that here on 14.5.0 and it worked fine.

Also, text labels are not tied to which case you're visualizing. They'll show anything you tell them to show. So if you're using only one view and are switching from Case 1 to Case 2 on the 3D view, the values shown by the text label will remain the same.

If you'd like to know how to write other CEL Expressions, just enable the 'Show equivalent expression' option at the bottom of the calculator ('Tools > Funtion Calculator').

Cheers
brunoc is offline   Reply With Quote

Old   September 5, 2013, 16:59
Default
  #12
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
yes i already know that but in that way, what is the advantage of AUTO ANOTATION !!!should i change the exprestion for every single case i am trying to taking some images? can you imagine how time consuming would be to take image of some contures and vectors for several variables for 30 different result cases that you just want to be high lighted which variable refers to which case by just setting a text!??i think that doesn't make seance at all!! maybe there is a way to define an expression that refers to current view results?
hmasenger is offline   Reply With Quote

Old   September 5, 2013, 21:43
Default
  #13
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 236
Rep Power: 12
brunoc is on a distinguished road
Yeah, that's not how Annotations work. They show you the value you tell them to show. Period. And if you have an expression such as massFlowAve(T)@inlet and several cases loaded, CFD-Post can't know which case it needs to use for the calculation. I do think what you said is a good idea, though.

Still, if all you want to do is export some calculated values from a bunch of results file, then loading them all at once is really not the way to do it. You see, the ability to load more then one result at a time is meant to compare them side-by-side. That's why the 'Case Comparison' feature only uses two Cases. The idea is to make qualitative comparisons (contours, planes, streamlines, etc). Yes, you can do quantitative comparisons too, but then you need to be explicit about the results you want.

To just export values across a list of result files, what you want is a script file that loads each result and exports the desired values to a text file in a sequence. It's not hard to do that with Perl. I don't have an example with me right now, but I can send you one tomorrow.

Cheers
hmasenger likes this.
brunoc is offline   Reply With Quote

Old   September 6, 2013, 02:36
Default
  #14
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
thanks bruno for your nice answer.
i am not familiar with pearl or the script thing mentioned .would you pleas show me a way that i can express the inlet pressure in every picture taken from every case result? i need to be able to have some images from contures and vectors from every cases and i need them to be highlighted that which pic refers to which case result in report. i am totally exhausted with pasting case conditions typed in Microsoft paint for each countor and vector plot !!
your guides would really help me trough this problem
best regards
hmasenger is offline   Reply With Quote

Old   September 6, 2013, 08:39
Default
  #15
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 11
singer1812 is on a distinguished road
Hamed:

Really look into perl for post processing stuff. It makes your life much easier.

Below is a sample script which loads in a results (my results were titled with numbers so it was easy to loop through the naming, you might have to get more creative). The view is already setup in post, so i dont have perl scripting for that (it is the same for all pics). The script outputs a jpg called cfxOutpu.jpg and then changes its name to aviod overwriting.

Pay close attention to syntax as using perl in CFX requires additional "!" to signify it is a perl command:



!for($i=1;$i<=145;$i+=1) {
!$b=($i-1)*5+109;
!$c=$b."_001.res";
> load filename=H:/Ed_Singer/CFX_IRAD/ARL_Magnus_M910/ARL-RP-131_M910_M102_3a_3649spin_DES/$c

HARDCOPY:
Antialiasing = On
Hardcopy Filename = H:/Ed_Singer/CFX_IRAD/ARL_Magnus_M910/DES_jpg/cfxOutput.jpg
Hardcopy Format = jpg
Hardcopy Tolerance = 0.0001
Image Height = 620
Image Scale = 100
Image Width = 1172
JPEG Image Quality = 100
Screen Capture = Off
Use Screen Size = Off
White Background = Off
END
>print
!rename("H:/Ed_Singer/CFX_IRAD/ARL_Magnus_M910/DES_jpg/cfxOutput.jpg","H:/Ed_Singer/CFX_IRAD/ARL_Magnus_M910/DES_jpg/$b.jpg");
!}
hmasenger and sinzhao22 like this.
singer1812 is offline   Reply With Quote

Old   September 6, 2013, 10:11
Default
  #16
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 236
Rep Power: 12
brunoc is on a distinguished road
Hi Singer,

I was going to send a huge Perl script to do everything, but yours is a lot easier to understand and edit.

For reference, you can use Perl variables inside CCL commands, so instead of renaming the file afterwards you can just export it with its final name:

Hardcopy Filename = H:/Ed_Singer/CFX_IRAD/ARL_Magnus_M910/DES_jpg/$b.jpg

Cheers.
hmasenger likes this.
brunoc is offline   Reply With Quote

Old   September 6, 2013, 10:50
Default
  #17
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 494
Rep Power: 11
singer1812 is on a distinguished road
Regarding the perl within ccl, I seem to remember I tried that with this script (it is a few years old) and the naming was having some sort of issues. Dont remember what it was, but ultimately I just ended up just renaming.

Of course Hamed can tailor it to his needs.
singer1812 is offline   Reply With Quote

Old   September 7, 2013, 00:24
Default
  #18
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 8
hmasenger is on a distinguished road
thanks dear frinds.
you are absolutely CFD experts.it would take me a year to find such a script .
hmasenger 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
Transient animation performance in CFX 5.5 POST Sjoerd Romkes CFX 8 February 5, 2013 15:53
CFX post legend modification mactech001 CFX 3 December 25, 2011 23:12
How to get reynolds stress values in POST CFX syler3321 CFX 5 March 17, 2011 01:23
Variedness of contours in CFX post Jia CFX 6 October 4, 2010 07:36
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 8 March 12, 2008 05:58


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