# What is the case with the number of imaginaries?

program: GNU octave

% tube side
TinA = 79.3
mdotA = 1.17
DA = 0.01905
TA = 0.00211

% hull side
TinJ = 31.0
mdotJ = 0.35
DJ = 0.114
TJ = 0.00602

% Of flippers
Nt = 7
ht = 0.0050
tt = 0.0009
Ltseg = 2.3
Lt = 2.3 * 2
Nf = 12

%General data
k = 52.3
roughA = 0.00015
roughJ = 0.00010
AnythingTime = 63.7
dpmaxA = 7700
dpmaxJ = 26800

% inside diameter of the hull
D = DJ – 2 * TJ
% inner diameter of the tube
d = DA – 2 * TA

% we will calculate the areas needed to solve the problem

Af = (2 * ht + tt) * Lt * Nf * Nt
Abf = (piDA – ttNf) * Lt * Nt
Aftot = Af + Abf

Afss = pi * (D ^ 2 – DA ^ 2 * Nt) / 4 – ht * tt * Nf * Nt
Pfss = pi * D + (pi * DA + 2 * ht * Nf) * Nt

Dh1 = d
Dh2 = 4 * Afss / Pfss
A = pi * d * Lt * Nt
AcA = Nt * pi * d ^ 2/4

% properties of the fluid
% Fluid A

TA = [33.0, 44.2, 55.3, 66.5, 77.7, 88.8, 100.0]
DyA = [994.02, 990.3, 985.68, 980.18, 973.78, 966.49, 958.30]
DiA = [7.48e-4, 6.05e-4, 5.04e-4, 4.28e-4, 3.67e-4, 3.18e-4, 2.84e-4]
CpA = [167.0, 4167.3, 4170.7, 4177.2, 4186.7, 4199.4, 4215.2]
KA = [0.6229, 0.6402, 0.6545, 0.6660, 0.6745, 0.6802, 0.6829]

% Fluid J

TJ = [20.0, 50.0, 80.0, 110.0, 140.0, 170]
DyJ = [1.0615, 0.9599, 0.8764, 0.8065, 0.7470, 0.6958]
DiJ = [9.945e-06, 1.104e-05, 1.213e-05, 1.323e-05, 1432e-05, 1.541e-05]
CpJ = [2079.2, 2130.1, 2185.7, 2243.9, 2302.9, 2361.6]
KJ = [0.0245, 0.0280, 0.0317, 0.0356, 0.0398, 0.0442]

% interpolations
TempA = TA (1): ((TA (length (TA)) – TA (1)) / 100): TA (length (TA))
TempJ = TJ (1): ((TJ (length (TJ)) – TJ (1)) / 100): TJ (length (TJ))

% Density A
Density A = interp1 (TA, DyA, TempA, "spline")
Figure 1)
parcel (TA, DyA, "ob", TempA, density A, "-r")
title ("Density A")
xlabel ("T [deg. C]")
ylabel ("Density [kg/m^3]")

% Density J
Density J = interp1 (TJ, DyJ, TempJ, "spline")
Figure 2)
plot (TJ, DyJ, "ob", TempJ, DensityJ, "-r")
title ("Density J")
xlabel ("T [deg. C]")
ylabel ("Density [kg/m^3]")

% Dynamic viscosity A
DyvA = interp1 (TA, DiA, TempA, "spline")
figure 3)
parcel (TA, DiA, "ob", TempA, DyvA, "-r")
title ("Dynamic Viscosity A")
xlabel ("T [deg. C]")
ylabel ("dynamic viscosity [Pa.s]")

% Dynamic Viscosity J
DyvJ = interp1 (TJ, DiJ, TempJ, "spline")
number (4)
plot (TJ, DiJ, "ob", TempJ, DyvJ, "-r")
title ("Dynamic Viscosity J")
xlabel ("T [deg. C]")
ylabel ("dynamic viscosity [Pa.s]")

% Specific heat capacity A
CpAs = interp1 (TA, CpA, TempA, "spline")
number (5)
plot (TA, CpA, "ob", TempA, CpAs, "-r")
title ("Specific thermal capacity A")
xlabel ("T [deg. C]")
ylabel ("Cp [J/kg.K)]")

% Specific heat capacity J
CpJs = interp1 (TJ, CpJ, TempJ, "spline")
number (6)
plot (TJ, CpJ, "ob", TempJ, CpJs, "-r")
title ("Specific heat capacity J")
xlabel ("T [deg. C]")
ylabel ("Cp [J/(kg.K)]")

% Thermal conductivity A
KAs = interp1 (TA, KA, TempA, "spline")
number (7)
parcel (TA, KA, "ob", TempA, KAs, "-r")
title ("Thermal Conductivity A")
xlabel ("T [deg. C]")
ylabel ("Cp [W/(m.k)]")

% Thermal conductivity J
KJs = interp1 (TJ, KJ, TempJ, "spline")
figure 8)
plot (TJ, KJ, "ob", TempJ, KJs, "-r")
title ("Thermal Conductivity J")
xlabel ("T [deg. C]")
ylabel ("Cp [W/(m.k)]")

% Estimation of exit temperatures

TAOut = (TinJ + TinA) / 2
TJOut = 63.7

% average temperatures
TmA = (TAOut + TinA) / 2
TmJ = (TJOut + TinJ) / 2

% Fluid Functions A and J

% Density A
FDensA = @ (T) interp1 (TA, DyA, T, "spline")
DensAm = FDensA (TmA)

% Density J
FDensJ = @ (T) interp1 (TJ, DyJ, T, "spline")
DensJm = FDensJ (TmJ)

% Dynamic viscosity A

FDvisA = @ (T) interp1 (TA, DiA, T, "spline")
DvisAm = FDvisA (TmA)

% Dynamic Viscosity J
FDvisJ = @ (T) interp1 (TJ, DiJ, T, "spline")
DvisJm = FDvisA (TmJ)

% Thermal conductivity A
FKAm = @ (T) interp1 (TA, KA, T, "spline")
KmA = FKAm (TmA)

% Thermal conductivity J
FKJm = @ (T) interp1 (TJ, KJ, T, "spline")
KmJ = FKJm (TmJ)

% Specific heat capacity A
FCpA = @ (T) interp1 (TA, CpA, T, "spline")
CpmA = FCpA (TmA)

% Specific heat capacity J
FCpJ = @ (T) interp1 (TJ, CpJ, T, "spline")
CpmJ = FCpJ (TmJ)

% of QdotA's estimate
QDotA = mdotA * CpmA * (TinA – TAOut)

% of heat transfer coefficients

% alpha1 (tube side)

Dh1 = d
uA = mdotA / (DensAm * AcA)
ReNA = Dh1 * uA * DensAm / DvisAm
CpAs = FCpA (TmA)
PrNA = CpAs * DvisAm / KmA
alpha1 = 0.023 * ReNA ^ 0.8 * PrNA ^ 0.4 * KmA / Dh1

% alpha2 (hull side)

uJ = mdotJ / (DensJm * Afss)
Dh2 = 4 * Afss / Pfss
ReNJ = DensJm * uJ * Dh2 / DvisJm
CpJs = FCpJ (TmJ)
PrNJ = CpJs * DvisJm / KmJ
alpha2fss = 0.023 * ReNJ ^ 0.8 * PrNJ ^ 0.4 * KmJ / Dh2

% cf interpolations
Xval = [0.0, 1.0, 2.0, 3.5, 5.0, 7.5]
Cfval = [1.00, 0.81, 0.71, 0.60, 0.50, 0.36]
NPHX = Xval (1): ((Xval (length (Xval)) – Xval (1)) / 100): Xval (length (Xval))
CHX = interp1 (Xval, Cfval, NPHX, "spline")
number (9)
plot (Xval, Cfval, "ob", NPHX, CHX, "-r")
title ("cp: cubic spline interpolation")
xlabel ("hf / gf [m]")
ylabel ("cp [J/kg.K]")
FCf = @ (T) interp1 (Xval, Cfval, T, "spline")

X = ht / (pi * DA / Nf – tt)
Cf = FCf (X)

% Fouling factor of water
FA = 0.000352
% fouling factor of ammonia
FJ = 0.000176

alphaf = Cf * alpha2fss

% Find the effectiveness of the fins:
theta = tanh (ht * sqrt (2 * alphaf / (k * tt))) / (ht * sqrt (2 * alphaf / (k * tt)))

% virtual heat transfer coefficient:

Av = alphaf * (theta * Af / Aftot + Abf / Aftot)

% We now have enough data to calculate the overall heat transfer coefficient itself:

U = 1 / ((Aftot / A) * (1 / alpha1 + FA + (DA – d) / (2 * k)) + FJ + 1 / Av)
dTLM = ((TinA – TJOut) – (TAOut – TinJ)) / log ((TinA – TJOut) / (TAOut – TinJ))

% new heat load corresponding to the surface of the finned tube:

Qdot = U * Aftot * dTLM

% of particles
epsilon = 0.001
Itr = 1

while (abs (Qdot – QDotA))> epsilon

``````        QDotJ = Qdot
``````

while (abs (QDotA – QDotJ))> epsilon

``````                    Itr + = 1

TJOut = TinJ + QDotJ / (mdotJ * CpmJ)
TAOut = TinA - QDotJ / (mdotA * CpmA)

CpmA = quad (FCpA, TAOut, TinA) / (TinA - TAOut)
CpmJ = quad (FCpJ, TinJ, TJOut) / (TJOut - TinJ)

QDotA = mdotA * CpmA * (TinA - TAOut)
QDotJ = mdotJ * CpmJ * (TJOut - TinJ)

TmA = (TinA + TAOut) / 2
TmP = (TinJ + TJOut) / 2

waiting

DensAm = FDensA (TmA)
DvisAm = FDvisA (TmA)
KmA = FKAm (TmA)

DensJm = FDensJ (TmJ)
DvisJm = FDvisJ (TmJ)
KmJ = FKJm (TmJ)
``````

uA = mdotA / (DensAm * AcA)
uJ = mdotJ / (DensJm * Afss)

ReNA = DensAm * uA * Dh1 / DvisAm
ReNJ = DensJm * uJ * Dh2 / DvisJm

CpA = FCpA (TmA)
CpJ = FCpJ (TmJ)

PrNA = CpA * DvisAm / KmA
PrNJ = CpJ * DvisJm / KmJ

alpha1 = 0.023 * ReNA ^ 0.8 * PrNA ^ 0.4 * KmA / Dh1
alpha2fss = 0.023 * ReNJ ^ 0.8 * PrNJ ^ 0.4 * KmJ / Dh2

alphaf = Cf * alpha2fss

theta = tanh (ht * sqrt (2 * alphaf / (k * tt))) / (ht * sqrt (2 * alphaf / (k * tt)));

Av = alphaf * (theta * Af / Aftot + Abf / Aftot)

U = 1 / (((Aftot / A)) * (1 / alpha1 + FA + (DA – d) / (2 * k) + FJ + (1 / Av)))

dTLM = ((TinA – TJOut) – (TAOut – TinJ)) / log ((TinA – TJOut) / (TAOut – TinJ))

``````Qdot = U * Aftot * dTLM
``````

waiting

% the pressure drop

``````                % pressure drop on the tube side
f1A = (-2,457 * log ((7 / ReNA) ^ 0.9 + (0.27 * roughA) / Dh1)) ​​^ 16
f2A = (37530 / ReNA) ^ 16

fA = 8 * ((8 / ReNA) ^ 12 + (1 / (f1A + f2A) ^ 1.5)) ^ (1/12)
``````

dpA = fA * (Lt / Dh1) * 0.5 * DensAm * uA ^ 2/2

% of pressure drop on the hull side
f1J = (-2,457 * log ((7 / ReNJ) ^ 0.9 + 0.27 * 0.045 / Dh2)) ^ 16
f2J = (37530 / ReNJ) ^ 16

``````                fJ = 8 * ((8 / ReNJ) ^ 12 + 1 / (f1J + f2J) ^ 1.5) ^ (1/12)
``````

dpJ = fJ * (Lt / Dh2) * 0.5 * DensJm * uJ ^ 2/2

dpAreal = 1.15 * dpA
dpJreal = 1.15 * dpJ