We discuss the basic problems and methods involved in the design of a radia
tive transfer module for a 2D/3D (magneto-)hydrodynamics simulation code ai
med at applications in cool-star atmospheres. Attention is focused on the d
ifficulties arising from the unstructured triangular/tetrahedral grid and t
he need to minimize the communication overhead, so that the code runs effic
iently on parallel computers. In a first step, we use the gray approximatio
n and ignore scattering effects, but even then the computation of the radia
tive heating rate, required as a source term in the energy equation, involv
es several integration steps that are discussed in detail. In particular, t
he details of the short-characteristics solver for the radiative transfer e
quation, the influence of the cell size, and the accuracy of the angular in
tegrations of the specific intensity are considered. Theoretical estimates
of possible errors are in general cumbersome to obtain; instead we use simp
le model problems for the accuracy estimates. A plane-parallel model for th
e quiet Sun serves as a testground for the basics while a schematic model o
f a magnetic flux sheet provides an acid test for the behavior of the compu
tational methods under typical circumstances arising during simulations. Tw
o alternative methods to compute the radiative heating rate are compared an
d their weaknesses are identified. The errors are minimized by a hybrid sch
eme that selects a method depending on the optical path length within a gri
d cell.