CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   How to consider earlier timesteps for time-averaged statistics? (https://www.cfd-online.com/Forums/cfx/103770-how-consider-earlier-timesteps-time-averaged-statistics.html)

oj.bulmer June 26, 2012 09:44

How to consider earlier timesteps for time-averaged statistics?
 
I am doing a transient simulation and am storing the transient statistics at the interval of 0.01 s. I have observed that as no. of trn results gets bigger, the response of CFX solver in Workbench is sluggish and at times even takes 15 minutes to start the solver run :rolleyes:. Hence I prefer to start new simulation, with def file and initialization from earlier simulation.

As a result I have say 4 simulations from 0-30 s, 30-60 s, 60-90 s, 90-120 s. Now, when I open the 4th simulation in CFD post, it loads all the trn files (i.e 91 -120 s) but doesn't load the earlier ones.

Now, I want to see the time average result of a variable, say variable.Trnavg in CFD post for last 60 seconds. Is there a way to do it?

I have checked loading earlier time steps using time step selecter, but that doesn't influence the variable.Trnavg, meaning only the timesteps run for that simulation can influence the Trnavg.

monkey1 June 26, 2012 10:26

as far as I know there is no way to get the trnavg variable "know" the previous time steps as it is always calculated during and only for a single run.
Getting transient averages would only work by playing a script file wich reads the required value from each trn file and averages it over the time interval.

For example the following code written in a file with a .cse extension can be "played" as a "Session" in CFX Post and will write you down the required value (here the r134.Mass concentration) at a specified point (Probe Point) for every time step in a .csv file. You will the have to do the time averaging by yourself in Excel or similar programs.

INTERNAL POINT:Probe Point
Option = XYZ
Point = 6.5 [m], 7.5 [m], 0.015 [m]
END

LIBRARY:
CEL:
EXPRESSIONS:
Konz ave1 = probe(r134a.Mass Concentration)@Probe Point
END
END
END
#
# Define outfile
#
!$outfile = "myEXPRESSION.csv";
#
# Open outfile
#
!open(OUT, ">$outfile");
#
# Get the timestep values from the current results file
#
!$timestepList = getValue("DATA READER", "Timestep List");
!@timesteps = split(/, /, $timestepList );
#
# Loop over timesteps
#
! foreach $ts ( @timesteps ) {
#
# Load current timestep
#
> load timestep=$ts
! $time = getValue( "DATA READER", "Current Timevalue");
! $time_formatted=sprintf("%.2f",$time);
! ($konzave1,$unit)=evaluate("Konz ave1");
! printf "%20s,%15.8e\n",$time_formatted, $konzave1;
! printf OUT "%20s,%15.8e\n",$time_formatted, $konzave1;
!}
!close(OUT);

Hope this helps.

oj.bulmer June 26, 2012 10:40

Thanks, I will have a look at it.

Though, from first thought, it seems like this will only give you the value at particular point. Is there a way to find the value at all domain? E.g. for finding out the time averaged contour plots or chart of the variable varying on line in CFD Post?

Regards
OJ

monkey1 July 3, 2012 05:24

hmm
I would suggest you look for the set of functions available in cfx post and how and where (on a point, plane or domain) to use them. Should be written somewhere in the cfx user guide. Or you can try to record a session in post while clicking together whatever you want to do. Then you can have a look at the .cse file and see what the commands are. That's how I did it till now.


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