It is key to assess quantitatively the transportation risks of hazardous materials for optimal route. It's difficult to analyze efficiently transportation risk involved the factors such as meteorological conditions, the underlying properties and sensitivity to harm. So the adjoint method is used to analyze transportation risks, the adjoint equation to calculate poisoning dose is deduced based on advection diffusion equation, the transportation risks, individual risks and social risks integrated with traditional risk model and principles of probability statistics were respectively analyzed, and penalty function is used to handle the constraint condition. The case suggested the feasibility of this method. In this paper, the dynamic model is proposed, which reflected the correlation between these factors such as meteorological conditions, topography conditions, toxicity of hazardous materials and transportation risks. The adjoint method is developed to use to solve this problem. These basic theories are meaningful for risk control of dangerous chemicals transportation.