head_img

Paint Image Model Construction

This page describes the procedure using newer version of Flowsquare+ 2023R1.0 or later. For operating procedures for the older versions, please click here.

1. Model configuration in Flowsquare+

An image for XY plane.
An image for XY plane.

An image for YZ plane.

An image for YZ plane.

An image for ZX plane.

An image for ZX plane.

There are three types of input files that Flowsquare+ uses: (1) parameter file, (2) paint images, and (3) CAD (STL) file. Here, the paint images and/or STL file are used only if necessary, and they are used to specify boundary conditions (BC; flow field model such as inflow and wall boundaries).

In this page, you will learn the methods and rules of 2D/3D model configuration based on single or multiple paint image(s).


 

2.Model configuration images

Boundary conditions (BC) such as wall and inflow boundaries can be specified by using bitmap images generated by any paint tool like Microsoft Paint.

These images consist of images for XY, YZ, ZX planes, and they are respectively named as bcXY#.bmp, bcYZ#.bmp, bcZX#.bmp, where # is replaced by a number from 0 to 9. Therefore, maximum of ten images can be used for each direcion (eg. bcXY0.bmp, bcXY1.bmp, ..., bcXY9.bmp for XY direction). Note that only single XY plane (bcXY0.bmp) is necessary for 2D simulation.


 

3. Color based boundary specification

A local boundary condition can be specified by a color code (RGB) in the bitmap image. A inflow boundary condition can be specified by

  • Blue (0, 0, 255)
  • Red (255, 0, 0)
  • Green (0, 255, 0)
  • Yellow (255, 255, 0)
  • Cyan (0, 255, 255)
  • Magenta (255, 0, 255)

These specified inflow boundaries may be treated as (solid) wall boundary or outflow (suction) conditions, depending on the special arrangement specified in parameter setting for a corresponding color.

General wall boundary can be specified by

  • Black (0, 0, 0).

Any region with

  • White (255, 255, 255)

is treated as fluid region, and if such a region is located on the computational boundary, the boundary is taken as an natural inflow/outflow (open) boundary.

These Blue, Red, Green, Yellow, Cyan, Magenta, Black, White colors are named "preset colors". The other colors, "non-preset colors" or "user-specific colors", can be used to specify wall boundary, similar to the one specified by black color. In the latest Flowsquare+, a total of 50 colors can be specified (Note that R2021R2.0 or earlier version allows 19 colors in total).

The below image shows an example image (bcXY0.bmp) to specify boundary conditions in a 2D flow field. Following the above rules, the image specify the simulation domain, where a fluid is fed from the left inflow boundary towards right, which is sandwiched between the uppper and lower walls. Also, there is an arrow-shaped object in the middle, which are specified by a user-specific color. A test simulation example using the below bcXY0.bmp is further explained in here.

Example of paint image for 2D flow simulation (bcXY0.bmp).
Example of paint image for 2D flow simulation (bcXY0.bmp).

 

4. Model configuration methods in Flowsquare+

Relatively complex 3D model can be constructed by combining few simple 3D models (elemental models). The below list summarizes methods to construct elemental models based on paint images.

In Flowsquare+, the methods (a)-(f) can be applied for preset and non-preset colors to construct a complex fully-3D model. There are example simulation cases, which apply these techniques to achieve simulations for various problems.

(a) Model with a uniform 2D cross-section

A simplest 3D object is an object with a uniform 2D cross-section. A cylinder and rectangular cylinder are some of such objects. Such objects can be specified with single image, which specifies the shape of cross-sectional cut of the 3D object (eg. if the cylinder spans in Z-direction, only XY cross-sectional shape of the object needs to be specified).

bcXY0.bmp
bcXY0.bmp
Alignment of bcXY0.bmp.
Alignment of bcXY0.bmp.
A 3D model constructed based on bcXY0.bmp.
A 3D model constructed based on bcXY0.bmp.

(b) Model constructed by third angle projection

A 3D object can be constructed by means of third angle projection. In such case, two or three cross-sectional images (eg. an image for XY-plane and another image for YZ-plane) needs to be prepared. These two images are basically projections of your object from their directions. You do not need to care too much about the pixel size or aspect ratio of images—images are automatically interpolated and adjusted to conform with the physical domain size specified by the parameters.

bcXY0.bmp
bcXY0.bmp
bcYZ0.bmp
bcYZ0.bmp
Alignment of bcXY0.bmp.
Alignment of bcXY0.bmp.
Alignment of bcYZ0.bmp.
Alignment of bcYZ0.bmp.
A 3D model constructed based on bcXY0.bmp and bcYZ0.bmp.
A 3D model constructed based on bcXY0.bmp and bcYZ0.bmp.

[(b) Supplemental]

In this method, an object is constructed by considering a volume of intersection of the "columns" with uniform 2D cross-sections specified in the two (orthogonal) paint images with a same color. If a subset of a column is not shared by the other image(s), the subset will not be a part of constructed 3D object. Here is such an example.

bcXY0.bmp
bcXY0.bmp
bcYZ0.bmp
bcYZ0.bmp
Alignment of bcXY0.bmp.
Alignment of bcXY0.bmp.
Alignment of bcYZ0.bmp.
Alignment of bcYZ0.bmp.
3D object constructed based on input images (bcXY0.bmp and bcYZ0.bmp.
3D object constructed based on input images (bcXY0.bmp and bcYZ0.bmp.

(c) Model with a smoothly-changing 2D cross-section (Stretching tool)

In Flowsquare+, a fully-3D model with a smoothly-changing 2D cross-section can also be constructed, by using "Stretching tool"*1. In the Stretching tool, you can select one of XY, YZ, and ZX planes, and Flowsquare+ "stretches" the 2D cross-sectional shape on that plane to fit shapes in the other one or two images with a same color, along its normal direction.

The following example shows a 3D model where YZ-cross-sectional shape is stretched to fit the shapes specified in XY and YZ images.

bcXY0.bmp
bcXY0.bmp
bcYZ0.bmp
bcYZ0.bmp
bcZX0.bmp
bcZX0.bmp
Alignment of bcXY0.bmp.
Alignment of bcXY0.bmp.
Alignment of bcYZ0.bmp.
Alignment of bcYZ0.bmp.
Alignment of bcZX0.bmp.
Alignment of bcZX0.bmp.
A 3D model constructed by stretching bcYZ0.bmp to the size of the other input images (bcXY0.bmp and bcZX0.bmp).
A 3D model constructed by stretching bcYZ0.bmp to the size of the other input images (bcXY0.bmp and bcZX0.bmp).

(d) Subtraction of an object from another object (Subtraction tool)

Flowsquare+ can perform shape construction by subtracting the 3D objects that can be constructed by the above method(s) from other objects. This function is called "subtraction", and this option can be selected for each color in the image loader window. For example, the object B constructed in a brown color can be subtracted from the object A constructed in a purple color (a simulation example using the subtraction feature).

In this case, it is necessary to specify the construction order of the brown boundary condition after the purple one in the image loader window, and it is also necessary to turn on subtraction (Subtrc) for the brown boundary condition in the same screen.
bcXY0.bmp
bcXY0.bmp
bcYZ0.bmp
bcYZ0.bmp
bcZX0.bmp
bcZX0.bmp
Placement direction of bcXY0.bmp
Placement direction of bcXY0.bmp
Placement direction of bcYZ0.bmp
Placement direction of bcYZ0.bmp
Placement direction of bcZX0.bmp
Placement direction of bcZX0.bmp
3D model constructed by subtracting the model constructed in brown from the model constructed in purple.
3D model constructed by subtracting the model constructed in brown from the model constructed in purple.

(e) Model consisting of few elemental objects constructed by using the above techniques

Flowsquare+ can construct a 3D model by combining elemental objects constructed by using above configuration techniques. Each elemental object can be constructed by using a color different from the other elemental objects. This technique is called "Coloring technique"*1. The following example shows a 3D model consisting of two elemental objects which are constructed by using (b) third angle projection (images bcXY1.bmp、bcYZ1.bmp) and (d) the Stretching tool (images bcXY0.bmp、bcYZ0.bmp、bcZX0.bmp).

bcXY1.bmp
bcXY1.bmp
bcYZ1.bmp
bcYZ1.bmp
bcXY0.bmp
bcYZ0.bmp
bcYZ0.bmp
bcZX0.bmp
bcZX0.bmp
A 3D model constructed from above five input images (YZ plane image, bcYZ0.bmp is stretched).
A 3D model constructed from above five input images (YZ plane image, bcYZ0.bmp is stretched).
The interior object (outer cylinder is not rendered).
The interior object (outer cylinder is not rendered).

 

5. Applying configuration options for each color

The described methods (c) and (d) can be selected in the boundary configuration image loader window on the right hand side of the window for each color including both preset and non-preset colors. If not used, select "OFF (default)". These selections are stored in input/bmp.txt and used in the future run.

Model configuration image loader.
Model configuration image loader.

Descriptions of the numbered items in the above figure.

  1. Colour information
    Information of each colour used in the model configuration images. Preset colours (black, blue, red and green) are always shown regardless of usage.
  2. Strtch
    Radio buttons to specify "Stretching" operation plane for each colour. A shape of the corresponding colour in the specified plane will be stretched.
  3. Subtrc
    Radio buttons to specify subtraction (Subtrc) of the target object from a model(s) consisting of other colors. Here, the model construction order of each color needs to be appropriately set. The model color to subtract must be placed after the model color to be subtracted (drag-and-drop operation in the color list to change the order).

 


Top