Finite element approach to the modeling of hydrothermal systems