Skip to content

Commit

Permalink
[Doc] Introduce some LaTeX macros in Sphinx and fix text subscripts
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Jan 3, 2024
1 parent 554d531 commit 88b19f6
Show file tree
Hide file tree
Showing 18 changed files with 185 additions and 178 deletions.
9 changes: 9 additions & 0 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ def escape_splats(app, what, name, obj, options, lines):

myst_enable_extensions = ["dollarmath", "amsmath", "deflist", "colon_fence"]

mathjax3_config = {
'tex': {
'macros': {
't': ['\\mathrm{#1}', 1],
'pxpy': ['\\frac{\\partial #1}{\\partial #2}', 2]
}
}
}

# Ensure that the primary domain is the Python domain, since we've added the
# MATLAB domain with sphinxcontrib.matlab
primary_domain = 'py'
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/develop/reactor-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ example, using the {py:class}`ExtensibleReactor` class, the governing equations
reactor are written in the form:

$$
\mathrm{LHS}_i \frac{dy_i}{dt} = \mathrm{RHS}_i
\t{LHS}_i \frac{dy_i}{dt} = \t{RHS}_i
$$

where the {ct}`Reactor::eval` method or the `eval()` method of any class derived from
Expand Down
52 changes: 26 additions & 26 deletions doc/sphinx/reference/kinetics/rate-constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ field.
## Falloff Reactions

A falloff reaction is one that has a rate that is first-order in the total concentration
of third-body colliders $\def\MM{[\mathrm{M}]} \MM$ at low pressure, like a
[three-body reaction](sec-three-body-reaction), but becomes zero-order in $\MM$ as $\MM$
increases. Dissociation/association reactions of polyatomic molecules often exhibit this
behavior.
of third-body colliders $[\t{M}]$ at low pressure, like a
[three-body reaction](sec-three-body-reaction), but becomes zero-order in $[\t{M}]$ as
$[\t{M}]$ increases. Dissociation/association reactions of polyatomic molecules often
exhibit this behavior.

The simplest expression for the rate coefficient for a falloff reaction is the Lindemann
form {cite:p}`lindemann1922`:

$$ k_f(T, \MM) = \frac{k_0 \MM}{1 + \frac{k_0 \MM}{k_\infty}} $$
$$ k_f(T, [\t{M}]) = \frac{k_0 [\t{M}]}{1 + \frac{k_0 [\t{M}]}{k_\infty}} $$

In the low-pressure limit, this approaches $k_0 \MM$, and in the high-pressure limit it
approaches $k_\infty$.
In the low-pressure limit, this approaches $k_0 [\t{M}]$, and in the high-pressure limit
it approaches $k_\infty$.

Defining the non-dimensional reduced pressure:

$$ P_r = \frac{k_0 \MM}{k_\infty} $$
$$ P_r = \frac{k_0 [\t{M}]}{k_\infty} $$

The rate constant may be written as

Expand All @@ -67,15 +67,15 @@ A falloff reaction may be defined in the YAML format using the
A widely-used falloff function is the one proposed by {cite:t}`gilbert1983`:

\begin{gather*}
\log_{10} F(T, P_r) = \frac{\log_{10} F_{cent}(T)}{1 + f_1^2} \\
\log_{10} F(T, P_r) = \frac{\log_{10} F_\t{cent}(T)}{1 + f_1^2} \\

F_{cent}(T) = (1-A) \exp(-T/T_3) + A \exp (-T/T_1) + \exp(-T_2/T) \\
F_\t{cent}(T) = (1-A) \exp(-T/T_3) + A \exp (-T/T_1) + \exp(-T_2/T) \\

f_1 = (\log_{10} P_r + C) / (N - 0.14 (\log_{10} P_r + C)) \\

C = -0.4 - 0.67\; \log_{10} F_{cent} \\
C = -0.4 - 0.67\; \log_{10} F_\t{cent} \\

N = 0.75 - 1.27\; \log_{10} F_{cent}
N = 0.75 - 1.27\; \log_{10} F_\t{cent}
\end{gather*}

```{admonition} YAML Usage
Expand All @@ -87,13 +87,13 @@ term of the falloff function is not used.
```

(sec-tsang-falloff)=
### Tsang's Approximation to $F_{cent}$
### Tsang's Approximation to $F_\t{cent}$

Wing Tsang presented approximations for the value of $F_{cent}$ for Troe falloff in
Wing Tsang presented approximations for the value of $F_\t{cent}$ for Troe falloff in
databases of reactions, for example, {cite:t}`tsang1991`. Tsang's approximations are
linear in temperature:

$$ F_{cent} = A + BT $$
$$ F_\t{cent} = A + BT $$

where $A$ and $B$ are constants. The remaining equations for $C$, $N$, $f_1$, and $F$
from the [Troe](sec-troe-falloff) falloff function are not affected.
Expand Down Expand Up @@ -132,11 +132,11 @@ An SRI falloff function may be specified in the YAML format using the
For these reactions, the rate falls off as the pressure increases, due to collisional
stabilization of a reaction intermediate. Example:

$$ \mathrm{Si + SiH_4 (+M) \leftrightarrow Si_2H_2 + H_2 (+M)} $$
$$ \t{Si + SiH_4 (+M) \leftrightarrow Si_2H_2 + H_2 (+M)} $$

which competes with:

$$ \mathrm{Si + SiH_4 (+M) \leftrightarrow Si_2H_4 (+M)} $$
$$ \t{Si + SiH_4 (+M) \leftrightarrow Si_2H_4 (+M)} $$

Like falloff reactions, chemically-activated reactions are described by blending between
a low-pressure and a high-pressure rate expression. The difference is that the forward
Expand Down Expand Up @@ -210,15 +210,15 @@ defining the rate, $\phi_n(x)$ is the Chebyshev polynomial of the first kind of
$n$ evaluated at $x$, and

$$
\tilde{T} \equiv \frac{2T^{-1} - T_\mathrm{min}^{-1} - T_\mathrm{max}^{-1}}
{T_\mathrm{max}^{-1} - T_\mathrm{min}^{-1}}
\tilde{T} \equiv \frac{2T^{-1} - T_\t{min}^{-1} - T_\t{max}^{-1}}
{T_\t{max}^{-1} - T_\t{min}^{-1}}
\tilde{P} \equiv \frac{2 \log P - \log P_\mathrm{min} - \log P_\mathrm{max}}
{\log P_\mathrm{max} - \log P_\mathrm{min}}
\tilde{P} \equiv \frac{2 \log P - \log P_\t{min} - \log P_\t{max}}
{\log P_\t{max} - \log P_\t{min}}
$$

are reduced temperatures and reduced pressures which map the ranges $(T_\mathrm{min},
T_\mathrm{max})$ and $(P_\mathrm{min}, P_\mathrm{max})$ to $(-1, 1)$.
are reduced temperatures and reduced pressures which map the ranges $(T_\t{min},
T_\t{max})$ and $(P_\t{min}, P_\t{max})$ to $(-1, 1)$.

A Chebyshev rate expression is specified in terms of the coefficient matrix $\alpha$ and
the temperature and pressure ranges.
Expand Down Expand Up @@ -284,7 +284,7 @@ Blowers Masel reactions can be defined in the YAML format using the

Heterogeneous reactions on surfaces are represented by an extended Arrhenius- like rate
expression, which combines the modified Arrhenius rate expression with further
corrections dependent on the fractional surface coverages $\theta_{k}$ of one or more
corrections dependent on the fractional surface coverages $\theta_k$ of one or more
surface species. The forward rate constant for a reaction of this type is:

$$
Expand Down Expand Up @@ -329,9 +329,9 @@ for all temperatures.

The sticking coefficient is related to the forward rate constant by the formula:

$$ k_f = \frac{\gamma}{\Gamma_\mathrm{tot}^m} \sqrt{\frac{RT}{2 \pi W}} $$
$$ k_f = \frac{\gamma}{\Gamma_\t{tot}^m} \sqrt{\frac{RT}{2 \pi W}} $$

where $\Gamma_\mathrm{tot}$ is the total molar site density, $m$ is the sum of all the
where $\Gamma_\t{tot}$ is the total molar site density, $m$ is the sum of all the
surface reactant stoichiometric coefficients, and $W$ is the molecular weight of the gas
phase species.

Expand Down
32 changes: 16 additions & 16 deletions doc/sphinx/reference/kinetics/reaction-rates.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ types.
The basic reaction type is a homogeneous reaction with a pressure-independent
rate coefficient and mass action kinetics. For example:

$$ \mathrm{A + B \rightleftharpoons C + D} $$
$$ \t{A + B \rightleftharpoons C + D} $$

The forward reaction rate is then calculated as:

$$ R_f = [\mathrm{A}] [\mathrm{B}] k_f $$
$$ R_f = [\t{A}] [\t{B}] k_f $$

where $k_f$ is the forward rate constant, calculated using one of the available rate
parameterizations such as the [modified Arrhenius](sec-arrhenius-rate) form.
Expand All @@ -32,30 +32,30 @@ reaction type is [`three-body`](sec-yaml-three-body).

A three-body reaction is a gas-phase reaction of the form:

$$ \mathrm{A + B + M \rightleftharpoons AB + M} $$
$$ \t{A + B + M \rightleftharpoons AB + M} $$

Here $\mathrm{M}$ is an unspecified collision partner that carries away excess energy to
stabilize the $\mathrm{AB}$ molecule (forward direction) or supplies energy to break the
$\mathrm{AB}$ bond (reverse direction). In addition to the generic collision partner
$\mathrm{M}$, it is also possible to explicitly specify a colliding species. In both
Here $\t{M}$ is an unspecified collision partner that carries away excess energy to
stabilize the $\t{AB}$ molecule (forward direction) or supplies energy to break the
$\t{AB}$ bond (reverse direction). In addition to the generic collision partner
$\t{M}$, it is also possible to explicitly specify a colliding species. In both
cases, the reaction type can be automatically inferred by Cantera and does not need to
be explicitly specified by the user.

Different species may be more or less effective in acting as the collision partner. A
species that is much lighter than $\mathrm{A}$ and $\mathrm{B}$ may not be able to
species that is much lighter than $\t{A}$ and $\t{B}$ may not be able to
transfer much of its kinetic energy, and so would be inefficient as a collision partner.
On the other hand, a species with a transition from its ground state that is nearly
resonant with one in the $\mathrm{AB^*}$ activated complex may be much more effective at
resonant with one in the $\t{AB^*}$ activated complex may be much more effective at
exchanging energy than would otherwise be expected.

These effects can be accounted for by defining a collision efficiency $\epsilon$ for
each species, defined such that the forward reaction rate is

$$ R_f = [\mathrm{A}][\mathrm{B}][\mathrm{M}]k_f(T) $$
$$ R_f = [\t{A}][\t{B}][\t{M}] k_f(T) $$

where

$$ [\mathrm{M}] = \sum_{k} \epsilon_k C_k $$
$$ [\t{M}] = \sum_{k} \epsilon_k C_k $$

where $C_k$ is the concentration of species $k$. Since any constant collision efficiency
can be absorbed into the rate coefficient $k_f(T)$, the default collision efficiency is
Expand All @@ -70,9 +70,9 @@ Sometimes, accounting for a particular third body's collision efficiency may req
alternate set of rate parameters entirely. In this case, two reactions are written:

$$
\mathrm{A + B + M \rightleftharpoons AB + M \quad (R1)}
\t{A + B + M \rightleftharpoons AB + M \quad (R1)}
\mathrm{A + B + C \rightleftharpoons AB + C \quad (R2)}
\t{A + B + C \rightleftharpoons AB + C \quad (R2)}
$$

where the third-body efficiency for C in the first reaction should be explicitly set to
Expand Down Expand Up @@ -105,14 +105,14 @@ Explicit reaction orders different from the stoichiometric coefficients are some
used for non-elementary reactions. For example, consider the global reaction:

$$
\mathrm{C_8H_{18} + 12.5 O_2 \rightarrow 8 CO_2 + 9 H_2O}
\t{C_8H_{18} + 12.5 O_2 \rightarrow 8 CO_2 + 9 H_2O}
$$

the forward rate constant might be given as {cite:p}`westbrook1981`:

$$
k_f = 4.6 \times 10^{11} [\mathrm{C_8H_{18}}]^{0.25} [\mathrm{O_2}]^{1.5}
\exp\left(\frac{30.0\,\mathrm{kcal/mol}}{RT}\right)
k_f = 4.6 \times 10^{11} [\t{C_8H_{18}}]^{0.25} [\t{O_2}]^{1.5}
\exp\left(\frac{30.0\,\t{kcal/mol}}{RT}\right)
$$

Special care is required in this case since the units of the pre-exponential factor
Expand Down
Loading

0 comments on commit 88b19f6

Please sign in to comment.