We develop thermodynamics for partly quenched systems, i.e., systems in which some of the particles are quenched, or frozen in place, and some of which are annealed, or allowed to equilibrate. In particular, we focus on a class of models for fluids adsorbed in microporous media, in which the quenched particles constitute a microporous matrix, while the annealed particles constitute a fluid adsorbed in that matrix. The replica method is used to relate the matrix-averaged quantities describing such a model to the thermodynamic quantities of a corresponding fully equilibrated model, called the replicated model. For these models, we present averaging methods that give the matrix-averaged thermodynamic quantities of the fluid. We show that there are two natural definitions for the average pressure and three natural definitions for the chemical potential of these systems. We provide both operational definitions and Mayer expansions of these quantities. We establish the Gibbs-Duhem relations for these quantities. We also present new exact relations that express the thermodynamic quantities of partly quenched media in terms of the correlation functions in such media. These include a set of compressibility relations and a virial relation. © 1995 American Institute of Physics.