Statistical mechanics and thermodynamics of simulated ionic solutions