The use of intensive technologies for the maintenance of animals in premises of an industrial type imposes special requirements on the microclimate, which contributes to an increase in the resulting products with minimal cost of feed, labor and means. In this regard, the development of a method for calculating ventilated enclosures and determining the required air parameters in their air channels is an urgent task. The purpose of the research is to develop a mathematical model of non-stationary heat-mass transfer through ventilated external fences. The problem of heat and mass transfer in the enclosing constructions is formulated, in addition to the transfer of moisture as well as air infiltration. The boundary conditions at low velocities of the filtration air motion through the layer of porous material and the conditions for the accompaniment of the heat flux and the moisture flux on the boundary of the phase transition of the liquid-cryophase phase, as well as the conditions for the accompaniment of the heat flux, steam flows and moisture in the region of the liquid-vapor transition are determined. The initial conditions are given by the equation corresponding to the stationary distribution of temperatures in the presence of air filtration through the fence. The boundary conditions of the third kind are given on the external and internal surfaces of the fence. Thus, a mathematical model of nonstationary heat and mass transfer through the enclosing structures was developed, taking into account the external air infiltration and possible phase changes of moisture.