I plan to create a program to solve a compressible flow problem of an isentropic converging nozzle followed by an adiabatic pipe with friction:
D is the diameter
k is the ratio of specific heats or isentropic coefficient for real gases
L is the length of the piping
M is the Mach number
MW is the molecular weight
N is the number of velocity heads lost in fittings
P is the absolute pressure
rho is the density
T is the temperature ( degrees C)
W is the mass flow rate
Z is the compressibility
Common inputs for all cases: N, L, g, Z, MW.
Common outputs for all cases: rho1, rho2, rho3, M1, M2, T2, P2.
For Case 1 of 5, my inputs are P3, P0, T0, D. W, P1, T1 will be calculated.
Case 1 will simulate flow rate through a specified piping configuration, or flow rate through a rupture disk installation.
I think workflow will be like:
Estimate W explicitly.
Estimate M1 iteratively.
Estimate M2 iteratively
Is P2 = P3? If not, re-estimate W and repeat.
So, I’ve got two iterative calculations within one bigger iterative calculation.
Two options come to mind. Solve M1 and M2 every big iteration, or iterate M1 and M2 once every big iteration.
My program of choice is Excel. Can I do both ways without VBA? How? Which way is best? Or, should I be looking for a different program/language?
If at the end of the day, recall I have 4 more cases to go, I would like to have the security of the methodology locked down, does this affect the program/language I use?