  We generalize the twisted quantum double model of topological orders in two
dimensions to the case with boundaries by systematically constructing the
boundary Hamiltonians. Given the bulk Hamiltonian defined by a gauge group $G$
and a three-cocycle in the third cohomology group of $G$ over $U(1)$, a
boundary Hamiltonian can be defined by a subgroup $K$ of $G$ and a two-cochain
in the second cochain group of $K$ over $U(1)$. The consistency between the
bulk and boundary Hamiltonians is dictated by what we call the Frobenius
condition that constrains the two-cochain given the three-cocyle. We offer a
closed-form formula computing the ground state degeneracy of the model on a
cylinder in terms of the input data only, which can be naturally generalized to
surfaces with more boundaries. We also explicitly write down the ground-state
wavefunction of the model on a disk also in terms of the input data only.
