Green production of hydrogen and its derivatives is becoming a cornerstone of industry decarbonation. Apart from the technological development point of view, optimizing the overall production chains dynamically is essential for the competitiveness of these systems. In this paper, we describe how we built, validated and used a Modelica-based library dedicated to the simulation and optimization of energy process for the production of green molecules. Especially, models of complex media, salt cavity hydrogen storage and electrolysis module are presented. An example application shows that the models of the library are particularly handy for the modeling of a 5MW electrolysis module, which is used for the calibration of an optimization model.