From e5bbb728ad92951ece215b29e44a1baa0dd8db8e Mon Sep 17 00:00:00 2001 From: Sashank Kasiraju Date: Fri, 13 Aug 2021 22:36:27 -0400 Subject: [PATCH 1/2] Update io.cpp Update code in io.cpp to print reaction and species thermodynamics to be printed at reference pressure of 1 bar similar to ChemKIN --- src/io.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/io.cpp b/src/io.cpp index bfd9ae0..3fd2ae8 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -146,10 +146,10 @@ void print_formation_enthalpy(vector> phases, string out { vector hform; ofstream out (output_file); - out << "#Dimensionless formation enthalpies of species (H/RT)\n" << endl; + out << "#Dimensionless formation enthalpies of species (H/RT) at Reference Pressure of 1 bar\n" << endl; for (const auto phase: phases){ hform.resize(phase->nSpecies()); - phase->getEnthalpy_RT(hform.data()); + phase->getEnthalpy_RT_ref(hform.data()); for (size_t k = 0; k < phase->nSpecies(); k++) { out.width(12); out << std::left << phase->speciesName(k); @@ -163,10 +163,10 @@ void print_formation_entropy(vector> phases, string outp { vector sform; ofstream out (output_file); - out << "#Dimensionless formation entropies of species (S/R)\n" << endl; + out << "#Dimensionless formation entropies of species (S/R) at Reference Pressure of 1 bar\n" << endl; for (const auto phase: phases){ sform.resize(phase->nSpecies()); - phase->getEntropy_R(sform.data()); + phase->getEntropy_R_ref(sform.data()); for (size_t k = 0; k < phase->nSpecies(); k++) { out.width(12); out << std::left << phase->speciesName(k); @@ -198,12 +198,12 @@ void print_rxn_enthalpy(vector kinetic_mgrs, doublereal T, string out { vector hrxn; ofstream out (output_file); - out << "#Dimensionless enthalpies of reactions (H/RT)\n" << endl; + out << "#Dimensionless enthalpies of reactions (H/RT) at Reference Pressure 1bar\n" << endl; for (const auto mgr: kinetic_mgrs){ size_t size = mgr->nReactions(); if (size > 0) { hrxn.resize(size); - mgr->getDeltaEnthalpy(hrxn.data()); + mgr->getDeltaSSEnthalpy(hrxn.data()); for (size_t k = 0; k < size; k++) { out.width(16); out << scientific << std::left << hrxn[k]/(GasConstant*T) ; @@ -217,19 +217,24 @@ void print_rxn_enthalpy(vector kinetic_mgrs, doublereal T, string out void print_rxn_entropy(vector kinetic_mgrs, string output_file) { vector sRxn; + vector sRxnRef; ofstream out (output_file); - out << "#Dimensionless entropies of reactions (S/R)\n" << endl; + out << "#Dimensionless entropies of reactions (S/R) at Reactor & Ref. Pressure (1bar)\n" << endl; for (const auto mgr: kinetic_mgrs){ size_t size = mgr->nReactions(); if (size > 0) { sRxn.resize(size); + sRxnRef.resize(size); mgr->getDeltaSSEntropy(sRxn.data()); + mgr->getDeltaRefEntropy(sRxnRef.data()); for (size_t k = 0; k < size; k++) { out.width(16); out << scientific << std::left << sRxn[k]/GasConstant ; out.width(16); + out << scientific << std::left << sRxnRef[k] / GasConstant; out << scientific << std::left << mgr->reactionString(k) << endl; } + } } } @@ -258,18 +263,22 @@ void print_rxn_eq_consts(vector kinetic_mgrs, string output_file) void print_rxn_gibbs(vector kinetic_mgrs, doublereal T, string output_file) { - vector muRxn; + vector muRxn; + vector muRxnRef; ofstream out (output_file); - out << "#Dimensionless Gibbs Energies of reactions (G/RT)\n" << endl; + out << "#Dimensionless Gibbs Energies of reactions (G/RT) at Reactor & Ref. Pressure (1bar)\n" << endl; for (const auto mgr: kinetic_mgrs){ size_t size = mgr->nReactions(); if (size > 0) { muRxn.resize(size); + muRxnRef.resize(size); mgr->getDeltaSSGibbs(muRxn.data()); + mgr->getDeltaRefGibbs(muRxnRef.data()); for (size_t k = 0; k < size; k++) { out.width(16); - out << scientific << std::left << muRxn[k]/(GasConstant*T) ; + out << scientific << std::left << muRxn[k] / (GasConstant*T) ; out.width(16); + out << scientific << std::left << muRxnRef[k] / (GasConstant * T); out << std::left << mgr->reactionString(k) << endl; } } From 9308902bac477a68e28ba10ff78516ea32fcd26b Mon Sep 17 00:00:00 2001 From: Sashank Kasiraju Date: Fri, 13 Aug 2021 22:36:56 -0400 Subject: [PATCH 2/2] Update omkmexceptions.cpp Changed included header file for correct compilation --- src/omkmexceptions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/omkmexceptions.cpp b/src/omkmexceptions.cpp index 36d73cf..8319604 100644 --- a/src/omkmexceptions.cpp +++ b/src/omkmexceptions.cpp @@ -8,7 +8,7 @@ //#include "application.h" #include "cantera/base/global.h" -#include "hctexceptions.h" +#include "omkmexceptions.h" namespace OpenMKM {