diff options
Diffstat (limited to '797/CH2')
-rw-r--r-- | 797/CH2/EX2.1.e/2_01_example.sci | 8 | ||||
-rw-r--r-- | 797/CH2/EX2.1.s/2_01_solution.sce | 14 | ||||
-rw-r--r-- | 797/CH2/EX2.2.e/2_02_example.sci | 3 | ||||
-rw-r--r-- | 797/CH2/EX2.2.s/2_02_solution.sce | 6 | ||||
-rw-r--r-- | 797/CH2/EX2.3.e/2_03_example.sci | 8 | ||||
-rw-r--r-- | 797/CH2/EX2.3.s/2_03_solution.sce | 15 | ||||
-rw-r--r-- | 797/CH2/EX2.4.e/2_04_example.sci | 5 | ||||
-rw-r--r-- | 797/CH2/EX2.4.s/2_04_solution.sce | 20 | ||||
-rw-r--r-- | 797/CH2/EX2.5.e/2_05_example.sci | 7 | ||||
-rw-r--r-- | 797/CH2/EX2.5.s/2_05_solution.sce | 11 | ||||
-rw-r--r-- | 797/CH2/EX2.6.e/2_06_example.sci | 7 | ||||
-rw-r--r-- | 797/CH2/EX2.6.s/2_06_solution.sce | 13 | ||||
-rw-r--r-- | 797/CH2/EX2.7.e/2_07_example.sci | 4 | ||||
-rw-r--r-- | 797/CH2/EX2.7.s/2_07_solution.sce | 11 |
14 files changed, 132 insertions, 0 deletions
diff --git a/797/CH2/EX2.1.e/2_01_example.sci b/797/CH2/EX2.1.e/2_01_example.sci new file mode 100644 index 000000000..71cd13018 --- /dev/null +++ b/797/CH2/EX2.1.e/2_01_example.sci @@ -0,0 +1,8 @@ +//Example 2-1 Density, Specific Gravity and Mass of Air in a Room +l = 4 //length [m] +b = 5 //breadth [m] +w = 6 //width [m] +P = 100 //Pressure [kPa] +T = 25 //Temperature [degree celcius] +R = 0.287 //Ideal gas(here air) constant [kJ/kg.K] +rho_water = 1000 //Density of water [kg/m^3]
\ No newline at end of file diff --git a/797/CH2/EX2.1.s/2_01_solution.sce b/797/CH2/EX2.1.s/2_01_solution.sce new file mode 100644 index 000000000..ba6af5b7a --- /dev/null +++ b/797/CH2/EX2.1.s/2_01_solution.sce @@ -0,0 +1,14 @@ +//Solution 2-1 +WD=get_absolute_file_path('2_01_solution.sce') +datafile=WD+filesep()+'2_01_example.sci' +clc; +exec(datafile) +rho = P / (R * (T + 273)) //ideal gas relation +SG=rho / rho_water //definition specific gravity +V = l * b * w //Volume in m^3 +m = rho * V //Mass in kg +//Result +printf("Density of air is %1.2f kg/m^3",rho) +printf("\nSpecific gravity of air is %1.5f",SG) +printf("\nVolume of air is %1.2f m^3",V) +printf("\nMass of air is %1.0f kg",m) diff --git a/797/CH2/EX2.2.e/2_02_example.sci b/797/CH2/EX2.2.e/2_02_example.sci new file mode 100644 index 000000000..fe7dc8866 --- /dev/null +++ b/797/CH2/EX2.2.e/2_02_example.sci @@ -0,0 +1,3 @@ +//Example 2-2 Minimum Pressure to Avoid Cavitation +T = 30 //temperature of water [degree celcius] +P = 4.25 //vapour pressure of water at 30 degree celcius [kPa]
\ No newline at end of file diff --git a/797/CH2/EX2.2.s/2_02_solution.sce b/797/CH2/EX2.2.s/2_02_solution.sce new file mode 100644 index 000000000..93cb6d6c8 --- /dev/null +++ b/797/CH2/EX2.2.s/2_02_solution.sce @@ -0,0 +1,6 @@ +//Solution 2-2 +WD=get_absolute_file_path('2_02_solution.sce') +datafile=WD+filesep()+'2_02_example.sci' +clc; +exec(datafile) +printf("Minimum pressure allowed in the system to avoid cavitation is %1.2f kPa", P) diff --git a/797/CH2/EX2.3.e/2_03_example.sci b/797/CH2/EX2.3.e/2_03_example.sci new file mode 100644 index 000000000..d37f45d44 --- /dev/null +++ b/797/CH2/EX2.3.e/2_03_example.sci @@ -0,0 +1,8 @@ +//Example 2-3 Variation of Density with Temperature and Pressure +T_i = 20 //initial temperature of water [degree C] +P_i = 1 //initial pressure of water [atm] +T_f = 50 //final temperature of water [degree C] +P_f = 100 //final pressure of water [atm] +alpha = 4.8 * 10**-5 //isothermal compressiblity of water [atm^-1] +rho = 998 //density of water at 20 degree celcius and 1 atm pressure [kg / m^3] +beta_ = 0.337 * 10**-3 //coefficient of colume expansion at average temperature 35 degree [1 / K] diff --git a/797/CH2/EX2.3.s/2_03_solution.sce b/797/CH2/EX2.3.s/2_03_solution.sce new file mode 100644 index 000000000..1744c6732 --- /dev/null +++ b/797/CH2/EX2.3.s/2_03_solution.sce @@ -0,0 +1,15 @@ +//Solution 2-3 +WD=get_absolute_file_path('2_03_solution.sce') +datafile=WD+filesep()+'2_03_example.sci' +clc; +exec(datafile) +//(a) +deltarho = - beta_ * rho * (T_f - T_i); //def of coefficient of volume expansion +rho_2 = rho + deltarho; //actual density at 50 C and 1 atm pressure +//result +printf("Final density of water \n1.At 50C and constant pressure of 1 atm = %1.1f kg / m^3",rho_2); +//(b) +deltarho = alpha * rho * (P_f - P_i); //def of coefficient of compressiblity +rho_2 = rho + deltarho; //actual density at 20C and 100atm pressure +//result +printf("\n2.At 20C and 100 atm pressure = %1.1f kg / m^3",rho_2);
\ No newline at end of file diff --git a/797/CH2/EX2.4.e/2_04_example.sci b/797/CH2/EX2.4.e/2_04_example.sci new file mode 100644 index 000000000..bfcc826eb --- /dev/null +++ b/797/CH2/EX2.4.e/2_04_example.sci @@ -0,0 +1,5 @@ +//Example 2-4 Mach Number of Air Entering the Diffuser +V = 200 //speed of air entering diffuser [m /s] +T =30 //temperature of air at the inlet of diffuser [degree C] +R = 287 //gas constant of air [J / Kg.K] +k = 1.4 //specific heat ratio for air at 30C []
\ No newline at end of file diff --git a/797/CH2/EX2.4.s/2_04_solution.sce b/797/CH2/EX2.4.s/2_04_solution.sce new file mode 100644 index 000000000..32ac174bd --- /dev/null +++ b/797/CH2/EX2.4.s/2_04_solution.sce @@ -0,0 +1,20 @@ +//Solution 2-4 +WD=get_absolute_file_path('2_04_solution.sce') +datafile=WD+filesep()+'2_04_example.sci' +clc; +exec(datafile) +//conversion +T = T + 273; //[degree C] to [K] +//(a) +c = sqrt(k * R * T); +printf("Speed of sound in air at 30C is %1.0f m / s", c); +//(b) +Ma = V / c; +printf("\nMach number at diffuser inlet is %1.3f", Ma); +if Ma < 1 then + printf("\nHence flow is subsonic"); +elseif Ma == 1 + printf("\nHence flow is sonic"); +else + printf("\nHence flow is supersonic"); +end diff --git a/797/CH2/EX2.5.e/2_05_example.sci b/797/CH2/EX2.5.e/2_05_example.sci new file mode 100644 index 000000000..7db8f1896 --- /dev/null +++ b/797/CH2/EX2.5.e/2_05_example.sci @@ -0,0 +1,7 @@ +//Example 2-5 Determining the Viscosity of Fluid +L = 40 //length of viscometer [cm] +l = 0.15 //gap between two cylinders [cm] +d_o = 12 //outer diameter of inner cylinder [cm] +ndot = 300 //rotational speed of inner cylinder [rpm] +T = 1.8 //torque required to move cylinder [N.m] +
\ No newline at end of file diff --git a/797/CH2/EX2.5.s/2_05_solution.sce b/797/CH2/EX2.5.s/2_05_solution.sce new file mode 100644 index 000000000..a52701952 --- /dev/null +++ b/797/CH2/EX2.5.s/2_05_solution.sce @@ -0,0 +1,11 @@ +//Solution 2-5 +WD=get_absolute_file_path('2_05_solution.sce') +datafile=WD+filesep()+'2_05_example.sci' +clc; +exec(datafile) +//conversion +l = l / 100; //from [cm] to [m] +L = L / 100; //from [cm] to [m] +R = d_o / (2 * 100); +mu = T * l / (4 * %pi**2 * R**3 * ndot / 60 * L); +printf("Viscocity of fluid is measured to be %1.3f N.s/m^2", mu);
\ No newline at end of file diff --git a/797/CH2/EX2.6.e/2_06_example.sci b/797/CH2/EX2.6.e/2_06_example.sci new file mode 100644 index 000000000..b22e19d35 --- /dev/null +++ b/797/CH2/EX2.6.e/2_06_example.sci @@ -0,0 +1,7 @@ +//Example 2-6 The Capillary Rise of Water in Tube +D = 0.6 //diameter of glass tube [mm] +T = 20 //temperature of water [degree C] +sigma_s = 0.073 //surface tension of water at 20C [N/m] +rho = 1000 //density of water [kg/m^3] +g = 9.81 //gravitational acceleration [m/s^2] +phi = 0 //contact angle for water and glass [degree]
\ No newline at end of file diff --git a/797/CH2/EX2.6.s/2_06_solution.sce b/797/CH2/EX2.6.s/2_06_solution.sce new file mode 100644 index 000000000..50bbda490 --- /dev/null +++ b/797/CH2/EX2.6.s/2_06_solution.sce @@ -0,0 +1,13 @@ +//Solution 2-6 +WD=get_absolute_file_path('2_06_solution.sce') +datafile=WD+filesep()+'2_06_example.sci' +clc; +exec(datafile) +//conversion +D = D / 1000; //from [mm] to [m] +phi = phi * %pi /180; //from [degree] to [radians] + +R = D / 2; +h = 2 * sigma_s * cos(phi) / (rho * g * R); //from capilary rise equation +h = h * 100; //conversion from [m] to [cm] +printf("Water rises in the tube %1.0f cm above the liquid level in the cup", h);
\ No newline at end of file diff --git a/797/CH2/EX2.7.e/2_07_example.sci b/797/CH2/EX2.7.e/2_07_example.sci new file mode 100644 index 000000000..ac015937c --- /dev/null +++ b/797/CH2/EX2.7.e/2_07_example.sci @@ -0,0 +1,4 @@ +//Example 2-7 Using Capillary Rise to Generate Power in a Hydraulic Turbine +h = 5 //rise of water column due to capillary effect [cm] +g = 9.81 //gravitational acceleration [m/s^2] +rho = 1000 //density of water [kg/m^3]
\ No newline at end of file diff --git a/797/CH2/EX2.7.s/2_07_solution.sce b/797/CH2/EX2.7.s/2_07_solution.sce new file mode 100644 index 000000000..5c72b3c86 --- /dev/null +++ b/797/CH2/EX2.7.s/2_07_solution.sce @@ -0,0 +1,11 @@ +//Solution 2-6 +WD=get_absolute_file_path('2_07_solution.sce') +datafile=WD+filesep()+'2_07_example.sci' +clc; +exec(datafile) +//conversion +h = h /100; //from [cm] to [m] + +deltaP = rho * g * h +deltaP = deltaP / 10**5; //conversion from [N/m^2] to [atm] +printf("The pressure at top of water column is less than atm pressure by %1.3f atm", deltaP);
\ No newline at end of file |