3-D numerical model is proposed for estimating the territorial risk in the emission of chemically hazardous substances in case of accidents at industrial facilities, transport or in a terrorist attack using a chemical agent. Emission of a chemical agent occurs near buildings. The task is to develop a model for assessing territorial risk taking into account various meteorological situations and taking into account the infiltration of hazardous substances into buildings. The developed model model is based on the modeling of the process of dispersal of a hazardous substance in the atmosphere under various meteorological conditions, the probability of which is known. The solution of the task of assessing territorial risk is based on a consistent solution of two tasks. The first task is the calculation of the velocity field of the wind flow in the conditions of building and under various meteorological situations. This task is solved taking into account the location of buildings in the calculation area. To solve this problem, the potential flow model is used. To solve this problem, the potential flow model is used. The model used makes it possible to quickly calculate, on small and medium-power computers, the deformation of the velocity field of the wind flow during flow of buildings. For the numerical solution of the Laplace equation for the velocity potential, the Richardson method is used. The second task is the problem of calculating the dispersion of a hazardous substance in the atmosphere with a known field of wind speed. To solve the second problem, a three-dimensional model of mass transfer of an impurity in the atmosphere is used. For the numerical integration of the mass transfer equation, an implicit difference splitting scheme is used. A mathematical model for the express calculation of the dynamics of indoor air pollution is considered. A description of the algorithm for solving the problem of assessing the territorial risk in the emission of a chemically hazardous substance is given. The results of a numerical experiment are presented.