diff --git a/README.md b/README.md new file mode 100644 index 00000000..9ffa51cc --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +## Overview + +`glowDischargeSolver` is a collection of python functions supporting +the approximation of plasma systems in "glow discharge" regime. The +model takes the form of a fluid model that uses the drift-diffusion +approximation so that the state variables consist of a set of species +number densities and an electron temperature. For more details on the +physical model, see the LaTeX documentation in the `doc` directory. + +These equations are discretized in space using Chebyshev collation and +in time using fully implicit schemes, either backward Euler or +Crank-Nicolson. Further, to support the time-periodic case, +time-periodic-shooting is implemented to accelerate converged to the +time-periodic solution. diff --git a/doc/.gitignore b/doc/.gitignore new file mode 100644 index 00000000..2664a243 --- /dev/null +++ b/doc/.gitignore @@ -0,0 +1,11 @@ +vc.tex +*~ +glow.aux +glow.fdb_latexmk +glow.fls +glow.log +glow.pdf +glow.bbl +glow.blg +glow.out +glow.toc diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 00000000..371ca0b7 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,23 @@ +PAPER := glow.pdf +TEX_SUFS := .aux .log .nav .out .snm .toc .vrb .fdb_latexmk .bbl .blg .fls +GITID := $(shell git describe --always 2> /dev/null) +TEXSRC := $(wildcard *.tex bolsig/*.tex fluid/*.tex hybrid/*.tex) +FIGURES := $(wildcard figures/*.pdf figures/*.jpg) +BIBS := $(wildcard bibs/*.bib) + +%.pdf:%.tex $(TEXSRC) $(BIBS) $(FIGURES) gitinfo2.pm + echo "hello" +ifdef GITID + ./gitinfo2.pm +endif + latexmk -pdf $< + +all: $(PAPER) + +clean: + $(RM) $(foreach suf, ${TEX_SUFS}, $(PAPER:.pdf=${suf})) +ifdef GITID + $(RM) vc.tex +endif + $(RM) $(PAPER) + diff --git a/doc/appendix.tex b/doc/appendix.tex new file mode 100644 index 00000000..5ce0e5fd --- /dev/null +++ b/doc/appendix.tex @@ -0,0 +1,77 @@ +\appendix +\chapter{Non-dimensionalization} + +For the non-dimensionalization of the system of equations, the following dimensionless variables are used +% +\begin{align*} +t' = \frac{t}{\tau}, \quad \phi' = \frac{\phi}{V_0}, \quad x' = \frac{x}{L}, \quad n_{i,e}' = \frac{n_{i,e}}{n_{p0}}, \quad n_{\alpha}' = \frac{n_{\alpha}}{n_{p0}}, \quad \left(n_{e}e_{e}\right)' = \frac{n_{e}e_{e}}{n_{p0} e_0}, \quad ne_t' = \frac{ne_t}{n_{Ar} e_0}. +\end{align*} +% +The Poisson equation governing the +electric potential $\phi$ takes the following form: +% +\begin{align*} +-\pp{^2\phi}{x^2} = \frac{\rho_c}{\epsilon_0} = \frac{q_e}{\epsilon_0} \left(n_i - n_e\right) \quad &\Rightarrow \quad \pp{^2\phi}{x^2} = - \frac{q_e}{\epsilon_0} \left(n_i - n_e\right) \quad \Rightarrow \quad \frac{V_0}{L^2}\pp{^2\phi'}{x'^2} = - \frac{q_e}{\epsilon_0} \left(n_i' - n_e'\right) n_{p0} \\ +\quad &\Rightarrow \quad \pp{^2\phi'}{x'^2} = \color{red}\boxed{\color{black} - \frac{q_e n_{p0} L^2}{\epsilon_0 V_0}} \color{black}\left(n_i' - n_e'\right) . +\end{align*} +% +The species transport equations can be non-dimensionalized as follows: +% +\begin{align*} +\pp{n_{\alpha}}{t} + \pp{}{x} \left( - z_{\alpha} \mu_{\alpha} n_{\alpha} \pp{\phi}{x} - D_{\alpha} \pp{n_{\alpha}}{x}\right)= k n_{Ar} n_{e} \ &\Rightarrow \ \frac{1}{\tau}\pp{n_{\alpha}'}{t'} + \frac{1}{L}\pp{}{x'} \left( - z_{\alpha} \mu_{\alpha} n_{\alpha}' \frac{V_0}{L}\pp{\phi'}{x'} - D_{\alpha} \frac{1}{L} \pp{n_{\alpha}'}{x'}\right) = k n_{Ar} n_{e}' \\ +\ &\Rightarrow \ \pp{n_{\alpha}'}{t'} - \pp{}{x'} \left( z_{\alpha} \color{red}\boxed{\color{black} \mu_{\alpha} \frac{\tau V_0}{L^2} } \color{black} n_{\alpha}'\pp{\phi'}{x'} + \color{red}\boxed{\color{black} D_{\alpha} \frac{\tau}{L^2}} \color{black} \pp{n_{\alpha}'}{x'}\right) = \color{red}\boxed{\color{black} k n_{Ar} \tau } \color{black} n_{e}' . +\label{eqn:species} +\end{align*} +% +The electron energy equation can be non-dimensionalized as below: +% +\begin{align*} +\pp{}{t} \left( n_e e_e \right) ++ +\pp{}{x} \left( - \frac{5}{3} D_e \pp{\left(n_e e_e\right)}{x} \right. \\ +\left. - \frac{5}{3} z_e \mu_e \pp{\phi}{x} \left(n_e e_e\right) \right) +&= +\underbrace{q_e \left(-z_{e} \mu_{e} n_{e} \pp{\phi}{x} - D_{e} \pp{n_{e}}{x} \right) \pp{\phi}{x}}_{\textrm{Joule heating}} \\ +&- +\underbrace{\frac{3}{2} k_B n_e \frac{2 m_e}{m_b} \left( T_e - T_g \right) \bar{\nu}_{e,b}}_{\textrm{Elastic}} \\ +&- +\underbrace{q_e \sum_{j=1}^{N_r} \Delta E^e_j G_j}_{\textrm{Inelastic}} \ \Rightarrow +\end{align*} +\begin{align*} +{\color{blue}\frac{n_{p0} e_0}{\tau}} \pp{}{t'} \left( n_e e_e \right)' ++ +{\color{blue}\frac{1}{L}} \pp{}{x} \left( - \frac{5}{3} D_e {\color{blue}\frac{n_{p0} e_0}{L}} \pp{\left(n_e e_e\right)'}{x'} \right. \\ +\left. - \frac{5}{3} z_e \mu_e {\color{blue}\frac{V_{0}}{L}} \pp{\phi'}{x'} {\color{blue}n_{p0} e_0} \left(n_e e_e\right)' \right) +&= +\underbrace{q_e \left(-z_{e} \mu_{e} {\color{blue}\frac{V_{0} n_{p0}}{L}} n_{e}' \pp{\phi'}{x'} - D_{e} {\color{blue}\frac{n_{p0}}{L}} \pp{n_{e}'}{x'} \right) {\color{blue}\frac{V_{0}}{L}} \pp{\phi'}{x'}}_{\textrm{Joule heating}} \\ +&- +\underbrace{\frac{3}{2} k_B n_e \frac{2 m_e}{m_b} \left( T_e - T_g \right) \bar{\nu}_{e,b}}_{\textrm{Elastic}} \\ +&- +\underbrace{q_e \sum_{j=1}^{N_r} \Delta E^e_j G_j}_{\textrm{Inelastic}} \ \Rightarrow +\end{align*} +\begin{align*} +\pp{}{t'} \left( n_e e_e \right)' ++ +\pp{}{x} \left( - \frac{5}{3} {\color{red}\boxed{\color{black} D_e \frac{\tau}{L^2}}} \color{black}\pp{\left(n_e e_e\right)'}{x'} \right. \\ +\left. - \frac{5}{3} z_e {\color{red}\boxed{\color{black} \mu_e \frac{\tau V_{0}}{L^2}}} \color{black}\pp{\phi'}{x'} \left(n_e e_e\right)' \right) +&= +\underbrace{q_e \left(-z_{e} {\color{red}\boxed{\color{black} \mu_{e} \frac{V_{0} \tau}{L^2}}} \color{black}n_{e}' \pp{\phi'}{x'} - {\color{red}\boxed{\color{black} D_{e} \frac{\tau}{L^2}}} \color{black} \pp{n_{e}'}{x'} \right) {\color{red}\boxed{\color{black} V_{0}}} \color{black} \pp{\phi'}{x'}}_{\textrm{Joule heating}} \\ +&- +\underbrace{\frac{3}{2} {\color{blue}\frac{\tau}{n_{p0} e_0}} k_B n_e \frac{2 m_e}{m_b} \left( T_e - T_g \right) \bar{\nu}_{e,b}}_{\textrm{Elastic}} \\ +&- +\underbrace{q_e {\color{blue}\frac{\tau}{n_{p0} e_0}} \sum_{j=1}^{N_r} \Delta E^e_j G_j}_{\textrm{Inelastic}} \ \Rightarrow +\end{align*} +% +The non-dimensionalization of the ideal gas law is presented below: +% +\begin{align*} +p = n_e k_B T_e + k_B T_g \sum_{\alpha \in h} n_{\alpha} \quad \Rightarrow \quad {\color{blue} n_{Ar} k_B T_0} \ p' = {\color{blue} n_{p0} e_0} \frac{2}{3} \left(n_e e_e\right)' + {\color{blue} n_{p0} e_0} \frac{2}{3} \left(k_B T_g \sum_{\alpha \in h} n_{\alpha} \right)'. +\end{align*} +% +\begin{align*} +\pp{ne_t}{t} = &- \frac{5}{3} \left( D_{e}\pp{n_e e_e}{x} + z_{e}\mu_{e} \pp{V}{x} n_e e_e \right) \\ + &- \frac{5}{3} \sum_{\alpha \in h} \left\{ \left( D_{a}\pp{\left( \frac{3}{2} k_B n_a T_g\right)}{x} + z_{a} \mu_{a} \pp{V}{x} \left( \frac{3}{2} k_B n_a T_g\right) \right) \right\} \\ + &+ \sum_{\alpha \in h} \left\{ \varepsilon_{\alpha} \left( - z_{\alpha} \mu_{\alpha} n_{\alpha} \pp{V}{x} - D_{\alpha} \pp{n_{\alpha}}{x} \right) \right\} + +\underbrace{\sum_{\alpha} q_e z_{\alpha} F_{\alpha} E}_{\textrm{Joule heating}} +\end{align*} +% \ No newline at end of file diff --git a/doc/bibs/glow.bib b/doc/bibs/glow.bib new file mode 100644 index 00000000..dd6aa8ea --- /dev/null +++ b/doc/bibs/glow.bib @@ -0,0 +1,10 @@ +@article{panneer2015computational, + title={Computational modeling of the effect of external electron injection into a direct-current microdischarge}, + author={Panneer Chelvam, Prem Kumar and Raja, Laxminarayan L}, + journal={Journal of Applied Physics}, + volume={118}, + number={24}, + pages={243301}, + year={2015}, + publisher={AIP Publishing LLC} +} diff --git a/doc/bolsig/eqns.tex b/doc/bolsig/eqns.tex new file mode 100644 index 00000000..0fd33fa9 --- /dev/null +++ b/doc/bolsig/eqns.tex @@ -0,0 +1,112 @@ +\section{BOLSIG+ Governing Equations} +The electron Boltzmann equation may be written as follows: +% +\begin{equation} +\pp{f}{t} ++ +\mbf{v} \cdot \nabla f +- +\frac{e}{m} \mbf{E} \cdot \nabla_{\mbf{v}} f += +C[f], +\label{eqn:electron-boltzmann-full} +\end{equation} +% +where $f(\mbf{x}, \mbf{v}, t)$ denotes the electron distribution +function, $\mbf{v}$ is the velocity vector, $\nabla f$ is the spatial +gradient of $f$ (i.e., wrt $\mbf{x}$), $\nabla_{\mbf{v}} f$ is the +velocity gradient of $f$ (i.e., wrt $\mbf{v}$), $e$ is the absolute +value of the charge of an electron, $m$ is the mass of an electron, +$\mbf{E}$ is the electric field, and $C[f]$ denotes the collision +term. + +The development here is based upon the description of Hagelaar and +Pitchford~\cite{} (referred to as HP for short) and the BOLSIG+ User's +Manual~\cite{}. + +To begin, it is assumed that the electric field and collision +probabilities are spatially uniform. In this situation, HP asserts +that the distribution function $f$ is 1) ``symmetric in velocity space +around the electric field direction'' and 2) ``may vary only along the +field direction'' in physical space. The meaning of 1) is somewhat +unclear, but in the subsequent analysis, a spherical coordinate system +is used and no possible dependence on the azimuthal angle is included. +Thus, the combined import of these assumptions is to reduce the +dependence of $f$ from 6D plus time to 3D plus time. Specifically, +letting $z$ denote the direction of the electric field, $v$ denote the +velocity magnitude, and $\theta$ denote the polar angle between the +electric field direction and the velocity direction, we have $f = f(z, +v, \theta, t)$. In this situation,~\ref{eqn:electron-boltzmann-full} +simplifies to +% +\begin{equation} +\pp{f}{t} ++ +v \cos \theta \pp{f}{z} +- +\frac{e}{m} E \left( \cos \theta \pp{f}{v} - \frac{\sin \theta}{v} \pp{f}{\theta} \right) += +C[f]. +\label{eqn:electron-boltzmann-reduced} +\end{equation} +% + +In preparation for subsequent development, let $\xi = \cos \theta$. +Then,~\ref{eqn:electron-boltzmann-reduced} becomes +% +\begin{equation} +\pp{f}{t} ++ +v \xi \pp{f}{z} +- +\frac{e}{m} E \left( \xi \pp{f}{v} + \frac{(1-\xi^2)}{v} \pp{f}{\xi} \right) += +C[f]. +\label{eqn:electron-boltzmann-xi} +\end{equation} +% +To continue, the following two-term expansion is introduced: +% +\begin{equation} +f(v, \xi, z, t) = f_0(v, z, t) + \xi f_1(v, z, t). +\label{eqn:two-term} +\end{equation} +% +To derive governing equations for $f_0$ and $f_1$, we apply the +Galerkin method in the $\xi$ coordinate. Specifically, +substitute~\eqref{eqn:two-term} into +~\eqref{eqn:electron-boltzmann-xi} and integrate against $1$ and +$\xi$. Rewriting the result in terms of a rescaled energy variable +$\epsilon \equiv (v^2 / \gamma^2)$, where $\gamma^2 = 2e / m$, gives +% +\begin{gather} +\pp{f_0}{t} ++ +\frac{\gamma}{3} \sqrt{\epsilon} \pp{f_1}{z} +- +\frac{\gamma}{3} \frac{E}{\sqrt{\epsilon}} \pp{}{\epsilon} \left( \epsilon f_1 \right) += +C_0 +\label{eqn:f0}\\ +% +\pp{f_1}{t} ++ +\gamma \sqrt{\epsilon} \pp{f_0}{z} +- +\gamma E \sqrt{\epsilon} \pp{f_0}{\epsilon} += +C_1 +\label{eqn:f1} +\end{gather} +% +where +% +\begin{gather*} +C_0 = \frac{1}{2} \int_{-1}^{1} C[f_0 + \xi f_1] \, d\xi\\ +C_1 = \frac{3}{2} \int_{-1}^{1} \xi C[f_0 + \xi f_1] \, d\xi. +\end{gather*} +% +Note that~\eqref{eqn:f0} and~\eqref{eqn:f1} are equivalent to HP (5) +and (6), respectively. Although, to match the forms in HP more +precisely, we must examine the collision terms in more detail. +\todo[inline]{Collisions} diff --git a/doc/bolsig/overview.tex b/doc/bolsig/overview.tex new file mode 100644 index 00000000..34aaa43e --- /dev/null +++ b/doc/bolsig/overview.tex @@ -0,0 +1,6 @@ +This chapter documents the models and data that support determination +of transport coefficients and reaction rates. For electron transport +properties and electron-impact reactions, the coefficients and rates +are determined using the BOLSIG+ +code\footnote{http://www.bolsig.laplace.univ-tlse.fr/}, which solves +an approximate form of the electron Boltzmann equation. diff --git a/doc/figures/glowfigcrop.pdf b/doc/figures/glowfigcrop.pdf new file mode 100644 index 00000000..73a7838a Binary files /dev/null and b/doc/figures/glowfigcrop.pdf differ diff --git a/doc/fluid/bcs.tex b/doc/fluid/bcs.tex new file mode 100644 index 00000000..54a0f535 --- /dev/null +++ b/doc/fluid/bcs.tex @@ -0,0 +1,74 @@ +\section{Boundary Conditions} \label{sec:fluid-bcs} + +\subsection{Species Continuity} +We impose conditions on the species fluxes at the walls. The electron +flux $F_e$ is given by +% +\begin{equation*} +F_e \mbf{n}_x += +\frac{1}{4} n_e \left( \frac{8 k_B T_e}{\pi m_e} \right)^{1/2} +- +\sum_{\alpha=1}^{N_s} \gamma_{\alpha} F_{\alpha} \mbf{n}_x +\end{equation*} +% +where $\mbf{n}_x$ denotes the outward pointing unit normal (in 1D, +$\mbf{n}_x =-1$ on the 'left' and $\mbf{n}_x = 1$ on the 'right') and +$\gamma_{\alpha}$ is the secondary electron emission coefficient for +species $\alpha$. \todo[inline]{We need values for the + $\gamma_{\alpha}$ parameters!} + +The ion flux, $F_i$, is given by +% +\begin{equation*} +F_i \mbf{n}_x += +\frac{1}{4} n_i \left( \frac{8 k_B T_g}{\pi m_i} \right)^{1/2} ++ +n_i \max(0, \mu_i E \mbf{n}_x), +\end{equation*} +% +\todo[inline]{Check inconsistency in refs for ion BC with Raja} + +Finally, the all neutral species fluxes ars given by +% +\begin{equation*} +F_{\alpha} \mbf{n}_x += +\frac{1}{4} n_{\alpha} \left( \frac{8 k_B T_g}{\pi m_{\alpha}} \right)^{1/2} +\end{equation*} +% + +\subsection{Electric Potential} +Dirichlet conditions on the electric potential are imposed on both +sides. For instance, assuming $x=0$ is ground and $x=L$ has an +imposed fluctuating voltage: +% +\begin{equation*} +\phi(0,t) = 0, \quad \phi(L,t) = V_0 \sin(2 \pi f t), +\end{equation*} +% +where $V_0$ is the voltage amplitude and $f$ is the frequency. + +\subsection{Energy} +For the electron energy equation, the total surface energy flux at the +wall is given by +% +\begin{equation*} +Q_{e,wall} \mbf{n}_x +\equiv +\left. \left( \frac{5}{2} k_B T_e F_e - \kappa_e \pp{T_e}{x} \right)\right|_{wall} \mbf{n}_x += +\frac{5}{2} k_B T_e F_e \mbf{n}_x, +\end{equation*} +% +where $F_e \mbf{n}_x$ is taken from the species continuity boundary +condition. + +Isothermal wall conditions are imposed on the gas temperature: +% +\begin{equation*} +T_g(0,t) = T_g(L,t) = T_{g,wall}, +\end{equation*} +% +where $T_{g,wall}$ is a specified value. diff --git a/doc/fluid/closure.tex b/doc/fluid/closure.tex new file mode 100644 index 00000000..15678e12 --- /dev/null +++ b/doc/fluid/closure.tex @@ -0,0 +1,123 @@ +\section{Fluid Closure Models: Transport and Chemistry} \label{sec:fluid-closures} +This section details the transport and chemistry models necessary to +close the PDEs in the fluid model. + +\subsection{Chemistry} +The chemical source terms $\dot{\omega}_{\alpha}$ are determined by +specifying a chemical mechanism and associated rate parameters. This +section gives the form of the source terms appearing in the species +transport equations for a generic mechanism as well as example +mechanisms for argon plasma. + +\subsubsection{General Form} +Assume that we have a set of $N_r$ chemical reactions, each taking the +following form: +% +\begin{equation*} +\sum_{\alpha=1}^{N_s} \nu^{\prime}_{\alpha r} X_{\alpha} +\ce{<=>} +\sum_{\alpha=1}^{N_s} \nu^{\prime\prime}_{\alpha r} X_{\alpha} +\quad +\textrm{for} \,\, r = 1, \ldots, N_r. +\end{equation*} +% +Then, +% +\begin{equation*} +\dot{\omega}_{\alpha} += +\sum_{r=1}^{N_r} (\nu^{\prime \prime}_{\alpha r} - \nu^{\prime}_{\alpha r}) G_r +\end{equation*} +% +where $M_{\alpha}$ is the molar mass of species $\alpha$ and $G_r$ is +the rate of progress of reaction $r$. The rate of progress is given +by +% +\begin{equation*} +G_r += +k_{f,r} \prod_{s=1}^{N_s} n_s^{\nu^{\prime}_{sr}} +- +k_{b,r} \prod_{s=1}^{N_s} n_s^{\nu^{\prime \prime}_{sr}}, +\end{equation*} +% +where $k_{f,r}$ and $k_{b,r}$ are the forward and backward rate +coefficients. These rate coefficients are functions of temperature +that must be provided as part of the mechanism. + +\subsubsection{Simple argon mechanisms} +The simplest possible argon mechanism that has been used~\cite{} +includes only irreversible ionization of ground state argon: +% +\begin{equation*} +\ce{Ar + e -> Ar^+ + 2e}. +\end{equation*} +% +Denoting this reaction 0, the energy loss per electron in $\Delta E_0 += 15.7 \si{eV}$, and the rate of progress is +% +\begin{equation*} +G_0 = k_i(T_e) n_b n_e, +\end{equation*} +% +where $n_b$ is the argon number density. Thus, +% +\begin{equation*} +\dot{\omega}_e = (2 - 1) G_0 = k_i n_b n_e. +\end{equation*} +% +Liu et al.~\cite{} uses +% +\begin{equation*} +k_i(T_e) = A \exp(-C/T_e), +\end{equation*} +% +where $A = 1.235 \times 10^{-7} \si{cm^3.s^{-1}}$ and $C = +-18.687\si{eV}$.\todo{Ref isn't clear only units for C, but has to be eV, right?} + +This may be sufficient for code development purposes, but a more +complex mechanism will be required for realistic simulations. + +\subsubsection{Advanced argon mechanism} +More complex argon plasma chemistry models are detailed in~\cite{}. + +\subsection{Transport} +To close the fluid model transport equation, we require transport +properties, namely the diffusion coefficient and thermal conductivity +for all species and the mobility for charged species. + +\subsubsection{Simple} +Some authors~\cite{} specify these quantities as constant for a given +background number density. Data from~\cite{} is shown in +Table~\ref{tbl:simpleTransport}. +% +\begin{table}[htp] +\caption{Transport property values from~\cite{}.} +\begin{center} +\begin{tabular}{|c|ccc|} +\hline +Name & Symbol & Units & Value \\ +\hline +Electron (\ce{e}) diffusivity & $n_{\ce{Ar}} D_{\ce{e}}$ & \si{(cm.s)^{-1}} & $3.86 \times 10^{22}$ \\ +Positive ion (\ce{Ar^+}) diffusivity & $n_{\ce{Ar}} D_{\ce{Ar^+}}$ & \si{(cm.s)^{-1}} & $2.07 \times 10^{18}$ \\ +Metastable atom (\ce{Ar^*}) diffusivity & $n_{\ce{Ar}} D_{\ce{Ar^{\ast}}}$ & \si{(cm.s)^{-1}} & $2.42 \times 10^{18}$ \\ +\hline +Electron mobility & $n_{\ce{Ar}} \mu_{\ce{e}}$ & \si{(V.cm.s)^{-1}} & $9.66 \times 10^{21}$ \\ +Positive ion mobility & $n_{\ce{Ar}} \mu_{\ce{Ar^+}}$ & \si{(V.cm.s)^{-1}} & $4.65 \times 10^{19}$ \\ +\hline +\end{tabular} +\end{center} +\label{tbl:simpleTransport} +\end{table} +% +The required thermal conductivities may be computed from the +diffusivity as follows: +% +\begin{equation*} +\kappa_{\alpha} = \frac{5}{2} n_{\alpha} k_B D_{\alpha}. +\end{equation*} +% +\todo[inline]{NB: this is from Panneer Chelvam and Raja. Some authors use 3/2 instead of 5/2. Why? Is it an error or a different modeling choice?} + + +\subsubsection{Advanced} diff --git a/doc/fluid/pdes.tex b/doc/fluid/pdes.tex new file mode 100644 index 00000000..7654945c --- /dev/null +++ b/doc/fluid/pdes.tex @@ -0,0 +1,413 @@ +The fluid model takes the form of a set of coupled PDEs governing the +species densities, temperatures, and the electric potential. We +document a 1-D version of the model here, including the PDEs, boundary +conditions, and transport and chemistry closure models. Extension to +2-D is necessary to model the full device, including the edge effects, +but this is not expected to be necessary for the envisioned model +validation relevant to the torch simulations. + +\section{PDEs} +We require equations governing for the species densities, +temperatures, and electric potential. + +\subsection{Species Continuity} \label{sec:species-continuity} +The species transport equations are as follows: +% +\begin{equation} +\pp{n_{\alpha}}{t} + \pp{F_{\alpha}}{x} = \dot{\omega}_{\alpha}, +\label{eqn:species} +\end{equation} +% +where $t$ is time, $x$ is the coordinate in the electrode-normal +direction, $n_{\alpha}$ denotes the number density of species +$\alpha$, $F_{\alpha}$ is the corresponding flux, and +$\dot{\omega}_{\alpha}$ is the net production rate of species $\alpha$ +due to chemical reactions. The flux is closed as follows: +% +\begin{equation*} +F_{\alpha} = z_{\alpha} \mu_{\alpha} n_{\alpha} E - D_{\alpha} \pp{n_{\alpha}}{x}, +\end{equation*} +% +where $z_{\alpha}$ is the charge number, $\mu_{\alpha}$ is the +mobility, $D_{\alpha}$ is the diffusion coefficient, and $E$ is the +electric field. The transport and chemistry closures are discussed in +\S\ref{sec:fluid-closures}. The electric field is determined from the +potential, $E = -\pp{\phi}{x}$, which is governed by a Poisson +equation (\S\ref{sec:pdes-poisson}). + +For a mixture of $N_s$ species, $N_s - 1$ species densities are +evolved according to~\eqref{eqn:species}. Alternatively, the density +of the dominant background species (e.g., argon) is determined either +by assuming it to be constant or by assuming that the pressure is +constant. We denote these as the ``constant $n_b$'' and ``constant +$p$'' cases. In the latter case, the background specie density, +denoted $n_b$, is evolved according to +% +\begin{equation*} +\pp{n_b}{t} = S, +\end{equation*} +% +where the field $S$ is determined by imposing the constraint that the +pressure remains constant, as detailed in~\S\ref{sec:pconstraint}. + +\subsection{Ideal Gas Law} +In either case (constant $n_b$ or constant $p$), the ideal gas law is +used to relate the pressure to the species densities and temperatures: +% +\begin{equation*} +p = \sum_{\alpha = 1}^{N_s} n_{\alpha} k_B T_{\alpha}, +\end{equation*} +% +where $k_B$ is the Boltzmann constant and $T_{\alpha}$ is the +temperature of species $\alpha$. As discussed in +\S\ref{sec:pdes-energy}, a two temperature model is adopted here. In this model, the +heavy species share a single temperature $T_g$, such that the ideal +gas law becomes +% +\begin{equation*} +p = n_e k_B T_e + k_B T_g \sum_{\alpha \in h} n_{\alpha}. +\end{equation*} +% +where $\alpha \in h$ indicates that $\alpha$ ranges over the heavy +species only (i.e., all species except the electrons). + +\subsection{Energy Equations} \label{sec:pdes-energy} +A two-temperature model is adopted. We assume a common temperature +$T_g$ for the heavy species and a separate temperature for the +electrons. In this section, we formulate three energy equations. Any +combination of two of these is sufficient to describe the system. + +\subsubsection{Electron Energy} +Letting $n_e e_e = \frac{3}{2} k_B n_e T_e$, the electron energy +equation is given by +% +\begin{gather*} +\pp{}{t} \left( \frac{3}{2} k_B n_e T_e \right) ++ +\pp{}{x} \left( \frac{5}{2} k_B T_e F_e - \kappa_e \pp{T_e}{x} \right) += +\underbrace{- q_e F_e E}_{\textrm{Joule heating}} +- +\underbrace{\frac{3}{2} k_B n_e \frac{2 m_e}{m_b} \left( T_e - T_g \right) \bar{\nu}_{e,b}}_{\textrm{Elastic}} +- +\underbrace{q_e \sum_{j=1}^{N_r} \Delta E^e_j G_j}_{\textrm{Inelastic}}, +\end{gather*} +% +where $m_e$ and $m_b$ denote the molecular mass of electron and the +background species, respectively, $\kappa_e$ is the electron thermal +conductivity, $\Delta E^e_j$ is the energy lost per electron in the +collisional process represented by reaction $j$, and $G_j$ is the rate +of progress of reaction $j$. The thermal conductivity $\kappa_e$ and +chemistry related quantities $\Delta E_j$ and $G_j$ are described more +in \S\ref{sec:fluid-closures}. + +\subsubsection{Heavy Species Energy} +The heavy species energy equation is given by +% +\begin{align*} +\pp{}{t} \left( \sum_{\alpha \in h} C_{v,\alpha} n_\alpha T_g \right) ++& +\pp{}{x} \left( \sum_{\alpha \in h} C_{p,\alpha} F_\alpha T_g - \sum_{\alpha \in h} \kappa_\alpha \pp{T_g}{x} \right) += \\ +& +\underbrace{C_{\textrm{inc}} \sum_{\alpha \in h} q_e z_{\alpha} F_\alpha E}_{\textrm{Joule heating}} ++ +\underbrace{\frac{3}{2} k_B n_e \frac{2 m_e}{m_b} \left( T_e - T_g \right) \bar{\nu}_{e,b}}_{\textrm{Elastic}} +- +\underbrace{q_e \sum_{j=1}^{N_r} \Delta E^g_j G_j}_{\textrm{Inelastic}}, +\end{align*} +% +where the notation $\sum_{\alpha \in h}$ denotes the summation over +the heavy species, $C_{v,\alpha}$ and $C_{p,\alpha}$ are the specific +heat at constant volume and pressure, respectively, for species +$\alpha$. From here forward, we assume that only monatomic species +are included, such that $C_{v,\alpha} = \frac{3}{2} k_B$ and +$C_{p,\alpha} = \frac{5}{2} k_B$. This assumption is true for the +argon-related species we include in year 1 ($\ce{Ar}$, +$\ce{Ar^{\ast}}$ and $\ce{Ar^+}$), but will need to be relaxed to +model air (or even more complex argon chemistry). Similarly to +$\Delta E^e_j$, the constants $\Delta E^g_j$ represent the energy lost +per heavy species particle in reaction $j$. Finally, +$C_{\textrm{inc}}$ is a constant that may be used to account for +incomplete conversion of the kinetic energy gained (by the ions from +the electric field) into heat due to the fact that the ion mean free +path can be of the same order of the sheath thickness~\cite{}. + +\subsubsection{Total Energy} +Rather than solving the electron energy and heavy species thermal +energy equations, it is also possible to formulate the model in terms +of the total energy. Specifically, let $n e_t$ denote the total +energy per unit volume: +% +\begin{equation*} +n e_t += +n_e e_e + \sum_{\alpha \in h} n_{\alpha} e_{\alpha} += +n_e \frac{3}{2} k_B T_e + \sum_{\alpha \in h} n_{\alpha} \left( \frac{3}{2} k_B T_g + \varepsilon_{\alpha} \right), +\end{equation*} +% +where $\varepsilon_{\alpha}$ denotes the internal energy of species +$\alpha$ (i.e., energy not associated with thermal motion). To begin, +we assume that the heavy species are monatomic, such that the internal +energy is associated only with electronic excitation or ionization. +That is for excited state species, $\varepsilon_{\alpha}$ is the +excitation energy, and for ions, $\varepsilon_{\alpha}$ is the +ionization energy. For electrons and ground state argon, +$\varepsilon_{\alpha} = 0$. Finally, we have assumed that the bulk +motion of the fluid is negligible, such that there is no contribution +from the kinetic energy associated with the bulk velocity. + +The total energy is governed by the following PDE: +% +\begin{equation} +\pp{ne_t}{t} = +\underbrace{-\,\pp{q}{x}}_{\mathrm{transport}} + +\underbrace{\sum_{\alpha} q_e z_{\alpha} F_{\alpha} E}_{\textrm{Joule heating}} + +\underbrace{\dot{Q}_{rad}}_{\textrm{Radiative heating}}, +\label{eqn:totalE} +\end{equation} +% +where the heat flux $q$ is given by +% +\begin{equation} +q += +\frac{5}{2} k_B T_e F_e - \kappa_e \pp{T_e}{x} + +\sum_{\alpha \in h} \left\{ \left( \frac{5}{2} k_B T_g + \varepsilon_{\alpha} \right) F_{\alpha} - \kappa_{\alpha} \pp{T_g}{x} \right\}, +\label{eqn:totalE_flux} +\end{equation} +% +and the radiative heating is modeled in $\dot{Q}_{rad}$. To start, we +set $\dot{Q}_{rad} = 0$, but this assumption will be replaced once the +initial implementation is complete. +% +The heat flux $q$ in~\eqref{eqn:totalE_flux} can be simplified as +\begin{align*} +q += +&+ \frac{5}{2} k_B T_e F_e - \kappa_e \pp{T_e}{x} + +\sum_{\alpha \in h} \left\{ \left( \frac{5}{2} k_B T_g + \varepsilon_{\alpha} \right) F_{\alpha} - \kappa_{\alpha} \pp{T_g}{x} \right\} \\ += &- \frac{5}{3} \left( D_{e}\pp{\left( \frac{3}{2} k_B n_e T_e\right)}{x} + z_{e}\mu_{e} \pp{V}{x} \left( \frac{3}{2} k_B n_e T_e\right) \right) \\ + &- \frac{5}{3} \sum_{\alpha \in h} \left\{ \left( D_{a}\pp{\left( \frac{3}{2} k_B n_a T_g\right)}{x} + z_{a} \mu_{a} \pp{V}{x} \left( \frac{3}{2} k_B n_a T_g\right) \right) \right\} \\ + &+ \sum_{\alpha \in h} \left\{ \varepsilon_{\alpha} \left( - z_{\alpha} \mu_{\alpha} n_{\alpha} \pp{V}{x} - D_{\alpha} \pp{n_{\alpha}}{x} \right) \right\} \\ += &- \frac{5}{3} \left( D_{e}\pp{n_e e_e}{x} + z_{e}\mu_{e} \pp{V}{x} n_e e_e \right) \\ + &- \frac{5}{3} \sum_{\alpha \in h} \left\{ \left( D_{a}\pp{\left( \frac{3}{2} k_B n_a T_g\right)}{x} + z_{a} \mu_{a} \pp{V}{x} \left( \frac{3}{2} k_B n_a T_g\right) \right) \right\} \\ + &+ \sum_{\alpha \in h} \left\{ \varepsilon_{\alpha} \left( - z_{\alpha} \mu_{\alpha} n_{\alpha} \pp{V}{x} - D_{\alpha} \pp{n_{\alpha}}{x} \right) \right\} +\label{eqn:totalE_fluxSimplified} +\end{align*} +% + +\subsubsection{Total Energy Sanity Check} +As a check on our total energy equation, we derive it from previously +introduced equations. We have +% +\begin{align*} +\pp{ne_t}{t} &= +\underbrace{\pp{}{t} \left( n_e \frac{3}{2} k_B T_e \right)}_{\textrm{Electron energy}} + +\underbrace{\pp{}{t} \left( \sum_{\alpha \in h} \frac{3}{2} k_B n_\alpha T_g \right)}_{\textrm{Heavy energy}} + +\underbrace{\sum_{\alpha \in h} \pp{n_{\alpha}}{t} \varepsilon_{\alpha}}_{\textrm{Species continuity}}, +\end{align*} +% +where the underbraces denote the previous equations that each term is +associated with. Collecting the transport terms from these equations, +it is straightforward to show that $q$ defined +in~\eqref{eqn:totalE_flux} is consistent. Similarly, collecting the +Joule heating terms from the electron and heavy species energy +equations, and setting $C_{\mathrm{inc}} = 1$ gives the Joule heating +term in~\eqref{eqn:totalE}. Clearly, we may allow $C_{\mathrm{inc}} +\neq 1$ in~\eqref{eqn:totalE} by a simple modification. + +From the remaining source terms we have +% +\begin{equation*} +- +\underbrace{\frac{3}{2} k_B n_e \frac{2 m_e}{m_b} \left( T_e - T_g \right) \bar{\nu}_{e,b}}_{\textrm{Elastic}} +- +\underbrace{q_e \sum_{j=1}^{N_r} \Delta E^e_j G_j}_{\textrm{Inelastic}}, ++ +\underbrace{\frac{3}{2} k_B n_e \frac{2 m_e}{m_b} \left( T_e - T_g \right) \bar{\nu}_{e,b}}_{\textrm{Elastic}} +- +\underbrace{q_e \sum_{j=1}^{N_r} \Delta E^g_j G_j}_{\textrm{Inelastic}}, ++ +\sum_{\alpha} \dot{\omega}_{\alpha} \varepsilon_{\alpha}. +\end{equation*} +% +As expected, the elastic terms simply exchange thermal energy between +the electrons and heavies and thus cancel each other. The remaining +(inelastic) terms represent exchanges between thermal and internal +energy: +% +\begin{equation*} +- +\underbrace{q_e \sum_{j=1}^{N_r} \Delta E^e_j G_j}_{\textrm{Inelastic}}, +- +\underbrace{q_e \sum_{j=1}^{N_r} \Delta E^g_j G_j}_{\textrm{Inelastic}}, ++ +\sum_{\alpha} \dot{\omega}_{\alpha} \varepsilon_{\alpha}. +\end{equation*} +% +To the extent that these do not balance, it must be because the +mismatch is radiated away. For instance, we can imagine a +de-excitation event where part of the excess energy is radiated away +rather than being converted into thermal energy. This must be +accounted for in the radiation model $\dot{Q}_{rad}$. If we assert +that $\dot{Q}_{rad} = 0$, this implies that +% +\begin{equation*} +\sum_{\alpha} \dot{\omega}_{\alpha} \varepsilon_{\alpha} += +q_e \sum_{j=1}^{N_r} ( \Delta E^e_j + \Delta E^g_j) G_j +\end{equation*} +% +To assess this, we rewrite $\dot{\omega}_{\alpha}$ in terms of the +contribution from each reaction: +% +\begin{equation*} +\sum_{\alpha} \dot{\omega}_{\alpha} \varepsilon_{\alpha} += +\sum_{j=1}^{N_r} \left\{ \sum_{\alpha} \left( \nu_{\alpha j}^{\prime \prime} - \nu_{\alpha j}^{\prime} \right) \varepsilon_{\alpha} \right\} G_j, +\end{equation*} +% +where $\nu_{\alpha j}^{\prime \prime}$ and $\nu_{\alpha j}^{\prime}$ +are stoichiometric coefficients (see~\S\ref{sec:fluid-closures}). Thus, +for $\dot{Q}_{rad} = 0$, it is sufficient to have +% +\begin{equation*} +\sum_{\alpha} \left( \nu_{\alpha j}^{\prime \prime} - \nu_{\alpha j}^{\prime} \right) \varepsilon_{\alpha} += +\Delta E^e_j + \Delta E^g_j +\end{equation*} +% +for all reactions $j$. + +\subsection{Pressure Constraint} \label{sec:pconstraint} +As noted in~\S\ref{sec:species-continuity}, in the ``constant $p$'' +mode, we assume constant pressure is maintained by adding or +subtracting the background species. Letting $n_b$ denote the number +density of the background species, then +% +\begin{equation*} +\pp{n_b}{t} = S, +\end{equation*} +% +where $S$ is determined by requiring constant pressure. Assuming this +mass is introduced at the local gas temperature, this also introduces +a source term on the righthand side of the heavy species and total +energy equations. This source term is given by $\frac{3}{2} S k_B +T_g$ (again assuming only monatomic species). Then, to determine $S$, +we may use the relationship between the total energy and the pressure. Specifically, +% +\begin{equation*} +ne_t = \frac{3}{2} p + \sum_{\alpha} n_{\alpha} \varepsilon_{\alpha}. +\end{equation*} +% +Thus, since the pressure is fixed, +% +\begin{equation*} +\pp{ne_t}{t} += \frac{3}{2} \pp{p}{t} + \sum_{\alpha} \pp{n_{\alpha}}{t} \varepsilon_{\alpha} += \sum_{\alpha} \pp{n_{\alpha}}{t} \varepsilon_{\alpha}. +\end{equation*} +% +Using the total energy equation~\eqref{eqn:totalE}, with the addition of the +source term imposed by addition of the background specie, this result +imposes a constraint that determines $S$: +% +\begin{equation*} +\sum_{\alpha} \pp{n_{\alpha}}{t} \varepsilon_{\alpha} += +-\,\pp{q}{x} ++ +\sum_{\alpha} q_e z_{\alpha} F_{\alpha} E ++ +\dot{Q}_{rad} ++ +\frac{3}{2} S k_B T_g. +\end{equation*} +% +Thus, +% +\begin{equation*} +S += +\frac{ +-\sum_{\alpha} \pp{n_{\alpha}}{t} \varepsilon_{\alpha} +- +\pp{q}{x} ++ +\sum_{\alpha} q_e z_{\alpha} F_{\alpha} E ++ +\dot{Q}_{rad} +} +{\frac{3}{2} k_B T_g} +\end{equation*} +% +Thus, using the ideal gas law to determine $T_g$ from the species +densities and electron energy, +% +\begin{equation*} +\frac{3}{2} k_B T_g = \frac{ \frac{3}{2} p - n_e e_e }{\sum_{\alpha \in h} n_{\alpha}}, +\end{equation*} +% +$S$ may be determined given the state and its spatial derivatives. + +\subsection{Electromagnetics} \label{sec:pdes-poisson} +A quasi-static model is used for the electromagnetics. In this case, +Maxwell's equations reduce to a Poisson equation governing the +electric potential $\phi$: +% +\begin{equation*} +-\pp{^2\phi}{x^2} = \frac{\rho_c}{\epsilon_0} +\end{equation*} +% +where $\rho_c$ is the charge density and $\epsilon_0$ is the +permittivity of free space. The charge density is given from the +species densities: +% +\begin{equation*} +\rho_c = \sum_{\alpha=1}^{N_s} z_{\alpha} q_e n_{\alpha}, +\end{equation*} +% +where $q_e$ is the elementary charge (the magnitude of the charge of +an electron). + + +\subsection{Equation Summary} +The state vector consists of the species densities ($n_e$ and +$n_{\alpha}$ for $\alpha \in h$) and the electron energy ($n_e e_e$). +The evolution equations are +% +\begin{gather*} +\pp{n_b}{t} = S, \quad \textrm{where ``b'' indicates the background specie}\\ +\pp{n_{\alpha}}{t} + \pp{F_{\alpha}}{x} = \dot{\omega}_{\alpha}, \quad \textrm{for all non-background species}\\ +\pp{}{t} \left( \frac{3}{2} k_B n_e T_e \right) ++ +\pp{}{x} \left( \frac{5}{2} k_B T_e F_e - \kappa_e \pp{T_e}{x} \right) += +- q_e F_e E +- +\frac{3}{2} k_B n_e \frac{2 m_e}{m_b} \left( T_e - T_g \right) \bar{\nu}_{e,b} +- +q_e \sum_{j=1}^{N_r} \Delta E^e_j G_j. +\end{gather*} +% +These equations are unclosed because of the precence of the fields $S$ +and $E = - \nabla \phi$. These fields are determined by two +additional constraints: +% +\begin{gather*} +\sum_{\alpha} \pp{n_{\alpha}}{t} \varepsilon_{\alpha} += +-\,\pp{q}{x} ++ +\sum_{\alpha} q_e z_{\alpha} F_{\alpha} E ++ +\dot{Q}_{rad} ++ +\frac{3}{2} S k_B T_g \\ +% +-\pp{^2\phi}{x^2} = \frac{1}{\epsilon_0} \sum_{\alpha=1}^{N_s} z_{\alpha} q_e n_{\alpha}. +\end{gather*} +% + diff --git a/doc/gitinfo2.pm b/doc/gitinfo2.pm new file mode 100755 index 00000000..016bad70 --- /dev/null +++ b/doc/gitinfo2.pm @@ -0,0 +1,93 @@ +#!/usr/bin/env perl +# Copyright 2018 Raphaƫl P. Barazzutti +# +# GitInfo2LatexMk - v0.2.1 +# Inspired by Brent Longborough's update-git.sh (part of gitinfo2 LaTeX package) +# +# The original update-git.sh is supposed to be "hooked" to some git events (such that +# Post-{commit,checkout,merge}). +# Although this approach is elegant, I find a bit too intrusive and complicated +# to maintain. +# +# This Perl variant makes sense for latexmk users. The only requirement is to add +# the following line into the .latexmkrc file that lays in the root of your +# LaTeX project (create it, if absent). +# +# do './gitinfo2.pm' +# +# That's it! Now it'd work! + +sub git_info_2 { + + # get file content as a string + my $get_file_content = sub { + my ($f)= @_; + + # do not separate the reads per line + local $/ = undef; + + open FILE, $f or return ""; + $string = ; + + close FILE; + return $string; + }; + + # compare two files` + my $cmp = sub { + my($a,$b) = @_; + + return $get_file_content->($a) ne $get_file_content->($b); + }; + + my $RELEASE_MATCHER = "[0-9]*.*"; + + if(%GI2TM_OPTIONS){ + if(exists $GI2TM_OPTIONS{"RELEASE_MATCHER"}){ + $RELEASE_MATCHER = $GI2TM_OPTIONS{"RELEASE_MATCHER"}; + } + } + + # When running in a sub-directories of the repo + my $REPOBASE = `git rev-parse --show-toplevel`; + chomp($REPOBASE); + my $GITDIR = "$REPOBASE/.git"; + + my $GIN = "$GITDIR/gitHeadInfo.gin"; + my $NGIN = "$GIN.new"; + + print "gitinfo2pm: saving git revision info at $GIN\n"; + +# if(length(`git status --porcelain`) == 0){ + # Get the first tag found in the history from the current HEAD + my $FIRSTTAG = `git describe --tags --always --dirty='-*'`; + chop($FIRSTTAG); + + # Get the first tag in history that looks like a Release + my $RELTAG = `git describe --tags --long --always --dirty='-*' --match '$RELEASE_MATCHER'`; + chop($RELTAG); + + # Hoover up the metadata + my $metadata =`git --no-pager log -1 --date=short --decorate=short --pretty=format:"shash={%h}, lhash={%H}, authname={%an}, authemail={%ae}, authsdate={%ad}, authidate={%ai}, authudate={%at}, commname={%an}, commemail={%ae}, commsdate={%ad}, commidate={%ai}, commudate={%at}, refnames={%d}, firsttagdescribe={$FIRSTTAG}, reltag={$RELTAG} " HEAD`; + + open(my $fh,'>',$NGIN); + print $fh "\\usepackage[".$metadata."]{gitexinfo}\n"; + close $fh; + +# }else{ +# print "GIT UNCLEAN\n"; +# } + + $cmp->($GIN,$NGIN ); + + if((-e $GIN || -e $NGIN) && $cmp->($GIN, $NGIN)) { + print "Status changed, request recompilation\n"; + $go_mode = 1; + unlink($GIN); + rename($NGIN, $GIN); + } else { + unlink($NGIN); + } +} + +git_info_2(); diff --git a/doc/glow.tex b/doc/glow.tex new file mode 100644 index 00000000..61144b1e --- /dev/null +++ b/doc/glow.tex @@ -0,0 +1,83 @@ +\documentclass[11pt]{report} + +\usepackage{fullpage} +\usepackage{graphicx} +\usepackage{xcolor} +\usepackage{todonotes} +\usepackage{siunitx} +\usepackage[square,numbers]{natbib} +\usepackage[american,siunitx]{circuitikz} + +\usepackage[font=small,skip=2pt,justification=raggedright]{subcaption} +\usepackage[font=small,skip=2pt,justification=raggedright]{caption} + +\usepackage{amsmath,amssymb,stmaryrd} +\usepackage[makeroom]{cancel} +\usepackage{mhchem} + +\graphicspath{{./figures/}} + +% include version control watermark +\usepackage[mark,maxdepth=6,raisemark=2.\baselineskip]{gitinfo2} +\renewcommand{\gitMark}{\gitAbbrevHash{} (\gitAuthorDate)} +\renewcommand{\gitMarkPref}{[~revision~]} + +% custom colors +\definecolor{copper}{rgb}{0.72,0.45,0.20} +\definecolor{darksilver}{rgb}{0.67,0.67,0.67} +\definecolor{silver}{rgb}{0.75,0.75,0.75} +\definecolor{lightsilver}{rgb}{0.83,0.83,0.83} +\definecolor{mint}{rgb}{0.6,0.98,0.6} +\definecolor{darkgreen}{rgb}{0.0,0.5,0.0} + +% custom commands +\newcommand{\mbb}[1]{\mathbb{#1}} +\newcommand{\mbf}[1]{\mathbf{#1}} +\newcommand{\sbf}[1]{\boldsymbol{#1}} +\newcommand{\mcal}[1]{\mathcal{#1}} +\newcommand{\mfk}[1]{\mathfrak{#1}} +\newcommand{\pp}[2]{\frac{\partial #1}{\partial #2}} +\newcommand{\dd}[2]{\frac{d #1}{d #2}} +\newcommand{\rarrow}{\rightarrow} +\newcommand{\Rarrow}{\Rightarrow} +\newcommand{\LRarrow}{\Leftrightarrow} +\newcommand{\ud}{\,\mathrm{d}} +\newcommand{\jump}[1]{\llbracket #1 \rrbracket} +\newcommand{\avg}[1]{\{ #1 \}} + +% title foo +% TODO: make a snazzy title page +\title{Glow Discharge Modeling Document} +\author{% + The PECOS Development Team\\ + Oden Institute for Computational Engineering and Sciences\\ + The University of Texas at Austin +} +\date{} + + +\begin{document} +\maketitle +\tableofcontents + +\chapter*{Preface} +\input{overview} + +\chapter{Fluid Model} \label{sec:fluid} +\input{fluid/pdes} +\input{fluid/bcs} +\input{fluid/closure} + +\chapter{Supporting Models and Data} +\input{bolsig/overview} +\input{bolsig/eqns} + +\chapter{Numerical Methods} +\todo{Write me} + +\input{appendix} + +\bibliographystyle{plainnat} +\bibliography{bibs/glow} + +\end{document} diff --git a/doc/overview.tex b/doc/overview.tex new file mode 100644 index 00000000..0c701b20 --- /dev/null +++ b/doc/overview.tex @@ -0,0 +1,11 @@ +This document describes the mathematical models and numerical methods +that will be used to simulate the glow discharge device. A schematic +of the device is shown in Figure~\ref{fig:glowSchematic}. +% +\begin{figure}[htp] +\begin{center} +\includegraphics[width=0.6\linewidth]{glowfigcrop.pdf} +\end{center} +\caption{Schematic of the glow discharge device (taken from the proposal).} +\label{fig:glowSchematic} +\end{figure} diff --git a/doc/vc b/doc/vc new file mode 100755 index 00000000..7ae6c8cc --- /dev/null +++ b/doc/vc @@ -0,0 +1,27 @@ +#!/bin/sh +# This is file 'vc' from the vc bundle for TeX. +# The original file can be found at CTAN:support/vc. +# This file is Public Domain. + +# Parse command line options. +full=0 +mod=0 +while [ -n "$(echo $1 | grep '-')" ]; do + case $1 in + -f ) full=1 ;; + -m ) mod=1 ;; + * ) echo 'usage: vc [-f] [-m]' + exit 1 + esac + shift +done + +MY_PATH="`dirname \"$0\"`" + +# English locale. +LC_ALL=C +git --no-pager log -1 HEAD --pretty=format:"Hash: %H%nAbr. Hash: %h%nParent Hashes: %P%nAbr. Parent Hashes: %p%nAuthor Name: %an%nAuthor Email: %ae%nAuthor Date: %ai%nCommitter Name: %cn%nCommitter Email: %ce%nCommitter Date: %ci%n" |gawk -v script=log -v full=$full -f $MY_PATH/vc-git.awk > vc.tex +if [ "$mod" = 1 ] +then + git status |gawk -v script=status -f vc-git.awk >> vc.tex +fi diff --git a/doc/vc-git.awk b/doc/vc-git.awk new file mode 100644 index 00000000..66b35263 --- /dev/null +++ b/doc/vc-git.awk @@ -0,0 +1,89 @@ +# This is file 'vc-git.awk' from the vc bundle for TeX. +# The original file can be found at CTAN:support/vc. +# This file is Public Domain. +BEGIN { + +### Process output of "git status". + if (script=="status") { + modified = 0 + } + +} + + + +### Process output of "git log". +script=="log" && /^Hash:/ { Hash = substr($0, 2+match($0, ":")) } +script=="log" && /^Abr. Hash:/ { AbrHash = substr($0, 2+match($0, ":")) } +script=="log" && /^Parent Hashes:/ { ParentHashes = substr($0, 2+match($0, ":")) } +script=="log" && /^Abr. Parent Hashes:/ { AbrParentHashes = substr($0, 2+match($0, ":")) } +script=="log" && /^Author Name:/ { AuthorName = substr($0, 2+match($0, ":")) } +script=="log" && /^Author Email:/ { AuthorEmail = substr($0, 2+match($0, ":")) } +script=="log" && /^Author Date:/ { AuthorDate = substr($0, 2+match($0, ":")) } +script=="log" && /^Committer Name:/ { CommitterName = substr($0, 2+match($0, ":")) } +script=="log" && /^Committer Email:/ { CommitterEmail = substr($0, 2+match($0, ":")) } +script=="log" && /^Committer Date:/ { CommitterDate = substr($0, 2+match($0, ":")) } + +### Process output of "git status". +### Changed index? +script=="status" && /^# Changes to be committed:/ { modified = 1 } +### Unstaged modifications? +script=="status" && /^# Changed but not updated:/ { modified = 2 } + + + +END { + +### Process output of "git log". + if (script=="log") { +### Standard encoding is UTF-8. + if (Encoding == "") Encoding = "UTF-8" +### Extract relevant information from variables. + LongDate = substr(AuthorDate, 1, 25) + DateRAW = substr(LongDate, 1, 10) + DateISO = DateRAW + DateTEX = DateISO + gsub("-", "/", DateTEX) + Time = substr(LongDate, 12, 14) +### Write file identification to vc.tex. + print "%%% This file has been generated by the vc bundle for TeX." + print "%%% Do not edit this file!" + print "%%%" +### Write Git specific macros. + print "%%% Define Git specific macros." + print "\\gdef\\GITHash{" Hash "}%" + print "\\gdef\\GITAbrHash{" AbrHash "}%" + print "\\gdef\\GITParentHashes{" ParentHashes "}%" + print "\\gdef\\GITAbrParentHashes{" AbrParentHashes "}%" + print "\\gdef\\GITAuthorName{" AuthorName "}%" + print "\\gdef\\GITAuthorEmail{" AuthorEmail "}%" + print "\\gdef\\GITAuthorDate{" AuthorDate "}%" + print "\\gdef\\GITCommitterName{" CommitterName "}%" + print "\\gdef\\GITCommitterEmail{" CommitterEmail "}%" + print "\\gdef\\GITCommitterDate{" CommitterDate "}%" +### Write generic version control macros. + print "%%% Define generic version control macros." + print "\\gdef\\VCRevision{\\GITAbrHash}%" + print "\\gdef\\VCAuthor{\\GITAuthorName}%" + print "\\gdef\\VCDateRAW{" DateRAW "}%" + print "\\gdef\\VCDateISO{" DateISO "}%" + print "\\gdef\\VCDateTEX{" DateTEX "}%" + print "\\gdef\\VCTime{" Time "}%" + print "\\gdef\\VCModifiedText{\\textcolor{red}{with local modifications!}}%" + print "%%% Assume clean working copy." + print "\\gdef\\VCModified{0}%" + print "\\gdef\\VCRevisionMod{\\VCRevision}%" + } + +### Process output of "git status". + if (script=="status") { + print "%%% Is working copy modified?" + print "\\gdef\\VCModified{" modified "}%" + if (modified==0) { + print "\\gdef\\VCRevisionMod{\\VCRevision}%" + } else { + print "\\gdef\\VCRevisionMod{\\VCRevision~\\VCModifiedText}%" + } + } + +}