# Computational methods

All the programs in this page are free of charge: they are under a Creative Commons licence and cannot be used for profit (CC-BY-NC).

This algorithm allows the calculation of the pinch point temperature in a chosen network of heat exchangers. Moreover, it computes the minimum heat needed by the network. The pinch point temperature difference is chosen by the user in the MATLAB Workspace directly and the Grand Composite Curve is computed and printed. The network of heat exchangers is defined in a txt file of this kind:
1 5 200 100
2 11 170 55
3 14 120 165
4 8 50 150
The first column indicates the fluid number, the second column is the product between the specific heat capacity and the mass flow (in kW/K), and the third and fourth columns represent the inlet and outlet temperatures, respectively. The order of the fluids does not influence the result and the txt file needs to be put in the folder where the script is.
I also wrote a JAVA PROGRAM (platform-independent .jar file) for Pinch Point analysis: it can be downloaded HERE.

#### FINITE DIFFERENCE METHOD

Below this point you will find some exercises that I solved.

A transport current of 50 A flows in an electrical conductor (laterally insulated, with length L = 1 m, resistivity rho = 1.75e-8 Ωm; diffusivity α = 11e-5 m2/s, conductivity k=350 W/m/K), with diameter D = 4mm. Compute the temperature evolution in the middle of the conductor, which is initially at  T(x,0)=T_0= 300K , with the boundaries kept at the given constant temperature T_0.

Pressurized water at ~ 400 K flows in a cylindrical pipe (inner diameter D_in = 20 mm, outer diameter D_out = 24 mm, conductivity k = 0.035 W/m/K, heat transfer coefficient h_in = 100 W/m2/K). On the outside the pipe is cooled by air at 300 K (heat transfer coefficient h_out = 10 W/m2/K). Compute numerically the temperature profile in the pipe wall cross section, using the FD method.

A transport current of 10 A flows in a hollow cylinder (inner diameter D_in = 2 mm, outer diameter D_out = 4 mm, resistivity ρ = 2.5e-7 Ωm; diffusivity α = 11e-5 m2/s, conductivity k = 3.5 W/m/K), having a length much larger than the transverse dimension. The conductor is insulated on the outer side, while the inner side contains a fluid at a constant temperature T_0 = 300 K, which is also the initial temperature of the cylinder (heat transfer coefficient with fluid h = 100 W/m2/K). Solve numerically the transient problem and compute the steady-state temperature profile on the conductor cross section, using the FD method.

A superconducting strand (diameter D = 0.81 mm, length L = 1 m, diffusivity α = 11e-5 m2/s, conductivity k = 350 W/m/K), initially at 4.5 K, carries a current of 50 A. The electric field generated by the current while the strand is superconducting is E = E_0 (I/I_C)^n, where E_0 = 1e-5 V/m and n = 1.2. I_C is the critical current and it decreases with temperature: I_C = 50 – T_2. The boundaries are kept at 4.5 K. Compute numerically the maximum temperature increase in the middle of the strand.

A fluid (ρ = 130 kg/m3, c_p = 5500 J/kg/K) flows in a pipe (diameter D = 4 mm, length L = 2 m). Consider the 1D flow along the conduit length, in view of the fact that L>>D. Write a program which uses the upwind finite difference scheme to compute the numerical solution of the 1D pure advection problem: dT/dt+c*dT/dx=0, with c = 0.005 m/s, and: T(x,0)=4.5K; T(0, t=0) =15K.
Note that we are specifying boundary values for the solution on the left boundary x = 0, but not on the right boundary x = 2 m: why? Plot the temperature profile along the pipe at t = 50, 100, 150 and 200 s.