-
-
Save lemmatum/52efc7f84a00373db3b93efd78576be6 to your computer and use it in GitHub Desktop.
Transport equations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# impact parameter | |
def impact_param(temperature, ionization=1.0): | |
""" | |
impact parameter for classical Coulomb collision () | |
default is electron species against ion with ionization = 1.0 | |
inputs: | |
temperature (eV) | |
ionization (dimless) | |
""" | |
vel = vTh(temperature=temperature, species='e') | |
param = ionization * plsmc.qe**2 / (4 * np.pi * plsmc.epsilon0 * plsmc.me * vel**2) | |
return param | |
# Coulomb logarithm (dimless) | |
# note: need to change to 'ee', 'ie', and 'ii' species | |
def coul_log(temperature, density, ionization=1.0): | |
""" | |
Coulomb logarithm (dimless) | |
default is ionization 1.0 | |
inputs: | |
temperature (eV) | |
density (cm^-3) | |
ionization (dimless) | |
""" | |
dLength = debye_length(temperature=temperature, density=density) | |
param = impact_param(temperature=temperature, ionization=ionization) | |
cLog = np.log( dLength / param ) | |
return cLog | |
# collision frequency (Hz) | |
# need to adjust to accept electron and/or ion temperature in vThermal | |
# check that ee frequency is correct! | |
def coll_freq(density, temperature, ionization=1.0, species='ii', massIon=-1): | |
""" | |
Collision frequency (Hz) | |
default is ion-ion collisions with ionization 1.0 | |
inputs: | |
density(cm^-3) | |
temperature (eV) | |
ionization (dimless) | |
""" | |
density_conv = 1e6 # convert density from cm^-3 to m^-3 | |
if species == 'ii': | |
param = impact_param(temperature=temperature, ionization=ionization) | |
cLog = coul_log(temperature=temperature, density=density, | |
ionization=ionization) | |
vel = vTh(temperature=temperature, species='i', massIon=massIon) | |
freq = density * density_conv * vel * 6 * np.pi * param**2 * cLog | |
elif species == 'ee': | |
param = impact_param(temperature=temperature, ionization=ionization) | |
cLog = coul_log(temperature=temperature, density=density, | |
ionization=ionization) | |
vel = vTh(temperature=temperature, species='e') | |
freq = density * density_conv * vel * 6 * np.pi * param**2 * cLog | |
return freq | |
# mean free path (m) | |
# allow for inputing ion and electron temperature independently | |
# for now it's Te=Ti | |
def mfp(density, temperature, ionization=1.0, species='ii', massIon=-1): | |
""" | |
Collisional mean free path (m) | |
Default is ion-ion collision with ionization 1.0 | |
inputs: | |
density (cm^-3) | |
temperature (eV) | |
ion mass (kg) | |
""" | |
if species == 'ee': | |
vel = vTh(temperature=temperature, species='e') | |
freq = coll_freq(density, temperature, ionization=ionization, | |
species='ee') | |
length = vel / freq | |
elif species == 'ie': | |
# !!! is it correct to only use electron thermal velocity here? | |
vel = vTh(temperature=temperature, species='e') | |
freq = coll_freq(density, temperature, ionization=ionization, | |
species='ii', massIon=massIon) | |
temp_rat = 1.0 | |
length = vel / (freq * (massIon/(2*plsmc.me))**0.5 * (temp_rat)**(3.0/2.0)) | |
elif species == 'ii': | |
vel = vTh(temperature=temperature, species='i', massIon=massIon) | |
freq = coll_freq(density, temperature, ionization=ionization, | |
species='ii', massIon=massIon) | |
length = vel / freq | |
return length | |
# particle mobility in electric field (m^2/(V s)) | |
def mobility(density, temperature, ionization=1.0, species='i', massIon=-1): | |
""" | |
Electrical mobility (m^2/(V s)) | |
default is ion with ionization 1.0 | |
input: | |
temperature (eV) | |
density (cm^-3) | |
ionization (dimless) | |
ion mass (kg) | |
""" | |
if species == 'e': | |
freq = coll_freq(density, temperature, ionization=ionization, | |
species='ee') | |
mob = plsmc.qe / (plsmc.me * freq) | |
elif species == 'i': | |
freq = coll_freq(density, temperature, ionization=ionization, | |
species='ii', massIon=massIon) | |
mob = ionization * plsmc.qe / (massIon * freq) | |
return mob | |
# Knudsen number | |
def knudsen(density, temperature, length, ionization=1.0, species='ee', massIon=-1): | |
""" | |
Knudsen number (dimless) | |
default species is e-e with ionization 1.0 | |
inputs: | |
density (cm^-3) | |
temperature (eV) | |
ionization (dimless) | |
characteristic length (m) | |
ion mass (kg) | |
""" | |
if species == 'ee': | |
path = mfp(density=density, temperature=temperature, | |
ionization=ionization, species='ee') | |
kn = path / length | |
elif species == 'ie': | |
path = mfp(density=density, temperature=temperature, | |
ionization=ionization, species='ie', massIon=massIon) | |
kn = path / length | |
elif species == 'ii': | |
path = mfp(density=density, temperature=temperature, | |
ionization=ionization, species='ii', massIon=massIon) | |
kn = path / length | |
return kn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment