I did not create a monitor point at the start of the simulation. How can I now extract monitor point information from a results file?
The easiest way to get the time history of a monitor point is to set up a monitor point in CFX-Pre. The solver will then output the monitor point information for every time step. If you don't or forget to do this you can use a transient results file to construct a time history. Obviously you will only have time data points for the times at which a transient result was written. The basic idea is to create a probe in CFX-Post and write out the value of the probe for each of the times the result file has a solution. Below is an example CFX-Post session file that automates the process. #----------------------------------------------------------------------- # Variable declaration #----------------------------------------------------------------------- ! use strict; ! my ($probe, $string, $variable, $varUnits, $locator); ! my ($nSteps, $stepInterval, $iStep, $currentTimestep, $time); ! local *FILE; ! $locator = "Point 1"; ! $variable = "HeavyGas.Molar Fraction"; ! $varUnits = " "; ! $nSteps = 60; ! $stepInterval = 60; #----------------------------------------------------------------------- # Create the monitoringpoint #----------------------------------------------------------------------- POINT:$locator Apply Instancing Transform = On Colour = 1, 1, 0 Colour Map = Rainbow Colour Mode = Constant Colour Scale = Linear Colour Variable = $variable Colour Variable Boundary Values = Hybrid Culling Mode = No Culling Domain List = All Domains Draw Faces = On Draw Lines = Off Instancing Transform = Default Transform Lighting = On Line Width = 2 Max = 0 [mol mol^-1] Min = 0 [mol mol^-1] Node Number = 1 Option = XYZ Point = 4.5 [m], 5.6 [m], 19.1 [m] Point Symbol = Crosshair Range = Local Specular Lighting = Off Surface Drawing = Smooth Shading Symbol Size = 1.0 Transparency = 0.0 Variable = Pressure Visibility = On END #----------------------------------------------------------------------- # Open outputfile #----------------------------------------------------------------------- ! open(FILE, ">probe.txt"); ! $string = sprintf("%s , %s [%s] n" , "time [s]", $variable, $varUnits); ! print FILE $string; #----------------------------------------------------------------------- # Loop over the timesteps and get the probe data for the monitoring point #----------------------------------------------------------------------- ! for ($iStep = 0; $iStep < $nSteps; $iStep++){ ! $currentTimestep = $iStep*$stepInterval; DATA READER:DATA READER Current Timestep = $currentTimestep END > load ! $probe = probe($variable ,$locator); ! $time = probe("Time" ,$locator); ! $string = sprintf("%f , %f n" , $time, $probe); ! print FILE $string; !} **** Entered By: dsclarke @ 11/16/2006 03:34 PM **** |
||
|