Question: 0 . 2 1 - D Shallow - Water Model Figure 1 : Configuration of the one - dimensional shallow - water model. Undisturbed water
D ShallowWater Model
Figure : Configuration of the onedimensional shallowwater model. Undisturbed water depth is
h
Governing equations for a D shallowwater model see Figure can be written as:
u
t g eta
x
eta
t u h
x
where u is speed in the xdirection, t is time, g is acceleration due to gravity, eta is sealevel elevation,
and h is the total water depth.
Analytical Solution
The water depth h can be approximated as constant for a flat seafloor together with wave amplitudes
small compared with total water depth. In this case, the wave solution of the above equation
is:
eta t xeta sinpi xlambda pi tT
ut x u sinpi xlambda pi tT
Page of
Final TakeHome Portion, Numerical Methods CWR Spring
Instructor: Dr C i gdem Akan
Due: May by : pm
where eta is wave amplitude, lambda is wavelength, T is wave period, and the magnitude of u is given
by:
ueta
pgh
Horizontal flow under a long surface wave is depthindependent and so are horizontal gradients of
u The solution for vertical speed of a fluid parcel as a function of depth can be written as:
wt x zpi u zlambda cospi xlambda pi tT
where z is positive distance from seafloor.
MATLAB Coding
You will create an animation of analytical wave solution using the input values below:
Wave amplitude eta m
Wavelength lambda m
Water depth h m
Wave speed cgh
Wave period T lambda c
In order to generate the animation, you will need to track individual fluid parcels using the equations
below:
xpnew xpold dt times u
zpnew zpold dt times w
You will track the particles at zp m zp m zp m and zp m
Suggested Algorithm
Enter the input variables
Limits of xaxis: lambda Use points.
Number of time steps Total animation time times T
Calculate dt
Initialize particle positions
You only need one loop: loop over number of time steps.
Calculate eta
Calculate u
Calculate w
Calculate the new fluid parcel locations
Page of
Final TakeHome Portion, Numerical Methods CWR Spring
Instructor: Dr C i gdem Akan
Due: May by : pm
Plot all the particles
Show the water surface with a thick solid line
Show rest of the particles with a circle
Label the x and yaxis properly
Use sprintf command to show the time at each time step
Save the frame
Create the animated GIF
Animation with MATLAB
There are several ways to create animated gif files with MATLAB. For example, examine the code
provided in class. You can adapt it and use it for your code.
Hand Calculations
Calculate the following for x m z m and x m z m at t s:
Wave speed cgh
Wave period T lambda c
eta
u
w
Midterm Take Home Rubric
Title Page: This should consist of a blank page with your name, UNF ID course title, home
work assignment number and title. pts
SummaryObservations: This should be a brief summary of the assignment. What did the
assignment ask for? What did you learn? Did you discover anything easydifficult with the
assignment? It doesnt have to be long, just clear and concise. Do not write only one
sentence. pts
MATLAB Codes: Copy and paste your codes into the Word document. pts
Output: Animation file in gif format pts
Hand Calculations: See the hand calculations section. pts
Extra Credit
Recall the Ready Aim, Fire GUI we used in class. Make improvements to the GUI interface and
the code by applying one of the options below:
Page of
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
