A novel method for simulating atoms and molecules interacting with ionic surfaces