$RequiredOutputs
Starting with version 9.513, the $RequiredOutputs directive is no longer needed, since an any output can be left out of a call to an Internal or External Procedure.
For example, the PipeFlow Procedure in the Heat Transfer library is defined as:
Procedure PipeFlow( Fluid$, T, P, m_dot, D, L,RelRough: h_T, h_H, DELTAP, Nusselt_T, f, Re)
All of the variables to the right of the colon are outputs. If you only wish to return h_H when calling this function, you can call the function in the following manner.
$UnitSystem SI K Pa J
T=363 [K] "average temperature of fluid in pipe"
P=101300 [Pa] "pressure of air in pipe"
m_dot=0.05 [kg/s] "flow rate"
D=0.15 [m] "pipe diameter"
L=500 [m] "pipe length"
RelRough=0 "relative roughness"
Call pipeflow('Air', T, P, m_dot, D, L,RelRough: , h_H, , , , )
{Solution: h_H=10.32 [W/m^2-K]}
_____________________
The following information is provided for versions previous to 9.513.
The $RequiredOutputs allows the number of outputs in the Call statement for a Procedure to be less than the number of outputs in the Procedure header statement. This directive must be placed after the Procedure statement but before the END statement for that procedure. If this directive appears in other places or if it indicates that more outputs are required than in the Procedure header statement, it will be ignored.
Example:
Note the use of the $RequiredOutputs directive in the Procedure listed below. This directive allows the procedure to be called with one to 5 outputs.
Procedure PipeFlow( Fluid$, T, T_s, P, m_dot, D, L,RelRough: h_T, h_H, f, Nu#, Re#,FT$)
$RequiredOutputs 1
{$PipeFlow
This function returns the heat transfer coefficient in [W/m^2-K] and friction factor [-] inside a smooth pipe .
The flow rate must be either kg/s.
The tube diameter (or hydraulic diameter) and length must be either meters or feet.
The temperature can be K or C, depending upon the EES units setting.
The pressure can be Pa, kPa, bar or MPa, depending upon the EES units setting.
This function determines Re#, Pr# and L/D from input data and then calls Internal_Flow_Pipe_ND to obtain f and Nu#
}
if (UnitSystem('C')=1) then UT$='C' else UT$='K'
if (UnitSystem('Pa')=1) then UP$='Pa' else
if (UnitSystem('kPa')=1) then UP$='kPa' else
if (UnitSystem('bar')=1) then UP$='bar' else UP$='MPa'
endif
endif
if (isIdealGas(Fluid$)) then
Pr#=Prandtl(Fluid$,T=T)
mu = viscosity(Fluid$, T=T)
mu_s = viscosity(Fluid$, T=T_s)
k = Conductivity(Fluid$, T=T)
else
Pr#=Prandtl(Fluid$, T=T, P=P)
mu = viscosity(Fluid$, T=T,P=P)
mu_s = viscosity(Fluid$, T=T_s,P=P)
k = Conductivity(Fluid$, T=T,P=P)
endif
mu\mu_s=mu/mu_s
Re#=(4*m_dot)/(pi*D*mu)
if (Re#<=0) then Call Error('Re# in PipeFlow must be greater than 0, The value is XXXA1',Re#)
call PipeFlow_N(Re,Pr,L/D,RelRough: Nusselt_T, Nusselt_H, f)
h_T=Nusselt_T*k/D {based on constant temperature boundary}
h_H=Nusselt_H*k/D {based on constant heat flux boundary}
END