38 virtual void resize(
size_t components,
size_t points);
46 bool doElectricField(
size_t j) {
70 virtual void evalResidual(
double* x,
double* rsd,
int* diag,
71 double rdt,
size_t jmin,
size_t jmax);
108 double E(
const double* x,
size_t j)
const {
109 return x[index(c_offset_E, j)];
112 double dEdz(
const double* x,
size_t j)
const {
113 return (
E(x,j)-
E(x,j-1))/(z(j)-z(j-1));
117 double ND(
const double* x,
size_t k,
size_t j)
const {
118 return Avogadro * m_rho[j] * Y(x,k,j) / m_wt[k];
122 double rho_e(
double* x,
size_t j)
const {
123 double chargeDensity = 0.0;
127 return chargeDensity;
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state.
This class models the ion transportation in a flame.
virtual void evalResidual(double *x, double *rsd, int *diag, double rdt, size_t jmin, size_t jmax)
virtual void electricFieldMethod(const double *x, size_t j0, size_t j1)
Solving phase two: the electric field equation is added coupled by the electrical drift.
double E(const double *x, size_t j) const
electric field
vector_fp m_mobi_e_fix
coefficients of polynomial fitting of fixed electron transport profile
vector_fp m_speciesCharge
electrical properties
virtual void setSolvingStage(const size_t phase)
set the solving stage
size_t m_kElectron
index of electron
virtual void frozenIonMethod(const double *x, size_t j0, size_t j1)
Solving phase one: the fluxes of charged species are turned off.
virtual void _finalize(const double *x)
In some cases, a domain may need to set parameters that depend on the initial solution estimate.
double rho_e(double *x, size_t j) const
total charge density
double ND(const double *x, size_t k, size_t j) const
number density
virtual bool componentActive(size_t n) const
Returns true if the specified component is an active part of the solver state.
virtual void resize(size_t components, size_t points)
Change the grid size. Called after grid refinement.
size_t m_stage
solving stage
vector_fp m_mobility
mobility
std::vector< size_t > m_kCharge
index of species with charges
std::vector< size_t > m_kNeutral
index of neutral species
virtual void updateDiffFluxes(const double *x, size_t j0, size_t j1)
Update the diffusive mass fluxes.
bool m_import_electron_transport
flag for importing transport of electron
void fixElectricField(size_t j=npos)
set to fix voltage on a point
virtual void updateTransport(double *x, size_t j0, size_t j1)
Update the transport properties at grid points in the range from j0 to j1, based on solution x.
void solveElectricField(size_t j=npos)
set to solve electric field on a point
std::vector< bool > m_do_electric_field
flag for solving electric field or not
void setElectronTransport(vector_fp &tfix, vector_fp &diff_e, vector_fp &mobi_e)
Sometimes it is desired to carry out the simulation using a specified electron transport profile,...
This class represents 1D flow domains that satisfy the one-dimensional similarity solution for chemic...
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
const double Avogadro
Avogadro's Number [number/kmol].
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const double ElectronCharge
Elementary charge [C].