Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

linear algebraic equation help

1 visualizzazione (ultimi 30 giorni)
harley
harley il 25 Ago 2013
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 Commenti
Marc
Marc il 25 Ago 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 .* ?
harley
harley il 25 Ago 2013
Modificato: harley il 25 Ago 2013
thanks for your time, have made a couple edits as suggested above. I can have a separate initial V for each pipe and then iteratively adjusting the friction factor and changing the velocity using eqn.1 V = αVnew + (1-α)Vold in each iteration, (also making sure that Q1=Q2+Q3=Q4 in each iteration). In eqn 1 the V becomes the Vold in the next iteration. Re and f has to be calculated each time as the new V is calculated.

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by