0% found this document useful (0 votes)
4 views

Sample+Project+Report+1

Uploaded by

jamesngombo97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Sample+Project+Report+1

Uploaded by

jamesngombo97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1 Simulation of water ripples

2 Namea *
3 a
Department of Mechanical Engineering, California State University, Los Angeles,
4 5151 State University Drive, Los Angeles, California 90032, USA

6 Abstract

7 Computational fluid dynamics (CFD) is used both in science and graphic design to simulate the
8 motion of fluids. However, both fields model fluids with different end goals in mind. Although the
9 scientific field is more interested in accuracy and quality to model the realistic properties of fluids,
10 the entertainment industry is more interested in playing with the limits of the physical properties of
11 fluids to create art, which requires stability to achieve. Since both fields do not have the same goal,
12 advancements are often kept in their respective fields, even if they can be applied to the other field.
13 This work attempts to look at the advancements in both fields to create a program in MATLAB that
14 balances accuracy, quality, stability, and visual appearance of a fluid simulation involving the drop
15 of an object into a body of water. The resulting ripples were tested against an experimental setup for
16 visual accuracy to reality. The current results are insufficient to conclude that the creation of this
17 program created a balance between both fields of study. However, the results have shown that it is
18 possible to have a visually realistic model of a ripple effect in MATLAB, with plans to create more
19 realistic models with a small amount of computation time.

20 Keywords: fluid simulation; water ripples; wave equation; grid-based; CFD

21 1. Introduction

22 Fluid simulation has been a topic of interest for both researchers and graphic designers. Although both
23 groups have different end goals for their simulation [1], each goal uses computational fluid dynamics (CFD) in
24 one way or another to simulate the fluid. In the scientific field, fluid simulation is used to model the realistic
25 properties of various fluids—such as water or air—to assist in creating or modifying existing technologies. In
26 computer graphics, it is used to create visually stunning media for entertainment—such as movies or video
27 games—to provide a sense of realism and immersivity to the viewer. However, unrealistic simulations of
28 fluids are sometimes desired in the entertainment industry—such as in animated cartoons that have water-

* Corresponding author. E-mail address:.


2 Name/ California State University, Los Angeles, ME 5250 (2017)

29 based characters—to create “movie magic” that entertains the viewers. Because of this, the accuracy and
30 quality of a fluid simulation is more important in science whereas the stability and visual appearance of a fluid
31 simulation is more important for graphic design [2]. Because each field has a different goal in mind, there is
32 not typically communication between the two fields in terms of new advancements in methods and
33 technology. Graphic designers often use modified or simplified versions of scientific methods that work best
34 for the goal they strive for [3].
35 In terms of the scientific advancements, they are mainly split into particle-based methods and grid-based
36 methods. In general, particle methods treat each element as a particle with its own position, velocity, density,
37 and temperature and are solved using Lagrangian discretization. Grid-based methods treat fluids as a field
38 instead of a particle, thus fixing the position while still having velocity, density, and temperature
39 measurements. These methods are solved using Eulerian discretization [4]. Both methods are displayed in
40 Figure 1 below.
41 The most common particle-based method is Smoothed Particle Hydrodynamics (SPH) [5]. It accounts for
42 mass conservation and conceptual simplicity at the cost of stability. There have been improvements made to
43 the efficiency of SPH [1][6], but real-time applications are still limited. Aside from SPH, there is Position
44 Based Dynamics (PBD) [7] and Moving-Particle Semi-Implicit (MPS) [8], as well as a myriad of
45 improvements to each method.

46

47 Fig. 2. Example of Particle-Based Method (Left) and Grid-Based Method (Right)

48 Although not as numerous, some grid-based methods include a 3D grid method [9] and 2D grid method
49 [10]. The 3D grid method is very precise, but involves heavy computation. It’s only realistically useful for
50 smaller bodies of water. The 2D grid, although not as accurate as the 3D grid method, is much simpler to
Name/ California State University, Los Angeles, ME 5250 (2017) 3

51 implement. It uses what is called a height field function, which is a function that accounts for the height of the
52 fluid, separate from the grid function.
53 There are also hybrid methods, such as the Fluid Implicit-Particle (FLIP) method, which combine both of
54 the main methods [11]. The FLIP method uses a grid to solve for the pressure. Afterwards, velocity changes
55 are transferred back into particles. However, this method is beyond the scope of this work.
56 The purpose of this work is to simulate an object being dropped into a body of water using the
57 commercially available computing software MATLAB. An example of a 2D wave equation MATLAB
58 simulator was found online and used as a guide for this paper [12]. Efforts will be made to implement the
59 accuracy and quality advancements in technology from science into computer graphics while still maintaining
60 a stable and visually appealing simulation. A grid-based simulation is used because they are visually more
61 appealing than particle-based methods [13]. The remainder of this paper will go over the approach and CFD
62 model used, the experimental setup used to test against the simulation, and conclusion to the case study.

63 2. Method/Model/Approach

64 2.1. CFD Model

65 In this work, MATLAB is used to simulate water ripples in a square container. The type of wave being
66 modeled is a pulse wave, which is a type of non-sinusoidal waveform and often occurs when there is a sudden
67 impact to a fluid medium. The model assumes incompressible flow and disregards heat transfer. The flow of
68 the model is laminar and steady. Friction is not accounted for in the model. The simulation is based on the 2D
69 wave equation, shown below:
70

∂ 2u 2 ∂ u ∂ 2u 
2
71 = c 
 ∂x 2 ∂y 2 
+ (1)
∂t 2  

72
73 where u is a scalar function, t is time, and c is a fixed constant. The boundary conditions used are
74 u(0,y,t)=u(a,y,t)=0 and u(x,0,t)=u(x,b,t)=0, where y is a value between 0 and b and x is a value between 0 and
75 a. The edges of the control volume are also at a fixed position 0. Equation (1) is then discretized using central
76 finite differencing to form the following equation used in MATLAB:
77
4 Name/ California State University, Los Angeles, ME 5250 (2017)

dt 2 k
78 u k +1
i, j
k
= 2u − u
i, j
k −1
i, j +c 2

dx 2
(
ui −1, j + uik, j −1 + uik+1, j + uik, j +1 − 4uik, j ) (2)

79 where dt is the change in time, dx is the change in height, k is time, and i and j are position variables for the
80 matrix iteration. In the MATLAB program, dt=0.1, dx=0.16, and c=1. Iterations were done for k=2:m-1,
81 j=2:n-1, and i=2:n-1, where m=200 and n=133. The number 133 was chosen to reflect the dimensions of the
82 experimental setup. The CFD model for the case study is shown below in Figure 3.

83

84 Fig. 3. CFD Model in MATLAB

85 Currently, the result of the simulation seems to be dependent on the mesh. This is likely due to the method
86 used for the already existing wave equation simulator. More testing will need to be done in order to determine
87 a relationship or function between the scaling of the mesh and the results.

88 2.2. Experimental Setup

89 A simple experiment was performed alongside the simulation in order to make sure the timing and look of
90 the simulation was overall realistic. In the experiment, a glass Tupperware container was used to emulate the
91 control volume. A Mardi Gras bead was used to emulate the object being dropped in the water. The
92 experimental setup is shown in Figure 4 below. The inside walls of the container measured 133 x 133 mm
93 from wall to wall. The rounded edges in the container were not accounted for. The water inside the container
94 had a depth of 30 mm from the edge of the inside of the container. A Mardi Gras bead was used as the object
Name/ California State University, Los Angeles, ME 5250 (2017) 5

95 to drop in the water. The bead was dropped 25 mm from each wall at the edge of the container and 25mm
96 above the water’s surface.

Tupperware
Container

Mardi Gras
Bead

97

98 Fig. 4. Experimental Setup

99 The experiment was performed three times each, from a top view and a side view, for a total of six drops.

100 3. Results and Discussion

101 3.1. Model Validation

102 The model was compared to the experimental setup discussed in the previous section. The starting drop
103 times were synced up such that the traveling speed of the ripple would match. After editing the code to figure
104 out which functions affected what, an accurate comparison was achieved. However, it was only achieved
105 using fudge factors. Further analysis and testing must be done in order to validate the model.
6 Name/ California State University, Los Angeles, ME 5250 (2017)

106

107 Fig. 5. Comparison of Simulation and Experiment

108 4. Conclusion

109 This work attempted to simulate the drop of an object in water and observe the resulting ripples in order to
110 create a program that balanced the accuracy, quality, stability, and visual appearance of a fluid. This was an
111 attempt to combine the works of fluid simulation from the science and graphic design fields. An existing
112 MATLAB code was used to run the simulation. Edits were made to the code so it would apply more to the
113 case study. The results were evaluated by comparing the visual appearance between the simulation and an
114 experimental setup which demonstrated a realistic occurrence of an object being dropped in water. The result
115 was satisfactory, however not enough data could be gathered to form a conclusion. The overall form of the
116 ripples was simulated, but the simulation could not be generalized. Future work would be to continue picking
117 at the existing code to determine how it was done, then creating a newer, simpler code using MATLAB’s
118 finite differencing function. Afterwards, the linear momentum equation for the object should be applied and
119 more in-depth experimental setups should be attempted. Similar work (Shao), although not the same, may still
120 be applicable for this. If this proves successful, more realistic factors such as friction and buoyancy can be
121 considered to determine how realistic the simulation can be before having an unrealistic computational time.
Name/ California State University, Los Angeles, ME 5250 (2017) 7

122 Acknowledgements

123 I would like to acknowledge Dr. Jim Kuo for the tremendous help with getting this project started and
124 for helping me understand concepts required for it.

125 References

126 [1] S. Premože, et al., “Particle-Based Simulation of Fluids,” in Eurographics, Vol. 22, No. 3. Oxford:
127 Blackwell Publishers, 2003, pp. 401-410.
128 [2] M. Ai, et al., “An Improved Shallow Water Equation Model for Water Animation,” in Advances in
129 Materials, Machinery, Electronics I AIP Conference Proceedings. AIP Publishing, 2017.
130 [3] N. Foster and D. Metaxas, “Modeling Water for Computer Animation,” in Communications of the ACM,
131 Vol. 43, No. 7. 2000.
132 [4] M. J. Gourlay, “Fluid Simulation for Video Games (part 1).” 2009.
133 [5] L. B. Lucy, “A numerical approach to the testing of the fission hypothesis,” in The Astronomical Journal,
134 Vol 82, No. 12., 1977, pp. 1013-1024.
135 [6] M. Macklin and M. Müller, “Position Based Fluids,” in ACM TOG, Vol. 32, No. 4. NVIDIA, pp. 1-5.
136 [7] M. Müller, B. Heidelberger, M. Hennix, and J. Ratcliff, “Position based dynamics,” in J. Vis, Vol. 18.
137 Comun. Image Represent, 2007, pp 109-118.
138 [8] S. Koshizuka, H. Tamako, and Y. Oka, “A particle method for incompressible viscous flow with fluid
139 fragmentation,” in Comput. Fluid Dynamics J., Vol. 29, No. 4. 1996.
140 [9] K. Iwasaki, Y. Dobashi, and T. Nishita, “An Efficient Method for Rendering Underwater Optical Effects
141 Using Graphics Hardware,” in Computer Graphics Forum. 2002.
142 [10] D. Luebke, M. Reddy, J. Cohen, A. Varshney, B. Watson, r. Huebner, “Level of Detail for 3D
143 Graphics.” Morgan Kaufmann, 2002.
144 [11] Y. Zhu and R. Bridson, “Animating sand as a fluid,” in ACM SIGGRAPH 2005 Papers. ACM,
145 SIGGRAPH, 2005, pp. 965–972.
146 [12] A. Mousa, “2D Wave Equation Simulation – Numerical Solution – GUI,” MATLAB, 2016.
147 <https://www.mathworks.com/matlabcentral/fileexchange/55117-2d-wave-equation-simulation-
148 numerical-solution-gui>.
149 [13] C. Braley and A. Sandu, “Fluid Simulation For Computer Graphics: A Tutorial in Grid Based and
150 Particle Based Methods.” Virginia Tech.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy