linear algebraic equation help
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
Trying to use the following equations to find V for all pipes when ∑Ploss = 103kPa.
Pipe 1 flows into pipe 2 & 3 which are parallel then both flow into pipe 4.
∑Ploss is the same whether line 1, 2, 4 or 1,3,4 is taken.
Q1 = Q2 + Q3 = Q4.
Pressure loss in each pipe is, Ploss = (f*rho (L/D) )*(V^2/2).
Ploss across pipes in parallel is the same.
I want to iterate until the values of V do not change significantly from one iteration to another. To “linearise” the system of equations, I want to treat any term including V^2 as Vold ×V, where Vold is the value from the previous iteration. To ensure that the solution converges, I want to use an “under-relaxation factor” 0 < α< 1:
V = αVnew + (1-α)Vold
where Vnew is the value that is computed from the set of equations.
Hope that makes sense to someone
D = zeros(4,1);D(0.1,1),D(0.2,1),D(0.05,1),D(0.15,1);
L = zeros(4,1);L(10,1),L(3,1),L(4,1),L(8,1);
%D1 = 0.1; L1 = 10;
%D2 = 0.2; L2 = 3;
%D3 = 0.05; L3 = 4;
%D4 = 0.15; L4 = 8;
%
A = 0.25*pi.*D^2;
e = 0.0015e-3;
rho = 998;
nu = 1.01e-6;
eoverD = e./D;
Ploss_total = 303.9e3; %Total Pressure Change
%
%Reynolds Number
Re = (V.*D) / nu;
if Re < 2300
f = 64 / Re;
else
colebrook = @(x) 1/sqrt(x)+2*log10(eoverD/3.7 + 2.51/Re/sqrt(x));
f = fzero(colebrook,0.01);
end
2 Kommentare
Marc
am 25 Aug. 2013
Just a couple of comments.
In Matlab, I would think it would be easier to define your pipes diameters and length, along with everything else as vectors.
So instead of having 4 variables, D1, D2, etc. have D =zeros(4,1); and then fill in D(1,1), D(2,1), etc. etc.
Although I may have missed something, when you are calculating the Reynolds number, where did you define D or V or is this in your explanation and you want us to fill in the code?
Last comment, although I have many more, eoverD appears to be 4 elements. When you define colebrook function, do you want this to spit out 4 elements? If so, then you will probably want to replace the / with ./ and check the * if you need a .* ?
Antworten (0)
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!