Simulation¶
- members
-
class
pyteck.simulation.
PressureRiseProfile
(mech_filename, initial_temp, initial_pres, reactants, pressure_rise, time_end)[source]¶ Set the velocity of reactor moving wall via specified pressure rise.
The initialization and calling of this class are handled by the Func1 interface of Cantera.
The approach used here is based on that discussed by Chaos and Dryer, “Chemical-kinetic modeling of ignition delay: Considerations in interpreting shock tube data”, Int J Chem Kinet 2010 42:143-150,
doi:10.1002/kin.20471 <http://dx.doi.org/10.1002/kin.20471
. A time-dependent polytropic state change is emulated by determining volume as a function of time, via a constant linear pressure rise \(A\) (given as a percentage of the initial pressure):\[ \begin{align}\begin{aligned}\begin{split}\frac{dv}{dt} &= -\frac{1}{\gamma} \frac{v(t)}{P(t)} \frac{dP}{dt} \\ v(t) &= \frac{1}{\rho} \left[ \frac{P(t)}{P_0} \right]^{-1 / \gamma}\end{split}\\\begin{split}\frac{dP}{dt} &= A P_0 \\ \therefore P(t) &= P_0 (A t + 1)\end{split}\\\frac{dv}{dt} = -A \frac{1}{\rho \gamma} (A t + 1)^{-1 / \gamma}\end{aligned}\end{align} \]The expression for \(\frac{dv}{dt}\) can then be used directly for the
Wall
velocity.
-
class
pyteck.simulation.
Simulation
(kind, apparatus, meta, properties)[source]¶ Class for ignition delay simulations.
-
class
pyteck.simulation.
VolumeProfile
(volume_history)[source]¶ Set the velocity of reactor moving wall via specified volume profile.
The initialization and calling of this class are handled by the Func1 interface of Cantera.
Based on
VolumeProfile
implemented in Bryan W. Weber’sCanSen
-
pyteck.simulation.
create_volume_history
(mech, temp, pres, reactants, pres_rise, time_end)[source]¶ Constructs a volume profile based on intiial conditions and pressure rise.
- Parameters
- Returns
List of times and volumes
- Return type
list of np.ndarray
-
pyteck.simulation.
first_derivative
(x, y)[source]¶ Evaluates first derivative using second-order finite differences.
Uses (second-order) centeral difference in interior and second-order one-sided difference at boundaries.
- Parameters
x (np.ndarray) – Independent variable array
y (np.ndarray) – Dependent variable array
- Returns
First derivative, \(dy/dx\)
- Return type
np.ndarray
-
pyteck.simulation.
get_ignition_delay
(time, target, target_name, ignition_type)[source]¶ Identify ignition delay based on time, target, and type of detection.