  We aim to reproduce the DCO$^+$ emission in the disk around HD163296 using a
simple 2D chemical model for the formation of DCO$^+$ through the cold
deuteration channel and a parametric treatment of the warm deuteration channel.
We use data from ALMA in band 6 to obtain a resolved spectral imaging data cube
of the DCO$^+$ $J$=3--2 line in HD163296 with a synthesized beam of
0."53$\times$ 0."42. We adopt a physical structure of the disk from the
literature that reproduces the spectral energy distribution. We then apply a
simplified chemical network for the formation of DCO$^+$ that uses the physical
structure of the disk as parameters along with a CO abundance profile, a
constant HD abundance and a constant ionization rate. Finally, from the
resulting DCO$^+$ abundances, we calculate the non-LTE emission using the 3D
radiative transfer code LIME. The observed DCO$^+$ emission is reproduced by a
model with cold deuteration producing abundances up to $1.6\times 10^{-11}$.
Warm deuteration, at a constant abundance of $3.2\times 10^{-12}$, becomes
fully effective below 32 K and tapers off at higher temperatures, reproducing
the lack of DCO$^+$ inside 90 AU. Throughout the DCO$^+$ emitting zone a CO
abundance of $2\times 10^{-7}$ is found, with $\sim$99\% of it frozen out below
19 K. At radii where both cold and warm deuteration are active, warm
deuteration contributes up to 20\% of DCO$^+$, consistent with detailed
chemical models. The decrease of DCO$^+$ at large radii is attributed to a
temperature inversion at 250 AU, which raises temperatures above values where
cold deuteration operates. Increased photodesorption may also limit the radial
extent of DCO$^+$. The corresponding return of the DCO$^+$ layer to the
midplane, together with a radially increasing ionization fraction, reproduces
the local DCO$^+$ emission maximum at $\sim$260 AU.
