summaryrefslogtreecommitdiff
path: root/3765/CH1
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3765/CH1
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3765/CH1')
-rw-r--r--3765/CH1/EX1.1/Ex1_1.sce26
-rw-r--r--3765/CH1/EX1.2/Ex1_2.sce23
-rw-r--r--3765/CH1/EX1.3/Ex1_3.sce17
-rw-r--r--3765/CH1/EX1.4/Ex1_4.sce24
-rw-r--r--3765/CH1/EX1.5/Ex1_5.sce32
-rw-r--r--3765/CH1/EX1.6/Ex1_6.sce32
-rw-r--r--3765/CH1/EX1.7/Ex1_7.sce45
7 files changed, 199 insertions, 0 deletions
diff --git a/3765/CH1/EX1.1/Ex1_1.sce b/3765/CH1/EX1.1/Ex1_1.sce
new file mode 100644
index 000000000..f67b55304
--- /dev/null
+++ b/3765/CH1/EX1.1/Ex1_1.sce
@@ -0,0 +1,26 @@
+clc
+// Example 1.1.py
+// Consider the low-speed flow of air over an airplane wing at standard
+// sea level conditions the free-stream velocity far ahead of the wing
+// is 100 mi/h. The flow accelerates over the wing, reaching a maximum
+// velocity of 150 mi/h at some point on the wing. What is the percentage
+// pressure change between this point and the free stream//
+
+
+// Variable declaration
+rho = 0.002377 // density at sea level (slug/ft^3)
+p_1 = 2116.0 // pressure at sea level (lb/ft^2)
+v_1 = 100.0 // velocity far ahead of the wing (mi/h)
+v_2 = 150.0 // velocity at some point on the wing (mi/h)
+
+// Calculations
+
+u_1 = v_1 * 88.0/60.0 // converting v_1 in ft/s
+u_2 = v_2 * 88.0/60.0 // converting v_2 in ft/s
+
+delP = 0.5*rho*(u_2*u_2 - u_1*u_1) // p_1 - p_2 from Bernoulli's equation
+fracP = delP/p_1 // fractional change in pressure with respect to freestream
+
+// Result
+printf("\n Fractional change in pressure is %.3f or %.1f percent", fracP, fracP*100)
+
diff --git a/3765/CH1/EX1.2/Ex1_2.sce b/3765/CH1/EX1.2/Ex1_2.sce
new file mode 100644
index 000000000..0f158e3f5
--- /dev/null
+++ b/3765/CH1/EX1.2/Ex1_2.sce
@@ -0,0 +1,23 @@
+clc
+// Example 1.2.py
+// A pressure vessel that has a volume of 10 m^3 is used to store high
+// pressure air for operating a supersonic wind tunnel. If the air pressure
+// and temperature inside the vessel are 20 atm and 300 K, respectively,
+// what is the mass of air stored in the vessel//
+
+// Variable declaration
+V = 10 // volume of vessel (m^3)
+p = 20.0 // pressure (atm)
+T = 300 // temperature (K)
+
+R = 287.0 // gas constant (J/Kg/K)
+
+// Calculations
+p = p * 101000.0 // units conversion to N/m^2
+rho = p/R/T // from ideal gas equation of state
+m = V * rho // total mass volume * density
+
+
+// Result
+printf("\n Total mass stored is %.1f Kg", m)
+
diff --git a/3765/CH1/EX1.3/Ex1_3.sce b/3765/CH1/EX1.3/Ex1_3.sce
new file mode 100644
index 000000000..d1ce816a7
--- /dev/null
+++ b/3765/CH1/EX1.3/Ex1_3.sce
@@ -0,0 +1,17 @@
+clc
+// Example 1.3.py
+// Calculate the isothermal compressibility for air at a pressure of 0.5 atm.
+
+// Variable declaration
+p = 0.5 // pressure (atm)
+p_si = 0.5*101325 // pressure (N/m^2)
+p_eng = 0.5*2116 // pressure (lb/ft^2)
+
+// Calculations
+tau_atm = 1/p // isothermal compressibility in atm^-1
+tau_si = 1/p_si // isothermal compressibility in m^2/N
+tau_eng = 1/p_eng // isothermal compressibility in ft^2/lb
+
+// Result
+printf("\n Isothermal compressibility for air at %.1f atm is %.2f atm^-1 or %.2e m^2/N or %.2e ft^2/lb", p, tau_atm, tau_si, tau_eng)
+
diff --git a/3765/CH1/EX1.4/Ex1_4.sce b/3765/CH1/EX1.4/Ex1_4.sce
new file mode 100644
index 000000000..775b45071
--- /dev/null
+++ b/3765/CH1/EX1.4/Ex1_4.sce
@@ -0,0 +1,24 @@
+clc
+// Example 1.4.py
+// For thre pressure vessel in Example 1.2, calculate the total internal
+// energy of the gas stored in the vessel.
+
+// Variable declaration from example 1.2
+V = 10 // volume of vessel (m^3)
+p = 20.0 // pressure (atm)
+T = 300 // temperature (Kelvin)
+
+R = 287.0 // gas constant (J/Kg/K)
+gamma1 = 1.4 // ratio of specific heats for air
+
+// Calculations
+cv = R / (gamma1-1) // specific heat capacity at constant volume(J/Kg K)
+e = cv * T // internal energy per Kg (J/Kg)
+p = p * 101000.0 // units conversion to N/m^2
+rho = p/R/T // from ideal gas equation of state (Kg/m^3)
+m = V * rho // total mass = volume * density (Kg)
+E = m*e // total energy in J
+
+// Result
+printf("\n Total internal energy is %.2e J", E)
+
diff --git a/3765/CH1/EX1.5/Ex1_5.sce b/3765/CH1/EX1.5/Ex1_5.sce
new file mode 100644
index 000000000..e6906bcad
--- /dev/null
+++ b/3765/CH1/EX1.5/Ex1_5.sce
@@ -0,0 +1,32 @@
+clc
+// Example 1.5.py
+// Consider the air in the pressure vessel in Example 1.2. Let us now heat
+// the gas in the vessel. Enough heat is added to increase the temperature
+// to 600 K. Calculate the change in entropy of the air inside the vessel.
+
+// Variable declaration from example 1.2
+V = 10 // volume of vessel (m^3)
+p = 20.0 // pressure (atm)
+T = 300.0 // initial temperature (K)
+T2 = 600.0 // final temperature (Kelvin)
+R = 287.0 // gas constant (J/Kg/K)
+gamma1 = 1.4 // ratio of specific heats for air
+
+
+// Calculations
+p2_by_p = T2/T // p2/p, at constant volume p/T = constant
+
+cv = R / (gamma1-1) // specific heat capacity at constant volume (J/Kg K)
+cp = cv + R // specific heat capacity at constant pressure (J/Kg K)
+
+p = p * 101000.0 // units conversion to N/m^2
+rho = p/R/T // from ideal gas equation of state (Kg/m^3)
+m = V * rho // total mass = volume * density (Kg)
+
+//
+del_s = cp*log(T2/T) - R*log(p2_by_p) // change in entropy per unit mass (J/ Kg K)
+total_del_s = m*del_s // total change in entropy (J/K)
+
+// Result
+printf("\n Total change in entropy is %.3e J/K", total_del_s)
+
diff --git a/3765/CH1/EX1.6/Ex1_6.sce b/3765/CH1/EX1.6/Ex1_6.sce
new file mode 100644
index 000000000..de5edc931
--- /dev/null
+++ b/3765/CH1/EX1.6/Ex1_6.sce
@@ -0,0 +1,32 @@
+clc
+// Example 1.6.py
+// Consider the flow through a rocket engine nozzle. Assume that the gas flow
+// through the nozzle in an isentropic expansion of a calorically perfect gas.
+// In the combustion chamber, the gas which results from the combustion of the
+// rocket fuel and oxidizer is at a pressure and temperature of 15 atm and
+// 2500 K, respectively, the molecular weight and specific heat at constant
+// pressure of the combustion gas are 12 and 4157 J/kg K, respectively. The gas
+// expands to supersonic speed through the nozzle, with temperature of 1350 K at
+// the nozzle exit. Calculate the pressure at the exit.
+
+
+// Variable declaration
+pc = 15.0 // pressure combustion chamber (atm)
+Tc = 2500.0 // temperature combustion chamber (K)
+mol_wt = 12.0 // molecular weight (gm)
+cp = 4157.0 // specific heat at constant pressure (J/Kg/K)
+
+Tn = 1350.0 // temperature at nozzle exit (K)
+
+// Calculations
+R = 8314.0/mol_wt // gas constant = R_prime/mo_wt, R_prime = 8314 J/K
+cv = cp - R // specific heat at constant volume (J/Kg/K)
+gamma1 = cp/cv // ratio of specific heat
+
+pn_by_pc = (Tn/Tc** gamma1/(gamma1-1)) // ratio of pressure for isentropic process** pn/pc
+
+pn = pc * pn_by_pc // pn = pc * pn/pc
+
+// Result
+printf("\n Pressure at the exit is %.3f atm", pn)
+
diff --git a/3765/CH1/EX1.7/Ex1_7.sce b/3765/CH1/EX1.7/Ex1_7.sce
new file mode 100644
index 000000000..db4a9b507
--- /dev/null
+++ b/3765/CH1/EX1.7/Ex1_7.sce
@@ -0,0 +1,45 @@
+clc
+// Example 1.7.py
+// A flat plate with a chord length of 3 ft and an infinite span(perpendicular to
+// the page in fig 1.5) is immersed in a Mach 2 flow at standard sea level
+// conditions at an angle of attack of 10 degrees. The pressure distribution
+// over the plate is as follows: upper surface, p2=constant=1132 lb/ft^2 lower
+// surface, p3=constant=3568 lb/ft^2. The local shear stress is given by tau_w =
+// 13/xeta^0.2, where tau_w is in pounds per square feet and xeta is the distance
+// in feet along the plate from the leading edge. Assume the distribution of
+// tau_w over the top and bottom surfaces is the same. Both the pressure and
+// shear disributions are sketched qualitatively in fig. 1.5. Calculate the lift
+// and drag per unit span on the plate.
+
+//
+
+// Variable declaration
+M1 = 2.0 // mach number freestream
+p1 = 2116.0 // pressure at sea level (in lb/ft^2)
+l = 3.0 // chord of plate (in ft)
+alpha = 10.0 // angle of attack in degrees
+
+p2 = 1132.0 // pressure on the upper surface (in lb/ft^2)
+p3 = 3568.0 // pressure on the lower surface (in lb/ft^2)
+
+// Calculations
+
+// assuming unit span
+
+pds = -p2*l + p3*l // integral p.ds from leading edge to trailing edge (in lb/ft)
+
+L = pds*cos(alpha*%pi/180.0) // lift per unit span (in lb/ft), alpha is converted to radians
+
+Dw = pds*sin(alpha*%pi/180.0) // pressure drag per unit span (in lb/ft), alpha is converted to radians
+
+Df = 16.25 * (l** 4.0/5.0) // skin friction drag per unit span (in lb/ft)
+ // from integral tau.d(xeta)
+
+Df = 2 * Df * cos(alpha*%pi/180.0) // since skin friction acts on both the side
+
+D = Df + Dw // total drag per unit span (in lb/ft)
+// Result
+printf("\n Total Lift per unit span = %.0f lb", L)
+
+printf("\n Total Drag per unit span = %.0f lb", D)
+