\section{Numerical model} \label{s.numerical}

\begin{figure*}
\includegraphics{fig_props}
\caption{Mesh structure (left), effective temperature (center) and
  effective gravity (right) for the O6V+O6V model, plotted as a
  function of sky coordinates $(x,y)$ for pole-on (top) and equator-on
  (bottom) vantages.}
\label{f.props}
\end{figure*}

\begin{figure*}
\includegraphics{fig_vel}
\caption{As in Figure~\ref{f.props}, except that the Cartesian
  components of the velocity are now shown in the sky coordinate
  system (the $z$ axis is directed out of the page).}
\label{f.vel}
\end{figure*}

\begin{figure*}
\includegraphics{isovelocity_t10000i30}
\caption{Snapshots of the isovelocity contours and
  \hetwo\,4026\,\AA\ line profiles for the O6+O6 model, at four
  selected orbital phases. Only the lower part of the line profiles is
  shown, in order to emphasize the depth differences. The dashed lines
  show the corresponding profiles in the absence of surface flows.}
\label{f.spectra}
\end{figure*}

\subsection{Overview} \label{s.numerical.over}

To predict the observable consequences of the transverse surface flows
described in the preceding section, we use the \glados\ spectral
modeling code (Hill \& Townsend, in preparation). Triangle-based
meshes representing the surfaces of the binary components are
constructed, using an iterative procedure to solve for the irradiating
fluxes. These meshes are rasterized using \glados's smooth shading
option to create property images comprised of pixels storing property
values derived from the sky-projected mesh. For each pixel, an
observer-directed specific intensity is synthesized; summing over all
pixels then yields a model spectrum for the system.

\subsection{Mesh Generation} \label{s.numerical.mesh}

The mesh for each binary component is generated by applying the
regularized marching tetrahedra (RMT) algorithm to the appropriate
Roche potential $\roche$, as described in section 3.2.3 of Hill \&
Townsend. The overall geometry of the system is set by specifying a
mass $M$ and polar radius $\Rpole$ for each component, together with
an orbital period $\period$. We assume that the orbit is circular and
the components rotate synchronously, since the focus here is on close
systems.

The local surface normal vector $\venorm$ and effective gravity
$\geff$ at each mesh vertex are obtained directly from the gradient of
the Roche potential,
\begin{equation}
\nabla \roche = \geff\ \venorm.
\end{equation}
The effective temperature $\Teff$ and transverse flow velocity
$\vvmean$ are calculated by first evaluating the external flux vector
$\vFex$ on each triangular face. This involves an iterative procedure,
similar to that outlined in \citet[][their section 3.2]{Hendry:1992aa}
but modified to handle vector fluxes. At each stage of the iteration,
the flux vector for each face is updated via a discrete integral over
the irradiating specific intensity,
\begin{equation} \label{e.flux-sum}
\vFexkpi = \sum_{j} \Ikj (\muij) \veij \Domegaij
\end{equation}
Here and throughout, the subscript $i$ indexes the faces of one mesh,
while $j$ indexes the faces of the other, with the superscript $k$
denoting the iteration stage. The unit vector $\veij$ is defined as
\begin{equation}
\veij = \frac{\vri - \vrj}{\dij},
\end{equation}
where $\vri$ and $\vrj$ are the position vectors of the face centers, and
\begin{equation}
\dij = |\vri - \vrj|
\end{equation}
is their separation. The term $\Ikj(\muij)$ denotes the \kth-stage
specific intensity, emergent from the \jth\ face in a direction
\begin{equation}
\muij = \veij \cdot \venormj,
\end{equation}
relative to the local surface normal $\venormj$. Likewise, the
$\Domegaij$ term represents the solid angle subtended by the \jth\
face at the \ith\ face, which can be written in terms of the face
area $\dareaj$ as
\begin{equation}
\Domegaij = \frac{\muij \dareaj}{\dij^{2}}.
\end{equation}
Note that the sum in equation~(\ref{e.flux-sum}) is taken only over
those faces that can `see' each other, such that $\veij \cdot \venormj
> 0$ and $\veij \cdot \venormi < 0$.

The specific intensity $\Ikj(\mu)$ is calculated using the expression
\begin{equation} \label{e.intensity-recon}
\Ikj(\mu) = (\Finj - \vFexkj \cdot \venormj) \recon(\mu).
\end{equation}
Here, $\Finj$ denotes the intrinsic outward flux of the \jth\ face,
calculated according to von Zeipel's \citeyear{von-Zeipel:1924aa} gravity
darkening law:
\begin{equation} \label{e.grav-dark}
\Finj = \frac{\geffj \Lstar}{\sum_{j'} \dareajp \geffjp},
\end{equation}
where $\Lstar$ is the intrinsic stellar luminosity (equal to the
energy release rate in the core). The term $\recon(\mu)$ is what might
be termed a `specific intensity reconstruction function'; it converts
an outgoing flux into a specific intensity that follows some
prescribed limb-darkening law. Following \citep{Hendry:1992aa}, we
adopt a reconstruction function based on a quadratic limb-darkening
law,
\begin{equation}
\recon(\mu) = \frac{6 \left[1 - (1 - \mu)u_{1} -
(1 - \mu^{2})u_{2}\right]}{\pi(6 - 2u_{1} - 3u_{2})} ,
\end{equation}
with gray-atmosphere bolometric coefficients $u_{1} = 0.6500$ and
$u_{2} = -0.0226$. Note that equation~(\ref{e.intensity-recon})
assumes the same reconstruction function for both intrinsic and
reflected fluxes. This is not quite correct; as \citet{Milne:1926aa}
first demonstrated, the reflected component is expected to show a limb
darkening behavior that is rather different from intrinsic
component. Nevertheless, any error introduced by this simplification
should be small.

The iterative procedure based on equation~(\ref{e.flux-sum}) converges
quite rapidly to the external flux incident on each mesh face; for a
fractional tolerance of $10^{-3}$, only $\approx 4$ steps are
required. Once converged, the corresponding flux vectors $\vFex$ on
each vertex are calculated by averaging over all faces that share that
vertex. These vectors are used to obtain vertex values for the
transverse flow velocity $\vvmean$ via equation~(\ref{e.flow-nonsph}), and
the local effective temperature $\Teff$ via
\begin{equation} \label{e.Teff}
\sigma \Teff^{4} = \Fin - \vFex \cdot \venorm,
\end{equation}
where the vertex intrinsic flux $\Fin$ is evaluated by similarly
averaging over neighboring faces.

\subsection{Spectral Synthesis} \label{s.numerical.spect}

The per-pixel spectral synthesis step uses a grid of specific
intensity spectra calculated with the \synspec\ code
\citep{Lanz:2003aa} from solar-metallicity, non-LTE line-blanketed
stellar atmosphere models: the OSTAR 2002 grid \citep{Lanz:2003aa} for
$\Teff \geq 30,000\,\kelv$, and the BSTAR 2006 grid
\citep{Lanz:2007aa} for $15,000\,\kelv \leq \Teff \leq
30,000\,\kelv$. The adoption of these \emph{unilluminated} atmospheres
represents an approximation: equation~(\ref{e.Teff}) itself amounts to
the assumption that the reflected radiation shares the same spectral
distribution as the intrinsic radiation, and thus simply augments
it. A more rigorous approach would involve self-consistent inclusion
of the external irradiation in the atmosphere and specific intensity
calculation \citep[e.g.,][]{Vaz:1985aa}, but this would introduce an
enormous jump in the computational cost of simulations.

