CFD Online Discussion Forums

CFD Online Discussion Forums (
-   STAR-CCM+ (
-   -   how to extract velocity values from cells (

fromain September 18, 2012 18:10

how to extract velocity values from cells

I'd like to run transient simulations but keep the history of the solution with StarCCM+ v6.
Right now I'm updating a table and exporting it as csv every n-time steps since someone described how to do that from a macro.
However I'd like to use a binary file format like HDF5 which is more compact and which I know how to post-process (not to mention that tables are exported with only 11 digits).

I am able to write HDF5 files from java macros, but I don't know how to iterate through the cells to collect the values of velocity (or whatever quantity). I also thought about updating a table like before but then iterating through the fields and export the values myself, but the java API documentation is rather thick and hard to understand.

Would someone have knowledge about that or point me towards similar macros that might already exist (i couldn't find any)?


abdul099 September 20, 2012 17:50

Maybe you can export a table and access the exported file to write the HDF5 file. Accessing an exported csv file does not depend on the CCM+ API, so you don't need to bother about the "hard to understand" API. I'm sorry for being a bit harsh, but the CCM+ API is as good as the Oracle Java API or any other - that's the f... Java API style most people don't understand. But when you'll spend the time to work with it, you'll understand why it's still pretty useful.

Anyway, it is NOT possible to directly access values on a cell basis- CCM+ does not allow this. You can access a field via field functions (which doesn't help you) or you can access the centroid position via tables. But you can't access cell #374675879 or any other cell. Either you can work with csv files or one of the export formats, or you can't do it.

By the way, forget about "only" 11 digits when exporting tables. CCM+ is a single precision code, the values you get are only precise for the first 6 or seven digits. All other digits are just bullshit, no matter which format you use since the internal precision is not good enough. There should be double precision versions available for Linux with v7.04, but to use them is unnecessary for most cases except some special cases.
Think about model errors, boundary conditions and discretization errors before you think about exporting 11 digits.

ximik May 27, 2015 14:12

user code
you may want to check out Running > Working with User Code sections of the User Guide. User code should give you a deeper access to the Star-CCM+ solver.

All times are GMT -4. The time now is 23:19.