A phase-field model has been developed to describe the morphology of pores constrained by a dendritic solid network, and are forced to adopt complex non-spherical shapes. The distribution of the solid, liquid and gas phases was calculated with a multiphase-field approach which accounts for the pressure difference between the liquid and the gas. The model considers the partitioning of the dissolved gas at interfaces, gas diffusion and capillary forces at the solid/liquid, liquid/gas and gas/solid interfaces. The model was used to study the influence of the dendrite arm spacing (DAS) and the solid fraction on the state of a pore. The calculations show that a pore constrained to grow in a narrow liquid channel exhibits a substantially higher mean curvature, a larger pressure and a smaller volume than an unconstrained pore. Comparisons with simple geometrical models indicate that analytical approaches show a good trend but tend to underestimate the pore curvature, in particular at high solid fractions, where pores have to penetrate the thin liquid channels. For pores spanning over distances larger than the average DAS, the simulations showed that the radius of curvature can vary between two limits, which are given by the size of the narrowest section that the pore needs to pass in order to expand and by the largest sphere that can be fitted in the interdendritic liquid. The pore curvature is therefore a complex non-monotonic function of the DAS, the solid fraction, the hydrogen content and statistical variations of the liquid channel width. (C) 2011 Acta Materialia Inc. Published by Elsevier Ltd. All rights reserved.