|March 24, 2009, 05:53||
Star-CCM+ Macro headache
Join Date: Mar 2009
Posts: 3Rep Power: 9
I want to write/edit an macro that extracts the velocity components (i,j,k) at predeterminde coordinates in my fluid region with the use of a point probe and have these values written to a .csv file. I have a .csv file containing all the coordinates at which i want to extract the data (nearly 400) and am able to read these coordinates into the macro and ajust the point probe acordingly, but I am having trouble extracting the velocity components at these positions. Any help in setting up the code to set a variable (xvel) equal to the i velocity component using the point probe will be greatly appreciated.
I am new user of star-ccm and have no previous experience with java so any help will be greatly appreciated.
An alternative is to insert all the point probes into the simulation and plot the different components using an XY plot, but with this method i'll have to have 3 plots (one for each velocity component and coordinate) that needs to be exported and it will leave me with more postprocessing.
Sorry for the long post and thatks in advance.
|April 16, 2009, 05:21||
Join Date: Mar 2009
Posts: 223Rep Power: 10
You are close:
1. create a Max Report, with Vel(i) component as the field, and the probe as the part - call it say Vi .
2. Create similar reports for Vj and Vk - so you now have each component of vel as a report
3. In your macro add something like
//Define some variables
double Vi, Vj, Vk ;
// Start loop over all your required probe locations using SetCoordinate etc
MaxReport maxReport_0 = ((MaxReport) simulation_0.getReportManager().getReport("Vi"));
Vi = maxReport_0.getValue();
MaxReport maxReport_1 = ((MaxReport) simulation_0.getReportManager().getReport("Vj"));
Vj = maxReport_1.getValue();
MaxReport maxReport_2 = ((MaxReport) simulation_0.getReportManager().getReport("Vk"));
Vk = maxReport_2.getValue();
// now you have the components of vel in these three variables - write to file
// repeat loop
A much easier non-java way to do it is to use an Internal XYZ Table which you then export to csv - fine if your probe points are say on a regular grid which a Presentation Grid can create. Or import the probe locations as an STL file - can't see a way to use an imported csv table as an Arbitrary probe location - that would be ideal for you!
|September 1, 2009, 08:22||
Join Date: Aug 2009
Posts: 12Rep Power: 8
how can I import probe locations from a stl-file?
How can I create a stl-file with my probe locations?
with best regards
|Thread||Thread Starter||Forum||Replies||Last Post|
|mesh algo for volume mesh in star ccm||rohit||CD-adapco||1||August 8, 2008 20:44|
|star ccm 3.04||jecil||CD-adapco||11||July 27, 2008 23:41|
|error in star ccm||maurizio||CD-adapco||3||October 16, 2007 05:17|
|Star CCM - Problem with image hardcopy quality||James||CD-adapco||2||March 14, 2007 03:36|
|Trimmed cell and embedded refinement mesh conversion issues||michele||OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...||2||July 15, 2005 04:15|