  The engulfment of substellar bodies (SBs, such as brown dwarfs and planets)
by giant stars is a possible explanation for rapidly rotating giants,
lithium-rich giants, and the presence of SBs in close orbits around subdwarfs
and white dwarfs. We simulate the flow in the vicinity of an engulfed SB in
three-dimensional hydrodynamics. We model the SB as a rigid body with a
reflective surface because it cannot accrete. This reflective boundary changes
the flow morphology to resemble that of engulfed compact objects with outflows.
We measure the drag coefficients for the ram pressure and gravitational drag
forces acting on the SB, and use them to integrate its trajectory inside the
star. We find that engulfment can increase the luminosity of a $1M_\odot$ star
by up to a few orders of magnitude. The time for the star to return to its
original luminosity is up to a few thousand years when the star has evolved to
$\approx10R_\odot$ and up to a few decades at the tip of the red giant branch.
No SBs can eject the envelope of a $1M_\odot$ star before it evolves to
$\approx10R_\odot$, if the orbit of the SB is the only energy source
contributing to the ejection. In contrast, SBs as small as
$\approx10M_\text{Jup}$ can eject the envelope at the tip of the red giant
branch. The numerical framework we introduce here can be used to study
planetary engulfment in a simplified setting that captures the physics of the
flow at the scale of the SB.
