Simcenter STAR-CCM+ Fly-through a pipe.

2023-11-01T23:27:55.000-0400
Simcenter STAR-CCM+ Simcenter STAR-CCM+ Virtual Reality Teamcenter Share Simcenter Cloud HPC Simcenter STAR-CCM+ Viewer Simcenter STAR-CCM+ Application Specific Solutions

Summary

Solution to Task A of our Macro Competition which took place at our STAR Global Conference 2015 in San Diego.


Details

2015 was the year that CD-adapco commemorated its 35th birthday and the year which saw the inaugural Macro Competition at the STAR Global Conference in San Diego.

The competition consisted of an unseen STAR-CCM+ simulation being given to each candidate along with an engineering objective that had to be completed at the end of the two-hour period.
 
It was expected that engineers had some proficiency in macro skills and have a thorough understanding of STAR-CCM+ and applied engineering.
 
This article shows you the Task A that was given to participants. At the end, some hints are given to reach the solution. 

 
Task A
 
You have entered an engineering department studying erosion in long pipes caused by suspended particles in the fluid. The main tasks are already under development, excepting one: Once erosion has been modeled it has to be screened. The final goal is to automatize the process, but for now, they need an example to assess the burden. Therefore you are asked to:
 
Create a Fly-Through a pipe. The starting point is a .sim file with a landscape and a pipe. The pipe is 3 Km long and the whole model is scaled 1:1000 (1 mm represents 1 m).

 
Landscape and pipe form Task A of Macro Competition 2015
 

Landscape and pipe are given as geometrical parts. The pipe is assigned to a Region and it has been meshed with the generalized cylinder mesher. 

Expected output should be something like:

 


The participants were given 30 minutes. After the 30 minutes, a MacroComp_TaskA_withHints.sim file---also attached to this article---was given. 

If you open that .sim file and open the scene file, you see the following:

 
Hints to Task A Macro Competition 2015



There is a streamline running through the center of the pipe and two points. Those two points are the intersection of plane sections with the streamline.
 
Proposed solution:

A streamline was generated from a point at the center of the pipe. The velocity field was obtained by solving a Stokes flow. That avoids large deviations of the streamline from the center of the pipe.  A plane section is swept along the Y axis. (In our case the intersection of that plane with the streamline always gives a single point within the appropriate range along the Y axis.) These points are used in pairs to define the view settings of the scene. As the points are swept along the streamline the scene view settings change accordingly.
 
  • Create a translation motion along the Y-axis. 
  • Define a coordinate system that is managed by the defined motion.
 
User-added image



Define two plane sections---Y-axis as normal---with a certain separation. The sections are defined through points with coordinates relative to the previous coordinate system. The sections cut the streamline and generate two points. Let us call them P1 and P2.

 
User-added image

Create reports that extract the laboratory coordinates of both points.
 
User-added image
 

Within the java macro those values are obtained as follows:
// coordinates P1
 
 double origingX = simulation_0.getReportManager().getReport("XP1").getReportMonitorValue();
 
 
// coordinates P2
 
 double origingX2 = simulation_0.getReportManager().getReport("XP2").getReportMonitorValue();



Now, loop over so many time steps such that the plane section sweeps the streamline.
(Therefore, the unsteady solver is compulsory. Time is only used for the motion. All other solvers are frozen.)
 
At each step:

 
User-added image


Set the Scene Position to P1.
 
coordinate_Position.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[]{
   origingX,
   origingY,
   origingZ}));

 
Set the Focal Point in the line connecting P1 to P2 at a fix distance to P1.
 
coordinate_FocalPoint.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[]{
  origingX + (origingX2 - origingX)*dist/norm,
  origingY + (origingY2 - origingY)*dist/norm,
  origingZ + (origingZ2 - origingZ)*dist/norm}));
 
 

Keep the View Up as the z lab-coordinate and loop over enough time steps. 

See the attached macro for the complete answer to the proposed solution. The macro works with the simulation with hints (MacroComp_TaskA_withHints.sim).

Macro has been successfully tested from version 9.06 till 12.02.

 
See also:
 








 

KB Article ID# KB000032815_EN_US

Contents

SummaryDetails

Associated Components

Design Manager Electronics Cooling In-Cylinder (STAR-ICE) Job Manager Simcenter STAR-CCM+