Flux boundary conditions in particle simulations.

Flux boundary conditions are interesting in a number of contexts ranging from multiscale simulations to simulations of molecular hydrodynamics in nanoscale systems. Here we introduce, analyze, and test a general scheme to impose boundary conditions that simultaneously control the momentum and energy flux into open particle systems The scheme is shown to handle far from equilibrium simulations. It acquires its main characteristics from the requirement that it fulfills the second law of thermodynamics and thus minimizes the entropy production, when it is applied to reversible processes. It is shown both theoretically and through simulations that the scheme emulates the effect of an extended particle system as far as particle number fluctuations, temperature, and density profiles are concerned. The numerical scheme is further shown to be accurate and stable in both equilibrium and far from equilibrium contexts.