CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CD-adapco (http://www.cfd-online.com/Forums/cd-adapco/)
-   -   macro editing in STAR-CCM+ (http://www.cfd-online.com/Forums/cd-adapco/56873-macro-editing-star-ccm.html)

JJ November 13, 2008 06:02

macro editing in STAR-CCM+
 
Hi Folks,

I'd like to export a few lines of data from my star-ccm+ model every time step.Could anyone give me tips on how to edit a macro for so that the process is repeated each time-step without overwriting?

Thanks for your help

ping November 13, 2008 10:23

Re: macro editing in STAR-CCM+
 
solve from within a Java macro

then in the macro have an infinite loop within loop

step one time step

print as below end loop

Here is a bit of code for openning and writing to a file:

String str1;

FileOutputStream fos;

DataOutputStream dos;

try {

File outFile= new File("MyFile.txt");

FileWriter out = new FileWriter(outFile);

// put your loop in here

str1 = "build your vars here" + " " + Area + " " ;

out.write( str1 );

out.close();

} catch (IOException e) {

e.printStackTrace();

}


JJ November 13, 2008 18:53

Re: macro editing in STAR-CCM+
 
Thanks for your help ping, much appreciated


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