diff --git a/interfaces/matlab/toolbox/@ThermoPhase/set.m b/interfaces/matlab/toolbox/@ThermoPhase/set.m index 7e348643da8..e00f4ad8998 100644 --- a/interfaces/matlab/toolbox/@ThermoPhase/set.m +++ b/interfaces/matlab/toolbox/@ThermoPhase/set.m @@ -184,6 +184,20 @@ function set(tp, varargin) setState_SP(tp, [sval,pval]); elseif ns == 1 && nv == 1 setState_SV(tp, [sval,vval]); + elseif ns == 1 && nt == 1 + setState_ST(tp, [sval,tval]); + elseif nt == 1 && nv == 1 + setState_TV(tp, [tval,vval]); + elseif np == 1 && nv == 1 + setState_PV(tp, [pval,vval]); + elseif nu == 1 && np == 1 + setState_UP(tp, [uval,pval]); + elseif nv == 1 && nh == 1 + setState_VH(tp, [vval,hval]); + elseif nt == 1 && nh == 1 + setState_TH(tp, [tval,hval]); + elseif ns == 1 && nh == 1 + setState_SH(tp, [sval,hval]); else error('Unimplemented property pair.'); end diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_PV.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_PV.m new file mode 100644 index 00000000000..21dbcd0618f --- /dev/null +++ b/interfaces/matlab/toolbox/@ThermoPhase/setState_PV.m @@ -0,0 +1,12 @@ +function setState_PV(tp, pv) +% SETSTATE_PV Set the pressure and specific volume. +% setState_PV(tp,pv) +% :param tp: +% Instance of class :mat:func:`ThermoPhase` (or another +% class derived from ThermoPhase) +% :param pv: +% Vector of length 2 containing the desired values for the +% pressure (Pa) and specific volume (m^3/kg). +% + +thermo_set(tp.tp_id, 29, pv); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_SH.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_SH.m new file mode 100644 index 00000000000..e632d158242 --- /dev/null +++ b/interfaces/matlab/toolbox/@ThermoPhase/setState_SH.m @@ -0,0 +1,12 @@ +function setState_SH(tp, sh) +% SETSTATE_SH Set the specific entropy and specific enthalpy. +% setState_SH(tp,sh) +% :param tp: +% Instance of class :mat:func:`ThermoPhase` (or another +% class derived from ThermoPhase) +% :param sh: +% Vector of length 2 containing the desired values for the specific +% entropy (J/kg/K) and specific enthalpy (J/kg). +% + +thermo_set(tp.tp_id, 33, sh); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_ST.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_ST.m new file mode 100644 index 00000000000..45258dde3ad --- /dev/null +++ b/interfaces/matlab/toolbox/@ThermoPhase/setState_ST.m @@ -0,0 +1,12 @@ +function setState_ST(tp, st) +% SETSTATE_ST Set the specific entropy and temperature. +% setState_ST(tp,st) +% :param tp: +% Instance of class :mat:func:`ThermoPhase` (or another +% class derived from ThermoPhase) +% :param st: +% Vector of length 2 containing the desired values for the specific +% entropy (J/kg-K) and temperature (K). +% + +thermo_set(tp.tp_id, 27, st); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_TH.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_TH.m new file mode 100644 index 00000000000..30d76d94743 --- /dev/null +++ b/interfaces/matlab/toolbox/@ThermoPhase/setState_TH.m @@ -0,0 +1,12 @@ +function setState_TH(tp, th) +% SETSTATE_TH Set the temperature and specific enthalpy. +% setState_TH(tp,th) +% :param tp: +% Instance of class :mat:func:`ThermoPhase` (or another +% class derived from ThermoPhase) +% :param th: +% Vector of length 2 containing the desired values for the +% temperature (K) and specific enthalpy (J/kg). +% + +thermo_set(tp.tp_id, 32, th); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_TV.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_TV.m new file mode 100644 index 00000000000..088609e4544 --- /dev/null +++ b/interfaces/matlab/toolbox/@ThermoPhase/setState_TV.m @@ -0,0 +1,12 @@ +function setState_TV(tp, tv) +% SETSTATE_TV Set the temperature and specific volume. +% setState_TV(tp,tv) +% :param tp: +% Instance of class :mat:func:`ThermoPhase` (or another +% class derived from ThermoPhase) +% :param tv: +% Vector of length 2 containing the desired values for the +% temperature (K) and specific volume (m^3/kg). +% + +thermo_set(tp.tp_id, 28, tv); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_UP.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_UP.m new file mode 100644 index 00000000000..4a1e51e9347 --- /dev/null +++ b/interfaces/matlab/toolbox/@ThermoPhase/setState_UP.m @@ -0,0 +1,12 @@ +function setState_UP(tp, up) +% SETSTATE_UP Set the specific internal energy and pressure. +% setState_UP(tp,up) +% :param tp: +% Instance of class :mat:func:`ThermoPhase` (or another +% class derived from ThermoPhase) +% :param up: +% Vector of length 2 containing the desired values for the specific +% internal energy (J/kg) and pressure (Pa). +% + +thermo_set(tp.tp_id, 30, up); diff --git a/interfaces/matlab/toolbox/@ThermoPhase/setState_VH.m b/interfaces/matlab/toolbox/@ThermoPhase/setState_VH.m new file mode 100644 index 00000000000..0532b76fca4 --- /dev/null +++ b/interfaces/matlab/toolbox/@ThermoPhase/setState_VH.m @@ -0,0 +1,12 @@ +function setState_VH(tp, vh) +% SETSTATE_VH Set the specific volume and specific enthalpy. +% setState_VH(tp,vh) +% :param tp: +% Instance of class :mat:func:`ThermoPhase` (or another +% class derived from ThermoPhase) +% :param vh: +% Vector of length 2 containing the desired values for the specific +% volume (m^3/kg) and specific enthalpy (J/kg). +% + +thermo_set(tp.tp_id, 31, vh); diff --git a/src/matlab/thermomethods.cpp b/src/matlab/thermomethods.cpp index 56112a53d24..398f1589c31 100644 --- a/src/matlab/thermomethods.cpp +++ b/src/matlab/thermomethods.cpp @@ -61,6 +61,27 @@ static void thermoset(int nlhs, mxArray* plhs[], case 26: ierr = th_set_RP(th,ptr); break; + case 27: + ierr = th_set_ST(th,ptr); + break; + case 28: + ierr = th_set_TV(th,ptr); + break; + case 29: + ierr = th_set_PV(th,ptr); + break; + case 30: + ierr = th_set_UP(th,ptr); + break; + case 31: + ierr = th_set_VH(th,ptr); + break; + case 32: + ierr = th_set_TH(th,ptr); + break; + case 33: + ierr = th_set_SH(th,ptr); + break; default: mexErrMsgTxt("unknown pair attribute."); }