From d92474ec2b886ac3145e2f5896ab00c60f68f2be Mon Sep 17 00:00:00 2001 From: ssun30 Date: Wed, 21 Dec 2022 07:32:14 -0500 Subject: [PATCH] Addressed reviewer comments including subclass definitions and docstrings. --- .../matlab_experimental/1D/AxisymmetricFlow.m | 27 ++-- .../1D/CounterFlowDiffusionFlame.m | 12 +- interfaces/matlab_experimental/1D/Domain1D.m | 50 +++---- interfaces/matlab_experimental/1D/FreeFlame.m | 28 ++-- interfaces/matlab_experimental/1D/Inlet.m | 26 +++- interfaces/matlab_experimental/1D/Outlet.m | 25 +++- interfaces/matlab_experimental/1D/OutletRes.m | 28 ++-- interfaces/matlab_experimental/1D/Sim1D.m | 17 +-- interfaces/matlab_experimental/1D/Surface.m | 36 +++-- interfaces/matlab_experimental/1D/SymmPlane.m | 26 ++-- .../matlab_experimental/Base/CarbonDioxide.m | 2 +- interfaces/matlab_experimental/Base/HFC134a.m | 2 +- interfaces/matlab_experimental/Base/Heptane.m | 2 +- .../matlab_experimental/Base/Hydrogen.m | 2 +- .../matlab_experimental/Base/Interface.m | 6 +- .../matlab_experimental/Base/Kinetics.m | 16 +-- interfaces/matlab_experimental/Base/Methane.m | 2 +- .../matlab_experimental/Base/Nitrogen.m | 2 +- interfaces/matlab_experimental/Base/Oxygen.m | 2 +- .../matlab_experimental/Base/Solution.m | 20 +-- .../matlab_experimental/Base/ThermoPhase.m | 42 +++--- .../matlab_experimental/Base/Transport.m | 8 +- interfaces/matlab_experimental/Base/Water.m | 2 +- interfaces/matlab_experimental/Func/Func.m | 10 +- interfaces/matlab_experimental/Func/fplus.m | 16 ++- .../matlab_experimental/Func/frdivide.m | 16 ++- interfaces/matlab_experimental/Func/ftimes.m | 34 +++-- .../matlab_experimental/Func/gaussian.m | 7 +- interfaces/matlab_experimental/Func/polynom.m | 12 +- .../matlab_experimental/Phases/Mixture.m | 26 ++-- .../Reactor/ConstPressureReactor.m | 27 ++-- .../matlab_experimental/Reactor/FlowDevice.m | 130 ++++++------------ .../matlab_experimental/Reactor/FlowReactor.m | 23 ++-- .../Reactor/IdealGasConstPressureReactor.m | 23 ++-- .../Reactor/IdealGasReactor.m | 22 ++- .../Reactor/MassFlowController.m | 33 +++-- .../matlab_experimental/Reactor/Reactor.m | 121 ++++++++-------- .../matlab_experimental/Reactor/ReactorNet.m | 49 +++---- .../matlab_experimental/Reactor/Reservoir.m | 27 ++-- .../matlab_experimental/Reactor/Valve.m | 46 ++++--- interfaces/matlab_experimental/Reactor/Wall.m | 95 +++++-------- 41 files changed, 594 insertions(+), 506 deletions(-) diff --git a/interfaces/matlab_experimental/1D/AxisymmetricFlow.m b/interfaces/matlab_experimental/1D/AxisymmetricFlow.m index b8922fb919..c57986fc70 100644 --- a/interfaces/matlab_experimental/1D/AxisymmetricFlow.m +++ b/interfaces/matlab_experimental/1D/AxisymmetricFlow.m @@ -1,20 +1,31 @@ -function m = AxisymmetricFlow(gas, id) +classdef AxisymmetricFlow < Domain1D % Create an axisymmetric flow domain. + % % m = AxisymmetricFlow(gas, id) % % :param gas: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % :param id: % String, ID of the flow % :return: - % Domain1D instance representing an axisymmetric flow. + % Instance of class :mat:class:`AxisymmetricFlow`. % - m = Domain1D('StagnationFlow', gas); - if nargin == 1 - m.setID('flow'); - else - m.setID(id); + methods + + % Constructor + function m = AxisymmetricFlow(gas, id) + + m = m@Domain1D('StagnationFlow', gas); + + if nargin == 1 + m.setID('flow'); + else + m.setID(id); + end + + end + end end diff --git a/interfaces/matlab_experimental/1D/CounterFlowDiffusionFlame.m b/interfaces/matlab_experimental/1D/CounterFlowDiffusionFlame.m index 06cf9f1d13..50af94e498 100644 --- a/interfaces/matlab_experimental/1D/CounterFlowDiffusionFlame.m +++ b/interfaces/matlab_experimental/1D/CounterFlowDiffusionFlame.m @@ -4,23 +4,23 @@ % % :param left: % Object representing the left inlet, which must be - % created using function :mat:func:`Inlet`. + % created using function :mat:class:`Inlet`. % :param flow: % Object representing the flow, created with - % function :mat:func:`AxisymmetricFlow`. + % function :mat:class:`AxisymmetricFlow`. % :param right: % Object representing the right inlet, which must be - % created using function :mat:func:`Inlet`. + % created using function :mat:class:`Inlet`. % :param tp_f: % Object representing the fuel inlet gas, instance of class - % :mat:func:`Solution`, and an ideal gas. + % :mat:class:`Solution`, and an ideal gas. % :param tp_o: % Object representing the oxidizer inlet gas, instance of class - % :mat:func:`Solution`, and an ideal gas. + % :mat:class:`Solution`, and an ideal gas. % :param oxidizer: % String representing the oxidizer species. Most commonly O2. % :return: - % Instance of :mat:func:`Sim1D` object representing the left + % Instance of :mat:class:`Sim1D` object representing the left % inlet, flow, and right inlet. % diff --git a/interfaces/matlab_experimental/1D/Domain1D.m b/interfaces/matlab_experimental/1D/Domain1D.m index 9a40d3e27f..9f22522e5e 100644 --- a/interfaces/matlab_experimental/1D/Domain1D.m +++ b/interfaces/matlab_experimental/1D/Domain1D.m @@ -15,8 +15,8 @@ % `OutletRes` % % :param b: - % Instance of class :mat:func:`Solution` (for ``a == 1``) - % or :mat:func:`Interface` (for ``a == 6``). Not used for + % Instance of class :mat:class:`Solution` (for ``a == 1``) + % or :mat:class:`Interface` (for ``a == 6``). Not used for % all other valid values of ``a``. % @@ -41,7 +41,7 @@ % i = d.domainIndex % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :return: % Integer flag denoting the location of the domain, % beginning with 1 at the left. @@ -52,7 +52,7 @@ % i = d.domainType % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :return: % Integer flag denoting the domain type. domainType @@ -62,7 +62,7 @@ % a = d.isFlow % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :return: % 1 if the domain is a flow domain, and 0 otherwise. isFlow @@ -72,7 +72,7 @@ % a = d.isInlet % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :return: % 1 if the domain is an inlet, and 0 otherwise. isInlet @@ -82,7 +82,7 @@ % a = d.isSurface % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :return: % 1 if the domain is a surface, and 0 otherwise. isSurface @@ -92,7 +92,7 @@ % mdot = d.massFlux % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :return: % The mass flux in the domain. massFlux @@ -102,7 +102,7 @@ % n = d.nComponents % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :return: % Number of variables at each grid point nComponents @@ -112,7 +112,7 @@ % n = d.nPoints % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :return: % Integer number of grid points. nPoints @@ -196,7 +196,7 @@ function delete(d) % d.disableEnergy % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % disp(' '); disp('Disabling the energy equation...'); @@ -209,7 +209,7 @@ function delete(d) % d.enableEnergy % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % disp(' '); disp('Enabling the energy equation...'); @@ -222,7 +222,7 @@ function delete(d) % d.disableSoret % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % disp(' '); disp('Disabling the Soret effect...'); @@ -235,7 +235,7 @@ function delete(d) % d.enableSoret % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % disp(' '); disp('Disabling the Soret effect...'); @@ -268,7 +268,7 @@ function delete(d) % n = d.componentIndex(name) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param name: % String name of the component to look up. If a numeric value % is passed, it will be returned. @@ -300,7 +300,7 @@ function delete(d) % n = d.componentName(index) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param index: % Integer or vector of integers of component names % to get. @@ -413,7 +413,7 @@ function delete(d) % to which the boundary domain is attached. % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param k: % Integer species index % :return: @@ -492,7 +492,7 @@ function setCoverageEqs(d, onoff) % d.setBounds(component, lower, upper) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param component: % String, component to set the bounds on % :param lower: @@ -534,7 +534,7 @@ function setFixedTempProfile(d, profile) % columns. % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param profile: % n x 2 or 2 x n array of ``n`` points at which the temperature % is specified. @@ -560,7 +560,7 @@ function setID(d, id) % d.setID(id) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param id: % String ID to assign % @@ -573,7 +573,7 @@ function setMassFlowRate(d, mdot) % d.setMassFlowRate(mdot) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param mdot: % Mass flow rate % @@ -586,7 +586,7 @@ function setMoleFractions(d, x) % d.setMoleFractions(x) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param x: % String specifying the species and mole fractions in % the format ``'SPEC:X,SPEC2:X2'``. @@ -600,7 +600,7 @@ function setSteadyTolerances(d, component, rtol, atol) % d.setSteadyTolerances(component, rtol, atol) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param component: % String or cell array of strings of component values % whose tolerances should be set. If ``'default'`` is @@ -641,7 +641,7 @@ function setTransientTolerances(d, component, rtol, atol) % d.setTransientTolerances(component, rtol, atol) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param component: % String or cell array of strings of component values % whose tolerances should be set. If ``'default'`` is @@ -694,7 +694,7 @@ function setupGrid(d, grid) % d.setupGrid(grid) % % :param d: - % Instance of class :mat:func:`Domain1D` + % Instance of class :mat:class:`Domain1D` % :param grid: % callct('domain_setupGrid', d.domainID, numel(grid), grid); diff --git a/interfaces/matlab_experimental/1D/FreeFlame.m b/interfaces/matlab_experimental/1D/FreeFlame.m index 061a3d5bab..e9018b77c8 100644 --- a/interfaces/matlab_experimental/1D/FreeFlame.m +++ b/interfaces/matlab_experimental/1D/FreeFlame.m @@ -1,21 +1,31 @@ -function m = FreeFlame(gas, id) +classdef FreeFlame < Domain1D % Create a freely-propagating flat flame. + % % m = FreeFlame(gas, id) % % :param gas: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % :param id: % String, ID of the flow % :return: - % Domain1D instance representing a freely propagating, - % adiabatic flame + % Instance of class :mat:class:`FreeFlame` representing + % a freely propagating, adiabatic flame. % - m = Domain1D('StagnationFlow', gas, 2); + methods + + % Constructor + function m = FreeFlame(gas, id) + + m = m@Domain1D('StagnationFlow', gas, 2); + + if nargin == 1 + m.setID('flame'); + else + m.setID(id); + end + + end - if nargin == 1 - m.setID('flame'); - else - m.setID(id); end end diff --git a/interfaces/matlab_experimental/1D/Inlet.m b/interfaces/matlab_experimental/1D/Inlet.m index be768e455c..f8ae095e87 100644 --- a/interfaces/matlab_experimental/1D/Inlet.m +++ b/interfaces/matlab_experimental/1D/Inlet.m @@ -1,20 +1,32 @@ -function m = Inlet(id) +classdef Inlet < Domain1D % Create an inlet domain. + % % m = Inlet(id) + % % Note that an inlet can only be a terminal domain - it must be % either the leftmost or rightmost domain in a stack. % % :param id: % String name of the inlet. % :return: - % Instance of class :mat:func:`Domain1D` representing an inlet. + % Instance of class :mat:class:`Inlet`. % - m = Domain1D('Inlet1D'); - if nargin == 0 - m.setID('inlet'); - else - m.setID(id); + methods + + % Constructor + function m = Inlet(id) + + m = m@Domain1D('Inlet1D'); + + if nargin == 0 + m.setID('inlet'); + else + m.setID(id); + end + + end + end end diff --git a/interfaces/matlab_experimental/1D/Outlet.m b/interfaces/matlab_experimental/1D/Outlet.m index b1731059e4..45bb4fa292 100644 --- a/interfaces/matlab_experimental/1D/Outlet.m +++ b/interfaces/matlab_experimental/1D/Outlet.m @@ -1,18 +1,29 @@ -function m = Outlet(id) +classdef Outlet < Domain1D % Create an outlet domain. + % % m = Outlet(id) % % :param id: % String ID of the outlet. % :return: - % Instance of :mat:func:`Domain1D` representing an outlet. + % Instance of :mat:class:`Outlet`. % - m = Domain1D('Outlet1D'); - if nargin == 0 - m.setID('outlet'); - else - m.setID(id); + methods + + % Constructor + function m = Outlet(id) + + m = m@Domain1D('Outlet1D'); + + if nargin == 0 + m.setID('outlet'); + else + m.setID(id); + end + + end + end end diff --git a/interfaces/matlab_experimental/1D/OutletRes.m b/interfaces/matlab_experimental/1D/OutletRes.m index 5b84b860dd..32aa19b8db 100644 --- a/interfaces/matlab_experimental/1D/OutletRes.m +++ b/interfaces/matlab_experimental/1D/OutletRes.m @@ -1,17 +1,29 @@ -function m = OutletRes(id) +classdef OutletRes < Domain1D % Create an outlet reservoir domain. + % % m = OutletRes(id) % + % :param id: + % String ID of the outlet reservoir. % :return: - % Instance of :mat:func:`Domain1D` representing an outlet - % reservoir. + % Instance of :mat:class:`OutletRes`. % - m = Domain1D('OutletRes'); - if nargin == 0 - m.setID('outletres'); - else - m.setID(id); + methods + + % Constructor + function m = OutletRes(id) + + m = m@Domain1D('OutletRes'); + + if nargin == 0 + m.setID('outletres'); + else + m.setID(id); + end + + end + end end diff --git a/interfaces/matlab_experimental/1D/Sim1D.m b/interfaces/matlab_experimental/1D/Sim1D.m index 8bd177502c..c0bedba5cd 100644 --- a/interfaces/matlab_experimental/1D/Sim1D.m +++ b/interfaces/matlab_experimental/1D/Sim1D.m @@ -7,12 +7,12 @@ % which are instances of class Domain1D. The domains are of two % types - extended domains, and connector domains. % - % See also: :mat:func:`Domain1D` + % See also: :mat:class:`Domain1D` % % :param domains: % Vector of domain instances % :return: - % Instance of class :mat:func:`Sim1D` + % Instance of class :mat:class:`Sim1D` % properties (SetAccess = immutable) @@ -20,6 +20,7 @@ stID % ID of the Sim1D object. domains % Domain instances contained within the Sim1D object. + end methods @@ -97,10 +98,10 @@ function restore(s, fname, id) % % This method can be used to provide an initial guess for the solution. % - % See also: :mat:func:`save` + % See also: :mat:class:`save` % % :param s: - % Instance of class :mat:func:`Sim1D` + % Instance of class :mat:class:`Sim1D` % :param fname: % File name of an XML file containing solution information % :param id: @@ -115,10 +116,10 @@ function saveSoln(s, fname, id, desc) % s.saveSoln(fname, id, desc) % % The output file is in a format that - % can be used by :mat:func:`restore` + % can be used by :mat:class:`restore` % % :param s: - % Instance of class :mat:func:`Sim1D` + % Instance of class :mat:class:`Sim1D` % :param fname: % File name where XML file should be written % :param id: @@ -218,7 +219,7 @@ function writeStats(s) % each one. % % :param s: - % Instance of class :mat:func:`Sim1D` + % Instance of class :mat:class:`Sim1D` % callct('sim1D_writeStats', s.stID, 1); @@ -266,7 +267,7 @@ function getInitialSoln(s) % z = s.grid(name) % % :param s: - % Instance of class :mat:func:`Sim1D` + % Instance of class :mat:class:`Sim1D` % :param name: % Name of the domain for which the grid % should be retrieved. diff --git a/interfaces/matlab_experimental/1D/Surface.m b/interfaces/matlab_experimental/1D/Surface.m index 5b7ce408df..74e6172fce 100644 --- a/interfaces/matlab_experimental/1D/Surface.m +++ b/interfaces/matlab_experimental/1D/Surface.m @@ -1,29 +1,39 @@ -function m = Surface(id, surface_mech) +classdef Surface < Domain1D % Create a surface domain. + % % m = Surface(id, surface_mech) % % :param id: % String ID of surface % :param surface_mech: - % Instance of class :mat:func:`Interface` defining + % Instance of class :mat:class:`Interface` defining % the surface reaction mechanism to be used. Optional. % :return: - % Instance of class :mat:func:`Domain1D` representing a + % Instance of class :mat:class:`Surface` representing a % non-reacting or reacting surface. % - if nargin > 1 - m = Domain1D('ReactingSurface', surface_mech); - m.setID(id); - return - end + methods + + % Constructor + function m = Surface(id, surface_mech) + + if nargin > 1 + m = m@Domain1D('ReactingSurface', surface_mech); + m.setID(id); + return + end + + m = m@Domain1D('Surf1D'); + + if nargin == 0 + m.setID('surface'); + elseif nargin == 1 + m.setID(id); + end - m = Domain1D('Surf1D'); + end - if nargin == 0 - m.setID('surface'); - elseif nargin == 1 - m.setID(id); end end diff --git a/interfaces/matlab_experimental/1D/SymmPlane.m b/interfaces/matlab_experimental/1D/SymmPlane.m index 2ded6b1f21..6005bd5cec 100644 --- a/interfaces/matlab_experimental/1D/SymmPlane.m +++ b/interfaces/matlab_experimental/1D/SymmPlane.m @@ -1,19 +1,29 @@ -function m = SymmPlane(id) +classdef SymmPlane < Domain1D % Create a symmetry plane domain. + % % m = SymmPlane(id) % % :param id: % String ID of the symmetry plane. % :return: - % Instance of class :mat:func:`Domain1D` representing a symmetry - % plane. + % Instance of class :mat:class:`SymmPlane`. % - m = Domain1D(Symm1D); - if nargin == 0 - m.setID('symmetry_plane'); - else - m.setID(id); + methods + + % Constructor + function m = SymmPlane(id) + + m = Domain1D(Symm1D); + + if nargin == 0 + m.setID('symmetry_plane'); + else + m.setID(id); + end + + end + end end diff --git a/interfaces/matlab_experimental/Base/CarbonDioxide.m b/interfaces/matlab_experimental/Base/CarbonDioxide.m index eaea05cecd..7377d54e51 100644 --- a/interfaces/matlab_experimental/Base/CarbonDioxide.m +++ b/interfaces/matlab_experimental/Base/CarbonDioxide.m @@ -16,7 +16,7 @@ % Cantera C++ source code documentation. % % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % h = Solution('liquidvapor.yaml', 'carbon-dioxide'); end diff --git a/interfaces/matlab_experimental/Base/HFC134a.m b/interfaces/matlab_experimental/Base/HFC134a.m index 124a2cf41a..2beef6bdf9 100644 --- a/interfaces/matlab_experimental/Base/HFC134a.m +++ b/interfaces/matlab_experimental/Base/HFC134a.m @@ -18,7 +18,7 @@ % Cantera C++ source code documentation. % % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % h = Solution('liquidvapor.yaml', 'HFC-134a'); end diff --git a/interfaces/matlab_experimental/Base/Heptane.m b/interfaces/matlab_experimental/Base/Heptane.m index 4801184c98..1efcd95194 100644 --- a/interfaces/matlab_experimental/Base/Heptane.m +++ b/interfaces/matlab_experimental/Base/Heptane.m @@ -16,7 +16,7 @@ % Cantera C++ source code documentation. % % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % h = Solution('liquidvapor.yaml', 'heptane'); end diff --git a/interfaces/matlab_experimental/Base/Hydrogen.m b/interfaces/matlab_experimental/Base/Hydrogen.m index b2fe134f39..6aa03ea51f 100644 --- a/interfaces/matlab_experimental/Base/Hydrogen.m +++ b/interfaces/matlab_experimental/Base/Hydrogen.m @@ -16,7 +16,7 @@ % Cantera C++ source code documentation. % % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % h = Solution('liquidvapor.yaml', 'hydrogen'); end diff --git a/interfaces/matlab_experimental/Base/Interface.m b/interfaces/matlab_experimental/Base/Interface.m index aa816b4d72..f5fe5aa766 100644 --- a/interfaces/matlab_experimental/Base/Interface.m +++ b/interfaces/matlab_experimental/Base/Interface.m @@ -19,7 +19,7 @@ % :param p4: % Adjoining phase to the interface. % :return: - % Instance of class :mat:func:`Interface` + % Instance of class :mat:class:`Interface` % properties (SetAccess = public) @@ -93,7 +93,7 @@ function setCoverages(s, cov, norm) % s.setCoverages(cov, norm) % % :param s: - % Instance of class :mat:func:`Interface` + % Instance of class :mat:class:`Interface` % :param cov: % Coverage of the species. ``cov`` can be either a vector of % length ``n_surf_species``, or a string in the format @@ -140,7 +140,7 @@ function setCoverages(s, cov, norm) % s.siteDensity = d % % :param s: - % Instance of class :mat:func:`Interface` + % Instance of class :mat:class:`Interface` % :param d % Double site density. Unit: kmol/m^2 for surface phases, % kmol/m for edge phases. diff --git a/interfaces/matlab_experimental/Base/Kinetics.m b/interfaces/matlab_experimental/Base/Kinetics.m index 57beb5ba4d..9858238915 100644 --- a/interfaces/matlab_experimental/Base/Kinetics.m +++ b/interfaces/matlab_experimental/Base/Kinetics.m @@ -50,7 +50,7 @@ % Evaluates the source term :math:`\dot{\omega}_k M_k /\rho` % % :param a: - % Instance of class :mat:func:`Kinetics` (or another + % Instance of class :mat:class:`Kinetics` (or another % object deriving from Kinetics) % for which the ydots are desired. % :return: @@ -80,31 +80,31 @@ % Class Kinetics represents kinetics managers, which are classes that manage % reaction mechanisms. The reaction mechanism attributes are specified in a YAML file. % - % Instances of class :mat:func:`Kinetics` are responsible for evaluating reaction rates + % Instances of class :mat:class:`Kinetics` are responsible for evaluating reaction rates % of progress, species production rates, and other quantities pertaining to % a reaction mechanism. % % :param ph: - % An instance of class :mat:func:`ThermoPhase` representing the phase + % An instance of class :mat:class:`ThermoPhase` representing the phase % in which reactions occur % :param src: % Input string of YAML file name. % :param id: % ID of the phase to import as specified in the input file. (optional) % :param neighbor1: - % Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a + % Instance of class :mat:class:`ThermoPhase` or :mat:class:`Solution` representing a % neighboring phase. % :param neighbor2: - % Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a + % Instance of class :mat:class:`ThermoPhase` or :mat:class:`Solution` representing a % neighboring phase. % :param neighbor3: - % Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a + % Instance of class :mat:class:`ThermoPhase` or :mat:class:`Solution` representing a % neighboring phase. % :param neighbor4: - % Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a + % Instance of class :mat:class:`ThermoPhase` or :mat:class:`Solution` representing a % neighboring phase. % :return: - % Instance of class :mat:func:`Kinetics` + % Instance of class :mat:class:`Kinetics` % checklib; diff --git a/interfaces/matlab_experimental/Base/Methane.m b/interfaces/matlab_experimental/Base/Methane.m index 092593a846..88d7696a37 100644 --- a/interfaces/matlab_experimental/Base/Methane.m +++ b/interfaces/matlab_experimental/Base/Methane.m @@ -13,7 +13,7 @@ % University, 1979. Print. % % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % h = Solution('liquidvapor.yaml', 'methane'); end diff --git a/interfaces/matlab_experimental/Base/Nitrogen.m b/interfaces/matlab_experimental/Base/Nitrogen.m index 510d254e48..c25f074e6a 100644 --- a/interfaces/matlab_experimental/Base/Nitrogen.m +++ b/interfaces/matlab_experimental/Base/Nitrogen.m @@ -13,7 +13,7 @@ % University, 1979. Print. % % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % h = Solution('liquidvapor.yaml', 'nitrogen'); end diff --git a/interfaces/matlab_experimental/Base/Oxygen.m b/interfaces/matlab_experimental/Base/Oxygen.m index 964ff415ae..b4c7e51ae0 100644 --- a/interfaces/matlab_experimental/Base/Oxygen.m +++ b/interfaces/matlab_experimental/Base/Oxygen.m @@ -13,7 +13,7 @@ % University, 1979. Print. % % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % h = Solution('liquidvapor.yaml', 'oxygen'); end diff --git a/interfaces/matlab_experimental/Base/Solution.m b/interfaces/matlab_experimental/Base/Solution.m index 20a4bca063..c47034c085 100644 --- a/interfaces/matlab_experimental/Base/Solution.m +++ b/interfaces/matlab_experimental/Base/Solution.m @@ -3,7 +3,7 @@ % % s = Solution(src, id, trans) % - % Class :mat:func:`Solution` represents solutions of multiple species. A + % Class :mat:class:`Solution` represents solutions of multiple species. A % solution is defined as a mixture of two or more constituents % (species) that are completely mixed on molecular length % scales. The macroscopic intensive thermodynamic state of a @@ -14,10 +14,10 @@ % % >> s = Solution('input.yaml', phase_name, transport_model) % - % constructs a :mat:func:`Solution` object from a specification contained in + % constructs a :mat:class:`Solution` object from a specification contained in % file ``input.yaml`` with the name of the phase to be imported specified with - % ``phase_name``. If a :mat:func:`Transport` model is included in ``input.yaml``, - % it will be included in the :mat:func:`Solution` instance with the default transport modeling as set + % ``phase_name``. If a :mat:class:`Transport` model is included in ``input.yaml``, + % it will be included in the :mat:class:`Solution` instance with the default transport modeling as set % in the input file. To specify the transport modeling, set the input argument % ``trans`` to one of ``'default'``, ``'None'``, ``'Mix'``, or ``'Multi'``. % In this case, the phase name must be specified as well. Alternatively, @@ -25,14 +25,14 @@ % property in the CTI file before loading the phase. The transport % modeling cannot be changed once the phase is loaded. % - % Class :mat:func:`Solution` derives from three more basic classes, and most of + % Class :mat:class:`Solution` derives from three more basic classes, and most of % its methods are inherited from these classes. These are: % - % * class :mat:func:`ThermoPhase` - composition information and thermodynamic properties - % * class :mat:func:`Kinetics` - homogeneous kinetics - % * class :mat:func:`Transport` - transport properties + % * class :mat:class:`ThermoPhase` - composition information and thermodynamic properties + % * class :mat:class:`Kinetics` - homogeneous kinetics + % * class :mat:class:`Transport` - transport properties % - % See also: :mat:func:`ThermoPhase`, :mat:func:`Kinetics`, :mat:func:`Transport` + % See also: :mat:class:`ThermoPhase`, :mat:class:`Kinetics`, :mat:class:`Transport` % % :param src: % Input string of YAML file name. @@ -42,7 +42,7 @@ % String, transport modeling. Possible values are ``'default'``, ``'None'``, % ``'Mix'``, or ``'Multi'``. If not specified, ``'default'`` is used. % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % properties (Access = private) diff --git a/interfaces/matlab_experimental/Base/ThermoPhase.m b/interfaces/matlab_experimental/Base/ThermoPhase.m index 0e95390702..94185e6f5b 100644 --- a/interfaces/matlab_experimental/Base/ThermoPhase.m +++ b/interfaces/matlab_experimental/Base/ThermoPhase.m @@ -8,7 +8,7 @@ % :param id: % ID of the phase to import as specified in the input file. % :return: - % Instance of class :mat:func:`ThermoPhase` + % Instance of class :mat:class:`ThermoPhase` % properties (SetAccess = public) @@ -34,7 +34,7 @@ % tp.basis = b % % :param tp: - % Instance of class :mat:func:`ThermoPhase`. + % Instance of class :mat:class:`ThermoPhase`. % :param b: % String. Can be 'mole'/'molar'/'Molar'/'Mole' or 'mass'/'Mass'. basis @@ -55,7 +55,7 @@ % molar masses of the individual species in the phase. % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :return: % Scalar double mean molecular weight. Units: kg/kmol @@ -86,7 +86,7 @@ % thermo manager. % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase). % :return: % Vector of species chemical potentials. Units: J/kmol @@ -114,7 +114,7 @@ % v = tp.enthalpies_RT % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :return: % Vector of standard-state species enthalpies @@ -138,10 +138,10 @@ % finite temperature range, which may be different for each species % in the phase. % - % See also: :mat:func:`minTemp` + % See also: :mat:class:`minTemp` % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :return: % Vector of maximum temperatures of all species @@ -156,10 +156,10 @@ % finite temperature range, which may be different for each species % in the phase. % - % See also: :mat:func:`maxTemp` + % See also: :mat:class:`maxTemp` % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :return: % Vector of minimum temperatures of all species @@ -189,7 +189,7 @@ % .. math:: c = \sqrt{\frac{p_1 - p_0}{\rho_1-\rho_0}} % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % class derived from ThermoPhase) % :return: % The speed of sound. Units: m/s @@ -429,7 +429,7 @@ function display(tp) % elMassFrac = tp.elementalMassFraction(element) % % :param tp: - % Object representing the gas, instance of class :mat:func:`Solution`, + % Object representing the gas, instance of class :mat:class:`Solution`, % and an ideal gas. The state of this object should be set to an % estimate of the gas state before calling elementalMassFraction. % @@ -499,7 +499,7 @@ function display(tp) % n = tp.nAtoms(k,m) % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :param k: % String species name or integer species number @@ -557,7 +557,7 @@ function display(tp) % >> iho2 = gas.speciesIndex('HO2'); % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % class derived from ThermoPhase) % :param name: % If name is a single string, the return value will be a integer @@ -625,7 +625,7 @@ function display(tp) % n = tp.speciesNames % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % class derived from ThermoPhase) % :return: % Cell array of strings of all of the species names @@ -663,7 +663,7 @@ function display(tp) % x = tp.moleFraction(species) % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :param species: % String or cell array of strings of species whose mole @@ -713,7 +713,7 @@ function display(tp) % y = tp.massFraction(species) % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :param species: % String or cell array of strings of species whose mass @@ -833,7 +833,7 @@ function display(tp) % p = tp.satPressure(t) % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :param t: % Temperature Units: K @@ -849,7 +849,7 @@ function display(tp) % t = tp.satTemperature(p) % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % object that derives from ThermoPhase) % :param p: % Pressure. Units: Pa @@ -1118,7 +1118,7 @@ function display(tp) % tp.setElectricPotential(phi) % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % class derived from ThermoPhase) % :param phi: % Electric potential. Units: V @@ -1136,7 +1136,7 @@ function display(tp) % intensive variables. % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % class derived from ThermoPhase) % :param p: % Pressure (Pa) @@ -1156,7 +1156,7 @@ function display(tp) % intensive variables. % % :param tp: - % Instance of class :mat:func:`ThermoPhase` (or another + % Instance of class :mat:class:`ThermoPhase` (or another % class derived from ThermoPhase) % :param t: % Temperature (K) diff --git a/interfaces/matlab_experimental/Base/Transport.m b/interfaces/matlab_experimental/Base/Transport.m index e58b5b577e..72e0d6e760 100644 --- a/interfaces/matlab_experimental/Base/Transport.m +++ b/interfaces/matlab_experimental/Base/Transport.m @@ -34,15 +34,15 @@ % % tr = Transport(r, th, model, loglevel) % - % Create a new instance of class :mat:func:`Transport`. One to three arguments + % Create a new instance of class :mat:class:`Transport`. One to three arguments % may be supplied. The first must be an instance of class - % :mat:func:`ThermoPhase`. The second (optional) argument is the type of + % :mat:class:`ThermoPhase`. The second (optional) argument is the type of % model desired, specified by the string ``'default'``, ``'Mix'`` or % ``'Multi'``. ``'default'`` uses the default transport specified in the % phase definition. The third argument is the logging level desired. % % :param th: - % Instance of class :mat:func:`ThermoPhase` + % Instance of class :mat:class:`ThermoPhase` % :param model: % String indicating the transport model to use. Possible values % are ``'default'``, ``'None'``, ``'Mix'``, and ``'Multi'``. @@ -50,7 +50,7 @@ % :param loglevel: % Level of diagnostic logging. Default if not specified is 4. % :return: - % Instance of class :mat:func:`Transport` + % Instance of class :mat:class:`Transport` % checklib; tr.trID = 0; diff --git a/interfaces/matlab_experimental/Base/Water.m b/interfaces/matlab_experimental/Base/Water.m index 36d143ce4e..f3ad5c1784 100644 --- a/interfaces/matlab_experimental/Base/Water.m +++ b/interfaces/matlab_experimental/Base/Water.m @@ -16,7 +16,7 @@ % Cantera C++ source code documentation. % % :return: - % Instance of class :mat:func:`Solution` + % Instance of class :mat:class:`Solution` % w = Solution('liquidvapor.yaml', 'water'); end diff --git a/interfaces/matlab_experimental/Func/Func.m b/interfaces/matlab_experimental/Func/Func.m index c8bba54d7f..2cb73f5f62 100644 --- a/interfaces/matlab_experimental/Func/Func.m +++ b/interfaces/matlab_experimental/Func/Func.m @@ -30,8 +30,8 @@ % Note: this MATLAB class shadows the underlying C++ Cantera class % "Func1". See the Cantera C++ documentation for more details. % - % See also: :mat:func:`polynom`, :mat:func:`gaussian`, :mat:func:`plus`, - % :mat:func:`rdivide`, :mat:func:`times` + % See also: :mat:class:`polynom`, :mat:class:`gaussian`, :mat:class:`fplus`, + % :mat:class:`frdivide`, :mat:class:`ftimes` % % :param typ: % String indicating type of functor to create. Possible values are: @@ -50,7 +50,7 @@ % :param p: % Vector of parameters % :return: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`Func` % properties (SetAccess = immutable) @@ -158,7 +158,7 @@ function display(f) % b = a.subsref(s) % % :param a: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`Func` % :param s: % Value at which the function should be evaluated. % :return: @@ -191,7 +191,7 @@ function display(f) % s = f.char % % :param f: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`Func` % :return: % Formatted string displaying the function % diff --git a/interfaces/matlab_experimental/Func/fplus.m b/interfaces/matlab_experimental/Func/fplus.m index b4a63780e1..778fbb6358 100644 --- a/interfaces/matlab_experimental/Func/fplus.m +++ b/interfaces/matlab_experimental/Func/fplus.m @@ -4,11 +4,19 @@ % r = fplus(a, b) % % :param a: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`Func` % :param b: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`Func` % :return: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`fplus` % - r = Func('sum', a, b); + methods + + % Constructor + function f = fplus(a, b) + f = f@Func('sum', a, b); + end + + end + end diff --git a/interfaces/matlab_experimental/Func/frdivide.m b/interfaces/matlab_experimental/Func/frdivide.m index 1dd993f45c..d4298ad79e 100644 --- a/interfaces/matlab_experimental/Func/frdivide.m +++ b/interfaces/matlab_experimental/Func/frdivide.m @@ -4,11 +4,19 @@ % r = frdivide(a,b) % % :param a: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`Func` % :param b: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`Func` % :return: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`frdivide` % - r = Func('ratio', a, b); + methods + + % Constructor + function f = frdivide(a, b) + f = f@Func('ratio', a, b); + end + + end + end diff --git a/interfaces/matlab_experimental/Func/ftimes.m b/interfaces/matlab_experimental/Func/ftimes.m index 4a3e32394c..7cb83ac4dd 100644 --- a/interfaces/matlab_experimental/Func/ftimes.m +++ b/interfaces/matlab_experimental/Func/ftimes.m @@ -1,14 +1,22 @@ -function r = ftimes(a, b) - % Create a functor that multiplies two other functors. - % - % r = ftimes(a, b) - % - % :param a: - % Instance of class :mat:func:`Func` - % :param b: - % Instance of class :mat:func:`Func` - % :return: - % Instance of class :mat:func:`Func` - % - r = Func('prod', a, b); +classdef ftimes < Func + % Ftimes - Get a functor representing the product of two input functors. + % + % f = ftimes(a, b) + % + % :param a: + % Instance of class :mat:class:`Func` + % :param b: + % Instance of class :mat:class:`Func` + % :return: + % Instance of class :mat:class:`ftimes` + % + methods + + % Constructor + function f = ftimes(a, b) + f = f@Func('prod', a, b); + end + + end + end diff --git a/interfaces/matlab_experimental/Func/gaussian.m b/interfaces/matlab_experimental/Func/gaussian.m index 3f29295cfd..502fdd7df6 100644 --- a/interfaces/matlab_experimental/Func/gaussian.m +++ b/interfaces/matlab_experimental/Func/gaussian.m @@ -1,5 +1,5 @@ classdef gaussian < Func - % Gaussian - Create a Gaussian :mat:func:`Func` instance. + % Gaussian - Create a Gaussian :mat:class:`Func` instance. % % f = gaussian(peak, center, width) % @@ -10,10 +10,13 @@ % :param width: % Full width at half-maximum. The value of the % function at center +/- (width)/2 is one-half - % the peak value. + % the peak value + % :return: + % Instance of class :mat:class:`gaussian` % methods + % Constructor function f = gaussian(peak, center, width) f = f@Func('gaussian', 0, [peak, center, width]); end diff --git a/interfaces/matlab_experimental/Func/polynom.m b/interfaces/matlab_experimental/Func/polynom.m index 0717cc13cc..dbb4e79484 100644 --- a/interfaces/matlab_experimental/Func/polynom.m +++ b/interfaces/matlab_experimental/Func/polynom.m @@ -1,5 +1,5 @@ -function poly = polynom(coeffs) - % Create a polynomial :mat:func:`Func` instance. +classdef polynom < Func + % Polynom - Create a polynomial :mat:class:`Func` instance. % % poly = polynom(coeffs) % @@ -14,7 +14,13 @@ % :param coeffs: % Vector of polynomial coefficients % :return: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`polynom` + % + methods + + % Constructor + function f = polynom(coeffs) + [n m] = size(coeffs); [n m] = size(coeffs); diff --git a/interfaces/matlab_experimental/Phases/Mixture.m b/interfaces/matlab_experimental/Phases/Mixture.m index b9f9a9c154..181e2c52d9 100644 --- a/interfaces/matlab_experimental/Phases/Mixture.m +++ b/interfaces/matlab_experimental/Phases/Mixture.m @@ -3,7 +3,7 @@ % % m = Mixture(phases) % - % Class :mat:func:`Mixture` represents mixtures of one or more phases of matter. + % Class :mat:class:`Mixture` represents mixtures of one or more phases of matter. % To construct a mixture, supply a cell array of phases and % mole numbers:: % @@ -32,7 +32,7 @@ % :param phases: % Cell array of phases and mole numbers % :return: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % properties (SetAccess = immutable) @@ -53,7 +53,7 @@ % n = m.nAtoms(e) % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param e: % Index of element % :return: @@ -75,7 +75,7 @@ % n = m.elementIndex(name) % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param name: % Name of the element whose index is desired % :return: @@ -91,7 +91,7 @@ % moles = m.elementMoles(e) % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param e: % Integer element number. % :return: @@ -104,7 +104,7 @@ % n = m.speciesIndex(k, p) % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param name: % Name of the speces whose index is desired % :return: @@ -120,7 +120,7 @@ % moles = m.speciesMoles(k) % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param k: % Integer species number. % :return: @@ -134,7 +134,7 @@ % moles = m.phaseMoles(n) % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param n: % Integer phase number. % :return: @@ -218,10 +218,10 @@ function addPhase(m, phase, moles) % addPhase(self, phase, moles) % % :param self: - % Instance of class :mat:func:`Mixture` to which phases should be + % Instance of class :mat:class:`Mixture` to which phases should be % added % :param phase: - % Instance of class :mat:func:`ThermoPhase` which should be added + % Instance of class :mat:class:`ThermoPhase` which should be added % :param moles: % Number of moles of the ``phase`` to be added to this mixture. % Units: kmol @@ -351,7 +351,7 @@ function setPhaseMoles(m, n, moles) % m.setPhaseMoles(n, moles) % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param n: % Phase number in the input % :param moles: @@ -374,7 +374,7 @@ function setSpeciesMoles(m, moles) % >> mix.setSpeciesMoles('C(s):1.0, CH4:2.0, O2:0.2'); % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param moles: % Vector or string specifying the moles of species % @@ -411,7 +411,7 @@ function setSpeciesMoles(m, moles) % >> mix.equilibrate('TP', 1.0e-6, 500) % % :param m: - % Instance of class :mat:func:`Mixture` + % Instance of class :mat:class:`Mixture` % :param XY: % Two-letter string specifying the two properties to hold % fixed. Currently, ``'TP'``, ``'HP'``, ``'TV'``, and ``'SP'`` are diff --git a/interfaces/matlab_experimental/Reactor/ConstPressureReactor.m b/interfaces/matlab_experimental/Reactor/ConstPressureReactor.m index f5fa8c1432..22979809c8 100644 --- a/interfaces/matlab_experimental/Reactor/ConstPressureReactor.m +++ b/interfaces/matlab_experimental/Reactor/ConstPressureReactor.m @@ -1,10 +1,10 @@ -function r = ConstPressureReactor(contents) +classdef ConstPressureReactor < Reactor % Create a constant pressure reactor object. % % r = ConstPressureReactor(contents) % - % A :mat:func:`ConstPressureReactor` is an instance of class - % :mat:func:`Reactor` where the pressure is held constant. The volume + % A :mat:class:`ConstPressureReactor` is an instance of class + % :mat:class:`Reactor` where the pressure is held constant. The volume % is not a state variable, but instead takes on whatever value is % consistent with holding the pressure constant. Examples: % @@ -13,17 +13,24 @@ % r1 = ConstPressureReactor % an empty reactor % r2 = ConstPressureReactor(contents) % a reactor containing contents % - % See also: :mat:func:`Reactor` + % See also: :mat:class:`Reactor` % % :param contents: - % Cantera :mat:func:`Solution` to be set as the contents of the + % Cantera :mat:class:`Solution` to be set as the contents of the % reactor % :return: - % Instance of class :mat:func:`Reactor` + % Instance of class :mat:class:`ConstPressureReactor` - if nargin == 0 - contents = 0; - end + methods + + % Constructor + function r = ConstPressureReactor(contents) + if nargin == 0 + contents = 0; + end - r = Reactor(contents, 'ConstPressureReactor'); + r = r@Reactor(contents, 'ConstPressureReactor'); + end + + end end diff --git a/interfaces/matlab_experimental/Reactor/FlowDevice.m b/interfaces/matlab_experimental/Reactor/FlowDevice.m index 51fc4ed9c7..bfb8c87b26 100644 --- a/interfaces/matlab_experimental/Reactor/FlowDevice.m +++ b/interfaces/matlab_experimental/Reactor/FlowDevice.m @@ -4,23 +4,23 @@ % x = FlowDevice(typ) % % Base class for devices that allow flow between reactors. - % :mat:func:`FlowDevice` objects are assumed to be adiabatic, + % :mat:class:`FlowDevice` objects are assumed to be adiabatic, % non-reactive, and have negligible internal volume, so that they are % internally always in steady-state even if the upstream and downstream % reactors are not. The fluid enthalpy, chemical composition, and mass - % flow rate are constant across a :mat:func:`FlowDevice`, and the + % flow rate are constant across a :mat:class:`FlowDevice`, and the % pressure difference equals the difference in pressure between the % upstream and downstream reactors. % - % See also: :mat:func:`MassFlowController`, :mat:func:`Valve` + % See also: :mat:class:`MassFlowController`, :mat:class:`Valve` % % :param typ: - % Type of :mat:func:`FlowDevice` to be created. ``typ='MassFlowController'`` - % for :mat:func:`MassFlowController`, ``typ='PressureController'`` for - % :mat:func:`PressureController` and ``typ='Valve'`` for - % :mat:func:`Valve` + % Type of :mat:class:`FlowDevice` to be created. ``typ='MassFlowController'`` + % for :mat:class:`MassFlowController`, ``typ='PressureController'`` for + % :mat:class:`PressureController` and ``typ='Valve'`` for + % :mat:class:`Valve` % :return: - % Instance of class :mat:func:`FlowDevice` + % Instance of class :mat:class:`FlowDevice` % properties (SetAccess = immutable) @@ -31,21 +31,28 @@ end properties (SetAccess = protected) - - upstream % Upstream object of type :mat:func:`Reactor` or :mat:func:`Reservoir`. - - downstream % Downstream object of type :mat:func:`Reactor` or :mat:func:`Reservoir`. - - % Get the mass flow rate. % - % mdot = f.massFlowRate + % Upstream object of type :mat:class:`Reactor` or :mat:class:`Reservoir`. + upstream % - % :param f: - % Instance of class :mat:func:`MassFlowController` - % :return: - % The mass flow rate through the :mat:func:`FlowDevice` at the current time + % Downstream object of type :mat:class:`Reactor` or :mat:class:`Reservoir`. + downstream + % + % The mass flow rate through the :mat:class:`FlowDevice` at the current time. + % + % The setter method can either take a double value or a function represented by + % an instance of :mat:class:`Func`. massFlowRate - + % + % Valve coefficient in kg/Pa-s. + % + % The mass flow rate [kg/s] is computed from the expression + % + % .. math:: \dot{m} = K(P_{upstream} - P_{downstream}) + % + % as long as this produces a positive value. If this expression is + % negative, zero is returned. + valveCoeff end methods @@ -80,13 +87,13 @@ function install(f, upstream, downstream) % f.install(upstream, downstream) % % :param f: - % Instance of class :mat:func:`FlowDevice` to install + % Instance of class :mat:class:`FlowDevice` to install % :param upstream: - % Upstream :mat:func:`Reactor` or :mat:func:`Reservoir` + % Upstream :mat:class:`Reactor` or :mat:class:`Reservoir` % :param downstream: - % Downstream :mat:func:`Reactor` or :mat:func:`Reservoir` + % Downstream :mat:class:`Reactor` or :mat:class:`Reservoir` % :return: - % Instance of class :mat:func:`FlowDevice` + % Instance of class :mat:class:`FlowDevice` % if nargin == 3 @@ -106,55 +113,21 @@ function install(f, upstream, downstream) %% Flowdevice Get Methods function mdot = get.massFlowRate(f) - % Get the mass flow rate. - % - % mdot = f.massFlowRate - % - % :param f: - % Instance of class :mat:func:`MassFlowController` - % :return: - % The mass flow rate through the :mat:func:`FlowDevice` at the current time - % mdot = callct('flowdev_massFlowRate2', f.id); end %% Flowdevice Set Methods - function setFunction(f, mf) - % Set the mass flow rate with class :mat:func:`Func`. - % - % f.setFunction(mf) - % - % See also: :mat:func:`MassFlowController`, :mat:func:`Func` - % - % :param f: - % Instance of class :mat:func:`MassFlowController` - % :param mf: - % Instance of class :mat:func:`Func` - % - if strcmp(f.type, 'MassFlowController') - k = callct('flowdev_setTimeFunction', f.id, ... - mf.id); - else - error('Time function can only be set for mass flow controllers.'); - end - - end + function set.massFlowRate(f, mdot) - function setMassFlowRate(f, mdot) - % Set the mass flow rate to a constant value. - % - % f.setMassFlowRate(mdot) - % - % See also: :mat:func:`MassFlowController` - % - % :param f: - % Instance of class :mat:func:`MassFlowController` - % :param mdot: - % Mass flow rate - % if strcmp(f.type, 'MassFlowController') - k = callct('flowdev_setMassFlowCoeff', f.id, mdot); + if isa(mdot, 'double') + k = callct('flowdev_setMassFlowCoeff', f.id, mdot); + elseif isa(mdot, 'Func') + k = callct('flowdev_setTimeFunction', f.id, mdot.id); + else + error('Mass flow rate must either be a value or function.'); + end else error('Mass flow rate can only be set for mass flow controllers.'); end @@ -168,9 +141,9 @@ function setMaster(f, d) % f.setMaster(d) % % :param f: - % Instance of class :mat:func:`MassFlowController` + % Instance of class :mat:class:`MassFlowController` % :param mf: - % Instance of class :mat:func:`Func` + % Instance of class :mat:class:`Func` % if strcmp(f.type, 'PressureController') k = callct('flowdev_setMaster', f.id, d); @@ -180,25 +153,8 @@ function setMaster(f, d) end - function setValveCoeff(f, k) - % Set the valve coefficient :math:`K`. - % - % f.setValveCoeff(k) - % - % The mass flow rate [kg/s] is computed from the expression - % - % .. math:: \dot{m} = K(P_{upstream} - P_{downstream}) - % - % as long as this produces a positive value. If this expression is - % negative, zero is returned. - % - % See also: :mat:func:`Valve` - % - % :param f: - % Instance of class :mat:func:`Valve` - % :param k: - % Value of the valve coefficient. Units: kg/Pa-s - % + function set.valveCoeff(f, k) + if ~strcmp(f.type, 'Valve') error('Valve coefficient can only be set for valves.'); end diff --git a/interfaces/matlab_experimental/Reactor/FlowReactor.m b/interfaces/matlab_experimental/Reactor/FlowReactor.m index 3342f1c9b4..6b46d1d3a6 100644 --- a/interfaces/matlab_experimental/Reactor/FlowReactor.m +++ b/interfaces/matlab_experimental/Reactor/FlowReactor.m @@ -1,4 +1,4 @@ -function r = FlowReactor(contents) +classdef FlowReactor < Reactor % Create a flow reactor object. % % r = FlowReactor(contents) @@ -11,17 +11,24 @@ % r1 = FlowReactor % an empty reactor % r2 = FlowReactor(gas) % a reactor containing a gas % - % See also: :mat:func:`Reactor` + % See also: :mat:class:`Reactor` % % :param contents: - % Cantera :mat:func:`Solution` to be set as the contents of the + % Cantera :mat:class:`Solution` to be set as the contents of the % reactor % :return: - % Instance of class :mat:func:`Reactor` + % Instance of class :mat:class:`FlowReactor` - if nargin == 0 - contents = 0; - end + methods + + % Constructor + function r = FlowReactor(contents) + if nargin == 0 + contents = 0; + end - r = Reactor(contents, 'FlowReactor'); + r = r@Reactor(contents, 'FlowReactor'); + end + + end end diff --git a/interfaces/matlab_experimental/Reactor/IdealGasConstPressureReactor.m b/interfaces/matlab_experimental/Reactor/IdealGasConstPressureReactor.m index 1a7c36cb26..722719b61b 100644 --- a/interfaces/matlab_experimental/Reactor/IdealGasConstPressureReactor.m +++ b/interfaces/matlab_experimental/Reactor/IdealGasConstPressureReactor.m @@ -1,4 +1,4 @@ -function r = IdealGasConstPressureReactor(contents) +classdef IdealGasConstPressureReactor < Reactor % Create a constant pressure reactor with an ideal gas. % % r = IdealGasConstPressureReactor(contents) @@ -15,17 +15,24 @@ % r1 = IdealGasConstPressureReactor % an empty reactor % r2 = IdealGasConstPressureReactor(gas) % a reactor containing a gas % - % See also: :mat:func:`Reactor` + % See also: :mat:class:`Reactor` % % :param contents: - % Cantera :mat:func:`Solution` to be set as the contents of the + % Cantera :mat:class:`Solution` to be set as the contents of the % reactor % :return: - % Instance of class :mat:func:`Reactor` + % Instance of class :mat:class:`IdealGasConstPressureReactor` - if nargin == 0 - contents = 0; - end + methods + + % Constructor + function r = IdealGasConstPressureReactor(contents) + if nargin == 0 + contents = 0; + end - r = Reactor(contents, 'IdealGasConstPressureReactor'); + r = r@Reactor(contents, 'IdealGasConstPressureReactor'); + end + + end end diff --git a/interfaces/matlab_experimental/Reactor/IdealGasReactor.m b/interfaces/matlab_experimental/Reactor/IdealGasReactor.m index 5a28e78c29..2f44e40c70 100644 --- a/interfaces/matlab_experimental/Reactor/IdealGasReactor.m +++ b/interfaces/matlab_experimental/Reactor/IdealGasReactor.m @@ -1,4 +1,4 @@ -function r = IdealGasReactor(contents) +classdef IdealGasReactor < Reactor % Create a reactor with an ideal gas. % % r = IdealGasReactor(contents) @@ -12,17 +12,25 @@ % r1 = IdealGasReactor % an empty reactor % r2 = IdealGasReactor(gas) % a reactor containing a gas % - % See also: :mat:func:`Reactor` + % See also: :mat:class:`Reactor` % % :param contents: - % Cantera :mat:func:`Solution` to be set as the contents of the + % Cantera :mat:class:`Solution` to be set as the contents of the % reactor % :return: - % Instance of class :mat:func:`Reactor` + % Instance of class :mat:class:`IdealGasReactor` + + methods + + % Constructor + function r = IdealGasReactor(contents) + if nargin == 0 + contents = 0; + end + + r = r@Reactor(contents, 'IdealGasReactor'); + end - if nargin == 0 - contents = 0; end - r = Reactor(contents, 'IdealGasReactor'); end diff --git a/interfaces/matlab_experimental/Reactor/MassFlowController.m b/interfaces/matlab_experimental/Reactor/MassFlowController.m index 7b518488a0..c5273efcf0 100644 --- a/interfaces/matlab_experimental/Reactor/MassFlowController.m +++ b/interfaces/matlab_experimental/Reactor/MassFlowController.m @@ -1,26 +1,39 @@ -function m = MassFlowController(upstream, downstream) +classdef MassFlowController < FlowDevice % Create a mass flow controller. % % m = MassFlowController(upstream, downstream) % - % Creates an instance of class :mat:func:`FlowDevice` configured to + % Creates an instance of class :mat:class:`FlowDevice` configured to % simulate a mass flow controller that maintains a constant mass flow % rate independent of upstream or downstream conditions. If two reactor % objects are supplied as arguments, the controller is installed - % between the two reactors. Otherwise, the 'install' method should be - % used to install the mass flow controller between reactors. + % between the two reactors. Otherwise, the :mat:func:`install` method + % should be used to install the :mat:class:`MassFlowController` between + % reactors. + % + % see also: :mat:class:`FlowDevice`, :mat:class:`Valve` % % :param upstream: - % Upstream 'Reactor' or 'Reservoir'. + % Upstream :mat:class:`Reactor` or :mat:class:`Reservoir` % :param downstream: - % Downstream 'Reactor' or 'Reservoir. + % Downstream :mat:class:`Reactor` or :mat:class:`Reservoir` % :return: - % Instance of class 'FlowDevice'. + % Instance of class :mat:class:`FlowDevice` + % + + methods + + % Constructor + function m = MassFlowController(upstream, downstream) + + m = m@FlowDevice('MassFlowController'); + + if nargin == 2 + m.install(upstream, downstream) + end - m = FlowDevice('MassFlowController'); + end - if nargin == 2 - m.install(upstream, downstream) end end diff --git a/interfaces/matlab_experimental/Reactor/Reactor.m b/interfaces/matlab_experimental/Reactor/Reactor.m index ef743eb1ac..f963df29b3 100644 --- a/interfaces/matlab_experimental/Reactor/Reactor.m +++ b/interfaces/matlab_experimental/Reactor/Reactor.m @@ -24,13 +24,14 @@ % properties (SetAccess = immutable) - type % Type of Reactor. + type % Type of Reactor. id % ID of Reactor. end properties (SetAccess = protected) + contents % % Density of the reactor contents at the end of the last call to @@ -64,6 +65,45 @@ % Mass fractions of the reactor contents at the end of the last call to % 'advance' or 'step'. Y + % + % Enable or disable changing reactor composition by reactions. + % + % r.chemistry = flag + % + % If the chemistry is disabled, then the reactor composition is + % constant. The parameter should be the string "on" to enable + % the species equaionts, or "off" to disable it. + % + % By default, Reactor objects are created with the species + % equations enabled if there are reactions present in the + % mechanism file, and disabled otherwise. + % + % :param r: + % Instance of class 'Reactor'. + % :param flag: + % String, either "on" or "off" to enable or disable chemical + % reactions, respectively. + chemistry + % + % Enable or disable solving the energy equation. + % + % r.energy = flag + % + % If the energy equation is disabled, then the reactor + % temperature is constant. The parameter should be the string + % "on" to enable the energy equation, or "off" to disable it. + % + % By default, Reactor objects are created with the energy + % equation enabled, so usually this method + % + % :param r: + % Instance of class 'Reactor'. + % :param flag: + % String, either "on" or "off" to enable or disable chemical + % reactions, respectively. + energy + + massFlowRate % Mass flow rate in kg/s. end @@ -182,6 +222,7 @@ function insert(r, gas) end function massFractions = get.Y(r) + nsp = r.contents.nSpecies; massFractions = zeros(1, nsp); @@ -193,92 +234,42 @@ function insert(r, gas) %% Reactor set methods - function setInitialVolume(r, v0) - % Set the initial reactor volume. - % - % r.setInitialVolume(v0) - % - % :param v0: - % Initial volume in m^3. + function set.V(r, v0) callct('reactor_setInitialVolume', r.id, v0); + end - function setMdot(r, MFR) - % Set the mass flow rate. - % - % r.setMdot(MFR) - % - % :param MFR: - % Mass flow rate in kg/s. - % + function set.massFlowRate(r, MFR) callct('reactor_setMassFlowRate', r.id, MFR); - r.Mdot = MFR; + r.massFlowRate = MFR; + end - function setChemistryFlag(r, flag) - % Enable or disable changing reactor composition by reactions. - % - % r.setChemistryFlag(flag) - % - % If the chemistry is disabled, then the reactor composition is - % constant. The parameter should be the string "on" to enable - % the species equaionts, or "off" to disable it. - % - % By default, Reactor objects are created with the species - % equations enabled if there are reactions present in the - % mechanism file, and disabled otherwise. - % - % :param r: - % Instance of class 'Reactor'. - % :param flag: - % String, either "on" or "off" to enable or disable chemical - % reactions, respectively. - % + function set.chemistry(r, flag) if strcmp(flag, 'on') - iflag = true; + cflag = true; elseif strcmp(flag, 'off') - iflag = false; + cflag = false; else error('Input must be "on" or "off"'); end - callct('reactor_setChemistry', r.id, iflag); + callct('reactor_setChemistry', r.id, cflag); end - function setEnergyFlag(r, flag) - % Enable or disable solving the energy equation. - % - % r.setEnergyFlag(flag) - % - % If the energy equation is disabled, then the reactor - % temperature is constant. The parameter should be the string - % "on" to enable the energy equation, or "off" to disable it. - % - % By default, Reactor objects are created with the energy - % equation enabled, so usually this method - % - % :param r: - % Instance of class 'Reactor'. - % :param flag: - % String, either "on" or "off" to enable or disable chemical - % reactions, respectively. - % - - iflag = -1; + function set.energy(r, flag) if strcmp(flag, 'on') - iflag = 1; + eflag = 1; elseif strcmp(flag, 'off') - iflag = 0; - end - - if iflag >= 0 - callct('reactor_setEnergy', r.id, iflag); + eflag = 0; else error('Input must be "on" or "off".'); end + callct('reactor_setEnergy', r.id, eflag); + end function setThermoMgr(r, t) diff --git a/interfaces/matlab_experimental/Reactor/ReactorNet.m b/interfaces/matlab_experimental/Reactor/ReactorNet.m index 3d15151811..d107e20c27 100644 --- a/interfaces/matlab_experimental/Reactor/ReactorNet.m +++ b/interfaces/matlab_experimental/Reactor/ReactorNet.m @@ -31,8 +31,23 @@ % rapidly changing, the time step becomes smaller to resolve % the solution. dt - - time % Current time in s. + % + % Current time in s. + % The setter method sets the time at which integration should be + % restarted, using the current state as the initial condition. + time + % + % Max time step in s. + % + % The integrator chooses a step size based on the desired error + % tolerance and the rate at which the solution is changing. + % In some cases, the solution changes very slowly at first, + % then very rapidly (ifnition problems). In such cases, the + % integrator may choose a timestep that is too large, which + % leads to numerical problems later. Use thismethod to set an + % upper bound on the timestep. + % + maxTimeStep atol % Absolute error tolerance. @@ -112,20 +127,11 @@ function advance(r, tout) %% ReactorNet set methods - function setInitialTime(r, t) - % Set the initial time of the integration. - % - % r.setInitialTime(t) - % - % :param t: - % Time at which integration should be restarted, using the - % current state as the initial condition. Unit: s. - % - + function set.time(r, t) callct('reactornet_setInitialTime', r.id, t); end - function setMaxTimeStep(r, maxstep) + function set.maxTimeStep(r, maxstep) % Set the maximum time step. % % r.setMaxTimeStep(maxstep) @@ -158,17 +164,13 @@ function setSensitivityTolerances(r, rerr, aerr) callct('reactornet_setSensitivityTolerances', r.id, rerr, aerr); end - function setTolerances(r, rerr, aerr) - % Set the error tolerance. - % - % r.setTolerances(rerr, aerr) - % - % :param rerr: - % Scalar relative error tolerance. - % :param aerr: - % Scalar absolute error tolerance. - % + function set.atol(r, aeer) + rerr = r.rtol; + callct('reactornet_setTolerances', r.id, rerr, aerr); + end + function set.rtol(r, reer) + aerr = r.atol; callct('reactornet_setTolerances', r.id, rerr, aerr); end @@ -207,7 +209,6 @@ function setTolerances(r, rerr, aerr) callct('reactornet_sensitivity', r.id, component, p, rxtr.id); end - % Check back on this one to add cases for component type integer. end end diff --git a/interfaces/matlab_experimental/Reactor/Reservoir.m b/interfaces/matlab_experimental/Reactor/Reservoir.m index 592b7fb985..6046d46180 100644 --- a/interfaces/matlab_experimental/Reactor/Reservoir.m +++ b/interfaces/matlab_experimental/Reactor/Reservoir.m @@ -1,7 +1,9 @@ -function r = Reservoir(contents) +classdef Reservoir < Reactor % Create a Reservoir object. + % % r = Reservoir(contents) - % A :mat:func:`Reservoir` is an instance of class :mat:func:`Reactor` + % + % A :mat:class:`Reservoir` is an instance of class :mat:class:`Reactor` % configured so that its intensive state is constant in time. A % reservoir may be thought of as infinite in extent, perfectly mixed, % and non-reacting, so that fluid may be extracted or added without @@ -15,18 +17,25 @@ % r1 = Reservoir % an empty reservoir % r2 = Reservoir(gas) % a reservoir containing a gas % - % See also: :mat:func:`Reactor` + % See also: :mat:class:`Reactor` % % :param contents: - % Cantera :mat:func:`Solution` to be set as the contents of the + % Cantera :mat:class:`Solution` to be set as the contents of the % reactor % :return: - % Instance of class :mat:func:`Reactor` + % Instance of class :mat:class:`Reactor` % - if nargin == 0 - contents = 0; - end + methods - r = Reactor(contents, 'Reservoir'); + % Constructor + function r = Reservoir(contents) + if nargin == 0 + contents = 0; + end + + r = r@Reactor(contents, 'Reservoir'); + end + + end end diff --git a/interfaces/matlab_experimental/Reactor/Valve.m b/interfaces/matlab_experimental/Reactor/Valve.m index c0454119b3..52a35ee626 100644 --- a/interfaces/matlab_experimental/Reactor/Valve.m +++ b/interfaces/matlab_experimental/Reactor/Valve.m @@ -1,22 +1,25 @@ -function v = Valve(upstream, downstream) +classdef Valve < FlowDevice % Create a valve. - % Creates an instance of class 'FlowDevice' configured to simulate a - % valve that produces a flow rate proportional to the pressure - % difference between the upstream or downstream reactors. + % v = Valve(upstream, downstream) + % Create an instance of class :mat:class:`FlowDevice` configured to + % simulate a valve that produces a flow rate proportional to the + % pressure difference between the upstream and downstream reactors. % - % The mass flow rate [kg/s] is computed from the expression: + % The mass flow rate [kg/s] is computed from the expression % - % mdot = K(P_upstream - P_downstream) + % .. math:: \dot{m} = K(P_{upstream} - P_{downstream}) % - % as long as this produces a positive value. If this expression is - % negative, zero is returned. Therefore, the 'Valve' object acts as a - % check valve - flow is always from upstream to downstream. + % as long as this produces a positive value. If this expression is + % negative, zero is returned. Therefore, the :mat:class:`Valve` object + % acts as a check valve - flow is always from the upstream reactor to + % the downstream one. Note: as currently implemented, the Valve object + % does not model real valve characteristics - in particular, it + % does not model choked flow. The mass flow rate is always assumed + % to be linearly proportional to the pressure difference, no matter how + % large the pressure difference. THIS MAY CHANGE IN A F`UTURE + % RELEASE. % - % Note: as currently implemented, the valve object does not model real - % valve characteristics - inparticular, it does not model choked flow. - % The mass flow rate is always assumed to be linearly proportional to - % the pressure difference, no matter how large. This MAY change in a - % future release. + % see also: :mat:class:`FlowDevice`, :mat:class:`MassFlowController` % % :param upstream: % Upstream 'Reactor' or 'Reservoir'. @@ -25,10 +28,19 @@ % :return: % Instance of class 'FlowDevice'. - v = FlowDevice('Valve'); + methods + + % Constructor + function v = Valve(upstream, downstream) + + v = v@FlowDevice('Valve'); + + if nargin == 2 + v.install(upstream, downstream) + end + + end - if nargin == 2 - v.install(upstream, downstream) end end diff --git a/interfaces/matlab_experimental/Reactor/Wall.m b/interfaces/matlab_experimental/Reactor/Wall.m index 90a9790fe8..884f3e019d 100644 --- a/interfaces/matlab_experimental/Reactor/Wall.m +++ b/interfaces/matlab_experimental/Reactor/Wall.m @@ -36,17 +36,42 @@ % properties (SetAccess = immutable) + id type + end properties (SetAccess = protected) + left % Reactor on the left. right % Reactor on the right. + end properties (SetAccess = public) + area % Area of the wall in m^2. + thermalResistance % Thermal resistance in K*m^2/W. + heatTransferCoeff % Heat transfer coefficient in W/(m^2-K). + emissivity % Non-dimensional emissivity. + expansionRateCoeff % Expansion rate coefficient in m/(s-Pa). + % + % Heat flux in W/m^2. + % + % Must be set by an instance of class 'Func', which allows the + % heat flux to be an arbitrary function of time. It is possible + % to specify a constant heat flux by using the polynomial + % functor with only the first term specified. + heatFlux + % + % Velocity in m/s. + % + % Must be set by an instance of class 'Func', which allows the + % velocity to be an arbitrary function of time. It is possible + % to specify a constant velocity by using the polynomial + % functor with only the first term specified. + velocity end methods @@ -129,85 +154,27 @@ function install(w, l, r) callct('wall_setArea', w.id, a); end - function setThermalResistance(w, r) - % Set the thermal resistance. - % - % w.setTHermalResistance(w) - % - % :param r: - % Thermal resistance. Unit: K*m^2/W. - % - + function set.thermalResistance(w, r) callct('wall_setThermalResistance', w.id, r); end - function setHeatTransferCoeff(w, u) - % Set the thermal transfer coefficient. - % - % w.setHeatTransferCoeff(u) - % - % :param u: - % Heat transfer coefficient. Unit: W/(m^2-K). - % - + function set.heatTransferCoeff(w, u) callct('wall_setHeatTransferCoeff', w.id, u); end - function setEmissivity(w, epsilon) - % Set the emissivity. - % - % w.setEmissitivity(epsilon) - % - % :param epsilon: - % Nondimensional emissivity. - % - + function set.emissivity(w, epsilon) callct('wall_setEmissivity', w.id, epsilon); end - function setExpansionRateCoeff(w, k) - % Set the expansion rate coefficient. - % - % w.setExpansionRateCoeff(k) - % - % :param k: - % Expanstion rate coefficient. Unit: m/(s-Pa). - % - + function set.expansionRateCoeff(w, k) callct('wall_setExpansionRateCoeff', w.id, k); end - function setHeatFlux(w, f) - % Set the heat flux. - % - % w.setHeatFlux(f) - % - % Must be set by an instance of class 'Func', which allows the - % heat flux to be an arbitrary function of time. It is possible - % to specify a constant heat flux by using the polynomial - % functor with only the first term specified. - % - % :param f: - % Instance of class 'Func'. Unit: W/m^2. - % - + function set.heatFlux(w, f) callct('wall_setHeatFlux', w.id, f.id); end - function setVelocity(w, f) - % Set the velocity of the wall. - % - % w.setVelocity(f) - % - % Must be set by an instance of class 'Func', which allows the - % velocity to be an arbitrary function of time. It is possible - % to specify a constant velocity by using the polynomial - % functor with only the first term specified. - % - % :param f: - % Instance of class 'Func'. Unit: m/s. - % - + function set.velocity(w, f) callct('wall_setVelocity', w.id, f.id); end