From 35ac1acfa87c4262931ec7acdd62de2629353550 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Tue, 13 Jun 2017 18:43:57 -0400 Subject: [PATCH] Clarify Valve coefficient vs function --- interfaces/cython/cantera/reactor.pyx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/interfaces/cython/cantera/reactor.pyx b/interfaces/cython/cantera/reactor.pyx index 2e4072c4f1..6f75b1c6b9 100644 --- a/interfaces/cython/cantera/reactor.pyx +++ b/interfaces/cython/cantera/reactor.pyx @@ -732,14 +732,18 @@ cdef class Valve(FlowDevice): .. math:: \dot m = K_v*(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 + where :math:`K_v` is a constant set by the `set_valve_coeff` method. + Note that :math:`P_1` must be greater than :math:`P_2`; otherwise, + :math:`\dot m = 0`. However, an arbitrary function can also be specified, + such that - .. math:: \dot m = F(P_1 - P_2) + .. math:: \dot m = f(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. + where :math:`f` is the arbitrary function that returns the mass flow rate given + a single argument, the pressure differential. See the documentation for the + `set_valve_coeff` method for an example. Note that 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. `Valve` objects are often used between an upstream reactor and a downstream reactor or reservoir to maintain them both at nearly the same @@ -764,8 +768,8 @@ cdef class Valve(FlowDevice): rate [kg/s] given the pressure drop [Pa]. >>> V = Valve(res1, reactor1) - >>> V.set_valve_coeff(1e-4) - >>> V.set_valve_coeff(lambda dP: (1e-5 * dP)**2) + >>> V.set_valve_coeff(1e-4) # Set the value of K to a constant + >>> V.set_valve_coeff(lambda dP: (1e-5 * dP)**2) # Set the value of K to a function """ cdef Func1 f if isinstance(k, _numbers.Real):