add support for surface chem
This commit is contained in:
parent
af85f4b42a
commit
6144c6dcd9
1 changed files with 29 additions and 4 deletions
|
|
@ -2,23 +2,48 @@
|
|||
#include "Wall.h"
|
||||
#include "ReactorBase.h"
|
||||
#include "Func1.h"
|
||||
#include "../InterfaceKinetics.h"
|
||||
#include "../SurfPhase.h"
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
|
||||
Wall::Wall() : m_left(0), m_right(0), m_area(0.0), m_k(0.0), m_rrth(0.0),
|
||||
m_vf(0), m_qf(0) {}
|
||||
Wall::Wall() : m_left(0), m_right(0),
|
||||
m_area(0.0), m_k(0.0), m_rrth(0.0),
|
||||
m_vf(0), m_qf(0) {
|
||||
for (int n = 0; n < 2; n++) {
|
||||
m_chem[n] = 0;
|
||||
m_surf[n] = 0;
|
||||
m_nsp[n] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool Wall::install(ReactorBase& rleft, ReactorBase& rright) {
|
||||
// check if wall is already installed
|
||||
if (m_left || m_right) return false;
|
||||
m_left = &rleft;
|
||||
m_right = &rright;
|
||||
m_left->addWall(*this, 1);
|
||||
m_right->addWall(*this, -1);
|
||||
m_left->addWall(*this, 0);
|
||||
m_right->addWall(*this, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Wall::setKinetics(Kinetics* left,
|
||||
Kinetics* right) {
|
||||
m_chem[0] = left;
|
||||
m_chem[1] = right;
|
||||
if (left) {
|
||||
m_surf[0] = (SurfPhase*)&left->thermo(left->surfacePhaseIndex());
|
||||
m_nsp[0] = m_surf[0]->nSpecies();
|
||||
}
|
||||
if (right) {
|
||||
m_surf[1] = (SurfPhase*)&right->thermo(right->surfacePhaseIndex());
|
||||
m_nsp[1] = m_surf[1]->nSpecies();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
doublereal Wall::vdot(doublereal t) {
|
||||
double rate1 = m_k * m_area *
|
||||
(m_left->pressure() - m_right->pressure());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue