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

CFX post-exprestion for reffrencing a case

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

Like Tree11Likes
  • 2 Post By singer1812
  • 1 Post By singer1812
  • 3 Post By brunoc
  • 1 Post By brunoc
  • 2 Post By singer1812
  • 1 Post By brunoc
  • 1 Post By soumitra2102

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2013, 04:43
Default CFX post-expression for referencing a case
  #1
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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 06:05.
hmasenger is offline   Reply With Quote

Old   September 5, 2013, 09:16
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,665
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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, 09:31
Default
  #3
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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, 09:34
Unhappy
  #4
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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, 09:41
Default
  #5
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
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, 09:51
Default
  #6
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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, 10:19
Default
  #7
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
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 and aero_head like this.
singer1812 is offline   Reply With Quote

Old   September 5, 2013, 10:26
Default
  #8
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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, 10:40
Default
  #9
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
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, 10:51
Default
  #10
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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, 16:15
Default
  #11
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 277
Rep Power: 21
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, 17:59
Default
  #12
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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, 22:43
Default
  #13
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 277
Rep Power: 21
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, 03:36
Default
  #14
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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, 09:39
Default
  #15
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
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, 11:11
Default
  #16
Senior Member
 
Bruno
Join Date: Mar 2009
Location: Brazil
Posts: 277
Rep Power: 21
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, 11:50
Default
  #17
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
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, 01:24
Default
  #18
Senior Member
 
hmasenger's Avatar
 
hamed
Join Date: Apr 2009
Posts: 148
Rep Power: 16
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

Old   February 11, 2021, 21:05
Default Exactly what I wanted! Listing Variables concerned with different cases
  #19
Member
 
Soumitra Vadnerkar
Join Date: Aug 2018
Posts: 70
Rep Power: 7
soumitra2102 is on a distinguished road
Quote:
Originally Posted by brunoc View Post
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

I simply wanted to extract area averaged values of a variable (pressure) at a boundary (inlet) each from different cases and list them in a Table all in ANSYS CFD-Post.
But the Table in ANSYS CFD-Post does not allow variables from different cases to appear in a single Table type report unlike the Chart type report option. So, I used the above-mentioned syntax with the appropriate case name, and it worked exactly how I wanted. It's like you beat the software at this ridicules hurdle!

just use this syntax and you can access same variables yet with different result cases in ANSYS CFD-Post
=<expression>(<variable>)@CASE:<casename>.<boundary>

Thank You
aero_head likes this.
soumitra2102 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get reynolds stress values in POST CFX syler3321 CFX 6 January 1, 2017 08:54
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 9 August 16, 2015 15:53
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
Variedness of contours in CFX post Jia CFX 6 October 4, 2010 08:36


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