  Continuum models to handle solvent and electrolyte effects in an effective
way have a long tradition in quantum-chemistry simulations and are nowadays
also being introduced in computational condensed-matter and materials
simulations. A key ingredient of continuum models is the choice of the solute
cavity, i.e. the definition of the sharp or smooth boundary between the regions
of space occupied by the quantum-mechanical (QM) system and the continuum
embedding environment. Although most of the solute-based approaches developed
lead to models with comparable and high accuracy when applied to small organic
molecules, they can introduce significant artifacts when complex systems are
considered. As an example, condensed-matter simulations often deal with
supports that present open structures. Similarly, unphysical pockets of
continuum solvent may appear in systems featuring multiple molecular
components. Here, we introduce a solvent-aware approach to eliminate the
unphysical effects where regions of space smaller than the size of a single
solvent molecule could still be filled with a continuum environment. We do this
by defining a smoothly varying solute cavity that overcomes several of the
limitations of straightforward solute-based definitions. This new approach
applies to any smooth local definition of the continuum interface, being it
based on the electronic density or the atomic positions of the QM system. It
produces boundaries that are continuously differentiable with respect to the QM
degrees of freedom, leading to accurate forces and/or Kohn-Sham potentials.
Benchmarks on semiconductor substrates and on explicit water substrates confirm
the flexibility and the accuracy of the approach and provide a general set of
parameters for condensed-matter systems featuring open structures and/or
explicit liquid components.
