Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/thermo/PlasmaPhase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ void PlasmaPhase::updateElectronEnergyDistribution()
} else if (m_distributionType == "isotropic") {
setIsotropicElectronEnergyDistribution();
} else if (m_distributionType == "Boltzmann-two-term") {
if (!nCollisions()) {
// EEDF solver requires collision data; skip if none are defined.
return;
}
auto ierr = m_eedfSolver->calculateDistributionFunction();
if (ierr == 0) {
auto y = m_eedfSolver->getEEDFEdge();
Expand Down Expand Up @@ -324,6 +328,11 @@ void PlasmaPhase::setParameters(const AnyMap& phaseNode, const AnyMap& rootNode)
auto distribution = eedf["distribution"].asVector<double>(levels.size());
setDiscretizedElectronEnergyDist(levels.data(), distribution.data(),
levels.size());
} else if (m_distributionType == "Boltzmann-two-term") {
if (eedf.hasKey("energy-levels")) {
auto levels = eedf["energy-levels"].asVector<double>();
setElectronEnergyLevels(levels.data(), levels.size());
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions test/data/air-plasma.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ phases:
energy-levels: [0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0,
24.0, 26.0, 28.0, 30.0, 32.0, 34.0, 36.0, 38.0, 40.0]

- name: air-plasma-default-ELs
thermo: plasma
kinetics: gas
species:
- nasa_gas.yaml/species: [Electron, O2, N2, O2+, N2+, O, O2-]
state: {T: 300.0, P: 1 atm, X: {O2: 0.21, N2: 0.79}}
electron-energy-distribution:
type: Boltzmann-two-term

reactions:
- equation: O2 + Electron => Electron + Electron + O2+
type: electron-collision-plasma
Expand Down
21 changes: 7 additions & 14 deletions test/python/test_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,28 +1328,21 @@ def test_elastic_power_loss_change_shape_factor(self, phase):

def test_eedf_solver(self):

phase = ct.Solution('air-plasma.yaml')
phase = ct.Solution('air-plasma.yaml','air-plasma-Phelps')
phase.TPX = 300., 101325., 'N2:0.79, O2:0.21, N2+:1E-10, Electron:1E-10'
phase.reduced_electric_field = 200.0 * 1e-21 # Reduced electric field [V.m^2]
phase.update_electron_energy_distribution()

grid = phase.electron_energy_levels
eedf = phase.electron_energy_distribution

reference_grid = np.logspace(-1, np.log10(60))

reference_eedf = np.array([
9.1027381e-02, 9.1026393e-02, 9.1025267e-02, 9.1023985e-02, 9.1022523e-02,
9.1020858e-02, 9.1015025e-02, 9.1006713e-02, 9.0997242e-02, 9.0986450e-02,
9.0974154e-02, 9.0954654e-02, 9.0923885e-02, 9.0888824e-02, 9.0842837e-02,
9.0775447e-02, 9.0695937e-02, 9.0578309e-02, 9.0398980e-02, 9.0118320e-02,
8.9293838e-02, 8.7498617e-02, 8.3767419e-02, 7.5765714e-02, 6.4856820e-02,
5.5592157e-02, 4.9309310e-02, 4.5268611e-02, 4.2261381e-02, 3.9440745e-02,
3.6437762e-02, 3.3181527e-02, 2.9616717e-02, 2.5795007e-02, 2.1676205e-02,
1.7347058e-02, 1.3022044e-02, 8.9705614e-03, 5.5251937e-03, 3.1894295e-03,
1.7301525e-03, 8.4647152e-04, 3.6030983e-04, 1.2894755e-04, 3.7416645e-05,
8.4693678e-06, 1.4299900e-06, 1.7026957e-07, 1.3992350e-08, 1.5340110e-09
])
0.09103376, 0.09103349, 0.09103313, 0.09103262, 0.09103193,
0.09103097, 0.09102965, 0.09102784, 0.09102534, 0.0910219,
0.09100814, 0.09098309, 0.09093237, 0.0908309, 0.09062281,
0.09005469, 0.08573433, 0.06499493, 0.0473475, 0.0,
0.0])
reference_grid = np.logspace(-1, np.log10(60), reference_eedf.size)

interp = np.interp(reference_grid, grid, eedf, left=0.0, right=0.0)

Expand Down
2 changes: 1 addition & 1 deletion test/zeroD/test_zeroD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ TEST(zerodim, test_individual_reactor_initialization)

TEST(zerodim, plasma_reactor_energy)
{
auto sol = newSolution("air-plasma.yaml", "air-plasma-Phelps", "none");
auto sol = newSolution("air-plasma.yaml", "air-plasma-default-ELs", "none");
auto thermo = sol->thermo();
auto* plasma = dynamic_cast<PlasmaPhase*>(thermo.get());
ASSERT_NE(plasma, nullptr);
Expand Down
Loading