Passing the full parameter vector to evalEqs for each reactor and wall
eliminates the need to re-order the parameter vector. Instead, each reactor and
wall just needs to know the indices of its sensitivity parameters, which are now
returned by ReactorNet::registerSensitivityReaction.
This causes problems to be caught early, where they can at least sometimes be
handled as recoverable intergrator errors, rather than letting NaN values
propagate through the solution.
Adds ReactorNet::reinitialize, which skips all one-time initialization and
re-uses the same CVODES integrator. The Reactor::syncState() method is
introduced for applying new initial conditions for individual Reactor objects.
This approach increases efficiency when solving many similar problems with short
integration times, for example when being used as the chemistry term integrator
in an operator-split CFD code.
This creates a single implementation of the calculation of the contributions of
walls and surface chemistry to the governing equations for all reactor types.
The name 'H' can mean either the species by that name or the entahlpy
of the reactor, in the case of ConstPressureReactor, and the previous
behavior always returned the index of the enthalpy.
This changes the behavior to preferentially return the species, and
adds alternative names for reactor state variables that are less
likely to generate namespace collisions: 'mass', 'volume',
'int_energy', 'enthalpy', 'temperature', 'distance', 'velocity'. The
single character names are still supported.
Resolves Issue 193.
Expanding the time derivative of the total internal energy only works for ideal
phases, so for the more general case it is necessary to keep the internal energy
as the state variable and use an iterative method for setting the state.
This formulation for the reactor's governing equations significantly improves
the performance of integrator, mostly by improving the quality of the
Jacobian. The effect is small for smaller mechanisms (GRI 3.0) but can lead to
order-of-magnitude improvements for mechanisms with hundreds or thousands of
species.
Since this set of variables corresponds to the intrinsic state variables used
for IdealGasPhase objects, we also eliminate the need to iterate when setting
the state of the thermo object.
Additionally, by using temperature as an independent variable, the
temperature-dependent parts of the kinetic rate expressions do not need to be
recomputed while updating the Jacobian (this optimization is not currently
implemented).
The order now matches the order in which the corresponding sensitivity reactions
are added to the ReactorNet, regardless of the order in which Reactors and Walls
are added to the network.
Sensitivity parameter names can be accessed using the "sensitivityParameterName"
method of ReactorNet, and the "sensParamID" methods of Reactor and Wall have
been removed as they no longer meaningful.
Sensitivity analysis requires that the system responds appropriately to small
perturbations in the solution, a condition which is not satisfied when using the
default iterative method implemented by ThermoPhase::setState_UV. Instead, we
now use Newton's method to calculate the mixture temperature to within a small
multiple of machine precision.
These changes make it unnecessary to copy header files around during
the build process, which tends to confuse IDEs and debuggers. The
headers which comprise Cantera's external C++ interface are now in
the 'include' directory.
All of the samples and demos are now in the 'samples' subdirectory.
2012-02-12 02:27:14 +00:00
Renamed from Cantera/src/zeroD/Reactor.cpp (Browse further)