Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cantera 2.5] Update valve/etc. in science section #104

Merged
merged 3 commits into from
Feb 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 42 additions & 16 deletions pages/science/reactors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,24 +322,29 @@ to the reactors previously mentioned:
detail of how the wall affects the connected reactors.

- :py:class:`Valve`: A valve is a flow devices with mass flow rate that is a function of
the pressure drop across it. The default behavior is linear:
the pressure drop across it. The mass flow rate is computed as:

.. math::

\dot m = K_v (P_1 - P_2)
\dot m = K_v g(t) f(P_1 - P_2)

if :math:`P_1 > P_2.` Otherwise, :math:`\dot m = 0`. However, an arbitrary
function can also be specified, such that
with :math:`K_v` being a proportionality constant that is set using the class
property :py:func:`Valve.valve_coeff`. Further, :math:`g` and :math:`f`
are functions of time and pressure drop that are set by class methods
:py:func:`Valve.set_time_function` and :py:func:`Valve.set_valve_function`,
respectively. If no functions are specified, the mass flow rate defaults to:

.. math::

\dot m = F(P_1 - P_2)
\dot m = K_v (P_1 - P_2)

if :math:`P_1 > P_2`, or :math:`\dot m = 0` otherwise. It is never possible
for the flow to reverse and go from the downstream to the upstream
reactor/reservoir through a line containing a Valve object.
The pressure difference between upstream (*1*) and downstream (*2*) reservoir
is defined as :math:`P_1 - P_2`. It is never possible for the flow to reverse
and go from the downstream to the upstream reactor/reservoir through a line
containing a :py:class:`Valve` object, which means that the flow rate is set to zero if
:math:`P_1 < P_2`.

Valve objects are often used between an upstream reactor and a downstream
:py:class:`Valve` objects are often used between an upstream reactor and a downstream
reactor or reservoir to maintain them both at nearly the same pressure. By
setting the constant :math:`K_v` to a sufficiently large value, very small
pressure differences will result in flow between the reactors that counteracts
Expand All @@ -351,11 +356,19 @@ to the reactors previously mentioned:

.. math::

\dot m = \max(\dot m_0, 0.0)
\dot m = m_0 g(t)

where :math:`m_0` is a mass flow coefficient and :math:`g` is a function of time
which are set by class property :py:func:`MassFlowController.mass_flow_coeff`
and method :py:func:`MassFlowController.set_time_function`, respectively. If no
function is specified, the mass flow rate defaults to:

.. math::

\dot m = m_0

where :math:`\dot m_0` is either a constant value or a function of time. Note
that if :math:`\dot m_0 < 0`, the mass flow rate will be set to zero, since
reversal of the flow direction is not allowed.
Note that if :math:`\dot m < 0`, the mass flow rate will be set to zero,
since a reversal of the flow direction is not allowed.

Unlike a real mass flow controller, a :py:class:`MassFlowController` object will maintain
the flow even if the downstream pressure is greater than the upstream
Expand All @@ -366,15 +379,28 @@ to the reactors previously mentioned:

- :py:class:`PressureController`: A pressure controller is designed to be used in
conjunction with another 'master' flow controller, typically a
MassFlowController. The master flow controller is installed on the inlet of
:py:class:`MassFlowController`. The master flow controller is installed on the inlet of
the reactor, and the corresponding :py:class:`PressureController` is installed on on
outlet of the reactor. The :py:class:`PressureController` mass flow rate is equal to the
master mass flow rate, plus a small correction dependent on the pressure
difference:

.. math::

\dot m = \dot m_{\mathrm{master}} + K_v(P_1 - P_2).
\dot m = \dot m_{\text{master}} + K_v f(P_1 - P_2)

where :math:`K_v` is a proportionality constant and :math:`f` is a function of
pressure drop :math:`\P_1 - P_2` that are set by class property
:py:func:`PressureController.pressure_coeff` and method
:py:func:`PressureController.set_pressure_function`, respectively. If no
function is specified, the mass flow rate defaults to:

.. math::

\dot m = \dot m_{\text{master}} + K_v (P_1 - P_2)

Note that if :math:`\dot m < 0`, the mass flow rate will be set to zero,
since a reversal of the flow direction is not allowed.

Time Integration
----------------
Expand All @@ -391,7 +417,7 @@ current state of the system, it can be advanced in time by one of the following
:math:`\Delta t_{\mathrm{max}}`. The new time :math:`t_{\mathrm{new}}` is
returned by this function.

- ``advance``\ :math:`(t_{\mathrm{new}})`: This method computes the state of the
- ``advance(``\ :math:`t_{\mathrm{new}}`\ ``)``: This method computes the state of the
system at time :math:`t_{\mathrm{new}}`. :math:`t_{\mathrm{new}}` describes
the absolute time from the initial time of the system. By calling this method
in a for loop for pre-defined times, the state of the system is obtained for
Expand Down