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

Spilt surface by patch

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2021, 12:44
Default Spilt surface by patch
  #1
New Member
 
Join Date: Mar 2021
Posts: 4
Rep Power: 3
Sandland is on a distinguished road
Hi all

I am trying to write a Macro, that imports an .stl file and use the "Split by patch" command and rename some of the patches to "New_Shaft". This will be done in a loop for a bunch of simulations.

The problem I run in to is that the IDs/numbers of the "Part surface Patches" changes every time I import a new STL file. The position in the list of ID are the same every time, so is there any way I can choose it from the position or get the list with the IDs instead of referring to the IDs directly (or maybe do it another way)?

The comand I use is as follow, where "13898, 13899, 13904" is number 4, 5 and 10 in the list of IDs:

Code:
cadPart_0.splitPartSurfaceByPatch(partSurface_0, new IntVector(new int[] {13898, 13899, 13904}), "New_Shaft");
Figures:
Fig1.png
Fig2.png
Sandland is offline   Reply With Quote

Old   April 26, 2021, 05:00
Thumbs up Same question, any help?
  #2
New Member
 
Sam
Join Date: Sep 2018
Posts: 2
Rep Power: 0
CY80 is on a distinguished road
I encounter the exact same problem during trying to ease my work load by Marco, have you figure it out, SandLand?
CY80 is offline   Reply With Quote

Old   April 27, 2021, 05:06
Default A workaround
  #3
New Member
 
Sam
Join Date: Sep 2018
Posts: 2
Rep Power: 0
CY80 is on a distinguished road
An update for Sandland and all the people may encounter the same problem:

I found that the using split by angle function can fix my question, the name ('Block Surface 1', 'Block Surface 2', ...) seems repeating at the same surface every time I call the function (at least so far).

Attached the my recorded Marco FYR, but record for your own simulation is highly recommended:

private void SplitSurfaces() {

Simulation simulation_0 =
getActiveSimulation();

SimpleBlockPart simpleBlockPart_0 =
((SimpleBlockPart) simulation_0.get(SimulationPartManager.class).getP art("Domain"));

PartSurface partSurface_0 =
((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartS urface("Block Surface"));

simpleBlockPart_0.getPartSurfaceManager().splitPar tSurfacesByAngle(new NeoObjectVector(new Object[] {partSurface_0}), 89.0);

partSurface_0.setPresentationName("Outlet");

PartSurface partSurface_1 =
((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartS urface("Block Surface 2"));

partSurface_1.setPresentationName("Sides -Y");

PartSurface partSurface_2 =
((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartS urface("Block Surface 3"));

partSurface_2.setPresentationName("Bottom");

PartSurface partSurface_3 =
((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartS urface("Block Surface 4"));

partSurface_3.setPresentationName("Top");

PartSurface partSurface_4 =
((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartS urface("Block Surface 5"));

partSurface_4.setPresentationName("Sides +Y");

PartSurface partSurface_5 =
((PartSurface) simpleBlockPart_0.getPartSurfaceManager().getPartS urface("Block Surface 6"));

partSurface_5.setPresentationName("Inlet");
}
CY80 is offline   Reply With Quote

Reply

Tags
macro java, split a surface, stl file

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
[OLAFLOW] The OLAFLOW Thread Phicau OpenFOAM Community Contributions 438 January 30, 2023 11:44
steadyUniversalMRFFoam Tutorial fails in MixingPlane HenrikJohansson OpenFOAM Bugs 0 February 14, 2019 05:48
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 16:03
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 05:04
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


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