CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Outputing scene pictures from a cluster (https://www.cfd-online.com/Forums/star-ccm/94542-outputing-scene-pictures-cluster.html)

Kasey November 18, 2011 11:14

Outputing scene pictures from a cluster
 
I am in a group using Star-CCM+ to measure drag on a locomotive. One thing that the company we are doing the work for wants is more pictures of pressure and velocity profiles around the locos. We are meshing and solving these simulations in two separate steps using a cluster. What we have been dong is bringing the meshed file, or the solved file back into star ccm, but now we have such huge files that it isn't working.

I have tried setting up a java macro to export these scenes, but it was never working out to give me the image I wanted.

Any ideas on coding an image export into the run script for a cluster?

Thanks.

rwryne November 18, 2011 12:44

Quote:

Originally Posted by Kasey (Post 332689)
I am in a group using Star-CCM+ to measure drag on a locomotive. One thing that the company we are doing the work for wants is more pictures of pressure and velocity profiles around the locos. We are meshing and solving these simulations in two separate steps using a cluster. What we have been dong is bringing the meshed file, or the solved file back into star ccm, but now we have such huge files that it isn't working.

I have tried setting up a java macro to export these scenes, but it was never working out to give me the image I wanted.

Any ideas on coding an image export into the run script for a cluster?

Thanks.


No need for a script. Open the scene you want, and go to the Update item in the properties tere. It lets you save off pictures of that scene at certain iteration steps. (i.e. every 100, 10, whatever)

abdul099 November 19, 2011 08:00

rwyne is right, you only need some lines in your macro when you want to save the same scene in different views or display different quantities.

There was a memory leak at least until version 6.02. After some time steps I got a "Heap space out of memory exception", when my simulation contained a lot of complex scenes. In this case, it would be better to add some lines to the macro and use only a few scenes and change the view, hardcopy, change the view, hardcopy etc... and solve after you've got all pictures for the current time step / iteration.

When you want to code something, just record a macro on a small, simple case and add this lines at the appropriate position to your run macro. You only have to make sure, the variable names (e.g. scene names) are the same and the applied view is the one you want to see.
It's also possible to execute a macro from your macro, but when you're not very familiar with macro programming, I recommend to copy and past the lines from a recorded macro.

Kasey November 22, 2011 10:14

Thanks for the help. I will try that out. The difficulty I had with using a macro, and hopefully it's not the same when saving at certain iterations, is that most of the time I didn't really know how to get the macro to zoom in on or display exactly what I wanted. For example sometimes when I wanted to export a mesh scene after the volume mesh, it would sometimes display the wind tunnel that I created around the part, and sometimes not. Sometimes it would be zoomed in, but other times the zooming would be way out to where I couldn't see what I wanted. All this with the same macro, which I recorded to have the scene hardcopied from the orientation I wanted. I must have screwed up on something.

I would also like to be able to get a visual check of the mesh before I send it into the solver. Would it be best to toil with the macro, or is there a way to do the update as the meshing finishes?

thanks

abdul099 November 23, 2011 15:26

When you just output the image, it will write the scene as you can see it when you would open the scene. It will show the same boundaries, representation etc.
The macro gives you more flexibility since you can code some lines to change the view, apply another representation etc.
Usually it works fine, it should always give the same view once you've recorded it. When it gives different views, it might be due to a slow update of the scene, so the macro tries to hardcopy the scene although it's not updated correctly. Just go to your macro and delete all unnecessary changes of views since the recorded macro contains ALL commands, even when just zooming in a little. When that doesn't help, just try to hardcopy it twice with the same file name.

You can also code your macro to hardcopy a scene and do nothing until you've inspected the picture and tell it to continue, but of course that will add some complexity. When you don't do that interactively, maybe let the macro loop to look for a file with a specified name, like "continue" and break out of the loop when the file is present. Especially the command to continue is somehow ungainly.
But on the other hand, you should maybe work on your process to make it stable enough, so you don't have to inspect the mesh by your own before running it.

What you can't do is to mesh your case, apply a representation and output the image WITHOUT a macro. The problem is, you can't apply the representation without using a macro or doing it by hand.


All times are GMT -4. The time now is 05:43.