MCPcopy Create free account
hub / github.com/Cantera/cantera / calculateDistributionFunction

Method calculateDistributionFunction

src/thermo/EEDFTwoTermApproximation.cpp:46–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46int EEDFTwoTermApproximation::calculateDistributionFunction()
47{
48 if (m_first_call) {
49 initSpeciesIndexCrossSections();
50 m_first_call = false;
51 }
52
53 updateMoleFractions();
54 updateCrossSections();
55
56 if (!m_has_EEDF) {
57 writelog("No existing EEDF. Using first guess method: {}\n", m_firstguess);
58 if (m_firstguess == "maxwell") {
59 writelog("First guess EEDF maxwell\n");
60 for (size_t j = 0; j < m_points; j++) {
61 m_f0(j) = 2.0 * pow(1.0 / Pi, 0.5) * pow(m_init_kTe, -3. / 2.) *
62 exp(-m_gridCenter[j] / m_init_kTe);
63 }
64 } else {
65 throw CanteraError("EEDFTwoTermApproximation::calculateDistributionFunction",
66 " unknown EEDF first guess");
67 }
68 }
69
70 converge(m_f0);
71
72 // write the EEDF at grid edges
73 vector<double> f(m_f0.data(), m_f0.data() + m_f0.rows() * m_f0.cols());
74 vector<double> x(m_gridCenter.data(), m_gridCenter.data() + m_gridCenter.rows() * m_gridCenter.cols());
75 for (size_t i = 0; i < m_points + 1; i++) {
76 m_f0_edge[i] = linearInterp(m_gridEdge[i], x, f);
77 }
78
79 m_has_EEDF = true;
80
81 // update electron mobility
82 m_electronMobility = electronMobility(m_f0);
83 return 0;
84}
85
86void EEDFTwoTermApproximation::converge(Eigen::VectorXd& f0)
87{

Callers 1

Calls 3

writelogFunction · 0.85
CanteraErrorClass · 0.85
linearInterpFunction · 0.85

Tested by

no test coverage detected