Multilevel Flow Modeling (MFM) is a functional modeling technique, which is used to represent objectives and functions of complex industrial systems such as oil and gas facilities. Therefore, the identification of objectives and functions is the key for building MFM models. This paper focuses on the analysis of safety objectives and proposes a procedure for modelling of safety functions. So the model represents safety aspects explicitly in the model. When any deviation occurs, the corresponding failed safety functions are identified as causes and subsequently, hazards as consequences. Existing industrial documents and standards (e.g. API RP 14C) are used as inputs for the model building. The procedure promotes a theoretical foundation for a methodology for computer supported generation of MFM models. A gas treatment process is presented for demonstrating and verifying the modelling procedure to show how hazards are modelled and propagated in the model, and how the installed instrumentation and automation is meant to react to the deviation.