Showing posts with label water. Show all posts
Showing posts with label water. Show all posts

Saturday, July 20, 2024

Swiss Micros DM41X and Casio fx-CG 50: Minor Head Loss

Swiss Micros DM41X and Casio fx-CG 50: Minor Head Loss



Introduction


When a fluid, such as water, is flowing in a pipe system, energy is lost from the flow due to friction. This loss is known as head loss. The equation presented here is an equation to determine head loss occurring in pipe bends and joints (entrances and exits), which is categorized as minor loss. Minor losses are typically summarized with major losses to determine total head loss.


A formula for minor head loss is stated as:


h = C * v^2 / (2 * g)


where:

h = head loss (m)

C = coefficient

v = velocity of the fluid (m/s)

g = Earth’s gravity = 9.80665 m/s^2 (2 * g = 19.6133 m/s^2)

C = head loss coefficient (see table below)


Type # for C

Value

1. Sharp Exit

1

2. Protruding Entrance

0.8

3. Sharp Entrance

0.5

4. Round Entrance

0.1


If we fit the above table like so:


Type # for C

Value

1

1

2

0.8

3

0.5

4

0.1


Fortunately, the data above (and only the data above) can fit into the quadratic equation:

y = -0.05 * x^2 – 0.05 * x + 1.1 = -0.05 * (x^2 + x) + 1.1


where x is the type number and y is the corresponding coefficient. The assignment of type numbers is arbitrarily.


In the code for the DM41X, I use the polynomial to grab the required coefficient of the user’s choice, mapping choice 1 to C =1 for sharp exit, mapping choice 2 to C = 0.8 for protruding entrance, and so on. I got really lucky because the quadratic equation presented a perfect fit (r^2 = 1). In programming it can serve as alternative way to retrieve coefficient values (but the fit has to be perfect or near perfect with minor adjustments).



Swiss Micros DM41X Code: HEADLOS

(HP 41C compatible, no modules needed)


01 LBL^T HEADLOS

02 LBL 00

03 ^T SHARP EXIT

04 AVIEW

05 PSE

06 PSE

07 ^T PROTRUDING

08 AVIEW

09 PSE

10 PSE

11 ^T 3 SHARP ENT.

12 AVIEW

13 PSE

14 PSE

15 ^T 4 ROUND ENT.

16 AVIEW

17 PSE

18 PSE

19 ^T TYPE?

20 PROMPT

21 INT

22 STO 00 (comparison: reject if the entry is negative or greater than 5)

23 X<=0?

24 GTO 00

25 5

26 X<=Y?

27 GTO 00

28 RCL 00

29 X↑2

30 RCL 00

31 +

32 -20

33 /

34 1.1

35 +

36 ^T VEL. <M/S>?

37 PROMPT

38 X↑2

39 *

40 19.6133

41 /

42 ^T HEAD LOSS=

43 ARCL X

44 RTN

45 END


Casio fx-CG 50 Program HEADLOSS


Menu “TYPE”, “SHARP EXIT”, 1, “PROTRUDING”, 2, “SHARP ENTRANCE”, 3, “ROUND ENTRANCE”, 4

Lbl 1: 1 → C: Goto 5

Lbl 2: 0.8 → C: Goto 5

Lbl 3: 0.5 → C: Goto 5

Lbl 4: 0.1 → C: Goto 5

Lbl 5

“VELOCITY (M _| S)”? → V ( _| is the fraction character [ []/[] ] )

C × V² ÷ 19.6133 → H

“HEAD LOSS:”

H


Example


For the velocity, v = 10.5 ft/s ≈ 3.2004 m/s:


Type

Head Loss (h)

1. Sharp Exit

0.5222

2. Protruding Entrance

0.4178

3. Sharp Entrance

0.2611

4. Round Entrance

0.0522



Sources


Ajmera, Benna. “Engineering Formulas” Quick Study Academic. BarCharts, Inc. 2014


“Minor Losses in Pipes and Ducts“ Ansys. 2020. https://courses.ansys.com/wp-content/uploads/2020/09/Lesson-4-Minor-Losses-in-Pipes-and-Ducts-Handout.pdf Retrieved June 6, 2024.



Until next time,


Eddie


All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Monday, January 29, 2018

HP Prime and TI-84 Plus CE: Heat Properties of Water

HP Prime and TI-84 Plus CE:  Heat Properties of Water


Introduction

The program HEATH20 calculates three heat properties of liquid water based on its temperature.  The program accepts three measurements for liquid water, Fahrenheit (°F), Celsius (°C), or Kelvin (K).

Formulas Used:

Specific heat capacity of water (amount of heat added or removed from an object to cause a temperature change), measured in J/(g*°C):

C =

4.218 + 3.47*10^-4 *(T – 273)^2, for 233 K ≤ T < 274 K 

4.175 + 1.3*10^-5 * (T – 308)^2 + 1.6 * 10^-8 *(T-308)^4, for 274 K ≤ T ≤ 308 K

(slight adjustment on the limits to allow for 273 K to be calculated using the former formula)

Latent heat of evaporation, measured in kJ/kg: 

V = 1000 * (2.5 * (273.15/T)^(0.167 + 3.67 * 10^-4 *T))

Latent heat of fusion, measured in kJ/kg:

M = 333.5 + 2.05 * T – 0.0105 * T^2


HP Prime Program HEATH20

EXPORT HEATH2O()
BEGIN
// Water Properties
// EWS 2018-01-28
// Seinfeld, Pandis
// Atmospheric Chemistry - 2006

// input of temperature
LOCAL ch,T,C,V,H;
INPUT({T,{ch,{"°F","°C","K"}}},
"Temperature",
{"Temp: ","Unit: "});
IF ch==1 THEN
T:=5/9*(T-32)+273.15; END;
IF ch==2 THEN
T:=T+273.15; END;

// Specific heat (liquid)
CASE
IF T≥233 AND T<274 THEN
C:=4.218+3.47ᴇ−4*(T-273)^2; END;
IF T≥274 AND T≤308 THEN
C:=4.175+1.3ᴇ−5*(T-308)+
1.6ᴇ−8*(T-308)^4; END;
DEFAULT
C:=0; END;

// Latent Heat: Evaporation
V:=(2.5*(273.15/T)^
(0.167+3.67ᴇ−4*T))*1000;

// Latent Heat: Fusion
M:=333.5+2.05*(T-273.15)
-0.0105*(T-273.15)^2;

// Results
PRINT();

PRINT("Temp: "+STRING(T)+" K");

IF C≠0 THEN
PRINT("Spec. Heat-Liquid (kJ/g*K)");
PRINT(STRING(C)+" kJ/(g*K)");
END;

PRINT("Latent Heat - Evaporation:");
PRINT(STRING(V)+" kJ/kg");

PRINT("Latent Heat - Fusion");
PRINT(STRING(M)+" kJ/kg");

END;

TI-84 Plus CE Program HEATH20

"EWS 2018-01-28"
"SEINFELD, PANDIS"
"ATMOSPHERIC CHEMISTRY,2006"

Input "TEMPERATURE: ",T
Menu("TEMP. UNIT","°F",1,"°C",2,"K",3)
Lbl 1
5/9*(T-32)+273.15→T
Goto 3
Lbl 2
T+273.15→T
Goto 3
Lbl 3
0→C
If T≥233 and T<274
Then
4.218+3.74E­4*(T-273)^2→C
End
If T≥274 and T≤308
Then
4.175+1.3E­5*(T-308)^2+1.6E­8*(T-308)^4→C
End
(2.5*(273.15/T)^(.167+3.67E­4*T))*1000→V
333.5+2.05*(T-273.15)-.0105*(T-273.15)^2→M
ClrHome
Disp "TEMP (K):",T
If C≠0
Then
Disp "SPEC. HEAT (KJ/(G*K)",C
End
Disp "LATENT-EVAP. (KJ/KG)",V
Disp "LATENT-FUSION (KJ/KG)",M

Example

0°C (273.15 K):

Results:

Temp:  273.15  K
Specific Heat:  4.218008415 kJ/(g*K)
Latent Heat – Evaporation:  2500 kJ/kg
Latent Heat – Fusion:  333.5 kJ/kg

Source:

John H. Seinfeld, Spyros N. Pandis.  Atmospheric Chemistry and Physics: From Air Pollution to Climate Change, 2nd Edition.  John Wiley & Sons, Inc:  Hoboken, New Jersey. 2006  ISBN-13: 978-0-471-72018-8

Eddie


This blog is property of Edward Shore, 2018.

Friday, January 12, 2018

TI-80 and TI-84 Plus CE – Two Opposing Ocean Waves

TI-80 and TI-84 Plus CE – Two Opposing Ocean Waves

Introduction

The program OPPTIDE draws an ocean wave consisting of a composite of two opposite waves at time t seconds. 

Inputs:

L = wavelength of the wave in feet (λ)
A = amplitude of the wave in feet
H = depth of the ocean in feet
T = time that the wave is drawn, in seconds

Constants:

G ≈ 32.174049 ft/s^2  (approximate Earth’s gravitation constant)

Output: 

Drawing of the wave described by the equation:

y = A cos (K*X – W*T) + A cos (K*X + W*T)  (X varies, T is a constant and given), where:
K = 2*π/L
W = (g*K*tanh(K*H))

Note:

The tanh, hyperbolic tangent function, is not on the TI-80.  Therefore the following definition is used:

tanh x = (e^(2*x) – 1)/(e^(2*x) + 1)

The tanh function is found only in the catalog of the TI-84 Plus CE ([Shift], [ 0 ]).

TI-80 Program OPPTIDE

DISP “2018-01-10 EWS”
RADIAN
0→XMIN
50→XMAN
5→XSCL
32.17049→G
DISP “FEET”
INPUT “WAVELENGTH:”,L
INPUT “DEPTH:”,H
INPUT “AMPLITUDE:”,A
-A-1→YMIN
A+1→YMAX
1→YSCL
INPUT “TIME:”,T
(2π)/L→K
(e^(2KH)-1)/(e^(2KH)+1)→Q
√(QKG)→W
“A*COS(KX-WT)+A*COS(KX+WT)”→Y1
DISPGRAPH

TI-84 Plus CE Program OPPTIDE

“EWS 2018-01-10”
Func: Radian
0→Xmin: 50→Xmax: 5→Xscl
32.174049→G
Disp “DISTANCE IN FEET”
Input “WAVELENGTH:”, L
Input “AMPLITUDE:”, A
-A-1→Ymin: A+1→Ymax: 1→Yscl
Input “OCEAN DEPTH:”, H
Input “TIME (S):”, T
2π/L→ K
√(G K * tanh(KH))→W
“A cos(KX – WT) + A cos(KX + WT)” → Y1
GraphColor(1,BLUE)
DispGraph

Example

At T = 1 second with parameters:
W = 75.5 feet
A = 4.76 feet
H = 25 feet

See the results below.



Source:

Salmon, Rick.  “Intro to Ocean Waves”  Scripps Institution of Oceanography.  UC San Diego  December 7, 2015.  http://pordlabs.ucsd.edu/rsalmon/111.textbook.pdf  Retrieved December 26, 2017

Eddie


This blog is property of Edward Shore, 2018.  

Sunday, April 23, 2017

HP Prime and TI-84 Plus CE: Shallow Wave Analysis

HP Prime and TI-84 Plus CE:  Shallow Wave Analysis

Introduction



The program H2OWAVES calculates wave speed, impedance, and wave flux for shallow ocean waves.  The following are assumed:

1. The criteria of λ < D/20 is assumed where λ is the length of the wave.
2. The water assumed to be 0°C, where the density (ρ) is 1,000 kg/m. 
3. SI units are used.  For gravity, g = 9.80665 m/s^2 is used.

Formulas Used

Wave Speed (m/s):  v = √(g * D)
Wave Impedance (Mks):  Z = ρ * v
Wave Energy Flux (W/m):  I = (ρ * g * H)^2/(2 * Z)
Maximum Possible Length (m):  λ = 20 * D

HP Prime Program H2OWAVES

EXPORT H2OWAVES()
BEGIN
// EWS 2017-04-21
// Shallow Wave Analysis
// for D/L<1/20
// SI Units

LOCAL D,H;
LOCAL v,Z,I;

INPUT({D,H},
"Wave Analysis",
{"D: ","H: "},
{"Depth (m)","Wave Height (m)"});

v:=√(9.80665*D);
Z:=1000*v;
I:=(9806.65*H)^2/(2*Z);

PRINT();
PRINT("Wave speed (m/s): "+v);
PRINT("Impedance (Mks): "+Z);
PRINT("Wave Flux (W/m): "+I);

RETURN {v,Z,I};

END;

TI-84 Plus CE Program H2OWAVES

"EWS 2017-04-23"
"SHALLOW WAVES"
"D<F/20"
Disp "SHALLOW WAVES"
Input "DEPTH (M): ",D
Input "HEIGHT (M): ",H
√(9.80665*D)→V
1000*V→Z
(9806.65*H)^2/(2*Z)→I
Disp "WAVE SPEED (M/S):",V
Disp "IMPEDANCE (WKS):",Z
Disp "WAVE FLUX (W/M):",I

Example

Input: 
Depth:  3.2 m
Height:  0.49 m

Output:
Wave Speed: 5.601899678 m/s
Impedance:  5601.899678 Wks
Wave Flux:  2060.953478 W/m

Source:

Ingard, K.U. Fundamental of Waves and Oscillations Cambridge University Press:  New York 1988.  IBSN 0 521 32734

Surf’s up!  Eddie


This blog is property of Edward Shore, 2017.

Saturday, July 12, 2014

When is the Glass Half Full?



We have heard the famous two expressions “the glass is half-full” and the “glass is half-empty”; the former is from the view of an optimist while the latter is from the view of a pessimist.  In life, I have been both the optimist and the pessimist. 

Let’s consider when a glass is actually half empty, oh sorry, half full.  This is achieved when the volume is half full when the volume of the liquid equals half of the volume of the glass.  Simple enough.

Let q be the flow rate of the liquid being poured in the glass, and assume it is a constant to keep it simple.  (Yes we can a variable flow rate q(t) – this would be appropriate when pouring viscous liquids or considering problems when we are drinking water or our favorite spirit or pop).

With V being the volume of the liquid:

dV/dt = q

dV = q dt

Taking the integral of both sides yield:

V = q*t + V0

Where V0 is the initial volume of the liquid.  Let’s assume that we start with an empty glass.  Then the liquid of the liquid inside of the glass is:

V = q*t

Let C be the volume (or the capacity) of the glass.  The glass is half full when V = C/2 or

t = C/(2 * q)

We can use this equation for various shapes of drinking glasses.  Case in point:



For a cylindrical glass:  volume = π * r^2 * h



For a cylindrical glass:  C = π * r^2 * h


For a parabolic glass:  volume = π * r^2 * h/2




For a parabolic glass:  C = π * r^2 * h/2

For a cup:  volume = π * h/3 * (a^2 + a*b + b^2)


For a cup:  C = π * h/3 * (a^2 + a*b + b^2)



(r, a, and b are radii – half of the distance of the diameter.)

Take the example that we have a cup with dimensions a = 1.375 in, b = 1.75 in, and h = 3.5 in.  We are going to pour iced tea in it at a flow rate of q = 8.3 in^3/sec.   

C = π * 3.5/3 * (1.375^2 + 1.375 * 1.75 + 1.75^2) ≈ 26.93752 in^3

and t ≈ 26.97352/(2 * 8.3) ≈ 1.62491 sec

P.S. The flow rate I gave came from a short experiment of actually pouring Arnold Palmer Ice Tea into the glass and timing how long it takes to pour the ice tea, which it took about 3.25 seconds to fill it.  Doing the same experiment with pouring water from a bottle, which took me 7 seconds (a flow rate of approximately 3.9 in^3/sec) – but I think held the bottle closer to the cup.

Pessimists and optimists (and everyone in between) – go out and have an awesome weekend.  Cheers!

Eddie

This blog is property of Edward Shore.  2014.


 

Earth's Radius by Latitude

Earth's Radius by Latitude Introduction: Calculating the Earth’s Radius In quick, general calculations, we assume that the...