Friday, 23 October 2015

Pipe Flow Simulation

Just ran another simulation related to HMT, this problem became steady state after about 36 seconds.

Water at 318 K starts flowing (0.00035 m^3/s) through a steel pipe initially at 298 K. The steel pipe had convection to air at 298 K at 3,000 W/m^2.K. A simple simulation yielded inner and outer wall temperatures of the pipe to be 309.07 K and 311.26 K respectively. Then I ran a transient simulation, to find out the time taken by the pipe’s walls to reach these temperatures (f...rom 298 K) as water flows through it. It came out to be around 36 seconds.

Then I ran a FEA. To calculate stresses induced in the pipe due to water pressure, thermal effects, gravity etc. The pipe’s diameter increased by 0.005866 mm and von-mises stress induced was 117,016,056 N/m^2 with a factor of safety of 5.302.

Then I ran fatigue study to see if the pipe will survive under these loads for 20 years or not. It will I think. The fatigue S-N curves were not available so I used the ones for carbon steel (slightly different from the ones I used for CFD analysis and FEA); so will it last for 20 years I am not sure yet (searching for curves).



 Temperatures at inner wall surface
 Temperature at outer wall surface
displacement and stress animation

LU Decomposition MATLAB





%Please don't mess around with my code
clc;
R=input('How many variables are there in your system of linear equations? ');



clc;
disp ('Please enter the elements of the Coefficient matrix "A" and the Constant/Known matrix "B" starting from first equation');



A=zeros(R,R);

B=zeros(R,1);
for H=1:R

for i=1:R

fprintf ('Coefficient Matrix Column \b'), disp(i), fprintf ('\b\b Row \b'), disp(H);

I=input(' ');



A(H,i)=A(H,i)+I;
end

fprintf ('Known Matrix Row \b'), disp(H);

J=input(' ');



B(H,1)=B(H,1)+J;
end
clc;

[L,U] = lu(A);

Y = L\B;

X = U\Y;
fprintf ('The Coefficient Matrix "A" is \n'), disp(A);

fprintf ('The Constant/Known Matrix "B" is \n'), disp(B);

fprintf ('The Solution Matrix "X" is \n'), disp(X);