The Pencil Code is a highly modular physics-oriented simulation code that can be adapted to a wide range of applications. It is primarily designed to solve partial differential equations (PDEs) of compressible hydrodynamics and has lots of add-ons ranging from astrophysical magnetohydrodynamics (MHD) to meteorological cloud microphysics and engineering applications in combustion. Nevertheless, the framework is general and can also be applied to situations not related to hydrodynamics or even PDEs, for example when just the message passing interface or input/output strategies of the code are to be used. The code can also evolve Lagrangian (inertial and noninertial) particles, their coagulation and condensation, as well as their interaction with the fluid.
The thermal instability with a piecewise power law cooling function is investigated using one- and three-dimensional simulations with periodic and shearing-periodic boundary conditions in the presence of constant thermal diffusion and kinematic viscosity coefficients. Consistent with earlier findings, the flow behavior depends on the average density, ⟨ρ⟩. When ⟨ρ⟩ is in the range (1-5) × 10-24 g cm-3, the system is unstable and segregates into cool and warm phases with temperatures of roughly 100 and 104 K, respectively. However, in all cases the resulting average pressure ⟨p⟩ is independent of ⟨ρ⟩ and just a little above the minimum value. For a constant heating rate of 0.015 ergs g-1 s-1, the mean pressure is around 24 × 10-14 dyn (corresponding to p/kB ≈ 1750 K cm-3). Cool patches tend to coalesce into bigger ones. In all cases investigated, there is no sustained turbulence, which is in agreement with earlier results. Simulations in which turbulence is driven by a body force show that when rms velocities of between 10 and 30 km s-1 are obtained, the resulting dissipation rates are comparable to the thermal energy input rate. The resulting mean pressures are then about 30 × 10-14 dyn, corresponding to p/kB ≈ 2170 K cm-3. This is comparable to the value expected for the Galaxy. Differential rotation tends to make the flow two-dimensional, that is, uniform in the streamwise direction, but this does not lead to instability.
The macroscopic behaviour of cosmic rays in turbulent magnetic fields is discussed. An implementation of anisotropic diffusion of cosmic rays with respect to the magnetic field in a non-conservative, high-order, finite-difference magnetohydrodynamic code is discussed. It is shown that the standard implementation fails near singular X-points of the magnetic field, which are common if the field is random. A modification to the diffusion model for cosmic rays is described and the resulting telegraph equation (implemented by solving a dynamic equation for the diffusive flux of cosmic rays) is used; it is argued that this modification may better describe the physics of cosmic ray diffusion. The present model reproduces several processes important for the propagation and local confinement of cosmic rays, including spreading perpendicular to the local large-scale magnetic field, controlled by the random-to-total magnetic field ratio, and the balance between cosmic ray pressure and magnetic tension. Cosmic ray diffusion is discussed in the context of a random magnetic field produced by turbulent dynamo action. It is argued that energy equipartition between cosmic rays and other constituents of the interstellar medium does not necessarily imply that cosmic rays play a significant role in the balance of forces.
In an attempt to determine the outer scale of turbulence driv en by localized sources, such as supernova explosions in the interstellar medium, we consid er a forcing function given by the gradient of gaussian profiles localized at random positions . Different coherence times of the forcing function are considered. In order to isolate the eff cts specific to the nature of the forcing function we consider the case of an isothermal equat ion of state and restrict ourselves to forcing amplitudes such that the flow remains subsonic. Wh en t e coherence time is short, the outer scale agrees with the scale of the gaussian. Longer coh ence times can cause extra power at large scales, but this would not yield power law beha vior at scales larger than that of the expansion waves. At scales smaller than the scale of th e expansion waves the spectrum is close to power law with a spectral exponent of −2. The resulting flow is virtually free of vorticity. Viscous driving of vorticity turns out to be weaknd self-amplification through the nonlinear term is found to be insignificant. No evidence for s mall scale dynamo action is found.
We study the effect of an imposed vertical magnetic field on the turbulent mass diffusion properties of magnetorotational turbulence in protoplanetary discs. It is well-known that the effective viscosity generated by the turbulence depends strongly on the magnitude of such an external field. In this Letter we show that the turbulent diffusion of the flow also changes, but that the diffusion coefficient does not rise with increasing vertical field as fast as the viscosity does. The vertical Schmidt number, i.e. the ratio between viscosity and vertical diffusion, can be close to 20 for high field magnitudes, whereas the radial Schmidt number is increased from below unity to around 3.5. Our results may have consequences for the interpretation of observations of dust in protoplanetary discs and for chemical evolution modelling of these discs.
In an attempt to determine the outer scale of turbulence driven by localized sources, such as supernova explosions in the interstellar medium, we consider a forcing function given by the gradient of gaussian profiles localized at random positions. Different coherence times of the forcing function are considered. In order to isolate the effects specific to the nature of the forcing function we consider the case of a polytropic equation of state and restrict ourselves to forcing amplitudes such that the flow remains subsonic. When the coherence time is short, the outer scale agrees with the half-width of the gaussian. Longer coherence times can cause extra power at large scales, but this would not yield power law behavior at scales larger than that of the expansion waves. At scales smaller than the scale of the expansion waves the spectrum is close to power law with a spectral exponent of -2. The resulting flow is virtually free of vorticity. Viscous driving of vorticity turns out to be weak and self-amplification through the nonlinear term is found to be insignificant. No evidence for small scale dynamo action is found in cases where the magnetic induction equation is solved simultaneously with the other equations.