[Doc/Matlab] Add documentation for all Matlab functions
This commit is contained in:
parent
0a0d5f2947
commit
c6ac27b07c
298 changed files with 3448 additions and 1132 deletions
|
|
@ -429,6 +429,8 @@ A stoichiometric liquid differs from a stoichiometric solid in only one respect:
|
|||
the transport manager computes the viscosity as well as the thermal
|
||||
conductivity.
|
||||
|
||||
.. _sec-interfaces:
|
||||
|
||||
Interfaces
|
||||
==========
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,28 @@
|
|||
function d = Domain1D(a, b, c)
|
||||
% DOMAIN1D - Create a new one-dimensional domain.
|
||||
% DOMAIN1D Domain1D class constructor.
|
||||
% d = Domain1D(a, b, c)
|
||||
% :param a:
|
||||
% Integer type of domain. Possible values are
|
||||
%
|
||||
% * 1 - Stagnation Flow
|
||||
% * 2 - Inlet1D
|
||||
% * 3 - Surf1D
|
||||
% * 4 - Symm1D
|
||||
% * 5 - Outlet1D
|
||||
% * 6 - Reacting Surface
|
||||
% * 8 - Sim1D
|
||||
% * -2 - OutletRes
|
||||
%
|
||||
% :param b:
|
||||
% Instance of class :mat:func:`Solution` (for ``a == 1``)
|
||||
% or :mat:func:`Interface` (for ``a == 6``). Not used for
|
||||
% all other valid values of ``a``.
|
||||
% :param c:
|
||||
% Integer, either 1 or 2, indicating whether an axisymmetric
|
||||
% stagnation flow or a free flame should be created. If not
|
||||
% specified, defaults to 1. Ignored if ``a != 1``.
|
||||
%
|
||||
|
||||
d.dom_id = -1;
|
||||
|
||||
% Valid job numbers for one argument
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
function n = componentIndex(d, name)
|
||||
% COMPONENTINDEX -
|
||||
% COMPONENTINDEX Get the index of a component given its name.
|
||||
% n = componentIndex(d, name)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param name:
|
||||
% String name of the component to look up. If a numeric value
|
||||
% is passed, it will be returned.
|
||||
% :return:
|
||||
% Index of the component, or input numeric value.
|
||||
%
|
||||
|
||||
if isa(name, 'double')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
function s = componentName(d, n)
|
||||
% COMPONENTNAME - Name of component n.
|
||||
% COMPONENTNAME Get the name of a component given its index.
|
||||
% s = componentName(d, n)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param n:
|
||||
% Integer or vector of integers of components' names
|
||||
% to get.
|
||||
% :return:
|
||||
% Cell array of component names.
|
||||
%
|
||||
|
||||
m = length(n);
|
||||
s = cell(m);
|
||||
for i = 1:m
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
function d = disableEnergy(d)
|
||||
% ENABLEENERGY - enable the energy equation
|
||||
% DISABLEENERGY Disable the energy equation.
|
||||
% d = disableEnergy(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
%
|
||||
|
||||
disp(' ');
|
||||
disp('Disabling the energy equation...');
|
||||
|
||||
domain_methods(d.dom_id, 66, 0);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
function i = domainIndex(d)
|
||||
% DOMAININDEX - domain index.
|
||||
%
|
||||
% DOMAININDEX Get the domain index.
|
||||
% i = domainIndex(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% This function returns an integer flag denoting the location
|
||||
% of the domain, beginning with 1 at the left.
|
||||
%
|
||||
|
||||
i = domain_methods(d.dom_id, 13) + 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
function i = domainType(d)
|
||||
% DOMAINTYPE - Type of domain.
|
||||
%
|
||||
% DOMAINTYPE Get the type of domain.
|
||||
% i = domainType(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% This function returns an integer flag denoting the domain
|
||||
% type.
|
||||
%
|
||||
|
||||
i = domain_methods(d.dom_id, 12);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
function n = domain_hndl(d)
|
||||
% DOMAIN_HNDL - Integer used to access kernel object.
|
||||
% DOMAIN_HNDL Get the integer used to access the kernel object.
|
||||
% n = domain_hndl(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% for which the handle is desired.
|
||||
% :return:
|
||||
% Integer used to access the kernel object
|
||||
%
|
||||
|
||||
n = d.dom_id;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
function d = enableEnergy(d)
|
||||
% ENABLEENERGY - enable the energy equation
|
||||
% ENABLEENERGY Enable the energy equation.
|
||||
% d = enableEnergy(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
%
|
||||
|
||||
disp(' ');
|
||||
disp('Enabling the energy equation...');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
function zz = gridPoints(d, n)
|
||||
% GRID -
|
||||
% GRIDPOINTS Get grid points from a domain.
|
||||
% zz = gridPoints(d, n)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param n:
|
||||
% Optional, vector of grid points to be retrieved.
|
||||
% :return:
|
||||
% Vector of grid points. Length of ``n`` or :mat:func:`nPoints`.
|
||||
%
|
||||
|
||||
if nargin == 1
|
||||
zz = zeros(1, nPoints(d));
|
||||
for i = 1:nPoints(d)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
function a = isFlow(d)
|
||||
% ISFLOW - Returns 1 if the domain is a flow domain, and 0 otherwise.
|
||||
% ISFLOW Determine whether a domain is a flow.
|
||||
% a = isFlow(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% 1 if the domain is a flow domain, and 0 otherwise.
|
||||
%
|
||||
|
||||
t = domainType(d);
|
||||
if t == 50
|
||||
a = 1;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
function a = isInlet(d)
|
||||
% ISINLET - Returns 1 if the domain is an inlet, and 0 otherwise.
|
||||
%
|
||||
% ISINLET Determine whether a domain is an inlet.
|
||||
% a = isInlet(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% 1 if the domain is an inlet, and 0 otherwise.
|
||||
%
|
||||
|
||||
t = domainType(d);
|
||||
if t == 104
|
||||
a = 1;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
function a = isSurface(d)
|
||||
% ISSURFACE - Returns 1 if the domain is a surface, and 0 otherwise.
|
||||
% ISSURFACE Determine if a domain is a surface.
|
||||
% a = isSurface(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% 1 if the domain is a surface, and 0 otherwise.
|
||||
%
|
||||
|
||||
t = domainType(d);
|
||||
if t == 102
|
||||
a = 1;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function mdot = massFlux(d)
|
||||
% MASSFLUX -
|
||||
% MASSFLUX Get the mass flux.
|
||||
% mdot = massFlux(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% The mass flux in the domain.
|
||||
%
|
||||
|
||||
mdot = domain_methods(d.dom_id, 17);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
function y = massFraction(d, k)
|
||||
% MASSFRACTION - Mass fraction of species k.
|
||||
% MASSFRACTION Get the mass fraction of a species given its integer index.
|
||||
% y = massFraction(d, k)
|
||||
% This method returns the mass fraction of species ``k``, where
|
||||
% k is the integer index of the species in the flow domain
|
||||
% to which the boundary domain is attached.
|
||||
%
|
||||
% This method returns the mass fraction of species k, where
|
||||
% k is the integer index of the species in the flow domain
|
||||
% to which the boundary domain is attached.
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param k:
|
||||
% Integer species index
|
||||
% :return:
|
||||
% Mass fraction of species
|
||||
%
|
||||
|
||||
if domainIndex(d) == 0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function n = nComponents(d)
|
||||
% NCOMPONENTS - number of components
|
||||
% NCOMPONENTS Get the number of components.
|
||||
% n = nComponents(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% Number of variables at each grid point
|
||||
%
|
||||
|
||||
n = domain_methods(d.dom_id, 11);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function npts = nPoints(d)
|
||||
% NPOINTS - Number of grid points.
|
||||
%
|
||||
% NPOINTS Get the number of grid points.
|
||||
% npts = nPoints(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% Integer number of grid points.
|
||||
%
|
||||
|
||||
npts = domain_methods(d.dom_id, 14);
|
||||
|
|
|
|||
|
|
@ -1,27 +1,43 @@
|
|||
function a = set(a,varargin)
|
||||
% SET - Set properties.
|
||||
% SET Set properties of a Domain1D.
|
||||
% a = set(a,varargin)
|
||||
% The properties that may be set are
|
||||
%
|
||||
% The properties that may be set are
|
||||
% * Temperature (T)
|
||||
% * Pressure (P)
|
||||
% * Mole Fractions (X)
|
||||
% * Mass Flux (mdot)
|
||||
% * tol
|
||||
% * tol-time
|
||||
% * grid
|
||||
% * bounds
|
||||
% * T_fixed
|
||||
% * ID
|
||||
%
|
||||
% Either the full property name or the symbol may be
|
||||
% specified. For the extensive properties (V,H,U,S), the values
|
||||
% must be given per unit mass. H, U, and S must be set in
|
||||
% conjunction with pressure (for H,S) or volume (for U,S). Either
|
||||
% (specific) volume or density may be specified. Mole and mass
|
||||
% fractions must be input as vectors (either row or column) with
|
||||
% length equal to the number of species.
|
||||
% Either the full property name or the symbol may be
|
||||
% specified. Mole and mass
|
||||
% fractions must be input as vectors (either row or column) with
|
||||
% length equal to the number of species.
|
||||
%
|
||||
% Examples:
|
||||
% Examples::
|
||||
%
|
||||
% set(gas,'Temperature',600.0);
|
||||
% set(gas,'T',600.0);
|
||||
% set(gas,'T',600.0,'P',2*oneatm,'Y',massfracs);
|
||||
% set(gas,'H',0.5*enthalpy_mass(gas),'P',pressure(gas));
|
||||
% set(gas,'S',entropy_mass(gas),'P',0.5*pressure(gas));
|
||||
% set(gas,'X',ones(nSpecies(gas),1));
|
||||
% >> set(gas,'Temperature',600.0);
|
||||
% >> set(gas,'T',600.0);
|
||||
% >> set(gas,'T',600.0,'P',2*oneatm,'Y',massfracs);
|
||||
% >> set(gas,'X',ones(nSpecies(gas),1));
|
||||
%
|
||||
% Alternatively, individual methods to set properties may be
|
||||
% called (setTemperature, setMoleFractions, etc.)
|
||||
% Alternatively, individual methods to set properties may be
|
||||
% called (setTemperature, setMoleFractions, etc.)
|
||||
%
|
||||
% See also: :mat:func:`setBounds`, :mat:func:`setFixedTempProfile` :mat:func:`setID`,
|
||||
% :mat:func:`setMdot`, :mat:func:`setMoleFractions`, :mat:func:`setPressure`,
|
||||
% :mat:func:`setProfile`, :mat:func:`setSteadyTolerances`, :mat:func:`setTemperature`,
|
||||
% :mat:func:`setTransientTolerances`, :mat:func:`setupGrid`
|
||||
%
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param varargin:
|
||||
% Comma separated list of ``property, value`` pairs to be set
|
||||
%
|
||||
|
||||
property_argin = varargin;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
function setBounds(d, component, lower, upper)
|
||||
% SETBOUNDS -
|
||||
% SETBOUNDS Set bounds on the solution components.
|
||||
% d = setBounds(d, component, lower, upper)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param component:
|
||||
% String, component to set the bounds on
|
||||
% :param lower:
|
||||
% Lower bound
|
||||
% :param upper:
|
||||
% Upper bound
|
||||
%
|
||||
n = componentIndex(d, component);
|
||||
domain_methods(d.dom_id, 51, n, lower, upper);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
function setCoverageEqs(d, onoff)
|
||||
% SETCOVERAGEEQS - Enable or disable solving the coverage equations.
|
||||
% SETCOVERAGEEQS Enable or disable solving the coverage equations.
|
||||
% d = setCoverageEqs(d,onoff)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param onoff:
|
||||
% String, one of ``'on'`` or ``'yes'`` to turn solving
|
||||
% the coverage equations on. One of ``'off'`` or ``'no'``
|
||||
% to turn off the coverage equations.
|
||||
%
|
||||
|
||||
if d.domain_type ~= 6
|
||||
error('Wrong domain type. Expected a reacting surface domain.')
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
function setFixedTempProfile(d, profile)
|
||||
% SETFIXEDTEMPPROFILE - set the temperature profile to use when the
|
||||
% SETFIXEDTEMPPROFILE Set a fixed temperature profile.
|
||||
% d = setFixedTempProfile(d, profile)
|
||||
% Set the temperature profile to use when the
|
||||
% energy equation is not being solved. The profile must be entered
|
||||
% as an array of positions / temperatures, which may be in rows or
|
||||
% columns.
|
||||
%
|
||||
% columns.
|
||||
%
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param profile:
|
||||
% n x 2 or 2 x n array of ``n`` points at which the temperature
|
||||
% is specified.
|
||||
%
|
||||
|
||||
sz = size(profile);
|
||||
if sz(1) == 2
|
||||
domain_methods(d.dom_id, 64, profile(1,:), profile(2,:));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function setID(d, id)
|
||||
% SETID - Set the ID tag for the domain.
|
||||
% SETID Set the ID tag for a domain.
|
||||
% d = setID(d, id)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param id:
|
||||
% String ID to assign
|
||||
%
|
||||
|
||||
domain_methods(d.dom_id, 54, id);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function setMdot(d, mdot)
|
||||
% SETMDOT -
|
||||
% SETMDOT Set the mass flow rate.
|
||||
% d = setMdot(d, mdot)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param mdot:
|
||||
% Mass flow rate
|
||||
%
|
||||
|
||||
domain_methods(d.dom_id, 60, mdot);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
function setMoleFractions(d, x)
|
||||
% SETMOLEFRACTIONS -
|
||||
% SETMOLEFRACTIONS Set the mole fractions.
|
||||
% d = setMoleFractions(d, x)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param x:
|
||||
% String specifying the species and mole fractions in
|
||||
% the format ``'SPEC:X,SPEC2:X2'``.
|
||||
%
|
||||
|
||||
domain_methods(d.dom_id, 62, x);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function setPressure(d, p)
|
||||
% SETPRESSURE -
|
||||
% SETPRESSURE Set the pressure.
|
||||
% d = setPressure(d, p)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param p:
|
||||
% Pressure to be set. Units: Pa
|
||||
%
|
||||
|
||||
domain_methods(d.dom_id, 63, p);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,20 @@
|
|||
function setProfile(d, n, p)
|
||||
% SETPROFILE -
|
||||
% SETPROFILE Set the profile of a component.
|
||||
% d = setProfile(d, n, p)
|
||||
% Convenience function to allow an instance of :mat:func:`Domain1D` to
|
||||
% have a profile of its components set when it is part of a :mat:func:`Stack`.
|
||||
%
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param n:
|
||||
% Integer index of component, vector of component indices, string
|
||||
% of component name, or cell array of strings of component names.
|
||||
% :param p:
|
||||
% n x 2 array, whose columns are the relative (normalized) positions
|
||||
% and the component values at those points. The number of positions
|
||||
% ``n`` is arbitrary.
|
||||
%
|
||||
|
||||
if d.stack == 0
|
||||
error('Install domain in stack before calling setProfile.');
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,16 @@
|
|||
function setSteadyTolerances(d, component, rtol, atol)
|
||||
% SETSTEADYTOLERANCES -
|
||||
% SETSTEADYTOLERANCES Set the steady-state tolerances.
|
||||
% d = setSteadyTolerances(d, component, rtol, atol)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param component:
|
||||
% String or cell array of strings of component values
|
||||
% whose tolerances should be set. If ``'default'`` is
|
||||
% specified, the tolerance of all components will be set.
|
||||
% :param rtol:
|
||||
% Relative tolerance
|
||||
% :param atol:
|
||||
% Absolute tolerance
|
||||
%
|
||||
|
||||
if strcmp(component, 'default')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function setTemperature(d, t)
|
||||
% SETTEMPERATURE - Set the temperature [K].
|
||||
% SETTEMPERATURE Set the temperature.
|
||||
% d = setTemperature(d, t)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param t:
|
||||
% Temperature to be set. Units: K
|
||||
%
|
||||
|
||||
domain_methods(d.dom_id, 61, t);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,16 @@
|
|||
function setTransientTolerances(d, component, rtol, atol)
|
||||
% SETSTEADYTOLERANCES -
|
||||
% SETTRANSIENTTOLERANCES Set the transient tolerances.
|
||||
% d = setTransientTolerances(d, component, rtol, atol)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param component:
|
||||
% String or cell array of strings of component values
|
||||
% whose tolerances should be set. If ``'default'`` is
|
||||
% specified, the tolerance of all components will be set.
|
||||
% :param rtol:
|
||||
% Relative tolerance
|
||||
% :param atol:
|
||||
% Absolute tolerance
|
||||
%
|
||||
|
||||
if strcmp(component, 'default')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
function setupGrid(d, grid)
|
||||
% SETUPGRID -
|
||||
% SETUPGRID Set up the solution grid.
|
||||
% d = setupGrid(d, grid)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param grid:
|
||||
%
|
||||
|
||||
domain_methods(d.dom_id, 53, grid);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function t = temperature(d)
|
||||
% TEMPERATURE - Temperature [K].
|
||||
% TEMPERATURE Get the boundary temperature.
|
||||
% t = temperature(d)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :return:
|
||||
% Temperature. Units: K
|
||||
%
|
||||
|
||||
t = domain_methods(d.dom_id, 15);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
function zz = z(d, n)
|
||||
% GRID -
|
||||
% Z Get the grid points.
|
||||
% zz = z(d, n)
|
||||
% :param d:
|
||||
% Instance of class :mat:func:`Domain1D`
|
||||
% :param n:
|
||||
% Optional. Indices of grid points to get.
|
||||
% Defaults to getting all of the grid points.
|
||||
% :return:
|
||||
% Vector of grid points.
|
||||
%
|
||||
|
||||
if nargin == 1
|
||||
zz = zeros(1, nPoints(d));
|
||||
for i = 1:nPoints(d)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,18 @@
|
|||
function s = Stack(domains)
|
||||
% STACK Stack class constructor.
|
||||
% s = Stack(domains)
|
||||
% A stack object is a container for one-dimensional domains,
|
||||
% which are instances of class Domain1D. The domains are of two
|
||||
% types - extended domains, and connector domains.
|
||||
%
|
||||
% STACK - A one-dimensional 'stack' of domains.
|
||||
% See also: :mat:func:`Domain1D`
|
||||
%
|
||||
% A stack object is a container for one-dimensional domains,
|
||||
% which are instances of class Domain1D. The domains are of two
|
||||
% types - extended domains, and connector domains.
|
||||
% :param domains:
|
||||
% Vector of domain instances
|
||||
% :return:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
%
|
||||
|
||||
s.stack_id = -1;
|
||||
s.domains = domains;
|
||||
if nargin == 1
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
function display(s, fname)
|
||||
% DISPLAY - show all domains.
|
||||
%
|
||||
% fname - file to write summary to. If omitted, output is to the screen.
|
||||
% DISPLAY Show all domains.
|
||||
% display(s, fname)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param fname:
|
||||
% File to write summary to. If omitted, output is to the screen.
|
||||
%
|
||||
|
||||
if nargin == 1
|
||||
fname = '-';
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
function n = domainIndex(s, name)
|
||||
% DOMAININDEX - Index of the domain with a specified name.
|
||||
% DOMAININDEX Get the index of a domain in a stack given its name.
|
||||
% n = domainIndex(s, name)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param name:
|
||||
% If double, the value is returned. Otherwise,
|
||||
% the name is looked up and its index is returned.
|
||||
% :return:
|
||||
% Index of domain
|
||||
%
|
||||
|
||||
if isa(name, 'double')
|
||||
n = name;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
function z = grid(s, name)
|
||||
% GRID - the grid in one domain.
|
||||
% GRID Get the grid in one domain.
|
||||
% z = grid(s, name)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param name:
|
||||
% Name of the domain for which the grid
|
||||
% should be retrieved.
|
||||
% :return:
|
||||
% The grid in domain name
|
||||
%
|
||||
|
||||
n = domainIndex(s, name);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
function plotSolution(s, domain, component)
|
||||
% PLOTSOLUTION - plot a specified solution component
|
||||
%
|
||||
% plotSolution(s, 'flow', 'T') plots component 'T' in domain 'flow'
|
||||
% PLOTSOLUTION Plot a specified solution component.
|
||||
% plotSolution(s, domain, component)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param domain:
|
||||
% Name of domain from which the component should be
|
||||
% retrieved
|
||||
% :param component:
|
||||
% Name of the component to be plotted
|
||||
%
|
||||
|
||||
n = domainIndex(s, domain);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,15 @@
|
|||
function r = resid(s, domain, rdt, count)
|
||||
% RESID Get the residuals.
|
||||
% r = resid(s, domain, rdt, count)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param domain:
|
||||
% Name of the domain
|
||||
% :param rdt:
|
||||
% :param count:
|
||||
% :returns:
|
||||
%
|
||||
|
||||
if nargin == 2
|
||||
rdt = 0.0;
|
||||
count = 0;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
function restore(s, fname, id)
|
||||
% RESTORE - Restore a previously-saved solution.
|
||||
% RESTORE Restore a previously-saved solution.
|
||||
% restore(s, fname, id)
|
||||
% This method can be used to provide an initial guess for the solution.
|
||||
%
|
||||
% This method can be used to provide an initial guess for the
|
||||
% solution.
|
||||
% See also: :mat:func:`save`
|
||||
%
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param fname:
|
||||
% File name of an XML file containing solution information
|
||||
% :param id:
|
||||
% ID of the element that should be restored
|
||||
%
|
||||
|
||||
stack_methods(s.stack_id, 111, fname, id);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,20 @@
|
|||
function save(s, fname, id, desc)
|
||||
% SAVE -
|
||||
% SAVE Save a solution to a file.
|
||||
% save(s, fname, id, desc)
|
||||
% The output file is in a format that
|
||||
% can be used by :mat:func:`restore`
|
||||
%
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param fname:
|
||||
% File name where XML file should be written
|
||||
% :param id:
|
||||
% ID to be assigned to the XML element when it is
|
||||
% written
|
||||
% :param desc:
|
||||
% Description to be written to the output file
|
||||
%
|
||||
|
||||
if nargin == 2
|
||||
id = 'solution';
|
||||
desc = '-';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,20 @@
|
|||
function saveSoln(s, fname, id, desc)
|
||||
% SAVE - Save solution.
|
||||
% SAVESOLN Save a solution to a file.
|
||||
% saveSoln(s, fname, id, desc)
|
||||
% The output file is in a format that
|
||||
% can be used by :mat:func:`restore`
|
||||
%
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param fname:
|
||||
% File name where XML file should be written
|
||||
% :param id:
|
||||
% ID to be assigned to the XML element when it is
|
||||
% written
|
||||
% :param desc:
|
||||
% Description to be written to the output file
|
||||
%
|
||||
|
||||
if nargin == 1
|
||||
fname = 'soln.xml';
|
||||
id = 'solution';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
function setFlatProfile(s, domain, comp, v)
|
||||
% SETFLATPROFILE -
|
||||
% SETFLATPROFILE Set a component to a value across the entire domain.
|
||||
% setFlatProfile(s, domain, comp, v)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param domain:
|
||||
% Integer ID of the domain
|
||||
% :param comp:
|
||||
% Component to be set
|
||||
% :param v:
|
||||
% Double, value to be set
|
||||
%
|
||||
|
||||
stack_methods(s.stack_id, 102, domain, comp, v);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,15 @@
|
|||
function setMaxJacAge(s, ss_age, ts_age)
|
||||
% SETMAXJACAGE - Set the number of times the Jacobian will be used
|
||||
% before it is recomputed.
|
||||
% SETMAXJACAGE Set the number of times the Jacobian will be used before it is recomputed.
|
||||
% setMaxJacAge(s, ss_age, ts_age)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param ss_age:
|
||||
% Maximum age of the Jacobian for steady state analysis
|
||||
% :param ts_age:
|
||||
% Maximum age of the Jacobian for transient analysis. If
|
||||
% not specified, defaults to ``ss_age``.
|
||||
%
|
||||
|
||||
if nargin == 2
|
||||
ts_age = ss_age;
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,23 +1,29 @@
|
|||
function setProfile(s, name, comp, p)
|
||||
% SETPROFILE - Specify a profile for one component.
|
||||
% SETPROFILE Specify a profile for one component.
|
||||
% setProfile(s, name, comp, p)
|
||||
% The solution vector values for this component will be linearly
|
||||
% interpolated from the discrete function defined by p(:,1) vs. p(:,2).
|
||||
% Note that ``p(1,1) = 0.0`` corresponds to the leftmost grid point in
|
||||
% the specified domain, and ``p(1,n) = 1.0`` corresponds to the rightmost
|
||||
% grid point. This method can be called at any time, but is
|
||||
% usually used to set the initial guess for the solution.
|
||||
%
|
||||
% name -- domain name
|
||||
% comp -- component number
|
||||
% zr -- array of relative positions (0.0 to 1.0)
|
||||
% v -- array of values
|
||||
% Example (assuming ``s`` is an instance of :mat:func:`Stack`)::
|
||||
%
|
||||
% The solution vector values for this component will be linearly
|
||||
% interpolated from the discrete function defined by v vs. zr.
|
||||
% Note that zr = 0.0 corresponds to the leftmost grid point in
|
||||
% the specified domain, and zr = 1.0 corresponds to the rightmost
|
||||
% grid point. This method can be called at any time, but is
|
||||
% usually used to set the initial guess for the solution.
|
||||
% >> zr = [0 0.1 0.2 0.4 0.8 1];
|
||||
% >> v = [500 650 700 730 800 900];
|
||||
% >> setProfile(s, 1, 2, [zr, v]);
|
||||
%
|
||||
% Example:
|
||||
%
|
||||
% zr = [0 0.1 0.2 0.4 0.8 1];
|
||||
% v = [500 650 700 730 800 900];
|
||||
% setProfile(1, 2, zr, v);
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param name:
|
||||
% Domain name
|
||||
% :param comp:
|
||||
% component number
|
||||
% :param p:
|
||||
% n x 2 array, whose columns are the relative (normalized) positions
|
||||
% and the component values at those points. The number of positions
|
||||
% ``n`` is arbitrary.
|
||||
%
|
||||
|
||||
if isa(name, 'double')
|
||||
|
|
|
|||
|
|
@ -1,17 +1,24 @@
|
|||
function setRefineCriteria(s, n, ratio, slope, curve, prune)
|
||||
% SETREFINECRITERIA - Set the criteria used to refine the grid.
|
||||
%
|
||||
% n -- domain number beginning with domain 1 at the left
|
||||
% ratio -- maximum size ratio between adjacent cells
|
||||
% slope -- maximum relative difference in value between
|
||||
% adjacent points
|
||||
% curve -- maximum relative difference in slope between
|
||||
% adjacent cells
|
||||
% prune -- minimum value for slope or curve for which points
|
||||
% will be retained in the grid. If the computed
|
||||
% slope or curve value is below prune for all
|
||||
% components, it will be deleted, unless either
|
||||
% neighboring point is already marked for deletion.
|
||||
% SETREFINECRITERIA Set the criteria used to refine the grid.
|
||||
% s = setRefineCriteria(s, n, ratio, slope, curve, prune)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param n:
|
||||
% Domain number
|
||||
% :param ratio:
|
||||
% Maximum size ratio between adjacent cells
|
||||
% :param slope:
|
||||
% Maximum relative difference in value between
|
||||
% adjacent points
|
||||
% :param curve:
|
||||
% Maximum relative difference in slope between
|
||||
% adjacent cells
|
||||
% :param prune:
|
||||
% Minimum value for slope or curve for which points
|
||||
% will be retained in the grid. If the computed
|
||||
% slope or curve value is below prune for all
|
||||
% components, it will be deleted, unless either
|
||||
% neighboring point is already marked for deletion.
|
||||
%
|
||||
|
||||
if nargin < 3
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
function setTimeStep(s, stepsize, steps)
|
||||
% SETTIMESTEP - Specify a sequence of time steps.
|
||||
% SETTIMESTEP Specify a sequence of time steps.
|
||||
% setTimeStep(s, stepsize, steps)
|
||||
% :param stepsize:
|
||||
% Initial step size (s)
|
||||
% :param steps:
|
||||
% Vector of number of steps to take before
|
||||
% re-attempting solution of steady-state problem. For
|
||||
% example, steps = [1, 2, 5, 10] would cause one time
|
||||
% step to be taken first the the steady-state
|
||||
% solution attempted. If this failed, two time steps
|
||||
% would be taken, etc.
|
||||
%
|
||||
% stepsize - initial step size (s)
|
||||
% steps - array of number of steps to take before
|
||||
% re-attempting solution of steady-state problem. For
|
||||
% example, steps = [1, 2, 5, 10] would cause one time
|
||||
% step to be taken first the the steady-state
|
||||
% solution attempted. If this failed, two time steps
|
||||
% would be taken, etc.
|
||||
|
||||
stack_methods(s.stack_id, 112, stepsize, length(steps), steps)
|
||||
|
|
|
|||
|
|
@ -1,19 +1,26 @@
|
|||
function setValue(s, n, comp, localPoint, v)
|
||||
% SETVALUE - Set the value of a single entry in the solution vector.
|
||||
% SETVALUE Set the value of a single entry in the solution vector.
|
||||
% setValue(s, n, comp, localPoint, v)
|
||||
% Example (assuming ``s`` is an instance of :mat:func:`Stack`)::
|
||||
%
|
||||
% n -- domain number
|
||||
% comp -- component number
|
||||
% localPoint -- local index of the grid point in the domain
|
||||
% v -- value
|
||||
% setValue(s, 3, 5, 1, 5.6)
|
||||
%
|
||||
% Example:
|
||||
% This sets component 5 at the leftmost point (local point 1) in domain 3
|
||||
% to the value 5.6. Note that the local index always begins at 1
|
||||
% at the left of each domain, independent of the global index of
|
||||
% the point, which depends on the location of this domain in the
|
||||
% stack.
|
||||
%
|
||||
% setValue(s, 3, 5, 1, 5.6)
|
||||
%
|
||||
% This sets component 5 at the leftmost point (local point 1) in domain 3
|
||||
% to the value 5.6. Note that the local index always begins at 1
|
||||
% at the left of each domain, independent of the global index of
|
||||
% the point, which depends on the location of this domain in the
|
||||
% stack.
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param n:
|
||||
% Domain number
|
||||
% :param comp:
|
||||
% Component number
|
||||
% :param localPoint:
|
||||
% Local index of the grid point in the domain
|
||||
% :param v:
|
||||
% Value
|
||||
%
|
||||
|
||||
stack_methods(s.stack_id, 100, n, comp, localPoint, v);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,19 @@
|
|||
function x = solution(s, domain, component)
|
||||
% SOLUTION - get a solution component in one domain.
|
||||
%
|
||||
% x = solution(s, 'flow', 'T') returns in vector x the values of
|
||||
% solution component 'T' in domain 'flow'.
|
||||
% SOLUTION Get a solution component in one domain.
|
||||
% x = solution(s, domain, component)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param domain:
|
||||
% String, name of the domain from which the solution is desired
|
||||
% :param component:
|
||||
% String, component for which the solution is desired. If omitted,
|
||||
% solutions for all of the components will be returned in an
|
||||
% :mat:func:`nPoints` x :mat:func:`nComponents` array.
|
||||
% :return:
|
||||
% Either an :mat:func:`nPoints` x 1 vector, or
|
||||
% :mat:func:`nPoints` x :mat:func:`nComponents` array.
|
||||
%
|
||||
|
||||
idom = domainIndex(s, domain);
|
||||
d = s.domains(idom);
|
||||
np = nPoints(d);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,14 @@
|
|||
function solve(s, loglevel, refine_grid)
|
||||
% SOLVE -
|
||||
% SOLVE Solve the problem.
|
||||
% solve(s, loglevel, refine_grid)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param loglevel:
|
||||
% Integer flag controlling the amount of diagnostic
|
||||
% output. Zero supresses all output, and 5 produces
|
||||
% very verbose output.
|
||||
% :param refine_grid:
|
||||
% Integer, 1 to allow grid refinement, 0 to disallow.
|
||||
%
|
||||
|
||||
stack_methods(s.stack_id, 104, loglevel, refine_grid);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
function b = subsref(s, index)
|
||||
% SUBSREF -
|
||||
% SUBSREF Redefine subscripted references.
|
||||
% b = subsref(s,index)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
% :param index:
|
||||
% :return:
|
||||
%
|
||||
|
||||
switch index.type
|
||||
case '()'
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
function writeStats(s)
|
||||
% WRITESTATS - Print statistics for the current solution.
|
||||
% WRITESTATS Print statistics for the current solution.
|
||||
% writeStats(s)
|
||||
% Prints a summary of the number of function and
|
||||
% Jacobian evaluations for each grid, and the CPU time spent on
|
||||
% each one.
|
||||
%
|
||||
% writeStats(s) prints a summary of the number of function and
|
||||
% Jacobian evaluations for each grid, and the CPU time spent on
|
||||
% each one.
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Stack`
|
||||
%
|
||||
|
||||
stack_methods(s.stack_id, 108);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
function m = AxiStagnFlow(gas)
|
||||
% AXISTAGNFLOW - Axisymmetric stagnation flow.
|
||||
%
|
||||
% Return a Domain1D instance representing an axisymmetric
|
||||
% stagnation flow.
|
||||
% AXISTAGNFLOW Get an axisymmetric stagnation flow domain.
|
||||
% m = AxiStagnFlow(gas)
|
||||
% :param gas:
|
||||
% Instance of class :mat:func:`Solution`
|
||||
% :return:
|
||||
% Domain1D instance representing an axisymmetric
|
||||
% stagnation flow.
|
||||
|
||||
m = Domain1D(1, gas);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,14 @@
|
|||
function m = AxisymmetricFlow(gas, id)
|
||||
% AXISYMMETRICFLOW - Axisymmetric flow.
|
||||
%
|
||||
% Return a Domain1D instance representing an axisymmetric flow.
|
||||
% AXISYMMETRICFLOW Create an axisymmetric flow domain.
|
||||
% m = AxisymmetricFlow(gas, id)
|
||||
% :param gas:
|
||||
% Instance of class :mat:func:`Solution`
|
||||
% :param id:
|
||||
% String, ID of the flow
|
||||
% :return:
|
||||
% Domain1D instance representing an axisymmetric flow.
|
||||
%
|
||||
|
||||
m = Domain1D(1, gas);
|
||||
if nargin == 1
|
||||
setID(m, 'flow');
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
function m = FreeFlame(gas, id)
|
||||
% FREEFLAME - Freely-propagating flat flame
|
||||
%
|
||||
% Return a Domain1D instance representing a freely-propagating
|
||||
% adiabatic flame
|
||||
% FREEFLAME Create a freely-propagating flat flame.
|
||||
% m = FreeFlame(gas, id)
|
||||
% :param gas:
|
||||
% Instance of class :mat:func:`Solution`
|
||||
% :param id:
|
||||
% String, ID of the flow
|
||||
% :return:
|
||||
% Domain1D instance representing a freely propagating,
|
||||
% adiabatic flame
|
||||
%
|
||||
|
||||
m = Domain1D(1, gas, 2);
|
||||
if nargin == 1
|
||||
setID(m, 'flame');
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
function m = Inlet(id)
|
||||
% INLET - Return a Domain1D instance representing an inlet.
|
||||
% INLET 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.
|
||||
%
|
||||
% 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.
|
||||
%
|
||||
|
||||
m = Domain1D(2);
|
||||
if nargin == 0
|
||||
setID(m, 'inlet');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
function m = Outlet(id)
|
||||
% OUTLET - Return a Domain1D instance representing an outlet.
|
||||
% OUTLET Create an outlet domain.
|
||||
% m = Outlet(id)
|
||||
% :param id:
|
||||
% String ID of the outlet.
|
||||
% :return:
|
||||
% Instance of :mat:func:`Domain1D` representing an outlet.
|
||||
%
|
||||
|
||||
m = Domain1D(5);
|
||||
if nargin == 0
|
||||
setID(m, 'outlet');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
function m = OutletRes(id)
|
||||
% OUTLET - Return a Domain1D instance representing an outlet reservoir.
|
||||
% OUTLETRES Create an outlet reservoir domain.
|
||||
% m = OutletRes(id)
|
||||
% :return:
|
||||
% Instance of :mat:func:`Domain1D` representing an outlet
|
||||
% reservoir.
|
||||
%
|
||||
|
||||
m = Domain1D(-2);
|
||||
if nargin == 0
|
||||
setID(m, 'outletres');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
function m = Surface(id, surface_mech)
|
||||
% SURFACE - Return a Domain1D instance representing a non-reacting
|
||||
% or reacting surface.
|
||||
% SURFACE 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
|
||||
% the surface reaction mechanism to be used. Optional.
|
||||
% :return:
|
||||
% Instance of class :mat:func:`Domain1D` representing a
|
||||
% non-reacting or reacting surface.
|
||||
%
|
||||
|
||||
if nargin < 2
|
||||
m = Domain1D(3);
|
||||
if nargin == 0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
function m = SymmPlane(id)
|
||||
% SYMMPLANE - Return a Domain1D instance representing a symmetry plane.
|
||||
% SYMMPLANE 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.
|
||||
%
|
||||
|
||||
m = Domain1D(4);
|
||||
if nargin == 0
|
||||
setID(m, 'symmetry_plane');
|
||||
|
|
|
|||
|
|
@ -1,20 +1,32 @@
|
|||
function flame = npflame_init(gas, left, flow, right, fuel, oxidizer, nuox)
|
||||
% FLAME - create a non-premixed flame object.
|
||||
%
|
||||
% gas -- object representing the gas. This object will be used to
|
||||
% compute all required thermodynamic, kinetic, and transport
|
||||
% properties. The state of this object should be set
|
||||
% to an estimate of the gas state emerging from the
|
||||
% burner before calling StagnationFlame.
|
||||
%
|
||||
% left -- object representing the left inlet, which must be
|
||||
% created using function Inlet.
|
||||
%
|
||||
% flow -- object representing the flow, created with
|
||||
% function AxisymmetricFlow.
|
||||
%
|
||||
% right -- object representing the right inlet, which must be
|
||||
% created using function Inlet.
|
||||
% NPFLAME_INIT Create a non-premixed flame stack.
|
||||
% flame = npflame_init(gas, left, flow, right, fuel, oxidizer, nuox)
|
||||
% :param gas:
|
||||
% Object representing the gas, instance of class
|
||||
% :mat:func:`Solution`, and an ideal gas. This object will be used
|
||||
% to compute all required thermodynamic, kinetic, and transport
|
||||
% properties. The state of this object should be set
|
||||
% to an estimate of the gas state emerging from the
|
||||
% burner before calling StagnationFlame.
|
||||
% :param left:
|
||||
% Object representing the left inlet, which must be
|
||||
% created using function :mat:func:`Inlet`.
|
||||
% :param flow:
|
||||
% Object representing the flow, created with
|
||||
% function :mat:func:`AxisymmetricFlow`.
|
||||
% :param right:
|
||||
% Object representing the right inlet, which must be
|
||||
% created using function :mat:func:`Inlet`.
|
||||
% :param fuel:
|
||||
% String representing the fuel species
|
||||
% :param ox:
|
||||
% String representing the oxidizer species
|
||||
% :param nuox:
|
||||
% Number of oxidizer molecules required to completely combust
|
||||
% one fuel molecule.
|
||||
% :return:
|
||||
% Instance of :mat:func:`Stack` object representing the left
|
||||
% inlet, flow, and right inlet.
|
||||
%
|
||||
|
||||
% Check input parameters
|
||||
|
|
|
|||
|
|
@ -1,5 +1,25 @@
|
|||
function x = FlowDevice(typ)
|
||||
% FLOWDEVICE FlowDevice class constructor.
|
||||
% x = FlowDevice(typ)
|
||||
% Base class for devices that allow flow between reactors.
|
||||
% :mat:func:`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
|
||||
% pressure difference equals the difference in pressure between the
|
||||
% upstream and downstream reactors.
|
||||
%
|
||||
% See also: :mat:func:`MassFlowController`, :mat:func:`Valve`
|
||||
%
|
||||
% :param typ:
|
||||
% Type of :mat:func:`FlowDevice` to be created. ``typ=1`` for
|
||||
% :mat:func:`MassFlowController` and ``typ=3`` for
|
||||
% :mat:func:`Valve`
|
||||
% :return:
|
||||
% Instance of class :mat:func:`FlowDevice`
|
||||
%
|
||||
|
||||
if nargin == 0
|
||||
typ = 1;
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
function clear(f)
|
||||
% CLEAR -
|
||||
% CLEAR Clear the specified flow device from memory.
|
||||
% clear(f)
|
||||
% :param f:
|
||||
% Instance of :mat:func:`FlowDevice` to be cleared.
|
||||
%
|
||||
|
||||
flowdevicemethods(1, f.index);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,15 @@
|
|||
function install(f, upstream, downstream)
|
||||
% INSTALL Install a flow device between reactors or reservoirs.
|
||||
% install(f, upstream, downstream)
|
||||
% :param f:
|
||||
% Instance of class :mat:func:`FlowDevice` to install
|
||||
% :param upstream:
|
||||
% Upstream :mat:func:`Reactor` or :mat:func:`Reservoir`
|
||||
% :param downstream:
|
||||
% Downstream :mat:func:`Reactor` or :mat:func:`Reservoir`
|
||||
% :return:
|
||||
% Instance of class :mat:func:`FlowDevice`
|
||||
%
|
||||
|
||||
if nargin == 3
|
||||
if ~isa(upstream, 'Reactor') || ~isa(downstream, 'Reactor')
|
||||
|
|
|
|||
|
|
@ -1,4 +1,12 @@
|
|||
function mdot = massFlowRate(f, time)
|
||||
% MASSFLOWRATE - mass flow rate in kg/s
|
||||
% MASSFLOWRATE Get the mass flow rate at a given time.
|
||||
% mdot = massFlowRate(f, time)
|
||||
% :param f:
|
||||
% Instance of class :mat:func:`MassFlowController`
|
||||
% :param time:
|
||||
% Time at which the mass flow rate is desired
|
||||
% :return:
|
||||
% The mass flow rate through the :mat:func:`FlowDevice` at the given time
|
||||
%
|
||||
|
||||
mdot = flowdevicemethods(21, f.index, time);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
function setFunction(f, mf)
|
||||
% SETMASSFLOWRATE -
|
||||
% SETFUNCTION Set the mass flow rate with class :mat:func:`Func`.
|
||||
% setFunction(f, 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 f.type == 1
|
||||
k = flowdevicemethods(5, f.index, func_hndl(mf));
|
||||
if k < 0
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
function setMassFlowRate(f, mdot)
|
||||
% SETMASSFLOWRATE -
|
||||
% SETMASSFLOWRATE Set the mass flow rate to a constant value.
|
||||
% setMassFlowRate(f, mdot)
|
||||
%
|
||||
% See also: :mat:func:`MassFlowController`
|
||||
%
|
||||
% :param f:
|
||||
% Instance of class :mat:func:`MassFlowController`
|
||||
% :param mdot:
|
||||
% Mass flow rate
|
||||
%
|
||||
if f.type == 1
|
||||
k = flowdevicemethods(3, f.index, mdot);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,21 @@
|
|||
function setValveCoeff(f, k)
|
||||
% SETVALVECOEFF - set valve coefficient
|
||||
% SETVALVECOEFF Set the valve coefficient :math:`K`.
|
||||
% setValveCoeff(f, 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
|
||||
%
|
||||
|
||||
if f.type ~= 3
|
||||
error('Valve coefficient can only be set for valves')
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,31 +1,56 @@
|
|||
function x = Func(typ, n, p)
|
||||
%
|
||||
% Func - a class for functors.
|
||||
%
|
||||
% FUNC Func class constructor.
|
||||
% x = Func(typ, n, p)
|
||||
% A class for functors.
|
||||
% A functor is an object that behaves like a function. Cantera
|
||||
% defines a set of functors to use to create arbitrary functions to
|
||||
% specify things like heat fluxes, piston speeds, etc., in reactor
|
||||
% network simulations. Of course, they can be used for other things
|
||||
% too.
|
||||
%
|
||||
% The main feature of a functor class is that it overloads the '()'
|
||||
% The main feature of a functor class is that it overloads the ``()``
|
||||
% operator to evaluate the function. For example, suppose object
|
||||
% 'f' is a functor that evaluates the polynomial '2x^2 - 3x +
|
||||
% 1'. Then writing 'f(2)' would cause the method that evaluates the
|
||||
% function to be invoked, and would pass it the argument '2'. The
|
||||
% ``f`` is a functor that evaluates the polynomial :math:`2x^2 - 3x + 1`.
|
||||
% Then writing ``f(2)`` would cause the method that evaluates the
|
||||
% function to be invoked, and would pass it the argument ``2``. The
|
||||
% return value would of course be 3.
|
||||
%
|
||||
% The types of functors you can create in Cantera are these:
|
||||
%
|
||||
% 1. A polynomial
|
||||
% 2. A Fourier series
|
||||
% 3. A sum of Arrhenius terms
|
||||
% 4. A Gaussian.
|
||||
%
|
||||
% You can also create composite functors by adding, multiplying, or
|
||||
% dividing these basic functors, or other composite functors.
|
||||
%
|
||||
% 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`
|
||||
%
|
||||
% :param typ:
|
||||
% String indicating type of functor to create. Possible values are:
|
||||
%
|
||||
% * ``'polynomial'``
|
||||
% * ``'fourier'``
|
||||
% * ``'gaussian'``
|
||||
% * ``'arrhenius'``
|
||||
% * ``'sum'``
|
||||
% * ``'diff'``
|
||||
% * ``'ratio'``
|
||||
% * ``'composite'``
|
||||
% * ``'periodic'``
|
||||
%
|
||||
% :param n:
|
||||
% Number of parameters required for the functor
|
||||
% :param p:
|
||||
% Vector of parameters
|
||||
% :return:
|
||||
% Instance of class :mat:func:`Func`
|
||||
|
||||
if ~isa(typ, 'char')
|
||||
error('Function type must be a string')
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
function s = char(p)
|
||||
% CHAR -
|
||||
% CHAR Get the formatted string to display the function.
|
||||
% s = char(p)
|
||||
% :param p:
|
||||
% Instance of class :mat:func:`Func`
|
||||
% :return:
|
||||
% Formatted string displaying the function
|
||||
%
|
||||
|
||||
if strcmp(p.typ,'sum')
|
||||
s = ['(' char(p.f1) ') + (' char(p.f2) ')'];
|
||||
elseif strcmp(p.typ,'diff')
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
function display(a)
|
||||
% DISPLAY -
|
||||
% DISPLAY Display the equation of the input function on the terminal.
|
||||
% display(a)
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Func`
|
||||
%
|
||||
|
||||
disp(' ');
|
||||
disp([inputname(1),' = '])
|
||||
disp(' ');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
function i = func_hndl(f)
|
||||
% FUNC_HNDL -
|
||||
% FUNC_HNDL Get the integer used to access the kernel object.
|
||||
% i = func_hndl(f)
|
||||
% :param f:
|
||||
% Instance of class :mat:func:`Func`
|
||||
% :return:
|
||||
% The handle of the input function
|
||||
%
|
||||
|
||||
i = f.index;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,12 @@
|
|||
function r = plus(a, b)
|
||||
% PLUS Get a functor representing the sum of two input functors.
|
||||
% r = plus(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`
|
||||
%
|
||||
% PLUS - Return a functor representing the sum of two functors a
|
||||
% and b.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
function r = rdivide(a, b)
|
||||
% RDIVIDE -
|
||||
% RDIVIDE Get a functor that is the ratio of the input functors.
|
||||
% r = rdivide(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('ratio', a, b);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
function b = subsref(a, s)
|
||||
% SUBSREF
|
||||
% SUBSREF Redefine subscripted references for functors.
|
||||
% b = subsref(a, s)
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Func`
|
||||
% :param s:
|
||||
% Value at which the function should be evaluated.
|
||||
% :return:
|
||||
% Returns the value of the function evaluated at ``s``
|
||||
%
|
||||
|
||||
switch s.type
|
||||
case '()'
|
||||
ind = s.subs{:};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
function r = times(a, b)
|
||||
% TIMES -
|
||||
% TIMES Create a functor that multiplies two other functors.
|
||||
% r = times(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);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,26 @@
|
|||
function s = Interface(src, id, p1, p2, p3, p4)
|
||||
% Interface - class Interface constructor.
|
||||
% INTERFACE Interface class constructor.
|
||||
% s = Interface(src, id, p1, p2, p3, p4)
|
||||
% See :ref:`sec-interfaces`.
|
||||
%
|
||||
% See also: :mat:func:`importEdge`, :mat:func:`importInterface`
|
||||
%
|
||||
% :param src:
|
||||
% CTI or CTML file containing the interface or edge phase.
|
||||
% :param id:
|
||||
% Name of the interface or edge phase in the CTI or CTML file.
|
||||
% :param p1:
|
||||
% Adjoining phase to the interface.
|
||||
% :param p2:
|
||||
% Adjoining phase to the interface.
|
||||
% :param p3:
|
||||
% Adjoining phase to the interface.
|
||||
% :param p4:
|
||||
% Adjoining phase to the interface.
|
||||
% :return:
|
||||
% Instance of class :mat:func:`Interface`
|
||||
%
|
||||
|
||||
doc = XML_Node('doc', src);
|
||||
node = findByID(doc, id);
|
||||
t = ThermoPhase(node);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
function c = concentrations(s)
|
||||
% CONCENTRATIONS - Surface concentrations
|
||||
% CONCENTRATIONS Get the concentrations of the species on an interface.
|
||||
% c = concentrations(s)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Interface` with surface species
|
||||
% :return:
|
||||
% If no output value is assigned, a bar graph will be plotted.
|
||||
% Otherwise, a vector of length ``n_surf_species`` will be
|
||||
% returned.
|
||||
%
|
||||
|
||||
c = surfmethods(thermo_hndl(s), 103);
|
||||
if nargout == 0
|
||||
figure
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
function c = coverages(s)
|
||||
% COVERAGES - Surface coverages
|
||||
% COVERAGES Get the surface coverages of the species on an interface.
|
||||
% c = coverages(s)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Interface` with surface species
|
||||
% :return:
|
||||
% If no output value is assigned, a bar graph will be plotted.
|
||||
% Otherwise, a vector of length ``n_surf_species`` will be
|
||||
% returned.
|
||||
%
|
||||
|
||||
c = surfmethods(thermo_hndl(s), 101);
|
||||
if nargout == 0
|
||||
figure
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
function setCoverages(s, cov)
|
||||
% SETCOVERAGES - set surface coverages
|
||||
% SETCOVERAGES Set surface coverages of the species on an interface.
|
||||
% setCoverages(s, cov)
|
||||
% :param s:
|
||||
% Instance of class :mat:func:`Interface`
|
||||
% :param cov:
|
||||
% Coverage of the species. ``cov`` can be either a vector of
|
||||
% length ``n_surf_species``, or a string in the format
|
||||
% ``'Species:Coverage, Species:Coverage'``
|
||||
%
|
||||
|
||||
if isa(cov, 'double')
|
||||
sz = length(cov);
|
||||
if sz == nSpecies(s)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,34 @@
|
|||
function k = Kinetics(r, ph, neighbor1, neighbor2, neighbor3, neighbor4)
|
||||
% KINETICS Kinetics class constructor.
|
||||
% k = Kinetics(r, ph, neighbor1, neighbor2, neighbor3, neighbor4)
|
||||
% Class Kinetics represents kinetics managers, which are classes
|
||||
% that manage reaction mechanisms. The reaction mechanism
|
||||
% attributes are specified in a CTML file.
|
||||
% Instances of class :mat:func:`Kinetics` are responsible for evaluating reaction rates
|
||||
% of progress, species production rates, and other quantities pertaining to
|
||||
% a reaction mechanism.
|
||||
%
|
||||
% KINETICS - Kinetics class constructor.
|
||||
%
|
||||
% Class Kinetics represents kinetics managers, which are classes
|
||||
% that manage reaction mechanisms. The reaction mechanism
|
||||
% attributes are specified in a CTML file.
|
||||
% :param r:
|
||||
% If ``r`` is an instance of class :mat:func:`Kinetics`, a copy of the instance
|
||||
% is returned. In this case, ``r`` should be the only argument. Otherwise, ``r``
|
||||
% must be an instance of class :mat:func:`XML_Node`.
|
||||
% :param ph:
|
||||
% If ``r`` is an instance of :mat:func:`XML_Node`, ``ph`` is an instance of class
|
||||
% :mat:func:`ThermoPhase`. Otherwise, optional.
|
||||
% :param neighbor1:
|
||||
% Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a
|
||||
% neighboring phase.
|
||||
% :param neighbor2:
|
||||
% Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a
|
||||
% neighboring phase.
|
||||
% :param neighbor3:
|
||||
% Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a
|
||||
% neighboring phase.
|
||||
% :param neighbor4:
|
||||
% Instance of class :mat:func:`ThermoPhase` or :mat:func:`Solution` representing a
|
||||
% neighboring phase.
|
||||
% :return:
|
||||
% Instance of class :mat:func:`Kinetics`
|
||||
%
|
||||
|
||||
% indices for bulk phases in a heterogeneous mechanism.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,13 @@
|
|||
function advanceCoverages(k, dt)
|
||||
% ADVANCECOVERAGES - advance the surface coverages forward in time holding the bulk phase concentrations fixed.
|
||||
% ADVANCECOVERAGES Advance the surface coverages forward in time.
|
||||
% advanceCoverages(k, dt)
|
||||
% The bulk phase concentrations are held fixed during this operation.
|
||||
%
|
||||
% :param k:
|
||||
% Instance of class :mat:func:`Interface` with an associated
|
||||
% :mat:func:`Kinetics` object.
|
||||
% :param dt:
|
||||
% Time interval by which the coverages should be advanced
|
||||
%
|
||||
|
||||
kinetics_set(k.id, 5, 0, dt);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
function clear(k)
|
||||
% CLEAR - delete the Kinetics instance.
|
||||
% CLEAR Delete the Kinetics instance.
|
||||
% clear(k)
|
||||
% :param k:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
%
|
||||
|
||||
kinetics_set(k.id, 3, 0, 0);
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
function cdot = creationRates(a)
|
||||
% CREATIONRATES Chemical creation rates (kmol/m^3/s).
|
||||
% CREATIONRATES Get the chemical creation rates.
|
||||
% cdot = creationRates(a)
|
||||
%
|
||||
% cdot = creationRates(K)
|
||||
% See also: :mat:func:`destructionRates`, :mat:func:`netProdRates`
|
||||
%
|
||||
% Returns a column vector of the creation rates of all
|
||||
% species. If the output is not assigned to a variable, a
|
||||
% bar graph is produced.
|
||||
%
|
||||
% See also: destructionRates, netProdRates.
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which creation rates are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the creation rates of all
|
||||
% species. If the output is not assigned to a variable, a
|
||||
% bar graph is produced. Units: kmol/m**3-s
|
||||
%
|
||||
|
||||
cdot = kinetics_get(a.id, 21, 0);
|
||||
if nargout == 0
|
||||
figure
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
function ddot = destructionRates(a)
|
||||
% destructionRates Chemical destruction rates (kmol/m^3/s).
|
||||
% DESTRUCTIONRATES Get the chemical destruction rates.
|
||||
% ddot = destructionRates(a)
|
||||
%
|
||||
% cdot = destructionRates(a)
|
||||
% See also: :mat:func:`creationRates`, :mat:func:`netProdRates`
|
||||
%
|
||||
% Returns a column vector of the destruction rates of all
|
||||
% species. If the output is not assigned to a variable, a
|
||||
% bar graph is produced.
|
||||
%
|
||||
% See also: creationRates, netProdRates.
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which destruction rates are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the destruction rates of all
|
||||
% species. If the output is not assigned to a variable, a
|
||||
% bar graph is produced. Units: kmol/m**3-s
|
||||
%
|
||||
|
||||
ddot = kinetics_get(a.id, 22, 0);
|
||||
if nargout == 0
|
||||
figure
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
function ddot = destruction_rates(a)
|
||||
% destruction_rates Chemical destruction rates for all species.
|
||||
%
|
||||
% q = destruction_rates(a)
|
||||
%
|
||||
% Returns a column vector of the destruction rates of all species.
|
||||
%
|
||||
% See also: creation_rates, net_production_rates.
|
||||
% DESTRUCTION_RATES Get the chemical destruction rates.
|
||||
% ddot = destruction_rates(a)
|
||||
% This function is deprecated in favor of the function
|
||||
% :mat:func:`destructionRates`
|
||||
%
|
||||
|
||||
warning('This function is deprecated. Use destructionRates instead.')
|
||||
ddot = destructionRates(a);
|
||||
if nargout == 0
|
||||
figure
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
function kc = equil_Kc(a)
|
||||
% equil_Kc(a) equilibrium constants for all reactions
|
||||
% EQUIL_KC Get the equilibrium constants for all reactions
|
||||
% kc = equil_Kc(a)
|
||||
%
|
||||
% q = equil_Kc(a)
|
||||
%
|
||||
% Returns a column vector of the equilibrium constants
|
||||
% for all reactions. The vector has an entry for every
|
||||
% reaction, whether reversible or not, but non-zero values
|
||||
% occur only for the reversible reactions.
|
||||
% See also: :mat:func:`fwdRateConstants`, :mat:func:`revRateConstants`
|
||||
%
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which equilibrium constants are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the equilibrium constants
|
||||
% for all reactions. The vector has an entry for every
|
||||
% reaction, whether reversible or not, but non-zero values
|
||||
% occur only for the reversible reactions. If the output is
|
||||
% not assigned to a variable, a bar graph is produced instead.
|
||||
%
|
||||
|
||||
kc = kinetics_get(a.id, 14, 0);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
function kf = fwdRateConstants(a)
|
||||
%FWDRATECONSTANTS Forward reaction rate constants for all the reactions.
|
||||
% FWDRATECONSTANTS Get the forward reaction rate constants.
|
||||
% kf = fwdRateConstants(a)
|
||||
%
|
||||
% kf = fwdRateConstants(a)
|
||||
% see also: :mat:func:`revRateConstants`, :mat:func:`equil_Kc`
|
||||
%
|
||||
% Returns a column vector of the forward rate constants of
|
||||
% all of the reactions.
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which forward rate constants are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the forward rate constants of
|
||||
% all of the reactions.
|
||||
%
|
||||
|
||||
kf = kinetics_get(a.id, 15, 0);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
function i = hndl(k)
|
||||
% HNDL Get the integer used to access kernel objects.
|
||||
% i = hndl(k)
|
||||
% Integer used to access kernel objects. Deprecated in favor of
|
||||
% :mat:func:`kinetics_hndl`.
|
||||
%
|
||||
|
||||
warning('This function is deprecated in favor of kinetics_hndl.m')
|
||||
i = k.id;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,25 @@
|
|||
function yn = isReversible(a, i)
|
||||
% ISREVERSIBLE - Reversible reaction flag.
|
||||
% ISREVERSIBLE Get an array of flags indicating reversibility of a reaction.
|
||||
% yn = isReversible(a, i)
|
||||
% A reversible reaction is one that runs in both the forward
|
||||
% direction (reactants -> products) and in the reverse direction
|
||||
% (products -> reactants). The reverse rate for reversible
|
||||
% reactions can computed from thermochemistry, so that the
|
||||
% reaction satisfies detailed balance, and the net rate of
|
||||
% progress is zero in states of chemical equilibrium. The reverse
|
||||
% rate can also be specified directly by a rate expression. An
|
||||
% irreversible reaction is one whose reverse reaction rate is
|
||||
% zero.
|
||||
%
|
||||
% A reversible reaction is one that runs in both the forward
|
||||
% direction (reactants -> products) and in the reverse direction
|
||||
% (products -> reactants). The reverse rate for reversible
|
||||
% reactions is computed from thermochemistry, so that the
|
||||
% reaction satisfies detailed balance, and the net rate of
|
||||
% progress is zero in states of chemical equilibrium.
|
||||
%
|
||||
% ISREVERSIBLE(K, IRXN) returns 1 if reaction number IRXN is
|
||||
% reversible, and 0 if it is irreversible.
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which the reversible flags are desired.
|
||||
% :param i:
|
||||
% Integer reaction number
|
||||
% :return:
|
||||
% 1 if reaction number ``i`` is
|
||||
% reversible, and 0 if it is irreversible.
|
||||
%
|
||||
|
||||
yn = kinetics_get(a.id, 4, i);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,12 @@
|
|||
function i = kinetics_hndl(k)
|
||||
% KINETICS_HNDL - integer used to access kernel object
|
||||
% KINETICS_HNDL Get the integer used to access kernel object.
|
||||
% i = kinetics_hndl(k)
|
||||
% :param k:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which the handle is desired.
|
||||
% :return:
|
||||
% Returns the integer ID of the kinetics kernel object.
|
||||
%
|
||||
|
||||
i = k.id;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,21 @@
|
|||
function n = multiplier(a, irxn)
|
||||
% MULTIPLIER Multiplier for reaction rate of progress.
|
||||
function n = multiplier(a,irxn)
|
||||
% MULTIPLIER Get the multiplier for reaction rate of progress.
|
||||
% n = multiplier(a,irxn)
|
||||
% The multiplier multiplies the reaction rate of progress. It may
|
||||
% be used to implement sensitivity analysis, or to selectively
|
||||
% disable reactions. For reversible reactions, it multiplies both
|
||||
% the forward and reverse rates. By default, the multiplier value
|
||||
% is 1.0, but it may be set to any other value by calling method
|
||||
% :mat:func:`setMultiplier`.
|
||||
%
|
||||
% The multiplier multiplies the reaction rate of progress. It may
|
||||
% be used to implement sensitivity analysis, or to selectively
|
||||
% disable reactions. For reversible reactions, it multiplies both
|
||||
% the forward and reverse rates. By default, the multiplier value
|
||||
% is 1.0, but it may be set to any other value by calling method
|
||||
% setMultiplier.
|
||||
%
|
||||
% MULTIPLIER(K, IRXN) Multiplier for reaction number IRXN
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which the multipliers are desired.
|
||||
% :param irxn:
|
||||
% Integer reaction number for which the multiplier is desired.
|
||||
% :return:
|
||||
% Multiplier of the rate of progress of reaction number ``irxn``
|
||||
%
|
||||
|
||||
n = kinetics_get(a.id, 2, irxn);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,12 @@
|
|||
function n = nReactions(a)
|
||||
% NREACTIONS - Number of reactions.
|
||||
% NREACTIONS Get the number of reactions.
|
||||
% n = nReactions(a)
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which the number of reactions is desired.
|
||||
% :return:
|
||||
% Integer number of reactions
|
||||
%
|
||||
|
||||
n = kinetics_get(a.id, 1, 0);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
function nsp = nTotalSpecies(a)
|
||||
% NTOTALSPECIES - The total number of species, summed over all
|
||||
% NTOTALSPECIES Get the total number of species.
|
||||
% nsp = nTotalSpecies(a)
|
||||
% The total number of species, summed over all
|
||||
% participating phases.
|
||||
%
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which the number of species is desired.
|
||||
% :return:
|
||||
% Integer total number of species
|
||||
%
|
||||
|
||||
nsp = kinetics_get(a.id, 3, 0);
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
function wdot = netProdRates(a)
|
||||
% NETPRODRATES Net chemical production rates for all species.
|
||||
% NETPRODRATES Get the net chemical production rates for all species.
|
||||
% wdot = netProdRates(a)
|
||||
%
|
||||
% wdot = netProdRates(a)
|
||||
% See also: :mat:func:`creationRates`, :mat:func:`destructionRates`
|
||||
%
|
||||
% Returns a column vector of the net production (creation -
|
||||
% destruction) rates of all species. If the output is not
|
||||
% assigned to a variable, a bar plot is produced.
|
||||
%
|
||||
% See also: creationRates, destructionRates
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which net production rates are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the net production (creation -
|
||||
% destruction) rates of all species. If the output is not
|
||||
% assigned to a variable, a bar plot is produced.
|
||||
%
|
||||
|
||||
wdot = kinetics_get(a.id, 23, 0);
|
||||
if nargout == 0
|
||||
figure
|
||||
|
|
|
|||
|
|
@ -1,6 +1,21 @@
|
|||
function e = reactionEqn(a, irxn)
|
||||
% reactionEqn Reaction equation of reaction irxn.
|
||||
% REACTIONEQN Get the reaction equation of a reaction.
|
||||
% e = reactionEqn(a, irxn)
|
||||
% If only the first argument
|
||||
% is given, the reaction equations of all of the reactions are
|
||||
% returned in a cell array. Otherwise, ``irxn`` must be an integer
|
||||
% or vector of integers.
|
||||
%
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which the reaction equations are desired.
|
||||
% :param irxn:
|
||||
% Optional. Integer or vector of integer reaction numbers.
|
||||
% :return:
|
||||
% String or cell array of strings of the reaction equations.
|
||||
%
|
||||
|
||||
if nargin == 1
|
||||
m = nReactions(a);
|
||||
n = 1;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
function kr = revRateConstants(a)
|
||||
%REVRATECONSTANTS Reverse reaction rate constants for all the reactions.
|
||||
% REVRATECONSTANTS Get the reverse reaction rate constants.
|
||||
% kr = revRateConstants(a)
|
||||
%
|
||||
% kr = revRateConstants(a)
|
||||
% See also: :mat:func:`fwdRateConstants`, :mat:func:`equil_KC`
|
||||
%
|
||||
% Returns a column vector of the reverse rate constants of
|
||||
% all of the reactions.
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which reverse rate constants are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the reverse rate constants of
|
||||
% all of the reactions.
|
||||
%
|
||||
|
||||
kr = kinetics_get(a.id, 16, 0);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,19 @@
|
|||
function rop = rop(a)
|
||||
% ROP - Forward and reverse rates of progress.
|
||||
% ROP Get the forward and reverse rates of progress.
|
||||
% rop = rop(a)
|
||||
%
|
||||
% ROP(K) returns an M x 2 array of reaction rates of
|
||||
% progress. The first column contains the forward rates of progress,
|
||||
% and the second column the reverse rates. If this function
|
||||
% is called with no output argument, a bar graph is produced.
|
||||
% See also: :mat:func:`rop_f`, :mat:func:`rop_r`, :mat:func:`rop_net`
|
||||
%
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which forward and reverse rates of progress are desired.
|
||||
% :return:
|
||||
% Returns an I x 2 array of reaction rates of
|
||||
% progress, where I is the number of reactions. The first
|
||||
% column contains the forward rates of progress, and the
|
||||
% second column the reverse rates. If this function
|
||||
% is called with no output argument, a bar graph is produced.
|
||||
%
|
||||
|
||||
f = rop_f(a);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
function q = rop_f(a)
|
||||
% ROP_F Forward rates of progress for all reactions.
|
||||
% q = rop_f(a)
|
||||
%
|
||||
% Q = ROP_F(K)
|
||||
% See also: :mat:func:`rop_r`, :mat:func:`rop_net`, :mat:func:`rop`
|
||||
%
|
||||
% Returns a column vector of the forward rates of progress
|
||||
% for all reactions.
|
||||
%
|
||||
% See also: rop_r, rop_net.
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which forward rates of progress are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the forward rates of progress
|
||||
% for all reactions. If this function
|
||||
% is called with no output argument, a bar graph is produced.
|
||||
%
|
||||
|
||||
q = kinetics_get(a.id, 11, 0);
|
||||
if nargout == 0
|
||||
figure
|
||||
|
|
|
|||
|
|
@ -1,12 +1,17 @@
|
|||
function q = rop_net(a)
|
||||
% ROP_F Forward rates of progress for all reactions.
|
||||
% ROP_NET Net rates of progress for all reactions.
|
||||
% q = rop_net(a)
|
||||
%
|
||||
% Q = ROP_F(K)
|
||||
% See also: :mat:func:`rop_f`, :mat:func:`rop_r`, :mat:func:`rop`
|
||||
%
|
||||
% Returns a column vector of the forward rates of progress
|
||||
% for all reactions.
|
||||
%
|
||||
% See also: rop_r, rop_net.
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which the net rates of progress are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the net rates of progress
|
||||
% for all reactions. If this function
|
||||
% is called with no output argument, a bar graph is produced.
|
||||
%
|
||||
|
||||
q = kinetics_get(a.id, 13, 0);
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
function q = rop_r(a)
|
||||
% ROP_R Reverse rates of progress for all reactions.
|
||||
% ROP_R Get the reverse rates of progress for all reactions.
|
||||
% q = rop_r(a)
|
||||
%
|
||||
% Q = ROP_R(K)
|
||||
% See also: :mat:func:`rop_f`, :mat:func:`rop_net`, :mat:func:`rop`
|
||||
%
|
||||
% Returns a column vector of the reverse rates of progress
|
||||
% for all reactions. The value is zero for irreversible
|
||||
% reactions.
|
||||
%
|
||||
% See also: rop_r, rop_net.
|
||||
% :param a:
|
||||
% Instance of class :mat:func:`Kinetics` (or another
|
||||
% object deriving from Kinetics)
|
||||
% for which reverse rates of progress are desired.
|
||||
% :return:
|
||||
% Returns a column vector of the reverse rates of progress
|
||||
% for all reactions. If this function
|
||||
% is called with no output argument, a bar graph is produced.
|
||||
%
|
||||
|
||||
q = kinetics_get(a.id, 12, 0);
|
||||
if nargout == 0
|
||||
figure
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue