Proceeding 2021
Proceeding 2021
Proceeding 2021
Keynote
Flexible Blades Wind-Turbines: Giant Installations
and System-of-Systems Approach to Optimizing Wind-Energy
Farms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Adnan Ibrahimbegovic
Innovation in Cements—Can We Meet Future Construction
Needs Sustainably? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
John L. Provis
Urban Thermal Modulation—The Limits of Interiorization
and Emergence of Atmospheric Security? . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Simon Marvin
xv
An Approach to Generate Level Set
Function from STL File for
Fluid-Structure Interaction
Computations
Abstract In this paper, we will present an approach to compute the signed distance
or level set function from the Standard Triangle Language (STL) file format. Then
the level set is used to represent the surface of a given object inside the computational
domain. The continuity and Navier-Stokes equations are solved numerically to study
the fluid flows over the solid body. The finite-volume method (FVM) is applied to
approximate all terms in the governing equations to conserve mass and momentum.
The cut-cell method is employed to avoid recomputing the mesh points when the body
moves around. The transport equation for the level set function is solved accordingly
to update the position of the object.
1 Introduction
Nevertheless, most of these softwares are only used to create body-fitted meshes and
the Cartesian mesh option is not available. In rectangular grid, instead of representing
the body surface by grid points, a scalar variable is employed to implicitly indicate
the outside of the object. There are two main variables widely used in the literature
which are a volume of fluid [9] and a level set function or signed distance field [13].
In the volume of fluid method, the volume fraction illustrates the ratio between the
part cut by the surface and the cell. The value vary from 0 to 1, which implies empty
to fully occupied cells. The level set method, on the other hand, is the signed dis-
tance which is positive outside the body and negative when the grid point is internal.
The surface will be implicitly specified by the zero level set value. Compared to the
volume of fluid method, the level set is easier to compute from CAD file formats.
In graphic visualization, the signed distance field is generated from the .STL file
using graphics processing units (GPUs) [2, 14, 18]. For fluid-structure interaction,
the distributed bounding box hierarchy has been applied to compute the level set
function from the CAD file, and then inserted into the Cartesian mesh [6, 8, 19].
Although this method can reduce the computing time for complex geometries, it is
difficult to implement and requires a complicated data structure. In this study, we will
present a simple method to calculate the level set function from the .STL file. The
method can be time-consuming for bodies with huge numbers of surface elements.
However, the calculation is performed only once, at the initial stage. Therefore, this
step only slightly affects to total time of the computation. In order to compute the
fluid flows over a structure, we applied the finite volume method combined with the
cut-cell approach to discretize the governing equations [4, 5, 11, 16].
Shortest distance The level set function (lvs) is used to present the object surface.
The object is placed inside the computational domain through the .STL file format.
The .STL file is made from triangles which connect to each other. In general, the
information in the .STL file contains the normal vector of the faces and the location
all triangles vertices as follows,
facet normal nx n y nz
outer loop
vertex x1 y1 z 1
vertex x2 y2 z 2
vertex x3 y3 z 3
end loop
end facet
An Approach to Generate Level Set Function from STL File… 63
2. If the projected point p1 is outside of triangle the shortest distance can be from
the grid point to the edge or the vertex. First, we need to determine the projected
point from grid point to the edge ( p2 ) and vertices ( p3 ). The distance from x2
and x3 to the edge or vertices are
d2 = |x2 − p2 |, (2)
d3 = |x3 − p3 |. (3)
The sign value of distance In order to decide if the grid point is inside or outside
the object, we need to assign the sign value to the computed distance from Sect. 2.1.
In our study, we used the ray casting method [17], which determines the sign by
inserting a ray from the target point and counts the number of intersections between
the ray and the object. If this is an odd number the point is inside the object. If the
number of intersections is even it means that the point is outside.
∇ · u = 0, (5)
∂ρu
+ ∇ · (ρuu) = −∇ p + μ∇ 2 u + ρg, (6)
∂t
where, u(u, v, w) is the velocity vector. ρ is the phase density, p is the pressure, μ is
dynamic viscosity and g is gravitational acceleration. In our work, the staggered grid
is used for the whole computations. The arrangement is applied for velocities and
scalar fields. In addition, we use the finite volume method to discretize the governing
equations. For a cell at which both fluid and solid are present, as in Fig. 2, the velocities
locates at the face centre of the fluid control volume, while the pressure locates at
original cell centre. Applying FVM for continuity and momentum equations, Eqs. 5
and 6 can be rewritten as
u · n f A f + uw · n F,w Aw = 0, (7)
Af
∂
V α f ρu = −α f V (∇ p + ρg) + μ∇u · n f A f + τ w · n f,w Aw − ρuu · n f A f ,
∂t
Af Af
(8)
where, A f is fluid surface area, A f,w is wall area, n f is the normal vector at the
fluid surface, n F,w is the normal vector pointing to the fluid field at the wall, uw is
the wall velocity, V is the volume of the cell, α f is the fluid volume fraction in the
cell and τ w is the wall shear stress tensor. The wall shear stress is computed based
on the distance from velocity position to the solid wall (Δh), as follows,
u − uw
τw = μ . (9)
Δh
The details of discretization are given in the work of Dang et al. [5]
An Approach to Generate Level Set Function from STL File… 65
3 Numerical Results
In this test, we focus on generating the level set function from a .STL file. The object
is a vessel which is created by Fusion 360. Figure 3a shows the ship structure with
simple design. Figure 3b shows the surfaces of the ship as being assembled from
triangles. The size of the ship is 332 × 168 × 600 mm. Computing the level set
function for the whole computational domain will be time-consuming. Therefore, we
only perform the computation for local points which are close to the surface. Firstly,
we will loop through all triangles and determine the cells containing a triangle. After
that, we will create a box which will contain the triangle plus buffer space. We
assign the Band_W idth as the number of grid point inside the the buffer space. In
our work, we set Band_W idth = 4. We will perform the computation for the level
set function for all grid points inside the box. Then, we will compare all values to
chose the smallest distance. Note that the normal vector of a triangle given by the
.STL file is not correct. Therefore, it is important to recompute the normal based on
the location of triangles vertices. Figure 4 shows the level set contour obtained when
we used the ray casting method to determine the sign value. In general, the method
can compute the level set accurately.
Fig. 3 The shape of ship a and the triangular wire-frame representing the surface of the object (b)
Fig. 5 The computational domain (a) and the computational mesh (b) for the flow over sphere test.
This test is used to validate our numerical method for 3D fluid-structure interaction.
Figure 5 shows the simulation domain and numerical mesh. In this study, we use the
simplistic structure which is a sphere. The body is placed 20D from the inlet and 40D
from the outlet, where D is spherical diameter. We create the sphere by CAD software
and export it in .STL format. Then we import the file into our code and generate
the level set function which is an implicit representation of the object surface. In
order to restrict the effect of boundary condition to our results, slip walls are placed
symmetrically at all sides of the computational domain. A non-uniform mesh of
121 × 81 × 81 points is used in our simulation. The grid is refined in the vicinity of
the sphere with 20Cells/D such that we can capture the physical phenomena around
the object accurately. Figure 6 shows our computed drag coefficient and compared
with theoretical data [3] and other numerical results [10, 12]. A good agreement
between our method and previous studies can be observed from this figure.
4 Conclusion
In this study, we presented the numerical method for computing the level set function
as well as solving fluid governing equations. The ray casting method is implemented
to correct the signed distance at specific region of the computational domain. Several
tests were performed to validate our methods. In general, the numerical method
produced good outputs compared to other works in literature. In the future, we will
perform more complex tests to check the robustness of our method.
Acknowledgements We would like to thank the Norwegian Research Council to fund our research
through the ICELOAD project (project number 308780, “Enabling prediction of ice loads on struc-
tures in the Arctic”), and the Russian Foundation for Basic Research for funding through grant
number 20-58-20004.
An Approach to Generate Level Set Function from STL File… 67
References
13. Osher, S., Sethian, J.A.: Fronts propagating with curvature-dependent speed: Algorithms based
on Hamilton-Jacobi formulations. Journal of Computational Physics 79(1), 12–49 (Nov 1988)
14. Park, T., Lee, S., Kim, J., Kim, C.: Cuda-based signed distance field calculation for adaptive
grids. In: 2010 10th IEEE International Conference on Computer and Information Technology.
pp. 1202–1206 (2010)
15. Pointwise: Pointwise (2020), http://www.pointwise.com/
16. Schneiders, L., Günther, C., Meinke, M., Schröder, W.: An efficient conservative cut-cell
method for rigid bodies interacting with viscous compressible flows. Journal of Computational
Physics 311, 62–86 (2016)
17. Shu, R., Liu, A.: A fast ray casting algorithm using adaptive isotriangular subdivision. In:
Proceedings of the 2nd Conference on Visualization ’91. p. 232–238. VIS ’91, IEEE Computer
Society Press, Washington, DC, USA (1991)
18. Sigg, C., Peikert, R., Gross, M.: Signed distance transform using graphics hardware. In: IEEE
Visualization, 2003. VIS 2003. pp. 83–90 (2003)
19. Wang, K., Grétarsson, J., Main, A., Farhat, C.: Computational algorithms for tracking dynamic
fluid–structure interfaces in embedded boundary methods. International Journal for Numerical
Methods in Fluids 70(4), 515–535 (2012)