CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Show solution data at certain time steps..

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 24, 2009, 11:05
Question Show solution data at certain time steps..
  #1
New Member
 
Peres
Join Date: Jul 2009
Posts: 22
Rep Power: 16
peresah is on a distinguished road
Help :-)

Hope someone can help with this basic task...

I would like to access the raw solution data at certain time steps during my transient simulation, not just a "hard copy" of a plot/scene...

I have successfully used the Auto Export to make a CCM-file with the Append option enabled, but once the file has been created and the simulation is finished, how do I actually get to view the data from each time step?

If this is not possible with the CCM-format, is it possible with some of the other available formats... Or do you have to write a macro for this?

I would appreciate any response - thanks!
peresah is offline   Reply With Quote

Old   July 27, 2009, 06:05
Default
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 260
Rep Power: 18
Maddin is on a distinguished road
Don't know if this works in 4.04 but in 4.02 you have to write all data's via export or hardcopy to look after the simulation is fine.
Other way could be the auto save but I think this isn't a good solution.
Maddin is offline   Reply With Quote

Old   July 27, 2009, 07:05
Default
  #3
New Member
 
Peres
Join Date: Jul 2009
Posts: 22
Rep Power: 16
peresah is on a distinguished road
Hi Maddin

Thanks for your reply. I'm not sure you understood, so I'll try to clarify. I know how to auto export the data. But how do I "import"/show the data, e.g. show the velocity profile along a vertical line for each time step. I don't want just an image ("hard copy"), but the actual raw data.

After crawling through the forum, I think I've come up with a solution: Record a macro with a loop that runs a single time-step, export the raw data as a csv-file and repeats...

Kindly
Peres
peresah is offline   Reply With Quote

Old   July 27, 2009, 07:32
Default
  #4
Senior Member
 
Join Date: Mar 2009
Posts: 260
Rep Power: 18
Maddin is on a distinguished road
Hmm maybe you should write a scene file for proVis? But I didn't worked much with this.
Maddin is offline   Reply With Quote

Old   July 28, 2009, 08:10
Default Provis?
  #5
New Member
 
Peres
Join Date: Jul 2009
Posts: 22
Rep Power: 16
peresah is on a distinguished road
Thanks Maddin. I've tried googling Provis, but get ambigious results. Do you know where I can possibly obtain this software?
peresah is offline   Reply With Quote

Old   July 28, 2009, 08:52
Default
  #6
Senior Member
 
Join Date: Mar 2009
Posts: 260
Rep Power: 18
Maddin is on a distinguished road
It's a part of stardesign. Maybe StarView+ can also help you.
Under Windows with STARCAT5 the post-processing is with provis (but there I have an older version of starccm).
Maddin is offline   Reply With Quote

Old   July 28, 2009, 11:16
Default
  #7
New Member
 
Peres
Join Date: Jul 2009
Posts: 22
Rep Power: 16
peresah is on a distinguished road
Ahh, I found provis, hidden in the stardesign directory... I'll try to play around with it , thanks.

By the way, I did make a macro (see below), named exporttransient.java, which does the job. The only thing I haven't figured out yet is if there's a way to automatically determine (1) if the stopping criteria have been met or (2) solution has become instable, so the loop knows when to end. The present approach attempts to resolve (1) but I'm not sure if it's working, so it requires an attentive user :-)

Quote:
package macro;

//Default imported packages
import java.util.*;
import star.common.*;
import star.base.neo.*;
import star.vis.*;

//Special imported packages for this class
import java.io.File;

//Class definition
public class exporttransient extends StarMacro {

public void execute() {

//Initialize variables
String Fname;
double Time;

//Set base path and extension of export file, and name of plot
String BasePath = "/home/username/dir/";
String Ext = ".csv";
String PlotName = "Velocity profile";

//Get references to current simulation, solution and plot
Simulation MySim = getActiveSimulation();
Solution MySol = MySim.getSolution();
XYPlot MyPlot = ((XYPlot) MySim.getPlotManager().getObject(PlotName));

//Extract file name and title (without extension) from simulation
File MyFile = new File(MySim.getSessionPath());
String SimName = MyFile.getName();
String SimTitle = SimName.substring(0,SimName.lastIndexOf("."));

//Initiaize solotion - else plot will be empty
MySol.initializeSolution();

//Step through iteration
while (IsCriteriaSatisfied(MySim) == false) {

//Run a single step and wait until the iteration has been completed
MySim.getSimulationIterator().step(1, true);

//Old: Make tabular data from plot
//InternalDataSet MyData = ((InternalDataSet) MyPlot.getDataSetGroup().getDataSet("line y=0.25 x=0"));

//Generate filename
Time = MySol.getPhysicalTime();
Fname = BasePath + SimTitle + "_time_is_" + Double.toString(Time) + "sec" + Ext;

//Export file
//Old: MySim.getDataSetManager().writeCSVDataSet(MyData,r esolvePath(Fname));
MyPlot.export(resolvePath(Fname));

//Output message
MySim.println("Exported plot " + PlotName + " as " + Fname);

} //Exit loop
} // Exit method

private boolean IsCriteriaSatisfied(Simulation MySim) {

PhysicalTimeStoppingCriterion MyCrit1 = ((PhysicalTimeStoppingCriterion) MySim.getSolverStoppingCriterionManager().getSolve rStoppingCriterion("Maximum Physical Time"));

StepStoppingCriterion MyCrit2 = ((StepStoppingCriterion) MySim.getSolverStoppingCriterionManager().getSolve rStoppingCriterion("Maximum Steps"));

//Return the IsSatisfied value for enabled criteria
if (MyCrit1.getIsUsed() && MyCrit2.getIsUsed())
return MyCrit1.getIsSatisfied() || MyCrit2.getIsSatisfied();

else if (MyCrit1.getIsUsed())
return MyCrit1.getIsSatisfied();

else if (MyCrit1.getIsUsed())
return MyCrit2.getIsSatisfied();

else return false;
} //Exit method
} //Exit class
peresah is offline   Reply With Quote

Old   August 31, 2009, 19:33
Default Updated
  #8
New Member
 
Peres
Join Date: Jul 2009
Posts: 22
Rep Power: 16
peresah is on a distinguished road
For those interested, a newer version and documentation for the macro can be found on Edinburgh University's Wiki for Star-users.

Cheers
Peres
peresah is offline   Reply With Quote

Old   May 12, 2010, 05:03
Default
  #9
Member
 
Ivan
Join Date: Aug 2009
Posts: 63
Rep Power: 16
IvanCFD is on a distinguished road
Hi all,

I am about to run a unsteady simulation on Fluent and I would need to export a number of variables on a certain plane of the grid (x-,y- and z- velocities, and x-vorticity) every time step to be post-processed with another software (Matlab).

So far I've exported data from steady simulations, at the end of them, once converged. However I've never done this before for unsteady simulations.

I would much appreciate any light you could give me on this.

Cheers,

Ivan.
IvanCFD is offline   Reply With Quote

Old   October 23, 2010, 19:56
Default Reading in CCM/SBD files for post processing
  #10
New Member
 
PK
Join Date: Oct 2010
Posts: 9
Rep Power: 15
pavko718 is on a distinguished road
Hi Peresah,

In the current version of STAR-CCM+ (5.04) it's possible to read .ccm files back into a blank simulation WITH the field function saved in them. These should appear in the Filed Function list under Tools in the simulation tree.

This feature may even be available in earlier versions, but nothing older than 5.02.

If you are only interested in surface data, such as temperature or other quantity only on the surface, the .sbd binary file format may be another option. This format is preferable for saving surface data (geometry and functions) and can be easily and quickly read back into a blank simulation.

Regards,
Pavel
pavko718 is offline   Reply With Quote

Old   December 29, 2014, 20:14
Default
  #11
Member
 
Join Date: Nov 2014
Posts: 88
Rep Power: 11
hwsv07 is on a distinguished road
Quote:
Originally Posted by IvanCFD View Post
Hi all,

I am about to run a unsteady simulation on Fluent and I would need to export a number of variables on a certain plane of the grid (x-,y- and z- velocities, and x-vorticity) every time step to be post-processed with another software (Matlab).

So far I've exported data from steady simulations, at the end of them, once converged. However I've never done this before for unsteady simulations.

I would much appreciate any light you could give me on this.

Cheers,

Ivan.

I have the same issue as well.

I want to export the data (in csv format) at different time steps of the simulation so that I can process the data in matlab.

any idea how to do this automatically?

I have too many timesteps and doing it manually just takes too much time.
hwsv07 is offline   Reply With Quote

Old   December 30, 2014, 02:57
Default
  #12
Member
 
kris
Join Date: May 2014
Posts: 73
Rep Power: 11
kguntur is on a distinguished road
HWSV07,

You can do it using a macro. the macro could run a few time steps, export data as a csv and repeat that. I believe that you can append new data to existing csv file so you can get all time steps in a single file.

Hope this helps.
kguntur is offline   Reply With Quote

Old   January 1, 2015, 12:53
Default
  #13
Member
 
Join Date: Nov 2014
Posts: 88
Rep Power: 11
hwsv07 is on a distinguished road
Quote:
Originally Posted by kguntur View Post
HWSV07,

You can do it using a macro. the macro could run a few time steps, export data as a csv and repeat that. I believe that you can append new data to existing csv file so you can get all time steps in a single file.

Hope this helps.
hi kguntur

but i would still have to manually run the macro to save the data at specified timestep right?
hwsv07 is offline   Reply With Quote

Old   January 3, 2015, 07:54
Default
  #14
Member
 
kris
Join Date: May 2014
Posts: 73
Rep Power: 11
kguntur is on a distinguished road
hi HWSV07,

No. you don't have to run the macro manually. Suppose you have to run the simulation for 10 sec with 0.1 s time step and you want to save the data ever 1s (i.e. 10 tie steps), your macro would look something like this.

for i = 1 to 10
step 10 time steps
save data
next i

that way you are running it for 100 (10 x 10 ) time steps while saving it every 10 time steps.
Now for the actual java code, you could record a java with what you need and then edit it. It is not that difficult. Hope this helps.
kguntur is offline   Reply With Quote

Reply

Tags
data, raw, solution, time, transient

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time step size and max iterations per time step pUl| FLUENT 33 October 23, 2020 23:50
CHT. Cooled blade. Different time steps. Georg CFX 4 December 26, 2008 09:26
Collect data at every 10 time steps, npt each. Anindya FLUENT 3 July 31, 2005 08:09
Time dependent solution Thomas FLUENT 1 January 13, 2004 10:12
unsteady calcs in FLUENT Sanjay Padhiar Main CFD Forum 1 March 31, 1999 13:32


All times are GMT -4. The time now is 06:09.