
=================================
Zero-Dimensional Reactor Networks
=================================

Func
----

.. mat:class:: Func(typ, n, p)

    Func class constructor.

    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 ``()``
    operator to evaluate the function. For example, suppose object
    ``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`

    .. mat:function:: char(p)

        Get the formatted string to display the function.

        :param p:
            Instance of class :mat:func:`Func`
        :return:
            Formatted string displaying the function
        

    .. mat:function:: gaussian(peak, center, width)

        Create a Gaussian :mat:func:`Func` instance.

        :param peak:
            The peak value
        :param center:
            Value of x at which the peak is located
        :param width:
            Full width at half-maximum. The value of the
            function at center +/- (width)/2 is one-half
            the peak value.
        

    .. mat:function:: plus(a, b)

        Get a functor representing the sum of two input functors.

        :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.
        

    .. mat:function:: polynom(coeffs)

        Create a polynomial :mat:func:`Func` instance.

        The polynomial coefficients are specified by a vector
        ``[a0 a1 .... aN]``. Examples:
        
        .. code-block:: matlab
        
            polynom([-2 6 3])          %3x^2 + 6.0x - 2
            polynom([1.0 -2.5 0 0 2])  %2x^4 - 2.5x + 1
        
        :param coeffs:
            Vector of polynomial coefficients
        :return:
            Instance of class :mat:func:`Func`
        

    .. mat:function:: rdivide(a, b)

        Get a functor that is the ratio of the input functors.

        :param a:
            Instance of class :mat:func:`Func`
        :param b:
            Instance of class :mat:func:`Func`
        :return:
            Instance of class :mat:func:`Func`
        

    .. mat:function:: times(a, b)

        Create a functor that multiplies two other functors.

        :param a:
            Instance of class :mat:func:`Func`
        :param b:
            Instance of class :mat:func:`Func`
        :return:
            Instance of class :mat:func:`Func`
        

Reactor
-------

.. mat:class:: Reactor(contents, typ)

    Reactor class constructor.

    A :mat:func:`Reactor` object simulates a perfectly-stirred reactor.
    It has a time-dependent state, and may be coupled to other reactors
    through flow lines or through walls that may expand or
    contract and/or conduct heat.
    
    .. code-block:: matlab
    
        >> r1 = Reactor      % an empty reactor
        >> r2 = Reactor(gas) % a reactor containing a phase
    
    See also: :mat:func:`Reservoir`, :mat:func:`IdealGasReactor`,
    :mat:func:`IdealGasConstPressureReactor`, :mat:func:`ConstPressureReactor`
    
    :param contents:
        Instance of class :mat:func:`Solution` representing the contents of the
        reactor
    :param typ:
        Character array, reactor type. Options are:
    
        'Reservoir'
        'Reactor'
        'FlowReactor'
        'ConstPressureReactor'
        'IdealGasReactor'
        'IdealGasConstPressureReactor'
    
    :return:
        Instance of class :mat:func:`Reactor`
    

    .. mat:function:: ConstPressureReactor(contents)

        Create a constant pressure reactor object.

        A :mat:func:`ConstPressureReactor` is an instance of class
        :mat:func:`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:
        
        .. code-block:: matlab
        
            r1 = ConstPressureReactor         % an empty reactor
            r2 = ConstPressureReactor(contents)    % a reactor containing contents
        
        See also: :mat:func:`Reactor`
        
        :param contents:
            Cantera :mat:func:`Solution` to be set as the contents of the
            reactor
        :return:
            Instance of class :mat:func:`Reactor`
        

    .. mat:function:: FlowReactor(contents)

        Create a flow reactor object.

        A reactor representing adiabatic plug flow in a constant-area
        duct. Examples:
        
        .. code-block:: matlab
        
            r1 = FlowReactor         % an empty reactor
            r2 = FlowReactor(gas)    % a reactor containing a gas
        
        See also: :mat:func:`Reactor`
        
        :param contents:
            Cantera :mat:func:`Solution` to be set as the contents of the
            reactor
        :return:
            Instance of class :mat:func:`Reactor`
        

    .. mat:function:: IdealGasConstPressureReactor(contents)

        Create a constant pressure reactor with an ideal gas.

        An IdealGasConstPressureReactor is an instance of 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. Additionally, its governing equations are specialized for the
        ideal gas equation of state (and do not work correctly with other
        thermodynamic models). Examples:
        
        .. code-block:: matlab
        
            r1 = IdealGasConstPressureReactor      % an empty reactor
            r2 = IdealGasConstPressureReactor(gas) % a reactor containing a gas
        
          See also: :mat:func:`Reactor`
        
        :param contents:
            Cantera :mat:func:`Solution` to be set as the contents of the
            reactor
        :return:
            Instance of class :mat:func:`Reactor`
        

    .. mat:function:: IdealGasReactor(contents)

        Create a reactor with an ideal gas.

        An IdealGasReactor is an instance of class Reactor where the governing
        equations are specialized for the ideal gas equation of state (and do not
        work correctly with other thermodynamic models). Examples:
        
        .. code-block:: matlab
        
            r1 = IdealGasReactor         % an empty reactor
            r2 = IdealGasReactor(gas)    % a reactor containing a gas
        
        See also: :mat:func:`Reactor`
        
        :param contents:
            Cantera :mat:func:`Solution` to be set as the contents of the
            reactor
        :return:
            Instance of class :mat:func:`Reactor`
        

    .. mat:function:: Reservoir(contents)

        Create a Reservoir object.

        A :mat:func:`Reservoir` is an instance of class :mat:func:`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
        changing the composition or thermodynamic state. Note that even
        if the reaction mechanism associated with the fluid in the
        reactor defines reactions, they are disabled within
        reservoirs. Examples:
        
        .. code-block:: matlab
        
            r1 = Reservoir         % an empty reservoir
            r2 = Reservoir(gas)    % a reservoir containing a gas
        
        See also: :mat:func:`Reactor`
        
        :param contents:
            Cantera :mat:func:`Solution` to be set as the contents of the
            reactor
        :return:
            Instance of class :mat:func:`Reactor`
        

    .. mat:function:: density(r)

        Get the density of the reactor.

        :param r:
            Instance of class :mat:func:`Reactor`
        :return:
            Density of the phase in the input. Units: kg/m**3
        

    .. mat:function:: enthalpy_mass(r)

        The specific enthalpy of the reactor.

        
        See also: :mat:func:`intEnergy_mass`
        
        :param r:
            Instance of class :mat:func:`Reactor`
        :return:
            The specific enthalpy of the reactor contents at the
            end of the last call to :mat:func:`advance` or :mat:func:`step`.
            The enthalpy is retrieved from the solution vector. Units: J/kg
        

    .. mat:function:: insert(r, gas)

        Insert a solution or mixture into a reactor.

        :param r:
            Instance of class :mat:func:`Reactor`
        :param gas:
            Instance of class :mat:func:`Solution` to be inserted
        

    .. mat:function:: intEnergy_mass(r)

        Get the specific internal energy.

        See also: :mat:func:`enthalpy_mass`
        
        :param r:
            Instance of class :mat:func:`Reactor`
        :return:
            The specific internal energy of the reactor contents at the
            end of the last call to :mat:func:`advance` or :mat:func:`step`.
            The internal energy is retrieved from the solution vector.
            Units: J/kg
        

    .. mat:function:: mass(r)

        Get the mass of the reactor.

        :param r:
            Instance of class :mat:func:`Reactor`
        :return:
            The mass of the reactor contents at the
            end of the last call to :mat:func:`advance` or :mat:func:`step`.
            The mass is retrieved from the solution vector. Units: kg
        

    .. mat:function:: massFraction(r, species)

        Get the mass fraction of a species.

        :param r:
            Instance of class :mat:func:`Reactor`
        :param species:
            String or the one-based integer index of the species
        :return:
            The mass fraction of the specifed species in the reactor at the
            end of the last call to :mat:func:`advance` or :mat:func:`step`.
        

    .. mat:function:: massFractions(r)

        Get the mass fractions of the species.

        :param r:
            Instance of class :mat:func:`Reactor`
        :return:
            The mass fractions of the reactor contents at the
            end of the last call to :mat:func:`advance` or :mat:func:`step`.
        

    .. mat:function:: pressure(r)

        Get the pressure of the reactor.

        :param r:
            Instance of class :mat:func:`Reactor`
        :return:
            The pressure of the reactor contents at the
            end of the last call to :mat:func:`advance` or :mat:func:`step`.
            Units: Pa
        

    .. mat:function:: setChemistry(r, flag)

        Enable or disable changing reactor composition by reactions.

        If the chemistry is disabled, then the reactor composition is
        constant. The parameter should be the string ``'on'`` to enable the
        species equations, 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. ::
        
            >> setChemistry(r, 'on');
            >> setChemistry(r, 'off');
        
        :param r:
            Instance of class :mat:func:`Reactor`
        :param flag:
            String, either ``'on'`` or ``'off'`` to enable and disable
            solving the energy equation, respectively
        

    .. mat:function:: setEnergy(r, flag)

        Enable or disable solving the energy equation.

        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 is only needed to disable the
        energy equation for isothermal simulations. ::
        
            >> setEnergy(r, 'on');
            >> setEnergy(r, 'off');
        
        :param r:
            Instance of class :mat:func:`Reactor`
        :param flag:
            String, either ``'on'`` or ``'off'`` to enable and disable
            solving the energy equation, respectively
        

    .. mat:function:: setInitialVolume(r, v0)

        Set the initial reactor volume.

        :param r:
            Instance of class :mat:func:`Reactor`
        :param v0:
            Initial volume. Units: m**3
        

    .. mat:function:: setKineticsMgr(r, k)

        Set the kinetics manager.

        This method is used internally during Reactor initialization, but
        is usually not called by users.
        
        :param r:
            Instance of class :mat:func:`Reactor`
        :param k:
            Instance of class :mat:func:`Kinetics`, or another object
            containing an instance of that class.
        

    .. mat:function:: setMassFlowRate(r, mdot)

        Set the mass flow rate.

        :param r:
            Instance of class :mat:func:`Reactor`
        :param mdot:
            Mass flow rate. Units: kg/s
        

    .. mat:function:: setThermoMgr(r, t)

        Set the thermodynamics manager.

        This method is used internally during Reactor initialization, but
        is usually not called by users.
        
        :param r:
            Instance of class :mat:func:`Reactor`
        :param t:
            Instance of class :mat:func:`ThermoPhase`, or another object
            containing an instance of that class.
        

    .. mat:function:: temperature(r)

        Get the temperature of the reactor.

        :param r:
            Instance of class :mat:func:`Reactor`
        :return:
            The temperature of the reactor contents at the
            end of the last call to :mat:func:`advance` or :mat:func:`step`.
            Units: K
        

    .. mat:function:: volume(r)

        Get the volume of the reactor.

        :param r:
            Instance of class :mat:func:`Reactor`
        :return:
            The volume of the reactor contents at the
            end of the last call to :mat:func:`advance` or :mat:func:`step`.
            Units: m**3
        

ReactorNet
----------

.. mat:class:: ReactorNet(reactors)

    ReactorNet class constructor.

    A :mat:func:`ReactorNet` object is a container that holds one
    or more :mat:func:`Reactor` objects in a network. :mat:func:`ReactorNet`
    objects are used to simultaneously advance the state of one or
    more coupled reactors.
    
    Example::
    
        >> r1 = Reactor(gas1)
        >> r2 = Reactor(gas2)
        >> <... install walls, inlets, outlets, etc...>
    
        >> reactor_network = ReactorNet({r1, r2})
        >> advance(reactor_network, time)
    
    See also: :mat:func:`Reactor`
    
    :param reactors:
        A single instance of :mat:func:`Reactor` or a cell array
        of instances of :mat:func:`Reactor`
    :return:
        Instance of class :mat:func:`ReactorNet`
    

    .. mat:function:: addReactor(net, reactor)

        Add a reactor to a network.

        :param net:
            Instance of class :mat:func:`ReactorNet`
        :param reactor:
            Instance of class :mat:func:`Reactor`
        

    .. mat:function:: advance(n, tout)

        Advance the state of the reactor network in time.

        Method :mat:func:`advance` integrates the system of ordinary differential
        equations that determine the rate of change of the volume, the
        mass of each species, and the total energy for each reactor. The
        integration is carried out from the current time to time
        ``tout``. (Note ``tout`` is an absolute time, not a time interval.)
        The integrator may take many internal time steps before reaching
        tout.
        
        .. code-block:: matlab
        
            for i in 1:10
               tout = 0.1*i
               advance(n, tout)
               ...
               <add output commands here>
               ...
            end
        
        See also: :mat:func:`step`
        
        :param n:
            Instance of class :mat:func:`ReactorNet`
        :param tout:
            End time of the integration. The solver may take many internal
            time steps to reach ``tout``.
        

    .. mat:function:: atol(r)

        Get the absolute error tolerance.

        :param r:
            Instance of class :mat:func:`ReactorNet`
        :return:
            Absolute error tolerance.
        

    .. mat:function:: rtol(r)

        Get the relative error tolerance.

        :param r:
            Instance of class :mat:func:`ReactorNet`
        :return:
            Relative error tolerance.
        

    .. mat:function:: setInitialTime(r, t)

        Set the initial time of the integration.

        If the time integration has already begun, this restarts the
        integrator using the current solution as the initial condition,
        setting the time to ``t``.
        
        :param r:
            Instance of class :mat:func:`ReactorNet`
        :param t:
            Time at which integration should be restarted, using the
            current state as the initial condition. Units: s
        

    .. mat:function:: setMaxTimeStep(r, maxstep)

        Set the maximum time step.

        The integrator chooses a step size based on the desired error
        tolerances and the rate at which the solution is changing. In
        some cases, the solution changes very slowly at first, then very
        rapidly (ignition problems). In such cases, the integrator may
        choose a timestep that is too large, which leads to numerical
        problems later. Use this method to set an upper bound on the
        timestep.
        
        :param r:
            Instance of class :mat:func:`ReactorNet`
        :param maxstep:
            Maximum time step
        

    .. mat:function:: setTolerances(r, rtol, atol)

        Set the error tolerances.

        :param r:
            Instance of class :mat:func:`ReactorNet`
        :param rtol:
            Scalar relative error tolerance
        :param atol:
            Scalar absolute error tolerance
        

    .. mat:function:: step(r)

        Take one internal time step.

        The integrator used to integrate the ODEs (CVODE) takes
        variable-size steps, chosen so that a specified error
        tolerance is maintained. At times when the solution is rapidly
        changing, the time step becomes smaller to resolve the
        solution.
        
        Method :mat:func:`step` takes one internal time step and returns
        the network time after taking that step. This
        can be useful when it is desired to resolve a rapidly-changing
        solution.
        
        This method can be used as follows:
        
        .. code-block:: matlab
        
            t = 0.0
            tout = 0.1
            while t < tout
               t = step(r)
               ,,,
               <commands to save desired variables>
               ...
            end
        
        See also: :mat:func:`advance`
        
        :param r:
            Instance of class :mat:func:`ReactorNet`
        :return:
            Network time after the internal time step. Units: s
        

    .. mat:function:: time(r)

        Get the current value of the time.

        :param r:
            Instance of class :mat:func:`ReactorNet`
        :return:
            Current time in the input ReactorNet. Units: s
        

FlowDevice
----------

.. mat:class:: FlowDevice(typ)

    FlowDevice class constructor.

    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='MassFlowController'``
        for :mat:func:`MassFlowController`,  ``typ='PressureController'`` for
        :mat:func:`PressureController` and ``typ='Valve'`` for
        :mat:func:`Valve`
    :return:
        Instance of class :mat:func:`FlowDevice`
    

    .. mat:function:: MassFlowController(upstream, downstream)

        Create a mass flow controller.

        Creates an instance of class :mat:func:`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 :mat:func:`install` method
        should be used to install the :mat:func:`MassFlowController` between
        reactors.
        
        see also: :mat:func:`FlowDevice`, :mat:func:`Valve`
        
        :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`
        

    .. mat:function:: Valve(upstream, downstream)

        Create a valve.

        Create an instance of class :mat:func:`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
        
        .. 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 :mat:func:`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 FUTURE
        RELEASE.
        
        see also: :mat:func:`FlowDevice`, :mat:func:`MassFlowController`
        
        :param upstream:
            Upstream reactor or reservoir
        :param downstream:
            Downstream Reactor or reservoir
        
        :return:
            Instance of class :mat:func:`FlowDevice`
        

    .. mat:function:: install(f, upstream, downstream)

        Install a flow device between reactors or reservoirs.

        :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`
        

    .. mat:function:: massFlowRate(f)

        Get the mass flow rate.

        :param f:
            Instance of class :mat:func:`MassFlowController`
        :return:
            The mass flow rate through the :mat:func:`FlowDevice` at the current time
        

    .. mat:function:: setFunction(f, mf)

        Set the mass flow rate with class :mat:func:`Func`.

        
        See also: :mat:func:`MassFlowController`, :mat:func:`Func`
        
        :param f:
            Instance of class :mat:func:`MassFlowController`
        :param mf:
            Instance of class :mat:func:`Func`
        

    .. mat:function:: setMassFlowRate(f, mdot)

        Set the mass flow rate to a constant value.

        
        See also: :mat:func:`MassFlowController`
        
        :param f:
            Instance of class :mat:func:`MassFlowController`
        :param mdot:
            Mass flow rate
        

    .. mat:function:: setValveCoeff(f, k)

        Set the valve coefficient :math:`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
        

Wall
----

.. mat:class:: Wall(left, right, area, k, u, q, v)

    Wall class constructor.

    A Wall separates two reactors, or a reactor and a reservoir. A wall has a
    finite area, may conduct heat between the two reactors on either
    side, and may move like a piston.
    
    Walls are stateless objects in Cantera, meaning that no differential
    equation is integrated to determine any wall property. Since it is the wall
    (piston) velocity that enters the energy equation, this means that it is
    the velocity, not the acceleration or displacement, that is specified.
    The wall velocity is computed from
    
    .. math:: v = K(P_{\rm left} - P_{\rm right}) + v_0(t),
    
    where :math:`K` is a non-negative constant, and :math:`v_0(t)` is a
    specified function of time. The velocity is positive if the wall is
    moving to the right.
    
    The heat flux through the wall is computed from
    
    .. math::  q = U(T_{\rm left} - T_{\rm right}) + q_0(t),
    
    where :math:`U` is the overall heat transfer coefficient for
    conduction/convection. The function
    :math:`q_0(t)` is a specified function of time. The heat flux is positive
    when heat flows from the reactor on the left to the reactor on the right.
    
    Note: all of the arguments are optional and can be activated after initial
    construction by using the various methods of the :mat:func:`Wall` class.
    Any improperly specified arguments will generate warnings; these can be ignored
    if the intention was to not use a particular argument. Thus, the velocity of
    the wall can be set by using empty strings or 0.0 for each of the arguments before
    the velocity with no harm.
    
    :param left:
        Instance of class :mat:func:`Reactor` to be used as the bulk phase on
        the left side of the wall. See :mat:func:`install`
    :param right:
        Instance of class :mat:func:`Reactor` to be used as the bulk phase on
        the right side of the wall. See :mat:func:`install`
    :param area:
        The area of the wall in m**2. See :mat:func:`area` and :mat:func:`setArea`.
        Defaults to 1.0 m**2 if not specified.
    :param k:
        Expansion rate coefficient in m/(s-Pa). See :mat:func:`setExpansionRateCoeff`
        and :mat:func:`vdot`. Defaults to 0.0 if not specified.
    :param u:
        Heat transfer coefficient in W/(m**2-K). See :mat:func:`setHeatTransferCoeff`
        and :mat:func:`qdot`. Defaults to 0.0 if not specified.
    :param q:
        Heat flux in W/m**2. Must be an instance of :mat:func:`Func`. See
        :mat:func:`setHeatFlux` and :mat:func:`qdot`. Defaults to 0.0 if not specified.
    :param v:
        Velocity of the wall in m/s. Must be an instance of :mat:func:`Func`. See
        :mat:func:`setVelocity` and :mat:func:`vdot`. Defaults to 0.0 if not specified.
    :return:
        Instance of class :mat:func:`Wall`

    .. mat:function:: area(w)

        Get the area of the wall.

        :param w:
            Instance of class :mat:func:`Wall`
        :return:
            Area of the wall in m**2
        

    .. mat:function:: install(w, left, right)

        Install a wall between two reactors.

        :param w:
            Instance of class :mat:func:`Wall`
        :param left:
            Instance of class :mat:func:`Reactor`or
            :mat:func:`Reservoir`
        :param right:
            Instance of class :mat:func:`Reactor` or
            :mat:func:`Reservoir`
        

    .. mat:function:: qdot(w, t)

        Get the total heat transfer through a wall given a time.

        A positive value corresponds to heat flowing from the left-hand
        reactor to the right-hand one.
        
        :param w:
            Instance of class :mat:func:`Wall`
        :param t:
            Time at which the heat transfer should be evaluated.
        :return:
            Total heat transfer. Units: W
        

    .. mat:function:: ready(w)

        Check whether a wall is ready.

        :param w:
            Instance of class :mat:func:`Wall`
        :return:
            Status of the wall
        

    .. mat:function:: setArea(w, a)

        Set the area of a wall.

        :param w:
            Instance of class :mat:func:`Wall`
        :param a:
            Double area of the wall.
        

    .. mat:function:: setExpansionRateCoeff(w, k)

        Set the expansion rate coefficient.

        The expansion rate coefficient
        determines the velocity of the wall for a given pressure
        differential between the left and right reactors, according to the
        formula
        
        .. math:: v = K(P_{left}-P_{right})
        
        where :math:`v` is velocity, :math:`K` is the expansion rate
        coefficient, and :math:`P` is the pressure.
        
        :param w:
            Instance of class :mat:func:`Wall`
        :param k:
            Double, wall expansion rate coefficient. Units: m/(s-Pa)
        

    .. mat:function:: setHeatFlux(w, f)

        Set the heat flux using :mat:func:`Func`

        Must be set by an instance of
        class :mat:func:`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:
        
        .. code-block:: matlab
        
            w = Wall()
            f = Func('polynomial',0,10); % Or f = polynom(10);
            setHeatFlux(w, f);
        
        sets the heat flux through the wall to 10 W/m**2.
        
        :param w:
            Instance of class :mat:func:`Wall`
        :param f:
            Instance of class :mat:func:`Func`. Units: W/m**2
        

    .. mat:function:: setHeatTransferCoeff(w, u)

        Set the heat transfer coefficient.

        :param w:
            Instance of class :mat:func:`Wall`
        :param u:
            Heat transfer coefficient of the wall. Units: W/(m**2-K)
        

    .. mat:function:: setThermalResistance(w, r)

        Set the thermal resistance.

        :param w:
            Instance of class :mat:func:`Wall`
        :param r:
            Double, thermal resistance. Units: K*m**2/W
        

    .. mat:function:: setVelocity(w, f)

        Set the velocity of the wall using :mat:func:`Func`.

        Must be set by an instance of class :mat:func:`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:
        
        .. code-block:: matlab
        
            w = Wall()
            f = Func('polynomial',0,10); % Or f = polynom(10);
            setVelocity(w, f);
        
        sets the velocity of the wall to 10 m/s.
        
        :param w:
            Instance of class :mat:func:`Wall`
        :param f:
            Instance of class :mat:func:`Func`. Units: m/s
        

    .. mat:function:: vdot(w, t)

        Get the rate of volumetric change at a given time.

        A positive value corresponds to the left-hand reactor volume
        increasing, and the right-hand reactor volume decreasing.
        
        :param w:
            Instance of class :mat:func:`Wall`
        :param t:
            Time at which the volumetric change should be calculated.
        :return:
            Rate of volumetric change Units: m**3/s
        


