Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

12/23/19 9:25 PM C:...\CME455Project3ParametersandPart2.

m 1 of 6

clear all

%% Part 1 and 2 of Project 3


%Morgan Walli, Stephen Kietz, Amanda Holbrook, Christina Binkowski
%CME 455 Fall 2019
%December 13, 2019
%% PART A
%Input values and run function to obtain parameters
display('*******************************************************************')
display('PART A')

%% input required parameters


display('*******************************************************************')
display('Please input all required parameters in the script below prior to running.')
display('Please input desired run type in the script below prior to running.')
display('1 = keep tube length constant as an input specification')
display('2 = change tube length according to needed area based on heat transfer
characteristics')
%% Heat exchanger geometry and construction

display('Entered values are displayed below:')

thermalConductivityExchanger = 45 %W/(m*K)

do = 20/1000 %m %tube outside diameter


dI = 16/1000 %m %tube inside diameter
pT = 1.25*do %tube pitch
layoutAngle = 90 %degrees
bc = 0.25 %baffle cut
dNTinlet = 0.3048 %m %inner diameter of inlet nozzle for tube side
dNToutlet = 0.3048 %m %inner diameter of outlet nozzle for tube side
dNSinlet = 0.2027 %m %inner diameter of inlet nozzle for tube side
dNSoutlet = 0.2027 %m %inner diameter of outlet nozzle for tube side

%% Data for shell side fluid

flowrateShell = 25 %kg/s
initialTempShell = 200+273 %K
finalTempShell = 95+273 %K
densityShell = 730 %kg/m3
heatCapacityShell = 2470 %J/(kg*K)
viscosityShell = 4.0*10^(-4) %N*s/m2
thermalConductivityShell = 0.132 %W/(m*K)
foulingCoeffShell = 5000; %W/(m2*K)
cValueShell =0.023 %nonviscous fluid
numberPassesShell = 1

%% Data for tube side


flowrateTube = 79.07 %kg/s
initialTempTube = 35+273 %K
finalTempTube = 75+273 %K
12/23/19 9:25 PM C:...\CME455Project3ParametersandPart2.m 2 of 6

densityTube = 830 %kg/m3


heatCapacityTube = 2050 %J/(kg*K)
viscosityTube = 3.6*10^(-3) %N*s/m2
thermalConductivityTube = 0.133 %W/(m*K)
foulingCoeffTube = 2000 %W/(m2*K)
cValueTube = 0.023 %nonviscous fluid
numberPassesTube = 2

%% Assumed parameters
velocityTube = 1 %m/s
velocityShell = 0.5 %m/s
initialTubeLength = 6 %m

%pitch factor
%1 for triangular and diagonal square pitch
%0.85 for in-line square pitch
fp =0.85

%% Additional parameters
%leakage factor
%0.9 for straight-tube bundle
%0.85 for U-tube bundle
%0.8 for floating-head bundle
fL = 0.8

%correction factor for unequal baffle spacing


%1 for equal baffle spacing which is assumed here
js = 1

pCF = 1

%pitch configuration factor


%4/pi for square pitch
%2sqrt(3)/pi for triangular pitch
cde = 4/pi

allowableVelocity = 1.74 %m/s

c = 0.023 % 0.023 for cooling, 0.024 for heating

% tables 12.7 and 12.8


ftc = 1.11
fsc = 1.15

%pitch configuration factor


%1 for square pitch
%0.866 for triangular pitch
pc = 1

%chosen to satisfy minimum Ft


%here ftmin>0.75, Xp = 0.9
12/23/19 9:25 PM C:...\CME455Project3ParametersandPart2.m 3 of 6

xp = 0.9

%tube count constant


%0.93 for one-pass exchanger
%0.9 for two-pass exchanger
%0.85 for three-pass exchanger
ctp = 0.93

%tube layout constant


%1 for square pitch layout
%0.866 for triangular-pitch layout
cl = 1

%% Decide how to run program


%1 = keep tube length constant as an input specification
%2 = change tube length according to needed area
display('Please input desired run method.')
display('1 = keep tube length constant as an input specification')
display('2 = change tube length according to needed area based on heat transfer
characteristics')
runMethod = input('Desired run method:')

display('*******************************************************************')

%% Call function to test


display('Results of function run to determine heat transfer characteristics and pressure
drops for given condtions')
display('This functions calculates these parameters for the inputs given above.')

[combinedResults, numberTubes, numberBaffles, pressureDropTubeSide,


pressureDropShellSide, areaEstimate, baffleSpacing, ds, tubeLength] =
CME455Project3Part1(densityTube, velocityTube, viscosityTube, heatCapacityTube,
thermalConductivityTube, initialTubeLength, dI, dNTinlet, numberPassesTube, do,
velocityShell, viscosityShell, fp, fL, js, thermalConductivityShell, heatCapacityShell,
densityShell, bc, flowrateShell, pT, pCF, cde, allowableVelocity, foulingCoeffShell,
thermalConductivityExchanger, foulingCoeffTube, flowrateTube, dNSinlet,initialTempShell,
finalTempShell, initialTempTube, finalTempTube, xp, runMethod, c, dNToutlet, ftc, fsc,
pc, dNSoutlet, cl, ctp)

%% PART B
%Use inputs for part A and desired pressure drops to calculate needed
%velocities and other parameters

display('*******************************************************************')
display('PART B')
%% Vary velocities to obtain values for fixed pressure drops
display('*******************************************************************')

display('This part of the script calculates velocities, geometry, and heat transfer
characteristics for desired pressure drops.')
12/23/19 9:25 PM C:...\CME455Project3ParametersandPart2.m 4 of 6

display('Initial guesses for velocities are taken to be the velocities inputed for part
A')

% determine objective pressures

objectivePressureTube = input('Enter desired pressure drop for the tube side (N/m2):')
objectivePressureShell = input('Enter desired pressure drop for the shell side:
(N/m2):')

display('Script Running....')

%setinitialguesses
vt(1) = velocityTube;
vs(1) = velocityShell;
n = 2;
error = (pressureDropTubeSide - objectivePressureTube)^2 + (pressureDropShellSide-
objectivePressureShell)^2;

while error > 1100

%% Tube side
if pressureDropTubeSide - objectivePressureTube > 0

vt(n) = vt(n-1)- (1/(n))*vt(n-1);

elseif pressureDropTubeSide - objectivePressureTube == 0

vt(n) = vt(n-1);

else

vt(n) = vt(n-1)+ (1/(n))*vt(n-1);

end
%% Shell side
if pressureDropShellSide - objectivePressureShell > 0

vs(n) = vs(n-1)-(1/(n))*vs(n-1);

elseif pressureDropShellSide - objectivePressureShell == 0

vs(n) = vs(n-1);

else

vs(n) = vs(n-1)+ (1/(n))*vs(n-1);

end

%% Calculate new pressure drops


12/23/19 9:25 PM C:...\CME455Project3ParametersandPart2.m 5 of 6

velocityTube = vt(n);
velocityShell = vs(n);

%call function
[combinedResults, numberTubes, numberBaffles, pressureDropTubeSide,
pressureDropShellSide, areaEstimate, baffleSpacing, ds, tubeLength] =
CME455Project3Part1(densityTube, velocityTube, viscosityTube, heatCapacityTube,
thermalConductivityTube, initialTubeLength, dI, dNTinlet, numberPassesTube, do,
velocityShell, viscosityShell, fp, fL, js, thermalConductivityShell, heatCapacityShell,
densityShell, bc, flowrateShell, pT, pCF, cde, allowableVelocity, foulingCoeffShell,
thermalConductivityExchanger, foulingCoeffTube, flowrateTube, dNSinlet,initialTempShell,
finalTempShell, initialTempTube, finalTempTube, xp, runMethod, c, dNToutlet, ftc, fsc,
pc, dNSoutlet, cl, ctp);

pressureDropShellSide;

pressureDropTubeSide;

%% Reset
n = n + 1;

if n>10000
error = 0;
else
error = (pressureDropTubeSide - objectivePressureTube)^2 +
(pressureDropShellSide-objectivePressureShell)^2;
end
end

display('Parameters calculated for desired pressure drops.')

format short

combinedResults

velocityTube = sprintf('%.2f', velocityTube) %m/s

velocityShell = sprintf('%.2f', velocityShell)%m/s

numberTubes

numberBaffles

baffleSpacingPerDiameter = baffleSpacing/ds;

areaEstimate = sprintf('%.2f',areaEstimate)%m2

baffleSpacing = sprintf('%.2f', baffleSpacing) %m

lengthPerDiameter = tubeLength/ds;
12/23/19 9:25 PM C:...\CME455Project3ParametersandPart2.m 6 of 6

lengthPerDiameter = sprintf('%.2f', lengthPerDiameter)

baffleSpacingPerDiameter = sprintf('%.2f', baffleSpacingPerDiameter)

display('*******************************************************************')
display('SCRIPT COMPLETE')
display('*******************************************************************')

You might also like