When you have long pipes, you sometimes want to create Plane Sections along the pipe at a certain distance to use for reports. The longer the pipe, the more time this takes to do manually. The worst case is a long pipe that also bends a lot, in which case you must use Constrained Plane Sections instead of just Plane Sections. To help with this, you can use the attached macro that will start by creating a streamline along the center of the pipe, then create constrained planes at a specified distance along this streamline. The macro can also create reports and monitors from each plane.
An example of a geometry where plane creation is a nightmare to do manually:
What the macro does:
0. the simulation needs to be open in serial due to how data to tables is written
1. make sure there is a flow solution. This is needed to create the streamline. The continuity initialization with the coupled solver is enough.
2. find the coordinate where you want your streamline to start and put that in the macro
3. input a radius of the pipe and distance between the planes in the macro
4. run the macro, this creates a tag "streamLineTag" that you use to tag the parts/regions you want to create the streamline from. Additionally, you can tag field functions if you want to create surface average reports of these field functions of the planes.
5. after tagging parts/regions and field functions, run the macro again. This creates a field function used for the streamline, your streamline and a table. Open a Scene and make sure that the streamline looks ok
6. run the macro a third time. This time the planes and reports are created. Additionally a new field function, streamlineLength, is created that you can use to plot data on the streamline. An example plot, plotting velocity vs streamlineLength on the streamline is created.
Note that the planes and reports contain the information of how far downstream (in meter) of the start of the streamline that they are located (0.101 0.200 etc). They also contain a serial number (001, 002 etc).
Note also that the macro automatically uses multivalued monitors in 18.04 and later releases but not in 18.02 and prior releases, see multivalued monitors
for more info.