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

Importing probes coordinates

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By JBeilke
  • 1 Post By ping

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2021, 02:47
Default Importing probes coordinates
  #1
New Member
 
Vlad
Join Date: Oct 2020
Posts: 13
Rep Power: 5
DrDerpy13 is on a distinguished road
Hello guys,


I am struggling for a while to import an .csv file to starccm in order to create probes from those coordinates. Does anybody have any clue how i should proceed?
DrDerpy13 is offline   Reply With Quote

Old   January 11, 2021, 03:38
Default
  #2
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 500
Rep Power: 20
JBeilke is on a distinguished road
A java macro should do the job.
JBeilke is offline   Reply With Quote

Old   January 11, 2021, 04:36
Default
  #3
New Member
 
Vlad
Join Date: Oct 2020
Posts: 13
Rep Power: 5
DrDerpy13 is on a distinguished road
Could you give me more details how to do it? I know how to import the table, but not to correlate the data with my probes
DrDerpy13 is offline   Reply With Quote

Old   January 11, 2021, 05:09
Default
  #4
Senior Member
 
Joern Beilke
Join Date: Mar 2009
Location: Dresden
Posts: 500
Rep Power: 20
JBeilke is on a distinguished road
There should be 2 ways.

1) Don't read the csv into a table but read it via the macro and create a probe for every line in the file
2) Read the csv into a table and loop over the lines of the table.
DrDerpy13 likes this.
JBeilke is offline   Reply With Quote

Old   January 12, 2021, 04:14
Default
  #5
cwl
Senior Member
 
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 436
Rep Power: 17
cwl is on a distinguished road
Quote:
Originally Posted by JBeilke View Post
There should be 2 ways.
2) Read the csv into a table and loop over the lines of the table.
Now I am curious - how can a loop over the lines of the table be implemented?

UPD The only way I can imagine - is to loop in Simulation Operations with Parameter and interpolateTable() using that parameter.
Is there any better way?
cwl is offline   Reply With Quote

Old   January 13, 2021, 08:05
Default
  #6
Senior Member
 
Ping
Join Date: Mar 2009
Posts: 556
Rep Power: 20
ping is on a distinguished road
here are two java macros from 2011 that read from and write to a star table - see class table in the api - might need mods for recent versions of star

package macro;

import star.base.neo.*;
import star.base.report.MaxReport;
import star.common.*;

/**
* This macro takes the first table it finds in the STAR-CCM+ simulation and prints the data in the 1st 4 columns
*
*/

public class JavaReadTable extends StarMacro {

Simulation sim;
Units meter;

public void execute() {
int rowStart = 0;
int colStart = 0;

sim = getActiveSimulation();
Table t = sim.getTableManager().getObjects().iterator().next ();

String format = "%0" + (Math.log10(t.getNumColumns()) + 1) + "d";
int nPoints = t.getNumRows();

for (int n = rowStart; n < nPoints; n++) {

sim.println( "Table data a, b, c, d : " +
t.getTableDataItem(n, 0) + ", " +
t.getTableDataItem(n, 1) + ", " +
t.getTableDataItem(n, 2) + ", " +
t.getTableDataItem(n, 3) ) ;

}
}

}

package macro;

import star.base.neo.*;
import star.base.report.MaxReport;
import star.common.*;

/**
* This macro takes the first table it finds in the STAR-CCM+ simulation and prints the data in the 1st 4 columns
*
*/

public class JavaWriteToTable extends StarMacro {

Simulation sim;
Units meter;

public void execute() {
int rowStart = 0;
int colStart = 0;

sim = getActiveSimulation();
Table t = sim.getTableManager().getObjects().iterator().next ();

String format = "%0" + (Math.log10(t.getNumColumns()) + 1) + "d";
int nPoints = t.getNumRows();

t.setTableDataItem(0, 0) = 1234 ;

}

}
DrDerpy13 likes this.
ping is offline   Reply With Quote

Reply


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
probes chtMultiRegionFoam (OF v7) carl_r OpenFOAM Post-Processing 1 April 30, 2020 23:21
Trouble importing airfoil coordinates into Pointwise without using iges files ColourMeRed Pointwise & Gridgen 2 February 6, 2020 18:59
[Scripting]: How to get the coordinates of a 2D airfoil @ different angles of attack? CfdIntro Main CFD Forum 2 December 12, 2017 10:23
importing point coordinates for creating probe zeta STAR-CCM+ 1 March 21, 2013 17:04
Problem With Importing Coordinates for an Airfoil Amerikaneca ANSYS Meshing & Geometry 3 July 8, 2011 07:28


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