Vous êtes sur la page 1sur 16

Flow Oscillation Simulation Andrews

The overall flow profile of a fluid depends on


Flow Oscillation the ratio between the viscous effect and bulk
flow effect. This ratio is described by the
Simulation Reynold’s number (R​e​). The Reynold’s number is
directly proportionate to fluid density (​ρ​),
Author: Mackenzie Andrews velocity (​v​), and tube diameter (​d​), and
inversely proportionate to viscosity (​µ​).
INTRODUCTION
ρvd
Re = µ
BACKGROUND

Viscosity is an intrinsic property of a fluid that When the Reynold’s number is low (< 2000), the
describes that fluid's resistance to flow. Fluids flow is viscous effect dominant which is called
resist the relative motion of objects that have a laminar flow. Laminar flow is also called parallel
different velocity to them. When a fluid flows flow and is characterized by a streamline
through a pipe, the pipe has a velocity of zero motion. When the Reynold’s number is high (>
which creates a negative relative motion to the 4000), the flow is bulk motion dominated which
fluid flow. The fluid will resist this relative is called turbulent flow. Turbulent flow is
motion by developing a velocity gradient. The characterized by chaotic flow with large scale
velocity of a fluid next to the pipe will equal mixing. When the Reynold’s number is
zero and gradually increase to maximum at the intermediate (2000 < R​e <​ 4000), the flow is
center of the flow profile. The viscosity classified as transitional or a mix between
essentially determines how much the fluid will laminar and turbulent properties.
resist the relative motion. If a fluid has high
viscosity, the resistance to flow will be high. SIMULATION THEORY

Viscosity (​µ)​ is defined as the sheer stress (​τ​) When fluid flows through a non-horizontal pipe,
required to drag one layer of fluid with unit both bulk motion and viscous effects are at
velocity (​dv​) past another layer a unit distance play. The bulk motion is caused by the driving
away (​dy)​. force of gravity. The gravitational driving force
is equal to the mass of the fluid multiplied by its
µ= τ
dv
acceleration (​g​). The fluid mass is equal to the
( dy )
fluid density (​ρ​) multiplied by the h​ eight of the
Viscosity is one of two major components that fluid (​h​) and the cross sectional area of the fluid
affect fluid flow. The viscous effect happens at (​A​).
the molecular scale and describes the
movement of molecules against one another. F g = ρhAg
This molecular movement causes momentum
diffusion through a fluid. The other major
In the case of laminar flow, the viscous effect
component is the bulk flow effect. Bulk flow
translates into a pressure drop which is
happens on the macroscopic scale and
characterized by the Hagen-Poiseuille equation
describes how the bulk of the fluid is moving as
where L is fluid length and Q is fluid flow rate.
a result of an external driving force. Bulk flow
causes a momentum convection through a fluid. 8μLQ
ΔP = πr4

1
Flow Oscillation Simulation Andrews

The pressure drop multiplied by the cross To experimentally model fluid flow in a U-tube,
sectional area of the pipe is representative of a long tube was mounted as a vertical U and
the drag force on the fluid. Drag is the force filled with enough water so the level, at
that resists (or slows) fluid motion. equilibrium, is about halfway between the
curve and the top of the tube. Figure 1 shows a
8μLQA
Fg = πr4
diagram of the experimental setup.

In the case of turbulent flow, the viscous effect


is negligible (according to the Reynold’s ratio).
Instead, a frictional coefficient is used to
describe the drag force. The derivation of this
drag force is shown fully in Appendix A,
Turbulent Flow Derivations.

When a fluid flows through a U-tube, the


gravitational force acts in the same direction
(downwards) in both sides of the tube. The net Figure 1: U-tube arrangement for flow oscillation
experiments. The tube is filled up to the dashed line, then
gravitational force acts on the side of the tube the water is pulled up to h1(0) on the left side, and
with more fluid. As the fluid flows from one side released.
of the tube to the other, gravity is working to
Food coloring and a ruler/meter stick were used
reverse the velocity of the fluid, creating an
to enable video data collection. Using a syringe,
oscillatory flow pattern. The drag force always
water was lifted into one arm of the U, and the
opposes the direction of velocity and is
water was released and allowed to come to
therefore acting as a damping factor on the
equilibrium. Image 1 shows the experimental
oscillatory flow.
set up for the 3/16” tube at the moment before
water was released. The event was captured on
PURPOSE
video, and the water height h(t) was extracted
from the video. The experiment was repeated
In this lab, we explored the flow characteristics
for 1/16, 1/8, 3/16, 1/2, and 1-inch diameter
of water in a U-tube. The purpose of this lab
tubing.
was to develop an understanding of laminar vs.
turbulent drag force characteristics in different
SIMULATION
sizes of tubing.
IMPLEMENTATION
Computational and analytical equations were
To computationally
derived and modeled. Those models were
model fluid flow in a U-tube, MATLAB was used
compared to experimental results to show the
to functionalize the derived differential
difference between laminar and turbulent flow
equations of laminar and turbulent flow.
in different sizes of tubing.
A second-order differential equation takes the
METHODS form of

EXPERIMENTAL SETUP Ax" + Bx' + Cx = q(t),


2
Flow Oscillation Simulation Andrews

and an array, ​y​ containing the heights in the


with initial conditions of first column and the velocities in the second
column.
x(0) = h1 , x'(0)=0.
In the case of turbulent flow, the drag term
Since MATLAB’s ODE solvers can only take (Bx’) is no longer linear so that term is raised to
first-order differential equations, the a power, ​beta​:
second-order differential equation was reduced
to a system of first-order differential equations - B/A*(y(2))^beta
using the vector y:
Since the raised power in not a multiple of 2,
y = |x x′ | the term will produce imaginary components
when velocity is negative. This can be handled
The second-order ODE above was then by sending in the absolute value of velocity and
reorganized as a system of first-order ODEs: multiplying by the sign of velocity:

d sign(y(2))*B/A*abs(y(2))^beta
dt |x x′ | = |0 1 − C /A − B /A ||x x′ | + |0 q(t)/A |

A MATLAB function that calculates x and x’ for In the case of a constriction, a 4​th​ term is
single time steps was implemented as the introduced to model the pressure drop due to
following: the constriction:

function dy = secondODE(t,y) - D/A*(y(2))^2


A=?;
B=?;
Since the pressure drop acts against the flow
C=?;
dy = zeros(2,1); direction, taking the absolute value of one of
dy(1) = y(2); the velocity terms will factor in the
dy(2) = -C/A*y(1)- B/A*y(2) + directionality of the force:
q(t)/A;
- D/A*(y(2))*abs(y(2))
That function was saved in a separate file. The
execute file contained the initial conditions and All of the MATLAB code including the variables
time span, and functions for each condition is contained in
Appendix B.
y0 = [h1; 0];
tspan = [0 t​end​]; RESULTS
which were then passed into MATLAB’s ​ode45 EXPERIMENTAL DATA
function along with a call to the ​secondODE
function: Using the data collected from the experimental
trials, height versus time plots were graphed to
[t, y] = ode45(@secondODE, observe damping characteristics across tubing
tspan, y0); sizes.

The output of this function is a time vector, ​t One trial from each tubing size was graphed in

3
Flow Oscillation Simulation Andrews

MATLAB and categorized as under, over, or


critically damped. Figure 2 shows the height Table 1: Damping characteristics, Reynold's number
versus time plot for the experimental data of estimations and flow classifications for 5 tubing sizes
based on experimental data.
the 1/16” tube. No oscillations occurred to the
damping behavior was classified as
Diameter Damping Max R​e Laminar vs.
over-damped.
(inches) Turbulent

.0625 Over 100 Laminar

.125 Under 800 Laminar

.1875 Under 1500 Laminar

.5 Under 5000 Turbulent

1 Under 15000 Turbulent

The plots were then used to estimate the


location of maximum velocity. The slope of the
position graphs corresponds to the velocity of
Figure 2: Height versus time plot showing the experimental
the fluid. Using the 2 points corresponding to
data collected from the 1/16" U-tube. the steepest slope, a velocity value was
calculated. This value was plugged into the
Figure 3 shows the height versus time plot for Reynold’s number formula. The density of
the experimental data of the 1” tube. Since the water (1000 kg·m​-3​) was also plugged into the
water height oscillated around the equilibrium formula along with an estimated viscosity of
height, the damping behavior was classified as 8.9x10​-4 ​kg·s​-1​·m​-1​. The diameter of the tube was
under-damped. converted from inches to meters and inserted
into the formula to calculate the maximum
Reynold’s numbers of each tubing size (Table 1,
Column 3). Those Reynold’s numbers were then
used to classify each flow is laminar or turbulent
(Table 1, Column 4).

SIMULATION RESULTS

Laminar Flow

A differential equation to describe laminar flow


through a U-tube was derived using a force
balance method. The full derivation for the
linear second-order differential equation
Figure 3: Height versus time plot showing the experimental describing laminar flow can be found in
data collected from the 1" U-tube. Appendix A, Laminar Flow Derivations. This
equation was used in the MATLAB ODE solver
The rest of the tubing sizes were also graphed
function described in the Method’s section.
and categorized. Table 1, Column 2 shows the
characterizations for the 5 tubing sizes tested.

4
Flow Oscillation Simulation Andrews

The derived ODE was then solved analytically laminar flow model and an experimental
using the initial conditions of the experimental turbulent flow condition. Figure 5 shows a
set up. Derivation of the analytical solution can height versus time comparison between the
be found in Appendix A, Laminar Flow computational models of turbulent and laminar
Derivations. to the experimental model of flow through the
1” U-tube.
The computational and analytical models of
laminar flow were then plotted in MATLAB and
compared to an experimental laminar flow
condition. Figure 4 shows a height versus time
comparison between the computational,
analytical and experimental models of flow
through the 1/16” U-tube.

Figure 5: Height versus time comparison of the


experimental model (red), computational model of
turbulent flow (blue) and computational model of laminar
flow (yellow) of flow through a 1" U-tube.

Figure 4: Height versus time comparison of the


Constricted Flow
experimental model (red), analytical model (blue) and
An equation describing the drag force caused by
computational model (yellow) of laminar flow through a
1/16" U-tube. a constriction in the bottom of the U-tube was
derived using the Venturi tube pressure drop
Turbulent Flow model. A full derivation of the constrictive drag
The relationship between the Fanning Friction force can be found in Appendix A, Constricted
Factor and Reynold’s number was derived using Flow Derivations.
points extracted from a Moody diagram. The This drag force term was added to the
derivation of this relationship can be found in differential equations describing laminar and
Appendix A, Turbulent Flow Derivations. turbulent flow. The logic behind this addition
This relationship was in the force balance can be found in Appendix A, Constricted Flow
method to derive a differential equation Derivations.
describing turbulent flow in a U-tube. The full The differential equations describing laminar
derivation for the non-linear second-order and turbulent flow through a constricted U-tube
differential equation can be found in Appendix were plotted in MATLAB. Figure 6 shows the
A, Turbulent Flow Derivations. height versus time plot for turbulent and
The computational model of turbulent flow was laminar flow simulations through a 1/16”
plotted in MATLAB and compared to the U-tube with a 1/32” constriction (the

5
Flow Oscillation Simulation Andrews

constriction has half the diameter of the main


tube).

Figure 8: Height versus time comparison of a laminar flow


model (yellow) to a turbulent flow model (blue) of flow
through a 1" U-tube with a 1/2” constriction.
Figure 6: Height versus time comparison of a laminar flow
model (yellow) to a turbulent flow model (blue) of flow
through a 1/16" U-tube with a 1/32” constriction.
DISCUSSION
Figure 7 shows the height versus time plot for TRENDS ACROSS TUBING SIZES
turbulent and laminar flow simulations through Damping Trends
a 1” U-tube with a 1/2” constriction and Figure
8 shows the height versus time plot for Trends relating to the damping characteristics
turbulent and laminar flow simulations through and flow classification develop as tubing size is
a 1” U-tube with a 7/8” constriction. increased. As the diameter of the tube
increases, the damping factor decreases. As
shown in Figure 2, at a small diameter (1/16”),
the fluid flow is over-damped causing no
oscillations across the equilibrium height to
occur. As the tubing size is increased, the
damping factor decreases and the flow
becomes increasingly under-damped. As
observed in Figure 3, fluid in a large diameter
(1”) tube oscillates multiple times before
reaching equilibrium.​1

The specific trend observed can be explained by


the relationship between the radius of the tube
and damping force. For simplicity, if we look at
Figure 7: Height versus time comparison of a laminar flow
the laminar flow ODE model (Appendix A,
model (yellow) to a turbulent flow model (blue) of flow Laminar Flow Derivations), we see that the
through a 1" U-tube with a 1/2” constriction. damping force is inversely proportionate to the
square of the radius. That means that as the
radius increases, the damping force decreases
by an exponential factor of 2. While the

6
Flow Oscillation Simulation Andrews

turbulent flow model is more complicated to simulation models follow the same general
quantify, we see a similar inverse relationship trend but show a higher degree of damping
between tube radius and damping force. than the experimental data. Sources of this
error will be discussed in the Approximations
Reynold’s Number Trends
and Simplifications secton.
We also observe a trend between the tube
EFFECT OF TURBULENCE ON DAMPING
diameter and Reynold’s number. As shown in
Table 1, as tube diameter increases, so does the As discussed in the Damping Trends section, the
Reynold’s number. The specific relationship turbulent flow model produces a different
between tube diameter and Reynold’s number damping relationship than the laminar model.
depends on whether the Reynold’s number is This difference can be observed in Figure 5
within the laminar or turbulent flow range. In which shows a height versus time comparison
the laminar range, the Reynold’s number between the computational models of
increases linearly with the tube radius. This can turbulent and laminar flow to the experimental
be explained by the direct proportionality of model of flow through the 1” U-tube. As shown
tube diameter to Reynold’s number in the in the figure, the turbulent model is more
Reynold’s number formula and the fact that the damped than the laminar model. Since a 1”
laminar flow model is linear with respect to tube would be expected to have turbulent flow,
velocity. the experimental results show that the
turbulent model is indeed more accurate than
In the turbulent range however, the Reynold’s
the laminar model.
number increases non-linearly with tube radius.
This can be explained by the non-linear The difference in damping between turbulent
behavior of velocity to tube radius in the flow and laminar flow can be explained by the
turbulent flow model. non-linear damping term in the turbulent flow
ODE model. The non-linearity results from the
relationship between the Fanning friction factor
and Reynold’s number (derivation in Appendix
3 TYPES OF MODELS FOR LAMINAR FLOW A, Turbulent Flow Derivations). The turbulent
drag force term is derived from the Darcy flow
In an attempt to model laminar flow, equation
experimental data was collected in conjunction
dP
with both computational and analytical dL = f ( 2ρ 2
D )v ,
simulations of flow. Figure 4 shows the height
versus time comparison between the where ​f​ is the Fanning friction factor equation.
computational, analytical and experimental After taking the derivative and multiplying by
models of flow through the 1/16” U-tube. The the cross sectional area (derivation in Appendix
analytical and computational models produce A, Turbulent Flow Derivations) the drag force
nearly identical results. The small error between term becomes
the two simulation curves is resultant of the F = 0.025πLρ0.8 µ0.2 D0.8 v 1.8 .
fact that they were ploted using different time
steps. The fact that the computational and Since water is a Newtonian, incompressible
analytical models are nearly identical is due to fluid, desity (ρ) and viscosity (µ) are constant.
the fact that they represent two ways of solving Therefore, it can be observed that both
the same differential equation. In comparison Reynold’s number and the drag force are
to the actual experimental results, the exclusively dependant on diameter (​D​) and
7
Flow Oscillation Simulation Andrews

velocity (​v​) and are both increased by increasing This effect can be explained by taking into
diameter and velocity. That means that at high consideration the relative magnitudes of
Reynold’s numbers, the diameter and velocity damping due to viscous/frictional effects
of the fluid will be greater, therefore increasing compared to pressure loss from the tube
the damping force as shown in the turbulent constriction. Even at first observation, it can be
model of flow. seen that the damping force due to the
constriction is proportionate to the square of
DAMPING EFFECTS IN CONSTRICTED U-TUBE
the velocity. Therefore, the damping term
Small Diameter Tube resulting from the constriction will have a
greater effect on the overall damping than the
The damping effects observed in a small open flow laminar or turbulent damping terms.
diameter constricted U-tube contradict the
aforementioned effect that turbulence In addition, as the size of the constriction
increases damping. As observed in Figure 6, the decreases relative to the size of the tube, the
turbulent model is actually less damped than constrictive damping force is multiplied by an
the laminar model for a small diameter exponentially increasing number. This effect can
constricted U-tube. be shown by the derivation of the constrictive
damping force (full derivation in Appendix A,
A general explanation for why this is the case is Constricted Flow Derivations). The resulting
that in a 1/16” diameter tube, we would expect drag force equation is
laminar flow, therefore, the turbulent model is
2 2
already an inaccurate representation of the A
F = (( AT ) − 1)ρv ,
O
flow.
where A​T​ is the cross sectional area of the tube
The actual damping effect can be explained by
and A​O ​is the cross sectional area of the orifice.
the quantitative behavior of the turbulent flow
If the orifice is a factor of ​x​ smaller than the
model. In the damping term of the turbulent
tube, the ratio between the areas becomes
flow ODE, velocity is raised to the power of 1.8.
Under laminar flow conditions (such as those in AT π(xRO )2
AO = ,
the 1/16” tube), we would expect low π(RO )2

velocities, specifically velocities under one which simplifies to


meter per second. When a value less than one
AT 2
is raised to a value greater than one, the =x .
AO
resulting value is less than the original value.
Therefore, at velocities lower than one meter Therefore, the multiplication factor in the drag
per second, the turbulent model will actually force equation is
show a decreased drag force.
x4 − 1
Large Diameter Tube
Quantitatively, this means that as the size of the
The damping effects observed in a large constriction decreases, the constrictive drag
diameter tube initially also appear to contradict force increases the size of the decrease to the
the effect that turbulence increases damping. power of four (minus 1). So, when the
As observed in figure 7, the turbulent and constriction is half the diameter of the tube, the
laminar flow models appear to have equal constrictive drag force is multiplied by 15 so the
magnitudes of damping. magnitude of its overall effect on total drag is
so much greater than the drag due to viscous or

8
Flow Oscillation Simulation Andrews

frictional effects that those effects aren’t extracting points from the Moody diagram.
visualized on the graph. Since we were interested in Reynolds numbers
on the order of magnitude of 10​3​ to 10​4​ The
In order to visualize the effect of both the
approximation of a smooth tube probably had a
constrictive drag and the difference between
small overall effect because the slopes through
turbulent and laminar flow, the size of the
the Reynold’s numbers in our range of interest
constriction can be increased (decreasing the
are roughly the same.
constrictive drag). ​Figure 8 shows the height
versus time plot for turbulent and laminar flow The second approximation resulted from the
simulations through a 1” U-tube with a 7/8” linearization of the Moody diagram. This
constriction. With a 7/8” constriction, the approximation also probably had minimal effect
multiplication factor on the constrictive drag on our calculations because the Moody diagram
force is only 0.7 therefore the effect can be is very close to linear in the Reynold’s number
visualized without overpowering the turbulent range that we were interested in.
vs laminar drag effects. As can be seen in Figure
The total effect of the Fanning friction factor
8, the overall damping is greater than in Figure
approximations and simplification to 2 external
5 (no constriction) due to the constrictive drag
forces can be visualized in Figure 5 by the
force, but the difference between turbulent and
difference between the experimental and
laminar flow can still be observed.
turbulent flow model.
APPROXIMATIONS AND SIMPLIFICATIONS
Approximation of K-value
Simplification to 2 External Forces
In the derivation of the drag force due to the
For all of the derivations, we took into account constriction, we estimated a K value of 2. Since
acceleration by gravity and drag by the K value depends on the geometry of the
visous/friction effects and constrictive pressure orrifice, and we were doing a theoretical
drop. While those are the major factors simulation, technically our result has no error
affecting drag, other factors include do to the K value we chose as long as we agree
hydrophobic/hydrophylic interactions with with the geometry that K value respresents. The
tubing, surface tension effects, tube roughness, range of K values goes from 1.01 (for a smooth
imperfect curvature of tubing, loss due to Venturi contraction) to as high as 2.7 (for a
angular velocty component in bend, etc. The sharp orrifice), so the greatest possible effect of
effect of these neglections can be visualized in K value choice would be a multiplication in the
figure 4 by the difference between the drage force by a factor of 2.67.
experimental and simulated results. The
ACCOUNTING FOR SIGN ERRORS IN MATLAB
magnitude of error by these neglections would
be different in every tubing case with the In the case of the turbulent and constrictive
greatest error percentage likely being in the differential equations, the drag force term is
smaller diameter tubing. non-linear. Two problems arise when handeling
non-linear terms in MATLAB.
Fanning Friction Factor Approximations
Creation of Imaginary Components
In the derivation of the Fanning friction factor
vs Reynold’s number formula, two major The first problem results from having a
approximations were made. First, we non-integer exponent. When a negative
approximated a tube roughness of zero when number is raised to a non-integer exponent,

9
Flow Oscillation Simulation Andrews

imaginary solutions are produce. This is the case


in the turbulent flow model where velocity is
raised to the 1.8. Whenever the velocity value is
negative, the drag force term will develop
imaginary components. This problem can be
handled by taking the absolute value of the
velocity before raising it to the non-integer
value.

Loss of Directionality

The second problem arises from both taking the


absolute value of velocity and from having an
even valued exponent. Drag forces always act in
the opposite direction to velocity, but when the
absolute value of velocity is taken (as is the case
to the solution of the first problem) or the
velocity value is raised to an even power (as is
the case in the constricted flow drag term) the
sign of velocity gets lost. This problem can be
handled by multiplying the drag term by the
orriginal sign of velocity. MATLAB’s function
sign()​will extract the sign of the value being
passed into it. So by multiplying the drag term
by ​sign(y(2))​the orriginal sign of the
velocity value will be regained and the
directionality of the drag force will be restored.

10
Flow Oscillation Simulation Andrews

APPENDIX A: DERIVATIONS

LAMINAR FLOW DERIVATIONS

Derivation of Laminar Flow Differential


Equation

TURBULENT FLOW DERIVATIONS

Derivation of Fanning Friction Factor vs


Analytical Solution to Laminar Flow Reynold’s Number Formula
Differential Equation

Derivation of Turbulent Flow Differential


Equation

11
Flow Oscillation Simulation Andrews

CONSTRICTED FLOW DERIVATIONS

Derivation of Drag Force Due to Constriction


Derivation of Constricted Laminar and
Turbulent Flow Differential Equations

12
Flow Oscillation Simulation Andrews

APPENDIX B: MATLAB mu = 8.9*10^(-4);

rho = 1000;
LAMINAR FLOW SIMULATION
r = .001588/2;
ODE Solver Function
L = .3;
function dy = secondODE(t,y)
% function to be integrated g = 9.81;

u = 8.9*10^(-4); h0 = .0324979;
p = 1000;
h= @(t)
r = .001588/2;
exp(((-4*mu)/(rho*r^2))*t)*(h0*cos(t
L = .3;
g = 9.81; *sqrt((2*g/L)-(16*mu^2)/((rho^2)*(r^
4))))+((4*mu*h0)/((rho*r^2)*sqrt((2*
A=p*pi*r^2*L; g/L)-(16*mu^2)/((rho^2)*(r^4)))))*si
B=8*u*L*pi; n(t*sqrt((2*g/L)-(16*mu^2)/((rho^2)*
C=2*p*g*pi*r^2; (r^4)))));

dy = zeros(2,1); y_anal = zeros(1,13);


dy(1) = y(2);
for i = 1 : 13
dy(2) = -C/A*y(1)- B/A*y(2);
y_anal(i) = h(t(i));
end
end
Execute
plot(t,y_ex,'r',t,y_anal,'b',t_comp,
%computational y_comp,'y','linewidth', 2)

y0 = [.0324979; 0]; legend('Experimental','Analytical','


Computational')
tspan = [0 1.188];
title('3 Models of Flow Through a
[t_comp, y] = ode45(@secondODE, 1/16" U-Tube')
tspan, y0);
xlabel('Time from Release (s)')
y_comp = y(1:end,1);
ylabel('Fluid Height in One Arm of
%experimental U-Tube (m)')
t = [0 0.099 0.198 0.297 0.396 set(gcf,'color','white')
0.495...
TURBULENT FLOW SIMULATION
0.594 0.693 0.792 0.891 0.99
1.089 1.188]; Turbulent ODE Solver Function
y_ex = .01.*[3.249792196 3.229922177 function dy = secondODEturb(t,y)
3.209148975 2.908389141 % function to be integrated
2.230500359...
u = 8.9*10^(-4);
1.626271143 1.137247895 p = 1000;
0.8349827567 0.580686654 r = .0254/2;
0.​4459117266​... L = 2;
g = 9.81;
0.3588047743 0.2710957002
beta = 1.8;
0.231355662];

%analytical A=p*pi*r^2*L;
B=.1*pi*u^(.2)*p^(.8)*(2*r)^(.8)*L/4

13
Flow Oscillation Simulation Andrews

; 2.23 2.30 2.53 2.63 2.80 2.87


C=2*p*g*pi*r^2; 3.03 3.33 3.47 3.73...
3.90 4.20 4.50 4.77 5.00 5.26
dy = zeros(2,1); 5.53 6.00 6.16 6.43...
dy(1) = y(2); 6.73 7.03 7.20 7.33 7.76 8.16
dy(2) = -C/A*y(1)- 8.40 8.96 9.26 9.43...
sign(y(2))*B/A*abs(y(2))^beta; 9.56 10.03 10.33 10.46 10.66
10.90 11.16 11.60 11.80 12.13...
end 12.20 12.60 12.90 13.36 13.76
14.03 14.46 14.83 15.09 15.56...
Laminar ODE Solver Function 15.99 16.33 16.69 16.96 17.29
17.76 18.23 18.59 18.89 19.06...
function dy = secondODELam(t,y) 19.56 19.93 20.33 21.19 21.79
22.16 22.46 22.83];
% function to be integrated
y_exp = .01.*[70.5 63.5 57 51 44 40
u = 8.9*10^(-4); 36.5 42 58 60 64 63.5 60.0...
p = 1000; 57 52 49 45 40 40.5 45 49 57
r = .0254/2; 60.5 57 52 45 43 48 51 57 58.5...
L = 2; 55 51.5 49 44.5 48 51.5 56.5 54
g = 9.81; 51 49 46 48 49.5 52 54.5...
55.5 52 49.5 47 47 49 52 54.5 52
A=p*pi*r^2*L; 49.5 48 49.5 51.5 53.2...
B=8*u*L*pi; 51.5 49.5 48.5 49.5 51 52.5 51
C=2*p*g*pi*r^2; 49.5 49 49.5 51 52 51 49.7...
51 51.5 51 50];
dy = zeros(2,1);
dy(1) = y(2); y_mid = .51.*ones(1,78);
dy(2) = -C/A*y(1)- B/A*y(2);
y_ex = y_exp - y_mid;
end
plot(t,y_ex,'r',t_compTurb,y_compTur
Execute b,'b',t_compLam,y_compLam,'y','linew
idth',1.5)
%computational turbulent legend('Experimental','Computational
y0 = [.705-.51; 0]; Turbulent','Computational Laminar')
tspan = [0 22.83]; title('3 Models of Flow Through a 1"
U-Tube')
[t_compTurb, yTurb] = xlabel('Time from Release (s)')
ode45(@secondODEturb, tspan, y0); ylabel('Fluid Height in One Arm of
U-Tube (m)')
y_compTurb = yTurb(1:end,1); set(gcf,'color','white')

CONSTRICTED FLOW SIMULATION: SMALL


%computational laminar TUBE
y0 = [.705-.51; 0];
tspan = [0 22.83]; Turbulent ODE Solver Function
function dy =
[t_compLam, yLam] =
secondODEconstTurbSmall(t,y)
ode45(@secondODElam, tspan, y0);
% function to be integrated
y_compLam = yLam(1:end,1);
u = 8.9*10^(-4);
p = 1000;
%experimental
r = .001588/2;
t = [0.00 0.33 0.50 0.60 0.77 0.87
L = .3;
1.20 1.47 1.90 2.00...
g = 9.81;

14
Flow Oscillation Simulation Andrews

tspan, y0);
A=p*pi*r^2*L;
B=.1*pi*u^(.2)*p^(.8)*(2*r)^(.8)*L/4 y_compLam = yLam(1:end,1);
;
C=2*p*g*pi*r^2; plot(t_compTurb,y_compTurb,'b',t_com
D=15*pi*r^2*p; pLam,y_compLam,'y','linewidth',1.5)
legend('Constricted
dy = zeros(2,1); Turbulent','Constricted Laminar')
dy(1) = y(2); title('2 Models of Flow Through a
dy(2) = -C/A*y(1)- 1/16" U-Tube With 1/32"
sign(y(2))*B/A*abs(y(2))^1.8 - Constriction')
D/A*abs(y(2))*y(2); xlabel('Time from Release (s)')
ylabel('Fluid Height in One Arm of
end U-Tube (m)')
set(gcf,'color','white')
Laminar ODE Solver Function
CONSTRICTED FLOW SIMULATION: LARGE
function dy = TUBE
secondODEconstLamSmall(t,y)
% function to be integrated Turbulent ODE Solver Function
u = 8.9*10^(-4); function dy =
p = 1000; secondODEconstTurbLarge(t,y)
r = .001588/2; % function to be integrated
L = .3;
g = 9.81; u = 8.9*10^(-4);
p = 1000;
A=p*pi*r^2*L; r = .0254/2;
B=8*u*L*pi; L = 2;
C=2*p*g*pi*r^2; g = 9.81;
D=15*pi*r^2*p;
A=p*pi*r^2*L;
dy = zeros(2,1); B=.1*pi*u^(.2)*p^(.8)*(2*r)^(.8)*L/4
dy(1) = y(2); ;
dy(2) = -C/A*y(1)- B/A*y(2)- C=2*p*g*pi*r^2;
D/A*abs(y(2))*y(2); D=15*pi*r^2*p;

end dy = zeros(2,1);
dy(1) = y(2);
Execute dy(2) = -C/A*y(1)-
sign(y(2))*B/A*abs(y(2))^1.8 -
%computational turbulent large D/A*abs(y(2))*y(2);
y0 = [.0324979; 0];
tspan = [0 1.88]; Laminar ODE Solver Function
[t_compTurb, yTurb] = function dy =
ode45(@secondODEconstTurbSmall, secondODEconstLamLarge(t,y)
tspan, y0); % function to be integrated

y_compTurb = yTurb(1:end,1); u = 8.9*10^(-4);


p = 1000;
%computational laminar large r = .0254/2;
y0 = [.0324979; 0]; L = 2;
tspan = [0 1.88]; g = 9.81;

[t_compLam, yLam] = A=p*pi*r^2*L;


ode45(@secondODEconstLamSmall, B=8*u*L*pi;

15
Flow Oscillation Simulation Andrews

C=2*p*g*pi*r^2;
D=15*pi*r^2*p;

dy = zeros(2,1);
dy(1) = y(2);
dy(2) = -C/A*y(1)- B/A*y(2) -
D/A*abs(y(2))*y(2);

Execute
%computational turbulent large
y0 = [.705-.51; 0];
tspan = [0 22.83];

[t_compTurb, yTurb] =
ode45(@secondODEconstTurbLarge,
tspan, y0);

y_compTurb = yTurb(1:end,1);

%computational laminar large


y0 = [.705-.51; 0];
tspan = [0 22.83];

[t_compLam, yLam] =
ode45(@secondODEconstLamLarge,
tspan, y0);

y_compLam = yLam(1:end,1);

plot(t_compTurb,y_compTurb,'b',t_com
pLam,y_compLam,'y','linewidth',1.5)
legend('Constricted
Turbulent','Constricted Laminar')
title('2 Models of Flow Through a 1"
U-Tube With 1/2" Constriction')
xlabel('Time from Release (s)')
ylabel('Fluid Height in One Arm of
U-Tube (m)')
set(gcf,'color','white')

16

Vous aimerez peut-être aussi