  Clays are a broad class of ubiquitous layered materials. Their specific
chemophysical properties are intimately connected to their molecular structure,
featuring repeating patterns broken by substitutions. Molecular dynamics
simulations can provide insight into the mechanisms leading to the emergent
properties of these layered materials, however up to now idealised clay
structures have been simulated to make the modelling process tractable. We
present ClayCode, software facilitating the modelling of clay systems closely
resembling experimentally determined structures. By comparing a realistic model
to a commonly used montmorillonite clay model, we demonstrate that idealised
models feature noticeably different ionic adsorption patterns. We then present
an application of ClayCode to the study the competitive barium and sodium
adsorption on Wyoming montmorillonite, Georgia kaolinite, and Montana illite,
of interest in the context of nuclear waste disposal.
