  We investigate close encounters by stellar mass black holes (BHs) in the
gaseous discs of active galactic nuclei (AGN) as a potential formation channel
of binary black holes (BBHs). We perform a series of 2D isothermal viscous
hydrodynamical simulations within a shearing box prescription using the
Eulerian grid code \texttt{Athena++}. We co-evolve the embedded BHs with the
gas keeping track of the energetic dissipation and torquing of the BBH by gas
gravitation and inertial forces. To probe the dependence of capture on the
initial conditions, we discuss a suite of 345 simulations spanning local AGN
disc density ($\rho_0$) and impact parameter ($b$) space. We identify a clear
region in $b - \rho_0$ space where gas assisted BBH capture is efficient. We
find that the presence of gas leads to strong energetic dissipation during
close encounters between unbound BHs, forming stably bound eccentric BBHs. We
find that the gas dissipation during close encounters increases for systems
with increased disc density and deeper periapsis passages $r_p$, fitting a
power law such that $\Delta E \propto \rho_0^{\alpha}r_p^{\beta}$ where
$\{\alpha,\beta\} = \{1.01\pm0.04,-0.43\pm0.03\}$. Alternatively, the gas
dissipation is approximately $\Delta E = 4.3 M_\text{d} v_\text{H} v_p$, where
$M_\text{d} $ is the mass of a single BH minidisc just prior to the encounter
when the binary separation is $2r_\text{H}$ (two binary Hill radii),
$v_\text{H}$ and $v_p$ are the relative BH velocities at $2r_\text{H}$ and at
the first closest approach, respectively. We derive a prescription for capture
which can be used in semi-analytical models of AGN. We do not find the
dissipative dynamics observed in these systems to be in agreement with the
simple gas dynamical friction models often used in the literature.
