The hydrodynamic equations of a phase-separating fluid mixture are derived from the underlying microscopic dynamics of the system. A projection operator method is used in the GENERIC form insuring the thermodynamic consistency of the final equations. The microscopic potential is separated into short and long range parts, in the spirit of the original work of van der Waals. Explicit expressions for surface tension terms in the hydrodynamic equations are obtained. These terms describe diffuse interfaces in the system. Miscible-immiscible and gas-liquid phase transitions are possible, non-isothermal situations can be studied, and explicit account of cross effects is taken.
The continuum equations are then rewritten in a way that allows for a better understanding of the internal energy term within the framework of van der Waals fluids. The resulting continuum equations are discretised by using the method of Smooth Particle Hydrodynamics (SPH). Special emphasis on the thermodynamic consistency of the model is made by casting the discrete model into the GENERIC structure. As a result, we obtain a model that not only exactly conserves mass, energy, and momentum but also shows strict increase of the entropy of the system.
Finally, in order to implement and test the model, we consider a special case of the general model: a binary mixture where only mass and energy diffusion take place. The particles do not move and remain at lattice points. The equations are written in convenient non-dimensional form. The simulations show that for sub-critical temperatures, the mixture separates in A-rich and B-rich regions, as predicted by the van der Waals equation of state. The tendency towards equilibrium occurs as the entropy increases in time. The theoretical coexistence curve is reproduced by the simulations at the final equilibrium state. The role of the strength of the surface tension is qualitatively investigated in the dynamics of the formation of domains. We observe that higher surface tension implies a change in dynamics of the system towards equilibrium along with larger domains and interface widths. We also observe how non-homogeneous temperature distributions (created either by walls at different temperatures or local sinks of energy) induce complex dynamics of phase separation and lead to very interesting pattern formation.