diff --git a/interfaces/matlab_experimental/Reactor/FlowDevice.m b/interfaces/matlab_experimental/Reactor/FlowDevice.m index fcd645ad539..efa376c7da8 100644 --- a/interfaces/matlab_experimental/Reactor/FlowDevice.m +++ b/interfaces/matlab_experimental/Reactor/FlowDevice.m @@ -30,6 +30,8 @@ properties (SetAccess = public) + name % name of flow device. + % Upstream object of type :mat:class:`Reactor` or :mat:class:`Reservoir`. upstream @@ -56,7 +58,7 @@ methods %% FlowDevice Class Constructor - function x = FlowDevice(typ) + function x = FlowDevice(typ, name) % Create a :mat:class:`FlowDevice` object. ctIsLoaded; @@ -64,9 +66,12 @@ if nargin == 0 error('please specify the type of flow device to be created'); end + if nargin < 2 + name = '(none)'; + end x.type = typ; - x.id = ctFunc('flowdev_new', typ); + x.id = ctFunc('flowdev_new3', typ, name); x.upstream = -1; x.downstream = -1; end @@ -112,12 +117,20 @@ function install(f, upstream, downstream) %% FlowDevice Get Methods + function name = get.name(f) + name = ctString('flowdev_name', f.id); + end + function mdot = get.massFlowRate(f) mdot = ctFunc('flowdev_massFlowRate2', f.id); end %% FlowDevice Set Methods + function set.name(f, name) + ctFunc('flowdev_setName', f.id, name); + end + function set.massFlowRate(f, mdot) if strcmp(f.type, 'MassFlowController') diff --git a/interfaces/matlab_experimental/Reactor/Reactor.m b/interfaces/matlab_experimental/Reactor/Reactor.m index 8075fa1c266..d9480acbabf 100644 --- a/interfaces/matlab_experimental/Reactor/Reactor.m +++ b/interfaces/matlab_experimental/Reactor/Reactor.m @@ -9,6 +9,8 @@ properties (SetAccess = public) + name % Name of reactor. + contents % Density of the reactor contents at the end of the last call to @@ -131,8 +133,6 @@ r.type = char(typ); r.id = ctFunc('reactor_new3', typ, content.solnID, name); - - end %% Reactor Class Destructor @@ -160,6 +160,10 @@ function addSensitivityReaction(r, m) %% Reactor Get Methods + function name = get.name(r) + name = ctString('reactor_name', r.id); + end + function temperature = get.T(r) temperature = ctFunc('reactor_temperature', r.id); end @@ -215,6 +219,10 @@ function addSensitivityReaction(r, m) %% Reactor set methods + function set.name(r, name) + ctFunc('reactor_setName', r.id, name); + end + function set.V(r, v0) ctFunc('reactor_setInitialVolume', r.id, v0); diff --git a/interfaces/matlab_experimental/Reactor/Wall.m b/interfaces/matlab_experimental/Reactor/Wall.m index 05721aaddbd..0ee28f9bc40 100644 --- a/interfaces/matlab_experimental/Reactor/Wall.m +++ b/interfaces/matlab_experimental/Reactor/Wall.m @@ -52,6 +52,8 @@ properties (SetAccess = protected) + name % Name of wall. + left % Reactor on the left. right % Reactor on the right. @@ -87,15 +89,18 @@ methods %% Wall Class Constructor - function w = Wall(l, r) + function w = Wall(l, r, name) % Create a :mat:class:`Wall` object. ctIsLoaded; % At the moment, only one wall type is implemented typ = 'Wall'; + if nargin < 3 + name = '(none)'; + end w.type = char(typ); - w.id = ctFunc('wall_new', w.type); + w.id = ctFunc('wall_new3', w.type, name); % Install the wall between left and right reactors w.left = l; @@ -127,6 +132,10 @@ function delete(w) %% ReactorNet get methods + function name = get.name(w) + name = ctString('wall_name', w.id); + end + function a = get.area(w) a = ctFunc('wall_area', w.id); end @@ -141,6 +150,10 @@ function delete(w) %% ReactorNet set methods + function set.name(w, name) + ctFunc('wall_setName', w.id, name); + end + function set.area(w, a) ctFunc('wall_setArea', w.id, a); end