  We perform global three-dimensional (3D) radiation-hydrodynamics calculations
of the envelopes surrounding young planetary cores of 5, 10, and 15 Earth
masses, located in a protoplanetary disk at 5 and 10 AU from a solar-mass star.
We apply a nested-grid technique to resolve the thermodynamics of the disk at
the orbital-radius length scale and that of the envelope at the core-radius
length scale. The gas is modeled as a solar mixture of molecular and atomic
hydrogen, helium, and their ions. The equation of state accounts for both gas
and radiation, and gas energy includes contributions from rotational and
vibrational states of molecular hydrogen and from ionization of atomic species.
Dust opacities are computed from first principles, applying the full Mie
theory. One-dimensional (1D) calculations of planet formation are used to
supplement the 3D calculations by providing energy deposition rates in the
envelope due to solids accretion. We compare 1D and 3D envelopes and find that
masses and gas accretion rates agree within factors of 2, and so do envelope
temperatures. The trajectories of passive tracers are used to define the size
of 3D envelopes, resulting in radii much smaller than the Hill radius and
smaller than the Bondi radius. The moments of inertia and angular momentum of
the envelopes are determined and the rotation rates are derived from the
rigid-body approximation, resulting in slow bulk rotation. We find that the
polar flattening is < ~0.05. The dynamics of the accretion flow is examined by
tracking the motion of tracers that move into the envelope. The anisotropy of
this flow is characterized in terms of both its origin and impact site at the
envelope surface. Gas merges with the envelope preferentially at mid- to high
latitudes.
