diff --git a/include/cantera/oneD/IonFlow.h b/include/cantera/oneD/IonFlow.h index 75cf6b1cf..af7a546ce 100644 --- a/include/cantera/oneD/IonFlow.h +++ b/include/cantera/oneD/IonFlow.h @@ -17,10 +17,10 @@ namespace Cantera * The first stage turns off the diffusion of ions due to the fast * diffusion rate of electron without internal electric forces (ambi- * polar diffusion effect). - * + * * The second stage uses charge neutrality model, which assume zero charge - * flux throughout the domain, to calculate drift flux. The drift flux is - * added to the total flux of ions. + * flux throughout the domain, to calculate drift flux. The drift flux is + * added to the total flux of ions. * Reference: * Prager, J., U. Riedel, and J. Warnatz. * "Modeling ion chemistry and charged species diffusion in lean @@ -29,7 +29,7 @@ namespace Cantera * * The third stage evaluates drift flux from electric field calculated from * Poisson's equation, which is solved together with other equations. Poisson's - * equation is coupled because the total charge densities depends on the species' + * equation is coupled because the total charge densities depends on the species' * concentration. * Reference: * Pederson, Timothy, and R. C. Brown. @@ -67,6 +67,20 @@ public: return m_do_velocity[j]; } + /** + * Sometimes it is desired to carry out the simulation using a specified + * electron transport profile, rather than assuming it as a constant (0.4). + * Reference: + * Bisetti, Fabrizio, and Mbark El Morsli. + * "Calculation and analysis of the mobility and diffusion coefficient + * of thermal electrons in methane/air premixed flames." + * Combustion and flame 159.12 (2012): 3518-3521. + * If in the future the class GasTranport is improved, this method may + * be discard. This method specifies this profile. + */ + void setElectronTransport(vector_fp& zfixed, vector_fp& diff_e_fixed, + vector_fp& mobi_e_fixed); + protected: virtual void updateTransport(double* x, size_t j0, size_t j1); virtual void updateDiffFluxes(const double* x, size_t j0, size_t j1); @@ -83,6 +97,12 @@ protected: //! flag for solving the velocity or not std::vector m_do_velocity; + //! flag for importing transport of electron + bool m_import_electron_transport; + + //! flag for overwrite transport of electron or not + bool m_overwrite_eTransport; + //! electrical properties vector_int m_speciesCharge; @@ -92,13 +112,17 @@ protected: //! index of neutral species std::vector m_kNeutral; + //! fixed transport profile of electron + vector_fp m_elecMobility; + vector_fp m_elecDiffCoeff; + //! mobility vector_fp m_mobility; //! solving stage int m_stage; - //! The voltage + //! The voltage double m_inletVoltage; double m_outletVoltage; @@ -111,6 +135,11 @@ protected: //! fixed velocity value vector_fp m_fixedVelocity; + //! fixed electron transport values + vector_fp m_ztfix; + vector_fp m_diff_e_fix; + vector_fp m_mobi_e_fix; + //! The fixed electric potential value at point j double phi_fixed(size_t j) const { return m_fixedElecPoten[j]; @@ -124,7 +153,7 @@ protected: //! electric potential double phi(const double* x, size_t j) const { return x[index(c_offset_P, j)]; - } + } //! electric field double E(const double* x, size_t j) const { diff --git a/src/oneD/IonFlow.cpp b/src/oneD/IonFlow.cpp index 0f7e50388..2bdc3ca78 100644 --- a/src/oneD/IonFlow.cpp +++ b/src/oneD/IonFlow.cpp @@ -16,6 +16,8 @@ namespace Cantera IonFlow::IonFlow(IdealGasPhase* ph, size_t nsp, size_t points) : FreeFlame(ph, nsp, points), + m_import_electron_transport(false), + m_overwrite_eTransport(true), m_stage(1), m_inletVoltage(0.0), m_outletVoltage(0.0), @@ -58,7 +60,7 @@ IonFlow::IonFlow(IdealGasPhase* ph, size_t nsp, size_t points) : } // no bound for electric potential setBounds(c_offset_P, -1.0e20, 1.0e20); - + m_refiner->setActive(c_offset_P, false); m_mobility.resize(m_nsp*m_points); m_do_poisson.resize(m_points,false); @@ -73,6 +75,8 @@ void IonFlow::resize(size_t components, size_t points){ m_do_velocity.resize(m_points,true); m_fixedElecPoten.resize(m_points,0.0); m_fixedVelocity.resize(m_points); + m_elecMobility.resize(m_points); + m_elecDiffCoeff.resize(m_points); } void IonFlow::updateTransport(double* x, size_t j0, size_t j1) @@ -81,12 +85,18 @@ void IonFlow::updateTransport(double* x, size_t j0, size_t j1) for (size_t j = j0; j < j1; j++) { setGasAtMidpoint(x,j); m_trans->getMobilities(&m_mobility[j*m_nsp]); - if (m_kElectron != npos) { - m_mobility[m_kElectron+m_nsp*j] = 0.4; - m_diff[m_kElectron+m_nsp*j] = 0.4*(Boltzmann * T(x,j)) / ElectronCharge; + if (m_overwrite_eTransport && (m_kElectron != npos)) { + if (m_import_electron_transport) { + m_mobility[m_kElectron+m_nsp*j] = m_elecMobility[j]; + m_diff[m_kElectron+m_nsp*j] = m_elecDiffCoeff[j]; + } else { + m_mobility[m_kElectron+m_nsp*j] = 0.4; + m_diff[m_kElectron+m_nsp*j] = 0.4*(Boltzmann * T(x,j)) / ElectronCharge; + } } } } + void IonFlow::updateDiffFluxes(const double* x, size_t j0, size_t j1) { if (m_stage == 1) { @@ -120,7 +130,7 @@ void IonFlow::frozenIonMethod(const double* x, size_t j0, size_t j1) // flux for ions // Set flux to zero to prevent some fast charged species (e.g. electron) - // to run away + // to run away for (size_t k : m_kCharge) { m_flux(k,j) = 0; } @@ -188,7 +198,7 @@ void IonFlow::poissonEqnMethod(const double* x, size_t j0, size_t j1) for (size_t k = 0; k < m_nsp; k++) { m_flux(k,j) = m_wt[k]*(rho*m_diff[k+m_nsp*j]/wtm); m_flux(k,j) *= (X(x,k,j) - X(x,k,j+1))/dz; - sum -= m_flux(k,j); + sum -= m_flux(k,j); } // ambipolar diffusion @@ -196,7 +206,7 @@ void IonFlow::poissonEqnMethod(const double* x, size_t j0, size_t j1) for (size_t k : m_kCharge) { double Yav = 0.5 * (Y(x,k,j) + Y(x,k,j+1)); double drift = rho * Yav * E_ambi - * m_speciesCharge[k] * m_mobility[k+m_nsp*j]; + * m_speciesCharge[k] * m_mobility[k+m_nsp*j]; m_flux(k,j) += drift; } @@ -395,6 +405,15 @@ void IonFlow::fixVelocity(size_t j) } } +void IonFlow::setElectronTransport(vector_fp& zfixed, vector_fp& diff_e_fixed, + vector_fp& mobi_e_fixed) +{ + m_ztfix = zfixed; + m_diff_e_fix = diff_e_fixed; + m_mobi_e_fix = mobi_e_fixed; + m_import_electron_transport = true; +} + void IonFlow::_finalize(const double* x) { FreeFlame::_finalize(x); @@ -420,4 +439,4 @@ void IonFlow::_finalize(const double* x) } } -} \ No newline at end of file +}