Users of CFX who utilize discrete particles in their domain were a bit stuck for options for visualizing and analyzing that data in EnSight. The current CFX Export to EnSight format does not include the particle track information, and the Native Reader of CFX files into EnSight did not handle the read of those particle very well (extremely slow for small amount of particle, and unusable for more.). Given some recent inquiries, and bit more investigation on our end, we here at CEI have come up with an alternative approach which seems to work fairly well. We have written a python routine which translates the Particle Traces exported from CFX (to a ascii text file) into EnSight Measured data, which can then be loaded up with your EnSight model. This allows you to now visualize and analyze your CFX particle data in EnSight.
The method to get your CFX Particle Traces into EnSight via this route is as follows:
1) Within CFX, Export out EnSight Format Data for your model. This is as normal, and will export out only the continuous phase results. You will get a series of files, typically called my_case_ensight.case, my_case_ensight.geom, my_case_ensight.s1, etc.
2) Within CFX, Export out the Particle Tracks to a Particle Track file, using an ASCII format. You will typically have a single file with a “.trk” extension (PT1.trk). From within the CFX-Pre program, Select Output Control tab -- > Particles. Choose the Track File Format = "Formatted" to ensure ASCII format.
3) With both of the above information in the same directory, simply run this conv_cfxtrk.py file. You can double click on the tool in your User Defined Tools area:
The GUI presented to the user has the following options that the user needs to provide:
a.) EnSight .case file : Provide the EnSight .case file from the “HowTo Step 1”. This file will get copied to the same name, with an “_particles” added to the name, and the appropriate Measured Data information added. This new .case file can be loaded up directly subsequent times (conversion routine only needs to be run once).
b.) CFX Particle track file: Provide the exported Particle Track file from CFX, from the “HowTo Step 2”. The file specified should be ASCII, and will most likely have a “.trk” extension.
c.) Number of Timesteps to Create : Provide the number of timesteps that the Particle Traces will be re-sampled into. This number of timesteps will be used to re-sample the particle onto a single timeline for EnSight to handle.
d.) Time Option on which to base the Timeset : The user can either specify their own start and end time for the re-sampling of the particles, or let the program search for the Maximum Time of any trace, and use this as the maximum time. The default is to use the Maximum Trace to determine the maximum time. This will capture all particles, but may result in a very long time domain (following that last particle which hangs around for a long time). The only downside is that this may cause large timesteps, and the user may miss important information early on in the time domain. To resolve, either use “User Specified Time” option allowing the user to shorten the time domain to an interesting time range, and/or increase the number of timesteps to decrease the timestep change. The second option results in longer conversion times and more measured data files (which may not be desirable).
e.)User Start and End Time: If the user chooses the User Specified Time, then please specify the minimum and maximum time to be used for the particle re-sampling. These two fields are ignored if the user is using the “Max Trace” option above.
f). Particle Final Location: This option is useful for particles which are not defined for all of time. The user should specify if the particles disappear at time greater than their last known time (default), or if they remain at their last known location for time greater than specified in the Particle Track File.
g.) Number of Species : Please provide the number of species solved for in the discrete domain. This will help indicate to the routine how many variables to expect in the .trk file (as the file does not explicitly outline this). Default is zero (most common).
h.) Was Heat Transfer solved for: Please check if the Heat Transfer was solved for, so the routine knows if Temperature is located in the file (as the Particle Track file does not explicitly outline this).
Upon clicking on the “Convert” routine, the python routine will read in the .trk file, and resample the Particle Information into a single timeline, and write out Measured Data files into a subdirectory called “ensight_mea_files”. The original .case file is copied over to a new case file with “_particles.case” suffix. This new case file is then automatically loaded into EnSight. The Particle conversion routine only needs to be run once for each dataset. The next time that the user wants to load the data containing the Particle information, the user can simply load up this “_particles.case” file directly.
a.) The routine only converts a single Track file at a time. If you have more than one track file (PT2.trk, PT1.trk), you will need to run this routine multiple times, from a separate directory, as to not overwrite any previously converted files.
b.) The specification of the EnSight .case file should be the original (non "_particle.case") file. Multiple Measured data parts are not supported in EnSight, so you should ensure that you provide a case file which does not already have Measured data in it.
Should you have any questions or issues with using this routine, please do not hesitate to contact CEI ([email protected])
Version : 2.0
Updated routine to handle different ASCII format (provided by CEI GmbH) (differing number of values per line in file)
Updated routine to handle explicit min and max times provided in the Track files
Updated routine to handle gaps in the ParticleIDs
Updated routine to stop routine if supplied .case file already has Measured Data in it (Information provided in Terminal window)
Updated routine to handle .case file which is already transient (time set += 1)
Kevin Colburn, CEI ANSYS