summaryrefslogtreecommitdiff
path: root/629/CH3/EX3.3/example3_3.sce
blob: 3e1d146f8de7096a68e82b229066f754b0d40fd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
clear
clc
//Example 3.3 PRESSURE IN TANK WITH TWO FLUIDS
//Hydrostatic equation(oil), p1/g_oil +z1=p2/g_oil +z2
p1=0; //[Pa]
z1=3; //[m]
z2=2.1; //[m]
g_oil=0.8*9810; //specific weight of oil[N/m^3]
p2=(p1+(z1-z2)*g_oil)/10^3//[kPa] (factor 1kPa/10^3Pa)

//At oil-water interface, p2_oil=p2_water
//Hydrostatic equation(water), p2/g_water +z2=p3/g_water +z3
z3=0; //[m]
g_water=9810; //specific weight of water[N/m^3]
p3=p2+(z2-z3)*g_water/10^3 //[kPa]
printf("\nThe gage pressure at the bottom of the tank = %.1f kPa gage.\n",p3)