Commit graph

94 commits

Author SHA1 Message Date
Ray Speth
f9375e1a09 Use locks/mutexes from the standard library instead of Boost.Thread
This eliminates the need to link against any of the compiled Boost libraries,
and means that we can always build in thread-safe mode
2015-10-17 18:58:50 -04:00
Ray Speth
a03f370cfd Make use of emplace and emplace_back methods 2015-10-14 18:45:23 -04:00
Ray Speth
3f6d8b0aca Use cppformat instead of int2str and fp2str 2015-10-14 18:45:23 -04:00
Ray Speth
2589a27b6c Use range-based for and auto to simplify some loops 2015-10-14 18:45:23 -04:00
Ray Speth
16143b47b6 Replace most uses of sprintf with cppformat 2015-10-14 18:45:22 -04:00
Ray Speth
41527b1ea7 Rename two-argument version of writelog 'debuglog'
This is a prerequisite to allowing writelog to take an arbitrary number
of arguments.
2015-10-14 18:45:22 -04:00
Ray Speth
3d27dfa1a1 [Reactor] Eliminate unused variable ReactorNet::m_iown 2015-10-05 18:48:14 -04:00
Ray Speth
6e138d0ae4 [Reactor] Always check that input/output are finite
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.
2015-08-24 12:27:07 -04:00
Ray Speth
acdf9cf0ed Clean up interstitial whitespace
Remove extra space around operators, between words, etc.
2015-08-02 23:06:16 -04:00
Ray Speth
6a04193646 Fix un-bracketed if, for, and else statements 2015-08-02 23:06:15 -04:00
Ray Speth
e4c45b6429 General whitespace cleanup
Remove unnecessary blank lines and trailing whitespace. Replace tabs with
spaces.
2015-08-02 23:06:15 -04:00
Ray Speth
d8772f261b [Reactor] Cannot add sensitivity reactions to initialized ReactorNet
Before, the attempt to add the reaction was silently ignored. Now, this raises
an exception.
2015-07-21 14:54:13 -04:00
Ray Speth
546289f737 Remove deprecated code with functional alternatives 2015-07-13 18:59:09 -04:00
Ray Speth
d373e0751e Remove unnecessary explicit specification of namespace Cantera 2015-06-24 14:45:55 -04:00
Ray Speth
0590b2cda8 [Reactor] Deprecate possibly-ambiguous names in componentIndex
Resolves #274.
2015-06-22 18:12:05 -04:00
Ray Speth
be24e9daf1 [Reactor] Move reactor contents check into ReactorBase::contents
The check introduced in f6f868fe28 takes place too late, as the pointer to
ReactorBase.m_thermo has already been dereferenced at this point. Most compilers
let this pass, but it is techincally incorrect.
2015-06-18 17:51:46 -04:00
Ray Speth
f6f868fe28 [Reactor] Check for Reactor contents before installing FlowDevice
Fixes #279.
2015-06-18 14:37:54 -04:00
Ray Speth
8d4e9bff6e [Reactor] Make argument to ReactorNet.step optional and deprecated
The value of this argument has almost no effect on the integrator, and
frequently confuses users since the ReactorNet can end up at a time either
greater or less than the specified time. By removing this argument, the
distinction betwen step() and advance(t) becomes much more clear.
2015-06-11 14:03:20 -04:00
Ray Speth
392b0f5692 [Reactor] Do not use argument to step/advance to set the max time step
Allow CVODES to take arbitrarily large timesteps by default. If a maximum time
step is desired, it can be set explicitly.
2015-06-11 14:03:20 -04:00
Ray Speth
0562f18100 [Reactor] Wall coverages may be set using a compositionMap or string 2015-05-02 20:07:45 -04:00
Ray Speth
ab2beb4c64 [Reactor] Check that contents are assigned before starting integration 2015-02-28 00:24:38 +00:00
Ray Speth
2e53890adf Minor cleanup of constructors and destructors 2015-02-26 21:58:42 +00:00
Ray Speth
b8a99b4b83 Remove unnecessary explicit calls to default constructors 2015-01-22 00:04:12 +00:00
Ray Speth
a6a10b854c [Reactor] Add damping factor to setState Newton iteration
This resolves convergence issues in somes cases where the iteration would
oscillate around the true solution.
2014-11-07 02:14:55 +00:00
Ray Speth
002c158761 Cleanup include statements
Move includes from header to implementation files where possible, and remove
unnecessary includes.
2014-08-28 16:54:13 +00:00
Ray Speth
56ccc667df Fix some uninitialized member variables 2014-07-30 16:59:39 +00:00
Ray Speth
884dd36b9c [Reactor] Remove unused reactor connectivity calculation 2014-07-18 15:14:12 +00:00
Ray Speth
1b1703cc56 [Reactor] Remove unused variable ReactorBase::m_init 2014-07-18 15:14:07 +00:00
Ray Speth
6ffbaa5f77 [Reactor] Remove unneeded variables from ReactorBase 2014-06-10 16:23:43 +00:00
Ray Speth
8b5ca80303 [Reactor] Implement reactor network reinitialization
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.
2014-06-10 16:23:03 +00:00
Ray Speth
1437aade8c [Reactor] Refactor updateState and getInitialConditions implementations
Extract common parts related to surface species
2014-06-10 16:22:46 +00:00
Ray Speth
67de2fa793 [Reactor] Refactor re-implementations of Reactor::initialize
The base class methods does almost all the initialization needed for the derived
classes, so call that first and then do any additional steps needed.
2014-06-10 16:22:37 +00:00
Ray Speth
0da063cdef [Reactor] Refactor wall / surface chemistry evaluation
This creates a single implementation of the calculation of the contributions of
walls and surface chemistry to the governing equations for all reactor types.
2014-06-10 16:21:56 +00:00
Ray Speth
a583949457 [Reactor] ReactorNet::addReactor takes a reference instead of a pointer
This reflects how the function is usually used. The old signature is now
deprecated, as is the extra argument for transfering "ownership" to the
ReactorNet object.
2014-06-06 00:17:41 +00:00
Ray Speth
b5396837b2 Make use of std::min, std::max, and clip 2014-06-03 16:52:43 +00:00
Ray Speth
a5d735f047 [Reactor] Disable verbose output by default, even in "debug mode" 2014-06-03 16:52:09 +00:00
Ray Speth
0e9ca0fc4b [Reactor] Eliminate tracking of Reservoirs by ReactorNet
Since Reservoirs don't have any equations to solve, there is no reason to add
them to a ReactorNet.
2014-06-03 16:52:00 +00:00
Ray Speth
2d1003271d [Reactor] Replace ReactorNet::m_size with m_start
A small simplification since the offset into the global solution vector is
usually what we're interested in.
2014-06-03 16:51:47 +00:00
Ray Speth
789574ac80 Remove commented-out code 2014-05-27 02:52:21 +00:00
Ray Speth
4587883d5e Remove try/catch from ReactorNet::evalJacobian
This function isn't actually called by CVODE (which uses its own difference
quotient method for calculating the Jacobian), so the note here isn't correct.
2014-03-28 23:12:17 +00:00
Ray Speth
95eb7ab3ba Remove newline after '::' in member function definitions
This inconsistency makes it hard to directly search the code for a specific
member function definition.
2014-03-24 04:03:09 +00:00
Ray Speth
c7ba8bfb84 Remove abandoned autotools build system 2014-03-04 17:38:53 +00:00
Ray Speth
d516d46f33 Remove unnecessary use of static_cast<int> 2014-01-31 23:15:09 +00:00
Bryan W. Weber
fc2d7e4ce0 [Reactor] Change 'species' to 'component' in context of sensitivities
Change the variable named *species* to be named *component*. This
better matches the utility of this variable, since it can be used to
retrieve any of the state variables. Also, update the corresponding
documentation.
2013-12-16 23:22:04 +00:00
Bryan W. Weber
1a2404aea5 [Reactor] Make default wall area 1.0 m^2
This makes the default consistent with the documentation in the Python
module.

Fixes Issue 194.
2013-12-16 23:21:58 +00:00
Ray Speth
f1b28158bf [Reactor] Fix behavior of componentIndex with ambigous names
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.
2013-12-14 00:18:12 +00:00
Ray Speth
0295f975e0 [Reactor] Refactor handling of sensitivity parameters in evalEqs 2013-07-30 15:57:48 +00:00
Ray Speth
cf0a418027 [Reactor] Fix segfault when requesting sensitivities at t = 0 2013-09-01 00:33:19 +00:00
Ray Speth
615c3124fb [Reactor] Fix sensitivity parameter order for constant pressure reactors
This matches the behavior of Reactor, where the parameter order is
determined by the order of the reactions in the mechanism.
2013-07-30 15:57:37 +00:00
Ray Speth
8a232abc71 [Reactor] Add optimized IdealGasConstPressureReactor class
Like IdealGasReactor, this formulation uses the temperature as a state variable
to improve performance for the common use case of reactors containing ideal gas
mixtures.
2013-07-16 22:09:46 +00:00