Started an ifdef block for intermediate zeroed phases in kinetics objects.
This commit is contained in:
parent
0d33823d9e
commit
3994bb9438
6 changed files with 96 additions and 6 deletions
|
|
@ -795,6 +795,36 @@ namespace Cantera {
|
|||
m_kdata->m_ROP_ok = true;
|
||||
}
|
||||
|
||||
#ifdef KINETICS_WITH_INTERMEDIATE_ZEROED_PHASES
|
||||
//=================================================================================================
|
||||
InterfaceKinetics::adjustRatesForIntermediatePhases() {
|
||||
doublereal sFac = 1.0;
|
||||
|
||||
array_fp& ropf = m_kdata->m_ropf;
|
||||
array_fp& ropr = m_kdata->m_ropr;
|
||||
array_fp& ropnet = m_kdata->m_ropnet;
|
||||
|
||||
getCreatingRates(DATA_PTR(m_speciestmpP));
|
||||
getDestructionRates(DATA_PTR(m_speciestmpD));
|
||||
|
||||
for (iphase = 0; iphase < nphases; iphase++) {
|
||||
if (m_intermediatePhases(iphase)) {
|
||||
for (isp = 0; isp < nspecies; isp++) {
|
||||
if (m_speciesTmpD[ispI] > m_speciesTmpP[I]) {
|
||||
sFac = m_speciesTmpD[ispI]/ m_speciesTmpP[I];
|
||||
}
|
||||
// Loop over reactions that are reactants for the species in the phase
|
||||
// reducing their rates.
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
//=================================================================================================
|
||||
//=================================================================================================
|
||||
/*
|
||||
*
|
||||
|
|
@ -1303,7 +1333,7 @@ namespace Cantera {
|
|||
|
||||
m_finalized = true;
|
||||
}
|
||||
|
||||
//================================================================================================
|
||||
doublereal InterfaceKinetics::electrochem_beta(int irxn) const{
|
||||
int n = m_ctrxn.size();
|
||||
for (int i = 0; i < n; i++) {
|
||||
|
|
@ -1314,7 +1344,7 @@ namespace Cantera {
|
|||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
//================================================================================================
|
||||
bool InterfaceKinetics::ready() const {
|
||||
return (m_finalized);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -783,6 +783,7 @@ namespace Cantera {
|
|||
//! Vector of raw activation energies for the reactions
|
||||
/*!
|
||||
* units are in Kelvin
|
||||
* Length is number of reactions.
|
||||
*/
|
||||
vector_fp m_E;
|
||||
|
||||
|
|
@ -896,6 +897,36 @@ namespace Cantera {
|
|||
*/
|
||||
std::vector<bool *> m_rxnPhaseIsProduct;
|
||||
|
||||
#ifdef KINETICS_WITH_INTERMEDIATE_ZEROED_PHASES
|
||||
//! Vector of ints indicating whether zeroed phase is an intermediate for
|
||||
//! the formation of another phase
|
||||
/*!
|
||||
* If a phase is zeroed out but it is an intermediate, then the phase
|
||||
* can be formed whether it is stable or not, but the destruction rate of
|
||||
* species in that phase can't exceed the formation rate for species in that
|
||||
* phase.
|
||||
*
|
||||
* length = number of phases in the object
|
||||
* By default all phases are not intermediates
|
||||
*/
|
||||
std::vector<int> m_phaseIsIntermediate;
|
||||
int m_numIntermediatePhases;
|
||||
|
||||
//! Reaction rate reduction factor for intermediates
|
||||
/*!
|
||||
* Individual reaction rates are reduced to accommodate the requirements of intermediate
|
||||
* zero phases.
|
||||
*
|
||||
* length = number of reactions in the object
|
||||
* By default all phases are not intermediates
|
||||
*/
|
||||
std::vector<doublereal> m_rxnRateFactorPhaseIntermediates;
|
||||
|
||||
//! Work vector having length number of species
|
||||
std::vector<doublereal> m_speciesTmpP;
|
||||
std::vector<doublereal> m_speciesTmpD;
|
||||
#endif
|
||||
|
||||
int m_ioFlag;
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -189,6 +189,10 @@ typedef int ftnlen; // Fortran hidden string length type
|
|||
// accessed by specifying the solver=2 option
|
||||
#undef WITH_VCSNONIDEAL
|
||||
|
||||
// Enable intermediate zeroed phases to be included in the
|
||||
// interfacial kinetics operator
|
||||
#undef KINETICS_WITH_INTERMEDIATE_ZEROED_PHASES
|
||||
|
||||
//-------------- Optional Cantera Capabilities ----------------------
|
||||
|
||||
// Enable sensitivity analysis via changing H298 directly
|
||||
|
|
|
|||
20
configure
vendored
20
configure
vendored
|
|
@ -308,7 +308,7 @@ ac_includes_default="\
|
|||
# include <unistd.h>
|
||||
#endif"
|
||||
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BITCOMPILE BITHARDWARE BITCHANGE ldemulationarg CVF_LIBDIR USE_CLIB_DLL local_inst local_python_inst python_prefix python_win_prefix ctversion homedir ct_libdir ct_bindir ct_incdir ct_incroot ct_datadir ct_demodir ct_templdir ct_tutdir ct_docdir ct_dir ct_mandir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os username ctroot buildinc buildlib buildbin MAKE GRAPHVIZDIR ARCHIVE DO_RANLIB RANLIB CXX_DEPENDS USERDIR INCL_USER_CODE CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT use_sundials CVODE_LIBS IDA_LIBS sundials_include sundials_lib_dir sundials_lib sundials_lib_dep CANTERA_DEBUG_MODE COMPILE_PURE_FLUIDS phase_object_files phase_header_files COMPILE_IDEAL_SOLUTIONS COMPILE_ELECTROLYTES NEED_CATHERMO COMPILE_KINETICS COMPILE_HETEROKIN COMPILE_RXNPATH WITH_REACTORS KERNEL KERNEL_OBJ BUILD_CK LIB_DIR COMPILE_VCSNONIDEAL COMPILE_H298MODIFY_CAPABILITY BOOST_INCLUDE BOOST_LIB PURIFY build_lapack build_blas BLAS_LAPACK_LIBS BLAS_LAPACK_LINK BLAS_LAPACK_DIR build_with_f2c build_f2c_lib F2C_SYSTEMLIB BOOST_LIB_DIR LOCAL_LIB_DIRS LOCAL_LIBS LOCAL_LIBS_DEP INSTALL_LIBS_DEP RAW_LIBS_DEP CANTERA_CORE_LIBS CANTERA_CORE_LIBS_DEP CT_SHARED_LIB PYTHON_CMD BUILD_PYTHON NUMPY_INC_DIR NUMPY_HOME NUMARRAY_INC_DIR NUMARRAY_HOME CANTERA_PYTHON_HOME CVSTAG MATLAB_CMD BUILD_MATLAB BUILD_CLIB export_name PIC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CC CFLAGS ac_ct_CC CXXCPP EGREP SOEXT SHARED CXX_INCLUDES LCXX_FLAGS LCXX_END_LIBS HAVE_STRIPSYMBOLS F77 FFLAGS ac_ct_F77 FLIBS F90 BUILD_F90 F90FLAGS F90BUILDFLAGS F90LIBS LCXX_FLIBS precompile_headers OS_IS_DARWIN OS_IS_WIN OS_IS_CYGWIN SHARED_CTLIB mex_ext F77_EXT CXX_EXT OBJ_EXT EXE_EXT math_libs SO LDSHARED EXTRA_LINK TSCOMPARE_abs INSTALL_abs INSTALL_VERBOSE LIBOBJS LTLIBOBJS'
|
||||
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS BITCOMPILE BITHARDWARE BITCHANGE ldemulationarg CVF_LIBDIR USE_CLIB_DLL local_inst local_python_inst python_prefix python_win_prefix ctversion homedir ct_libdir ct_bindir ct_incdir ct_incroot ct_datadir ct_demodir ct_templdir ct_tutdir ct_docdir ct_dir ct_mandir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os username ctroot buildinc buildlib buildbin MAKE GRAPHVIZDIR ARCHIVE DO_RANLIB RANLIB CXX_DEPENDS USERDIR INCL_USER_CODE CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT use_sundials CVODE_LIBS IDA_LIBS sundials_include sundials_lib_dir sundials_lib sundials_lib_dep CANTERA_DEBUG_MODE COMPILE_PURE_FLUIDS phase_object_files phase_header_files COMPILE_IDEAL_SOLUTIONS COMPILE_ELECTROLYTES NEED_CATHERMO COMPILE_KINETICS COMPILE_HETEROKIN COMPILE_RXNPATH WITH_REACTORS KERNEL KERNEL_OBJ BUILD_CK LIB_DIR COMPILE_VCSNONIDEAL COMPILE_H298MODIFY_CAPABILITY COMPILE_INTERMEDIATE_ZEROED_KINETICS BOOST_INCLUDE BOOST_LIB PURIFY build_lapack build_blas BLAS_LAPACK_LIBS BLAS_LAPACK_LINK BLAS_LAPACK_DIR build_with_f2c build_f2c_lib F2C_SYSTEMLIB BOOST_LIB_DIR LOCAL_LIB_DIRS LOCAL_LIBS LOCAL_LIBS_DEP INSTALL_LIBS_DEP RAW_LIBS_DEP CANTERA_CORE_LIBS CANTERA_CORE_LIBS_DEP CT_SHARED_LIB PYTHON_CMD BUILD_PYTHON NUMPY_INC_DIR NUMPY_HOME NUMARRAY_INC_DIR NUMARRAY_HOME CANTERA_PYTHON_HOME CVSTAG MATLAB_CMD BUILD_MATLAB BUILD_CLIB export_name PIC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CC CFLAGS ac_ct_CC CXXCPP EGREP SOEXT SHARED CXX_INCLUDES LCXX_FLAGS LCXX_END_LIBS HAVE_STRIPSYMBOLS F77 FFLAGS ac_ct_F77 FLIBS F90 BUILD_F90 F90FLAGS F90BUILDFLAGS F90LIBS LCXX_FLIBS precompile_headers OS_IS_DARWIN OS_IS_WIN OS_IS_CYGWIN SHARED_CTLIB mex_ext F77_EXT CXX_EXT OBJ_EXT EXE_EXT math_libs SO LDSHARED EXTRA_LINK TSCOMPARE_abs INSTALL_abs INSTALL_VERBOSE LIBOBJS LTLIBOBJS'
|
||||
ac_subst_files=''
|
||||
|
||||
# Initialize some variables set by options.
|
||||
|
|
@ -2749,6 +2749,17 @@ fi
|
|||
|
||||
|
||||
|
||||
COMPILE_INTERMEDIATE_ZEROED_KINETICS=0
|
||||
if test "$KINETICS_WITH_INTERMEDIATE_ZEROED_KINETICS" = "y"; then
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define KINETICS_WITH_INTERMEDIATE_ZEROED_KINETICS 1
|
||||
_ACEOF
|
||||
|
||||
COMPILE_INTERMEDIATE_ZEROED_KINETICS=1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test "$WITH_HTML_LOG_FILES" = "y"; then
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define WITH_HTML_LOGS 1
|
||||
|
|
@ -10047,7 +10058,7 @@ fi
|
|||
|
||||
|
||||
# Provide some information about the compiler.
|
||||
echo "$as_me:10050:" \
|
||||
echo "$as_me:10061:" \
|
||||
"checking for Fortran 77 compiler version" >&5
|
||||
ac_compiler=`set X $ac_compile; echo $2`
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
|
||||
|
|
@ -10254,7 +10265,7 @@ _ACEOF
|
|||
# flags.
|
||||
ac_save_FFLAGS=$FFLAGS
|
||||
FFLAGS="$FFLAGS $ac_verb"
|
||||
(eval echo $as_me:10257: \"$ac_link\") >&5
|
||||
(eval echo $as_me:10268: \"$ac_link\") >&5
|
||||
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
|
||||
echo "$ac_f77_v_output" >&5
|
||||
FFLAGS=$ac_save_FFLAGS
|
||||
|
|
@ -10332,7 +10343,7 @@ _ACEOF
|
|||
# flags.
|
||||
ac_save_FFLAGS=$FFLAGS
|
||||
FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
|
||||
(eval echo $as_me:10335: \"$ac_link\") >&5
|
||||
(eval echo $as_me:10346: \"$ac_link\") >&5
|
||||
ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
|
||||
echo "$ac_f77_v_output" >&5
|
||||
FFLAGS=$ac_save_FFLAGS
|
||||
|
|
@ -11635,6 +11646,7 @@ s,@BUILD_CK@,$BUILD_CK,;t t
|
|||
s,@LIB_DIR@,$LIB_DIR,;t t
|
||||
s,@COMPILE_VCSNONIDEAL@,$COMPILE_VCSNONIDEAL,;t t
|
||||
s,@COMPILE_H298MODIFY_CAPABILITY@,$COMPILE_H298MODIFY_CAPABILITY,;t t
|
||||
s,@COMPILE_INTERMEDIATE_ZEROED_KINETICS@,$COMPILE_INTERMEDIATE_ZEROED_KINETICS,;t t
|
||||
s,@BOOST_INCLUDE@,$BOOST_INCLUDE,;t t
|
||||
s,@BOOST_LIB@,$BOOST_LIB,;t t
|
||||
s,@PURIFY@,$PURIFY,;t t
|
||||
|
|
|
|||
|
|
@ -617,6 +617,14 @@ fi
|
|||
AC_SUBST(COMPILE_H298MODIFY_CAPABILITY)
|
||||
|
||||
|
||||
COMPILE_INTERMEDIATE_ZEROED_KINETICS=0
|
||||
if test "$KINETICS_WITH_INTERMEDIATE_ZEROED_KINETICS" = "y"; then
|
||||
AC_DEFINE(KINETICS_WITH_INTERMEDIATE_ZEROED_KINETICS)
|
||||
COMPILE_INTERMEDIATE_ZEROED_KINETICS=1
|
||||
fi
|
||||
AC_SUBST(COMPILE_INTERMEDIATE_ZEROED_KINETICS)
|
||||
|
||||
|
||||
if test "$WITH_HTML_LOG_FILES" = "y"; then
|
||||
AC_DEFINE(WITH_HTML_LOGS)
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -238,6 +238,11 @@ WITH_PRIME=${WITH_PRIME:="n"}
|
|||
# to have a value of "y"
|
||||
WITH_H298MODIFY_CAPABILITY=${WITH_H298MODIFY_CAPABILITY:="n"}
|
||||
|
||||
# Capability in the planning and implementation stage
|
||||
# Phases may be intermediates but actually have zero mole numbers
|
||||
# in the InterfacialKinetics object
|
||||
KINETICS_WITH_INTERMEDIATE_ZEROED_PHASES=${KINETICS_WITH_INTERMEDIATE_ZEROED_PHASES:="n'}
|
||||
|
||||
######################################################################
|
||||
# if set to 'y', the ck2cti program that converts Chemkin input files
|
||||
# to Cantera format will be built. If you don't use Chemkin format
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue