We model sympathetic cooling of ground-state CaF molecules by ultracold Li and Rb atoms. The molecules are moving in a microwave trap, while the atoms are trapped magnetically. We calculate the differential elastic cross sections for CaF-Li and CaF-Rb collisions, using model Lennard-Jones potentials adjusted to give typical values for the
s-wave scattering length. Together with trajectory calculations, these differential cross sections are used to simulate the cooling of the molecules, the heating of the atoms, and the loss of atoms from the trap. We show that a hard-sphere collision model based on an energy-dependent momentum transport cross section accurately predicts the molecule cooling rate but underestimates the rates of atom heating and loss. Our simulations suggest that Rb is a more effective coolant than Li for ground-state molecules, and that the cooling dynamics is less sensitive to the exact value of the
s-wave scattering length when Rb is used. Using realistic experimental parameters, we find that molecules can be sympathetically cooled to $100\phantom{\rule{0.28em}{0ex}}\ensuremath{\mu}\mathrm{K}$ in about 10 s. By applying evaporative cooling to the atoms, the cooling rate can be increased and the final temperature of the molecules can be reduced to $1 \ensuremath{\mu}\mathrm{K}$ within 30 s.
We prepare mixtures of ultracold CaF molecules and Rb atoms in a magnetic trap and study their inelastic collisions. When the atoms are prepared in the spin-stretched state and the molecules in the spin-stretched component of the first rotationally excited state, they collide inelastically with a rate coefficient k_{2}=(6.6±1.5)×10^{-11} cm^{3}/s at temperatures near 100 μK. We attribute this to rotation-changing collisions. When the molecules are in the ground rotational state we see no inelastic loss and set an upper bound on the spin-relaxation rate coefficient of k_{2}<5.8×10^{-12} cm^{3}/s with 95% confidence. We compare these measurements to the results of a single-channel loss model based on quantum defect theory. The comparison suggests a short-range loss parameter close to unity for rotationally excited molecules, but below 0.04 for molecules in the rotational ground state.