Commit graph

48 commits

Author SHA1 Message Date
Ray Speth
8ff82c06ce [Reactor] Add componentName function to ReactorNet and Reactor classes 2016-05-09 22:42:45 -04:00
Ray Speth
cf13b318f4 [Reactor] Implement enthalpy of formation sensitivity analysis 2016-05-08 18:24:14 -04:00
Ray Speth
c7a1a57fbd [Reactor] Eliminate re-ordering of sensitivity parameters
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.
2016-05-01 20:35:34 -04:00
Ray Speth
032bb9c363 [Reactor] Move sensitivity parameter vector into FuncEval
This eliminates the need for class FuncData, and makes it possible to
introduce sensitivity parameters which have a nominal values other than 1.0.
2016-04-19 16:08:52 -04:00
Ray Speth
9ed23a57ab Move non-trivial functions out of header files 2016-04-08 19:13:09 -04:00
Ray Speth
70fe821c19 Deprecate FuncEval::getInitialConditions and related functions 2015-11-06 14:40:48 -05:00
Thomas Fiala
16ab7dff51 [Reactor] Implement functions getState for reactors and reactor networks
These are simpler forms of getInitialConditions.
2015-11-03 14:34:28 -05:00
Ray Speth
0647823ada Replace DATA_PTR macro with calls to data() 2015-10-17 18:58:50 -04:00
Ray Speth
a945ef2c23 Make use of initializer lists where appropriate 2015-10-17 18:58:50 -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
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
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
2e53890adf Minor cleanup of constructors and destructors 2015-02-26 21:58:42 +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
884dd36b9c [Reactor] Remove unused reactor connectivity calculation 2014-07-18 15:14:12 +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
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
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
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
Ray Speth
cf0a418027 [Reactor] Fix segfault when requesting sensitivities at t = 0 2013-09-01 00:33:19 +00:00
Ray Speth
a6614b87bb [Doxygen] Fix some incorrect/missing "@file" commands 2013-06-06 15:32:30 +00:00
Ray Speth
00da5bead5 Remove some dead code 2013-06-03 22:17:19 +00:00
Ray Speth
7da738d238 Re-applied consistent formatting to trunk
Applied using: astyle -n --style=kr --add-brackets --indent=spaces=4
--indent-col1-comments --unpad-paren --pad-header --align-pointer=type
--lineend=linux
2013-02-07 23:40:59 +00:00
Ray Speth
a5b1d1f7f6 [Reactor] Added ability to set the CVODES "MaxErrTestFails" variable
Increasing this value (from the default of 7) will sometimes allow CVODES to
find solutions to problems that previously caused it to fail.
2013-02-07 23:40:40 +00:00
Ray Speth
1e43e4f333 Added a version of writelog which takes the log level as an argument 2012-12-30 00:17:08 +00:00
Ray Speth
fe6b5d3c0b Changed the ordering of Reactor sensitivity coefficients
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.
2012-11-02 20:07:25 +00:00
Ray Speth
3cd3bbef8f Removed some unnecessary "using namespace" directives 2012-10-24 15:45:19 +00:00
Ray Speth
3df93b8f4c Removed some dead code 2012-10-24 15:45:08 +00:00
Ray Speth
c404c31879 Eliminated unnecessary string copying in Reactor / ReactorNet 2012-10-12 20:34:41 +00:00
Ray Speth
dec608b811 Fixed ReactorNet::setInitialTime to actually set the initial integrator time
Removed the optional argument to ReactorNet::initialize so that setInitialTime
is the only interface for setting the integrator start time, and made initialize
protected to make it clear that it does not need to be explicitly called by the
user.
2012-10-10 18:25:12 +00:00
Ray Speth
e168634c72 Translate exceptions into appropriate error codes in cvodes_rhs 2012-08-11 23:58:33 +00:00
Ray Speth
8ea4ae728a Moved a few standard library includes to more local scopes 2012-03-23 22:16:04 +00:00
Ray Speth
2fa2d98171 Exceptions generate less mysterious error messages in a few places 2012-03-05 20:46:46 +00:00
Ray Speth
657ed19371 Fixed warnings related to printf/sprintf 2012-02-28 19:02:00 +00:00
Ray Speth
a310345b9e Updated #includes to reflect new header file locations 2012-02-12 02:44:14 +00:00
Ray Speth
2528df0f75 Reorganized source tree structure
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/ReactorNet.cpp (Browse further)