*** empty log message ***

This commit is contained in:
Dave Goodwin 2008-01-09 13:43:26 +00:00
parent 13cb81dc54
commit a22145b832
14 changed files with 3822 additions and 103 deletions

View file

@ -3,7 +3,7 @@ PROJECT (Cantera)
#----------------------------
# user-configurable settings
#----------------------------
INCLUDE (config.cmake)
#INCLUDE (config.cmake)
#operating system
@ -19,8 +19,6 @@ else (PYTHON_CMD STREQUAL "default")
SET( PYTHON_EXE ${PYTHON_CMD} )
endif (PYTHON_CMD STREQUAL "default")
INCLUDE(cmake/thermo.cmake)
INCLUDE(cmake/fortran.cmake)
# configuration

View file

@ -1,9 +1,5 @@
add_subdirectory(src)
add_subdirectory(clib)
add_subdirectory(fortran)
if (BUILD_F90_INTERFACE)
add_subdirectory(fortran)
endif (BUILD_F90_INTERFACE)
if (BUILD_MATLAB_TOOLBOX)
add_subdirectory(matlab)
endif (BUILD_MATLAB_TOOLBOX)

View file

@ -3,19 +3,21 @@
* Declaration and Definition for the class Interface, part of
* Cantera's Cantera_CXX namespace.
*/
/*
* $Id$
*/
#ifndef CXX_INTERFACE
#define CXX_INTERFACE
#include <string>
#include "Cantera.h"
#include "thermo.h"
#include "kernel/SurfPhase.h"
#include "kernel/InterfaceKinetics.h"
#include "kernel/importKinetics.h"
#include "kinetics.h"
// #include "kernel/SurfPhase.h"
// #include "kernel/InterfaceKinetics.h"
// #include "kernel/importKinetics.h"
/**
* This namespace is used for the Cantera C++ user interface.
@ -23,12 +25,12 @@
namespace Cantera_CXX {
/**
* An interface between multiple bulk phases. This class is defined
* mostly for convenience. It inherits both from Cantera::SurfPhase
* and Cantera::InterfaceKinetics. It therefore represents a
* surface phase, and also acts as the kinetics manager to manage
* reaction occurring on the surface, possibly involving species
* from other phases.
* An interface between multiple bulk phases. This class is
* defined mostly for convenience. It inherits both from
* Cantera::SurfPhase and Cantera::InterfaceKinetics. It therefore
* represents a surface phase, and also acts as the kinetics
* manager to manage reaction occurring on the surface, possibly
* involving species from other phases.
*/
class Interface :
public Cantera::SurfPhase,
@ -48,7 +50,6 @@ namespace Cantera_CXX {
Interface(std::string infile, std::string id,
std::vector<Cantera::ThermoPhase*> phases)
: m_ok(false), m_r(0) {
m_r = Cantera::get_XML_File(infile);
if (id == "-") id = "";

View file

@ -11,5 +11,7 @@
#include "kernel/ThermoFactory.h"
#include "importPhase.h"
#include "kernel/SurfPhase.h"
#include "kernel/EdgePhase.h"
#endif

View file

@ -1,2 +1,4 @@
add_subdirectory(base)
add_subdirectory(thermo)

View file

@ -37,17 +37,17 @@ namespace Cantera {
void GRI_30_Kinetics::
gri30_update_rates_T() {
doublereal T = thermo().temperature();
if (fabs(T - m_kdata->m_temp) > m_dt_threshold) {
doublereal logT = log(T);
m_kdata->m_logc_ref = m_kdata->m_logp_ref - logT;
update_rates(T, logT, &m_kdata->m_rfn[0]);
m_falloff_low_rates.update(T, logT, &m_kdata->m_rfn_low[0]);
m_falloff_high_rates.update(T, logT, &m_kdata->m_rfn_high[0]);
m_falloffn.updateTemp(T, &m_kdata->falloff_work[0]);
m_kdata->m_temp = T;
gri30_updateKc();
m_kdata->m_ROP_ok = false;
}
//if (fabs(T - m_kdata->m_temp) > m_dt_threshold) {
doublereal logT = log(T);
m_kdata->m_logc_ref = m_kdata->m_logp_ref - logT;
update_rates(T, logT, &m_kdata->m_rfn[0]);
m_falloff_low_rates.update(T, logT, &m_kdata->m_rfn_low[0]);
m_falloff_high_rates.update(T, logT, &m_kdata->m_rfn_high[0]);
m_falloffn.updateTemp(T, &m_kdata->falloff_work[0]);
m_kdata->m_temp = T;
gri30_updateKc();
m_kdata->m_ROP_ok = false;
//}
};

View file

@ -38,7 +38,6 @@ namespace Cantera {
Kinetics(),
m_kk(0),
m_nfall(0),
m_dt_threshold(0.0), // 1.e-6),
m_nirrev(0),
m_nrev(0),
m_finalized(false)
@ -49,8 +48,8 @@ namespace Cantera {
m_rxnstoich = new ReactionStoichMgr;
}
GasKinetics::
~GasKinetics() {delete m_kdata; delete m_rxnstoich;}
GasKinetics::
~GasKinetics() {delete m_kdata; delete m_rxnstoich;}
/**
* Update temperature-dependent portions of reaction rates and
@ -66,17 +65,16 @@ namespace Cantera {
_update_rates_T() {
doublereal T = thermo().temperature();
m_kdata->m_logStandConc = log(thermo().standardConcentration());
if (fabs(T - m_kdata->m_temp) > 0.0) { // m_dt_threshold) {
doublereal logT = log(T);
//m_kdata->m_logp0 - logT;
m_rates.update(T, logT, &m_kdata->m_rfn[0]);
m_falloff_low_rates.update(T, logT, &m_kdata->m_rfn_low[0]);
m_falloff_high_rates.update(T, logT, &m_kdata->m_rfn_high[0]);
m_falloffn.updateTemp(T, &m_kdata->falloff_work[0]);
m_kdata->m_temp = T;
updateKc();
m_kdata->m_ROP_ok = false;
}
//if (fabs(T - m_kdata->m_temp) > 0.0) {
doublereal logT = log(T);
m_rates.update(T, logT, &m_kdata->m_rfn[0]);
m_falloff_low_rates.update(T, logT, &m_kdata->m_rfn_low[0]);
m_falloff_high_rates.update(T, logT, &m_kdata->m_rfn_high[0]);
m_falloffn.updateTemp(T, &m_kdata->falloff_work[0]);
m_kdata->m_temp = T;
updateKc();
m_kdata->m_ROP_ok = false;
//}
};

View file

@ -60,11 +60,11 @@ namespace Cantera {
bool m_ROP_ok;
doublereal m_temp;
vector_fp m_rfn;
vector_fp falloff_work;
vector_fp concm_3b_values;
vector_fp concm_falloff_values;
vector_fp m_rkcn;
array_fp m_rfn;
array_fp falloff_work;
array_fp concm_3b_values;
array_fp concm_falloff_values;
array_fp m_rkcn;
};
@ -78,8 +78,9 @@ namespace Cantera {
class GasKinetics : public Kinetics {
public:
/**
* @name Constructors and General Information about Mechanism
* @name Constructors and General Information
*/
//@{
/// Constructor.
@ -113,6 +114,7 @@ namespace Cantera {
updateROP();
std::copy(m_kdata->m_ropf.begin(), m_kdata->m_ropf.end(), fwdROP);
}
/**
* Reverse rates of progress.
* Return the reverse rates of progress in array revROP, which
@ -123,6 +125,7 @@ namespace Cantera {
updateROP();
std::copy(m_kdata->m_ropr.begin(), m_kdata->m_ropr.end(), revROP);
}
/**
* Net rates of progress. Return the net (forward - reverse)
* rates of progress in array netROP, which must be
@ -144,27 +147,24 @@ namespace Cantera {
virtual void getEquilibriumConstants(doublereal* kc);
/**
* Return the vector of values for the reaction gibbs free energy
* Return the array of values for the reaction gibbs free energy
* change.
* These values depend upon the concentration
* of the solution.
* These values depend on the species concentrations.
*
* units = J kmol-1
*/
virtual void getDeltaGibbs( doublereal* deltaG);
/**
* Return the vector of values for the reactions change in
* enthalpy.
* These values depend upon the concentration
* of the solution.
* Return the array of values for the reaction enthalpy change.
* These values depend upon the species concentrations.
*
* units = J kmol-1
*/
virtual void getDeltaEnthalpy( doublereal* deltaH);
/**
* Return the vector of values for the reactions change in
* Return the array of values for the reactions change in
* entropy.
* These values depend upon the concentration
* of the solution.
@ -174,19 +174,19 @@ namespace Cantera {
virtual void getDeltaEntropy(doublereal* deltaS);
/**
* Return the vector of values for the reaction
* standard state gibbs free energy change.
* These values don't depend upon the concentration
* of the solution.
* Return the array of values for the reaction
* standard state Gibbs free energy change.
* These values do not depend on the species
* concentrations.
*
* units = J kmol-1
*/
virtual void getDeltaSSGibbs(doublereal* deltaG);
/**
* Return the vector of values for the change in the
* Return the array of values for the change in the
* standard state enthalpies of reaction.
* These values don't depend upon the concentration
* These values do not depend upon the concentration
* of the solution.
*
* units = J kmol-1
@ -194,9 +194,9 @@ namespace Cantera {
virtual void getDeltaSSEnthalpy(doublereal* deltaH);
/**
* Return the vector of values for the change in the
* Return the array of values for the change in the
* standard state entropies for each reaction.
* These values don't depend upon the concentration
* These values do not depend upon the concentration
* of the solution.
*
* units = J kmol-1 Kelvin-1
@ -216,7 +216,7 @@ namespace Cantera {
* wdot, which must be dimensioned at least as large as the
* total number of species.
*
* @param net Vector of species production rates.
* @param net Array of species production rates.
* units kmol m-3 s-1
*/
virtual void getNetProductionRates(doublereal* net) {
@ -314,19 +314,10 @@ namespace Cantera {
*/
//@{
/**
* Set delta T threshold for updating temperature-dependent
* rates.
*/
void setRateUpdateThreshold(doublereal dt) {
m_dt_threshold = dt;
}
virtual void init();
/// Add a reaction to the mechanism.
void addReaction(const ReactionData& r);
virtual void addReaction(const ReactionData& r);
virtual void finalize();
virtual bool ready() const;
@ -352,8 +343,7 @@ namespace Cantera {
int m_kk, m_nfall;
vector_int m_fallindx;
doublereal m_dt_threshold;
array_int m_fallindx;
Rate1<Arrhenius> m_falloff_low_rates;
Rate1<Arrhenius> m_falloff_high_rates;
@ -389,16 +379,16 @@ namespace Cantera {
* to account for the fact that we can have real-valued
* stoichiometries.
*/
vector_fp m_dn;
vector_int m_revindex;
array_fp m_dn;
array_int m_revindex;
std::vector<std::string> m_rxneqn;
GasKineticsData* m_kdata;
vector_fp m_conc;
array_fp m_conc;
void processFalloffReactions();
vector_fp m_grt;
array_fp m_grt;
private:

View file

@ -780,7 +780,7 @@ namespace Cantera {
* Add a single reaction to the mechanism. This routine
* must be called after init() and before finalize().
*
* @param r Reference to the ReactionRate object for the reaction
* @param r Reference to the ReactionData object for the reaction
* to be added.
*/
virtual void addReaction(const ReactionData& r) {

View file

@ -1,10 +1,9 @@
SET (CTTHERMO_SRCS State.cpp Elements.cpp Constituents.cpp Phase.cpp
SET (THERMO_SRCS State.cpp Elements.cpp Constituents.cpp Phase.cpp
ThermoPhase.cpp IdealGasPhase.cpp ConstDensityThermo.cpp
SpeciesThermoFactory.cpp ConstCpPoly.cpp
SpeciesThermoFactory.cpp ConstCpPoly.cpp Nasa9Poly1.cpp
Nasa9PolyMultiTempRegion.cpp
Mu0Poly.cpp GeneralSpeciesThermo.cpp SurfPhase.cpp
ThermoFactory.cpp phasereport.cpp StoichSubstance.cpp
PureFluidPhase.cpp LatticeSolidPhase.cpp LatticePhase.cpp)
INCLUDE_DIRECTORIES (../base)
ADD_LIBRARY(ctthermo ${CTTHERMO_SRCS})
ThermoFactory.cpp phasereport.cpp SemiconductorPhase.cpp
StoichSubstance.cpp PureFluidPhase.cpp LatticeSolidPhase.cpp
LatticePhase.cpp)
ADD_LIBRARY(thermo ${THERMO_SRCS})

View file

@ -24,7 +24,6 @@
#include <boost/thread/mutex.hpp>
#endif
//#include "SpeciesThermoFactory.h"
#include "FactoryBase.h"
namespace Cantera {

3734
ChangeLog

File diff suppressed because it is too large Load diff

View file

@ -10,7 +10,7 @@
</thermo>
<elementArray datasrc="elements.xml"> O H C</elementArray>
<speciesArray datasrc="#surf_species_data">
surf-* surf-H
surf_site surf_H
</speciesArray>
<reactionArray datasrc="#surf_rxn_data">
</reactionArray>
@ -25,7 +25,7 @@
<speciesData id="surf_species_data">
<species name="surf-*">
<species name="surf_site">
<note>open site</note>
<atomArray> </atomArray>
<thermo>
@ -46,7 +46,7 @@
</thermo>
</species>
<species name="surf-H">
<species name="surf_H">
<note>surface H</note>
<atomArray> H:1 </atomArray>
<thermo>
@ -74,9 +74,9 @@
<!-- reaction 1 -->
<reaction id="surf_rxn_1" reversible="yes">
<equation>H + surf-H [=] H2 + surf-*</equation>
<reactants> H:1 surf-H:1 </reactants>
<products>H2:1 surf-*:1 </products>
<equation>H + surf_H [=] H2 + surf_site</equation>
<reactants> H:1 surf_H:1 </reactants>
<products>H2:1 surf_site:1 </products>
<rateCoeff>
<Arrhenius>
<A units="cm3/mol/s">1.0E14</A>

View file

@ -5,10 +5,13 @@
* site fractions.
*/
#include "Cantera.h"
#include <iostream>
#include "IdealGasMix.h"
#include "Interface.h"
using namespace Cantera;
using namespace Cantera_CXX;
using namespace std;
using namespace Cantera_CXX;
@ -30,7 +33,8 @@ int main() {
surf.getNetProductionRates(DATA_PTR(wdot));
int k;
for (k = 0; k < gas.nSpecies(); k++)
cout << gas.speciesName(k) << " " << wdot[k] << endl;
cout << gas.speciesName(k) << " " << wdot[k] << endl;
for (k = 0; k < surf.nSpecies(); k++)
cout << surf.speciesName(k) << " "
<< wdot[k+gas.nSpecies()] << endl;