Merging Multiple Time Periods of a Converge Result into One

Are you a ConvergeCFD user with EnSight?

Do you have a Single Dataset, but multiple time periods which you translated to Case Format? Ie you export results from Time T = 0 to T1 in one operation, then later exported from Time T2 to Time T3, and then again exported reults from Time T4 to T5?

If so, then currently you have multiple different time ‘sets’ or ‘periods’, which can’t easily read into a single session of EnSight (other than using Multiple Cases, but that is not what Cases are meant for).

Would you then like to be able to operate on this solution as though it were one complete time period from T = 0 to T5? Well, I think we have a little tool for you. This tool should provide you back with a single coherent time period (From T = 0 to T = T5) as a single case.

This little python tool takes a look at all of the .case files in your current directory, and gathers up a list of all of the files that are referenced, constants written, and time values. In then creates a internal global list of all of that infomation, and sorts it in ascending time order. It then renames all of the associated files so that they fall into a single progression in time order, and generates a NEW case file, referencing the global total time, global total constants, and the newly renamed set of variable and geometry files. The routine takes only a second to run (renames are quick), and you should be able to load up the NEW case file into EnSight.

As renaming files is perhaps a dangerous thing, the routine also writes an “undo” file as well. You can run the “undo”, and you will get back to your original set of files (if you need to for some reason).

As with any routine, there are some assumptions, limitations, and caveats. They shouldn’t be too restrictive, but here they are, so you have a better idea about what the routine is expecting:

a. All of the case files are in the same directory (the routine doesn’t go rooting around in sub directories looking for .case files to merge).

b. All the .case files in the current directory are meant to be “merged” into one. If there are some which aren’t meant to be merged, just move them temporarily to somewhere else.

c. When you exported the results (using post_convert), you ALWAYS exported the same variables. No exceptions allowed, no if’s, but’s, no coconuts. (EnSight can’t deal with some variables existing at some times, and not others…. rules are rules).

d. The time values can overlap, and be of varying delta T. The routine should handle that okay.

e. The routine assumes you have measured data (default for converge post_convert us).

f. Due to internal coding assumptions/methods, this routine is for CONVERGE users only. If you have results from OpenFOAM, or Fluent, CFx, or other solvers, please contact CEI (support@ceisoftware.com) separately. We have some prototypes for other solvers.

To run the routine, simply download the python file, and place it into the directory you want to merge Converge .case files together. Then, type :

cpython31 merge_time_case.py

After running, should you need to undo, there will be a new python file created in your directory, and that can be run via:

cpython31 merge_time_UNDO.py

This works for MAC/Linux/Win. Use a cmd shell in Windows to run the python routine.

As always, please contact if you have questions, comments, requests. We’d love to hear from you, and work with you to provide you with the best post processing experience.

-Kevin

Download Link for file:

merge_time_case

Once downloaded, simply unzip the file to find the python .py routine.