Merge pull request #300 from bryanwweber/fix-matlab-purefluid-functions

Fix Matlab PureFluid functions and documentation
This commit is contained in:
Bryan W. Weber 2015-10-24 15:16:40 -04:00
commit eee1de7368
7 changed files with 26 additions and 17 deletions

View file

@ -1,8 +1,8 @@
function i = phase_get(n, job, a, b)
if nargin == 2
i = ctmethods(30,n,job);
i = ctmethods(30, n, job);
elseif nargin == 3
i = ctmethods(30,n,job,a);
i = ctmethods(30, n, job, a);
else
i = ctmethods(30, n, job, a, b);
end

View file

@ -1,8 +1,8 @@
function phase_set(n, job, a, b)
if nargin == 2
ctmethods(30,n,-job);
ctmethods(30, n, -job);
elseif nargin == 3
ctmethods(30,n,-job,a);
ctmethods(30, n, -job, a);
else
ctmethods(30, n,-job, a, b);
end

View file

@ -1,16 +1,16 @@
function i = thermo_set(n, job, a, b, c, d, e, f)
if nargin == 2
i = ctmethods(20,n,-job);
i = ctmethods(20, n, -job);
elseif nargin == 3
i = ctmethods(20,n,-job,a);
i = ctmethods(20, n, -job,a);
elseif nargin == 4
i = ctmethods(20, n,-job, a, b);
i = ctmethods(20, n, -job, a, b);
elseif nargin == 5
i = ctmethods(20, n,-job, a, b, c);
i = ctmethods(20, n, -job, a, b, c);
elseif nargin == 6
i = ctmethods(20, n,-job, a, b, c, d);
i = ctmethods(20, n, -job, a, b, c, d);
elseif nargin == 7
i = ctmethods(20, n,-job, a, b, c, d, e);
i = ctmethods(20, n, -job, a, b, c, d, e);
elseif nargin == 8
i = ctmethods(20, n,-job, a, b, c, d, e, f);
i = ctmethods(20, n, -job, a, b, c, d, e, f);
end

View file

@ -1,10 +1,15 @@
function setState_Psat(tp, px)
% SETSTATE_PSAT Set the fluid to a saturated state at a given pressure.
% SETSTATE_PSAT Set the fluid state using the given pressure and quality.
% setState_Psat(tp,px)
% The fluid state will be set to a saturated liquid-vapor state using the
% input pressure and vapor fraction (quality) as the independent,
% intensive variables.
% :param tp:
% Instance of class :mat:func:`ThermoPhase` (or another
% class derived from ThermoPhase)
% :param px:
% Pressure. Units: Pa
% Vector of length 2 containing the desired values for the pressure (Pa)
% and the vapor fraction
%
thermo_set(tp.tp_id, 24, px);

View file

@ -1,11 +1,15 @@
function setState_Tsat(tp, tx)
% SETSTATE_TSAT Set the fluid to a saturated state at a given temperature.
% SETSTATE_TSAT Set the fluid state using the given temperature and quality.
% setState_Tsat(tp,tx)
% The fluid state will be set to a saturated liquid-vapor state using the
% input temperature and vapor fraction (quality) as the independent,
% intensive variables.
% :param tp:
% Instance of class :mat:func:`ThermoPhase` (or another
% class derived from ThermoPhase)
% :param tx:
% Temperature. Units: K
% Vector of length 2 containing the desired values for the temperature (K)
% and the vapor fraction (quality)
%
thermo_set(tp.tp_id, 25, tx);

View file

@ -6,4 +6,4 @@ function setState_satLiquid(tp)
% class derived from ThermoPhase)
%
thermo_set(tp.tp_id, 2, 0);
set(tp, 'T', temperature(tp), 'Liquid', 1.0)

View file

@ -6,4 +6,4 @@ function setState_satVapor(tp)
% class derived from ThermoPhase)
%
thermo_set(tp.tp_id, 3, 0);
set(tp, 'T', temperature(tp), 'Vapor', 1.0)