Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Cuong Ha-Minh · Anh Minh Tang · Tinh Quoc Bui ·

Xuan Hong Vu · Dat Vu Khoa Huynh


Editors

CIGOS 2021, Emerging


Technologies
and Applications for Green
Infrastructure
Proceedings of the 6th International
Conference on Geotechnics, Civil
Engineering and Structures
Contents

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

Advanced Modeling and Characterization of Structures (AMCS)


A Study on Behavior of RC Beams Strengthened
with Three-Surface-Steel Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Duy-Liem Nguyen, Minh-Phung Tran, Tri Nhat Minh Nguyen,
and Duc-Hoa Nguyen
An Approach to Generate Level Set Function from STL File
for Fluid-Structure Interaction Computations . . . . . . . . . . . . . . . . . . . . . . . 61
Son Tung Dang, Stein Tore Johansen, and Iskander Akhatov
Analysis of Crack Characteristics of Reinforced Concrete
Bridge Deck Under the Effect of Static Wheel Load . . . . . . . . . . . . . . . . . . 69
Duc Hieu Nguyen, The Truyen Tran, Thanh Tung Bui,
Minh Cuong Le, and Ngoc Trinh Vu
Behavior of Steel-UHPC Composite Column Under Axial
and Flexural Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Viet-Chinh Mai, Cong-Binh Dao, and Hoang Pham

xv
An Approach to Generate Level Set
Function from STL File for
Fluid-Structure Interaction
Computations

Son Tung Dang, Stein Tore Johansen, and Iskander Akhatov

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.

Keywords Fluid-structure interaction · Computational fluid dynamics · Level-set


function · Cut-cell method

1 Introduction

In computational fluid dynamics (CFD), the accurate presentation of objects is cru-


cial. Gridding of complex objects may take a substantial time and may be a major
limitation in the application of CFD. Ansys Fluent [1] and PointWise [15] provide
various choices for geometry formats. However, both softwares are commercial and
expensive to purchase. Another software to create mesh is GSMH [7], which is open-
source. It also supports many different computer-aided design (CAD) file formats.

S. T. Dang · S. T. Johansen (B)


SINTEF Industry, S. P. Andersens veg 15B, 7031, Trondheim, Norway
e-mail: Stein.T.Johansen@sintef.no
S. T. Johansen
Department of Energy and Process Engineering, NTNU, 7041, Trondheim, Norway
I. Akhatov
Skolkovo Institute of Science and Technology, 121205 Moscow, Russia
S. T. Dang
Viettel High Technology Industries Corporation, Da Nang, Vietnam
© The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd. 2022 61
C. Ha-Minh et al., (eds.), CIGOS 2021, Emerging Technologies and Applications
for Green Infrastructure, Lecture Notes in Civil Engineering 203,
https://doi.org/10.1007/978-981-16-7160-9_5
62 S. T. Dang et al.

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].

2 Equations and Numerical Methods

2.1 Level Set Function

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

Fig. 1 The distance from a


point to triangles surface

The shortest distance can be achieved by two main cases (Fig. 1)


1. From the point to the triangle itself, the projected point p1 is the projection of
the point x1 onto an infinite straight plane in which the triangle is located. When
the point p1 is inside the triangle. The distance can be calculated by

dmin = d1 = |x1 − p1 | (1)

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)

Then, the minimum length is determined by

dmin = min(d2 , d3 ) (4)

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.

2.2 Governing Equations and Discretization

The continuity and Navier-Stokes equations describing incompressible fluid motions


are given as follows,
64 S. T. Dang et al.

Fig. 2 The cell contains


both fluid and solid. The
interface between two phases
is marked with red colour

∇ · 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

3.1 Level Set Function for a Ship

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. 4 The zero contour


level set represents the ship
surface. The sign distance is
computed based on the ray
casting method
66 S. T. Dang et al.

Fig. 5 The computational domain (a) and the computational mesh (b) for the flow over sphere test.

3.2 Flow Past a Sphere

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

Fig. 6 The drag coefficients


for various reynolds numbers

References

1. ANSYS. https://www.ansys.com/ (2018)


2. Fast distance fields for fluid dynamics mesh generation on graphics hardware. Communications
in Computational Physics 26(3), 654–680 (2019)
3. Clift, R., Grace, J.R., Weber, M.E.: Bubbles, Drops, and Particles. Academic Press, New York
(1978)
4. Dang, S.T., Johansen, S.T., Meese, E.A.: A Cartesian cut-cell method based on formal volume
averaging of mass momentum and energy equations. In: Proceedings of the 12th International
Conference on Computational Fluid Dynamics in the Oil & Gas, Metallurgical and Process
Industries, SINTEF akademisk forlag (2017)
5. Dang, S.T., Meese, E.A., Morud, J.C., Johansen, S.T.: Numerical Approach for Generic Three-
Phases Flow Based on Cut-cell and Ghost Fluid Methods. International Journal for Numerical
Methods in Fluids 0(ja) (Jun 2019)
6. DesJardin, P.E., Bojko, B.T., McGurn, M.T.: Initialization of high-order accuracy immersed
interface cfd solvers using complex cad geometry. International Journal for Numerical Methods
in Engineering 109(4), 487–513 (2017)
7. Geuzaine, C., Remacle, J.F.: Gmsh: A 3-d finite element mesh generator with built-in pre- and
post-processing facilities. International Journal for Numerical Methods in Engineering 79(11),
1309–1331 (2009)
8. Günther, C., Meinke, M., Schröder, W.: A flexible level-set approach for tracking multiple
interacting interfaces in embedded boundary methods. Computers & Fluids 102, 182–202
(2014)
9. Hirt, C.W., Nichols, B.D.: Volume of fluid (VOF) method for the dynamics of free boundaries.
Journal of Computational Physics 39(1), 201–225 (1981)
10. Johnson, T.A., Patel, V.C.: Flow past a sphere up to a Reynolds number of 300. Journal of Fluid
Mechanics 378, 19–70 (1999)
11. Kirkpatrick, M., Armfield, S., Kent, J.: A representation of curved boundaries for the solution
of the Navier–Stokes equations on a staggered three-dimensional Cartesian grid. Journal of
Computational Physics 184(1), 1–36 (2003)
12. Mittal, R., Dong, H., Bozkurttas, M., Najjar, F.M., Vargas, A., von Loebbecke, A.: A versatile
sharp interface immersed boundary method for incompressible flows with complex boundaries.
Journal of Computational Physics 227(10), 4825–4852 (May 2008)
68 S. T. Dang et al.

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)

You might also like