A force field model of phosphorus has been developed based on density functional ͑DF͒ computations and experimental results, covering low energy forms of local tetrahedral symmetry and more compact ͑simple cubic͒ structures that arise with increasing pressure. Rules tailored to DF data for the addition, deletion, and exchange of covalent bonds allow the system to adapt the bonding configuration to the thermodynamic state. Monte Carlo simulations in the N-P-T ensemble show that the molecular (P 4 ) liquid phase, stable at low pressure P and relatively low temperature T, transforms to a polymeric ͑gel͒ state on increasing either P or T. These phase changes are observed in recent experiments at similar thermodynamic conditions, as shown by the close agreement of computed and measured structure factors in the molecular and polymer phases. The polymeric phase obtained by increasing pressure has a dominant simple cubic character, while the polymer obtained by raising T at moderate pressure is tetrahedral. Comparison with DF results suggests that the latter is a semiconductor, while the cubic form is metallic. The simulations show that the T-induced polymerization is due to the entropy of the configuration of covalent bonds, as in the polymerization transition in sulfur. The transition observed with increasing P is the continuation at high T of the black P to arsenic ͑A17͒ structure observed in the solid state, and also corresponds to a semiconductor to metal transition.