  Cosmic rays (CRs) are thought to play a dynamically important role in several
key aspects of galaxy evolution, including the structure of the interstellar
medium, the formation of galactic winds, and the non-thermal pressure support
of halos. We introduce a numerical model solving for the CR streaming
instability and acceleration of CRs at shocks with a fluid approach in the
adaptive mesh refinement code ramses. CR streaming is solved with a diffusion
approach and its anisotropic nature is naturally captured. We introduce a shock
finder for the ramses code that automatically detects shock discontinuities in
the flow. Shocks are the loci for CR injection, and their efficiency of CR
acceleration is made dependent on the upstream magnetic obliquity according to
the diffuse shock acceleration mechanism. We show that the shock finder
accurately captures shock locations and estimates the shock Mach number for
several problems. The obliquity-dependent injection of CRs in the Sedov
solution leads to situations where the supernova bubble exhibits large polar
caps (homogeneous background magnetic field), or a patchy structure of the CR
distribution (inhomogeneous background magnetic field). Finally, we combine
both accelerated CRs with streaming in a simple turbulent interstellar medium
box, and show that the presence of CRs significantly modifies the structure of
the gas.
