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

Modifying Session Files for CFD Post processing

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By singer1812

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 1, 2012, 17:01
Question Modifying Session Files for CFD Post processing
  #1
Senior Member
 
Crank-Shaft's Avatar
 
Ovi
Join Date: Oct 2012
Location: Sydney, Australia
Posts: 166
Rep Power: 13
Crank-Shaft is on a distinguished road
Hi all,

I have only recently started to learn about CFD Post Session features and I managed to record actions in the following sequence -
1 Create a longitudinal, stream-wise plane.
2 Create a contour of stream-wise velocity for the selected time step, which I manually selected from the instance selection menu. (I have 50 time steps now just to understand the process)
3 Save the image into the directory.

The main limitation of this is that everytime I want to replicate this sequence for each time step I have to manually select it. The file name also remains static and this causes previous images to simply be replaced with the new file in the same directory. Hence, I am currently making 50 folders (50 time-steps) and just altering the 'time-step' value at the top of the Session file re-running the sequence of actions.

Is it possible to edit the session script so that all the time steps are automatically incremented and the images are saved with the respective time steps in the title? This will save me A LOT of time and I would really appreciate the help.

Thank you
Crank-Shaft is offline   Reply With Quote

Old   November 1, 2012, 18:45
Default
  #2
Senior Member
 
Join Date: Dec 2009
Posts: 131
Rep Power: 19
mjgraf is on a distinguished road
add some perl code in the cse to handle this.
Check the documentation on how to implement perl in your cse, ccl language. This is very powerful. Have fun.


quick snippet

Code:
! @steplist = ( 31..157, 159, 160, 161 );

! foreach $curstep (@steplist) {
> load timestep=$curstep
! ($solverstep, $units) = evaluate( "Accumulated Time Step" );

DO SOME STUFF

! }
Load the final res file as you typically would for a transient. Hopefully you have state file with the setup for the image you want, load this. If you record a session where you export the image, look at this code and wrap the image export in the foreach and use the variables to modify the naming, etc.

If you are using a TEXT feature, you can add the Expression "Accumulated Time Step" and this will change as the timesteps are loaded.

Quote:
Originally Posted by Crank-Shaft View Post
Hi all,

I have only recently started to learn about CFD Post Session features and I managed to record actions in the following sequence -
1 Create a longitudinal, stream-wise plane.
2 Create a contour of stream-wise velocity for the selected time step, which I manually selected from the instance selection menu. (I have 50 time steps now just to understand the process)
3 Save the image into the directory.

The main limitation of this is that everytime I want to replicate this sequence for each time step I have to manually select it. The file name also remains static and this causes previous images to simply be replaced with the new file in the same directory. Hence, I am currently making 50 folders (50 time-steps) and just altering the 'time-step' value at the top of the Session file re-running the sequence of actions.

Is it possible to edit the session script so that all the time steps are automatically incremented and the images are saved with the respective time steps in the title? This will save me A LOT of time and I would really appreciate the help.

Thank you
mjgraf is offline   Reply With Quote

Old   November 1, 2012, 20:48
Default
  #3
Senior Member
 
Crank-Shaft's Avatar
 
Ovi
Join Date: Oct 2012
Location: Sydney, Australia
Posts: 166
Rep Power: 13
Crank-Shaft is on a distinguished road
Thanks so much for that informative post.

I have no experience with Perl language however, I know some basics of C and MATLAB.

I will try to implement these ideas perhaps, with the aid of a friend and you report back on progress. At the very least, the current session file I created saves me about 50-60 separate mouse actions and this will hopefully save some significant time.

This is OK for the preliminary stages however, when I switch to a fully transient study with a LES I will definitely need to try and implement automated capturing, hard-copy saving and appending of filenames.

Does anyone else have any similar experiences or encounters they can share?
Crank-Shaft is offline   Reply With Quote

Old   November 2, 2012, 07:44
Default
  #4
Senior Member
 
Crank-Shaft's Avatar
 
Ovi
Join Date: Oct 2012
Location: Sydney, Australia
Posts: 166
Rep Power: 13
Crank-Shaft is on a distinguished road
Code:
! @steplist = ( 31..157, 159, 160, 161 );
! foreach $curstep (@steplist) { > load timestep=$curstep 
! ($solverstep, $units) = evaluate( "Accumulated Time Step" ); 
DO SOME STUFF  ! }
I have copied my main case file and CFD Post state file and tried the code snippet you provided. I also managed to record a new session including file opening, loading results, creating a contour, creating a chart, exporting both and saving the state.

This was implemented within your code snippet and I found that the time steps were actually being loaded iteratively as the for loop suggests. This is a very positive result. I verified the functionality by choosing time step 5 and then when the session is played back it reverts to the array {1,2} as documented in the session script. Thank you so much for your assistance.

Now I will need to try and implement a feature which appends file names with the "Accumulated Time Step" which hasn't been successful yet.

I have attached my current script. I welcome any suggestions and feedback.
Attached Files
File Type: zip 50TimeSteps-SSTCase1 - Trial1 - Copy.zip (2.3 KB, 172 views)
Crank-Shaft is offline   Reply With Quote

Old   November 2, 2012, 11:11
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
Something like below? I havent checked it, so you will have to debug exact details.

# Load a transient file and read the time step list
> load filename=myFile.res
!$timestepList = getValue("DATA READER", "Timestep List");
!@timesteps = split(/, /, $timestepList );


! foreach $ts ( @timesteps ) {
> load timestep=$ts
!$c="P".$ts."B.csv";
! open(FH,">$c");
! $val = ave("Pressure", "Point 1");
! $time = getValue( "DATA READER", "Current Timevalue");
! print FH "$ts $time $val\n";
!close FH;
!}
yuqian likes this.
singer1812 is offline   Reply With Quote

Old   November 4, 2012, 21:17
Default
  #6
Senior Member
 
Crank-Shaft's Avatar
 
Ovi
Join Date: Oct 2012
Location: Sydney, Australia
Posts: 166
Rep Power: 13
Crank-Shaft is on a distinguished road
I haven't had the chance to try this yet. I will implement this as soon as I can and report back on progress.

Thanks for your help Singer.
Crank-Shaft is offline   Reply With Quote

Old   November 11, 2012, 04:46
Post
  #7
Senior Member
 
Crank-Shaft's Avatar
 
Ovi
Join Date: Oct 2012
Location: Sydney, Australia
Posts: 166
Rep Power: 13
Crank-Shaft is on a distinguished road
Thanks for you help so far everyone.

I have recently extracted some data from the flow domain I am analysing and I am finding it a little difficult to interpret the results.

Please refer to the attached images including the line locations which were used for the profile data and I would really appreciate if someone is able to clarify the following areas of confusion for me -
- The standard SST model which is present in Fluent is following Menter's formulation and is applicable in this case since the wall-y+ values are low enough. Hence, I assume that the blending feature is being used to resolve the free-stream and the near-wall region.
- Exact same meshes were used for both simulation cases and all settings are identical except the low-Re correction. Why is Wall-y+ values are significantly higher for the low-Re model?
- Is is reasonable to try and assess the length of the recirculation region and the point of reattachment from the 0 wall shear stress? I imagine that the shear stress values are dependent on the skin-friction coefficient, which is based on the vel. magnitudes. What could be an explanation for the variation between the two models here?

A little off-topic from the session files however, I didn't necessarily think this required a new thread.

Thanks for your guidance.
Attached Images
File Type: jpg VelU-X50.jpg (41.0 KB, 109 views)
File Type: jpg VelU-X100.jpg (42.1 KB, 72 views)
File Type: jpg VelU-X200.jpg (39.9 KB, 61 views)
File Type: jpg WallShear.jpg (20.5 KB, 45 views)
File Type: jpg WallY+.jpg (21.0 KB, 27 views)

Last edited by Crank-Shaft; November 11, 2012 at 06:00. Reason: Attachments included
Crank-Shaft is offline   Reply With Quote

Reply

Tags
cfd-post, cfx, fluent 14, post procesing, timestep cfx post, timestep selection cfx, unsteady flow


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
Post Processing Transient Data chrisoturner FLUENT 2 August 18, 2017 02:53
CFX Post: .trn files bunching? user_of_cfx CFX 9 December 3, 2015 04:48
post processing field average in cht moritzhoefert OpenFOAM Pre-Processing 0 January 11, 2012 10:41
Ansys Post processing ano999 ANSYS 1 May 27, 2011 16:24
post processing in CFD MANISH BHARGAVA Main CFD Forum 0 October 17, 1998 20:51


All times are GMT -4. The time now is 12:54.