The evolution of crustal magmatic systems is incompletely understood, as most studies are limited either by their temporal or spatial resolution. Exposed plutonic rocks represent the final stage of a long-term evolution punctuated by several magmatic events with different chemistry and generated under different mechanical conditions. Although the final state can be easily described, the nature of each magmatic pulse is more difficult to retrieve. This study presents a new method to investigate the compositional evolution of plutonic systems while considering thermal and mechanical processes. A thermomechanical code (MVEP2) extended by a semi-analytical dike/sill formation algorithm, is combined with a thermodynamic modelling approach (Perple_X) to investigate the feedback between petrology and mechanics. Melt is extracted to form dikes while depleting the source region. The evolving rock compositions are tracked on markers using a different phase diagram for each discrete bulk-rock composition. The rock compositional evolution is thus tracked with a high precision by means of a database with more than 58,000 phase diagrams. This database describes how density, melt fraction, chemical composition of melt and solid fractions and mineralogical assemblages change over crustal to uppermost mantle P-T conditions for a large range of rock compositions. Each bulk rock composition is composed of the 10 major oxides (SiO2-TiO2-Al2O3-Cr2O3-MgO-FeO-CaO-Na2O-K2O-H2O) including an oxygen buffer. The combined modelling approach is applied to study the chemical evolution of the crust during arc magmatism and related melt extraction and magma mixing processes. Basaltic sills are periodically injected into the crust to model heat/magma influx from the mantle. We find that accumulated sills turn into long-lived mush chambers when using a lower rock cohesion or assuming a higher intrusion depth. Associated partial melting of crustal host rocks occurs around densely distributed dikes and sills. High silica rocks (e.g. granites) are generated by partial melting of the host rocks, melt segregation within dikes, and from fractional crystallization of basalts. Although the volume of these rocks is relatively small in our models compared to rocks with a mafic to intermediate composition, they provide important information about the processes of magma differentiation within arc continental crust.