  We propose a numerical method using the discrete variable representation
(DVR) for constructing real-valued Wannier functions localized in a unit cell
for both symmetric and asymmetric periodic potentials. We apply these results
to finding Wannier functions for ultracold atoms trapped in laser-generated
optical lattices. Following Kivelson \cite{kivelson_wannier_1982}, for a
symmetric lattice with inversion symmetry, we construct Wannier functions as
eigen states of the position operators $\hat x$, $\hat y$ and $\hat z$
restricted to single-particle Bloch functions belonging to one or more bands.
To ensure that the Wannier functions are real-valued, we numerically obtain the
band structure and real-valued eigen states using a uniform Fourier grid DVR.
We then show by a comparison of tunneling energies, that the Wannier functions
are accurate for both inversion symmetric and asymmetric potentials to better
than ten significant digits when using double-precision arithmetic. The
calculations are performed for an optical lattice with double-wells per unit
cell with tunable asymmetry along the $x$ axis and a single sinusoidal
potential along the perpendicular directions. Localized functions at the two
potential minima within each unit cell are similarly constructed, but using a
superposition of single-particle solutions from the two lowest bands. We
finally use these localized basis functions to determine the two-body
interaction energies in the Bose-Hubbard (BH) model, and show the dependence of
these energies on lattice asymmetry.
