AtomicSystem.add_liquid_layer#

AtomicSystem.add_liquid_layer(blueprint, thickness, distance=2.0, vacuum=10.0, axis='z')[source]#

Add a liquid layer on top of this system.

This method creates a liquid layer with the composition defined by the blueprint and places it on top of the current system along the specified axis. The layer is aligned to match the transverse dimensions of the current system.

Parameters:
blueprintSolutionBuilder

Solution blueprint defining the liquid composition (density, solutes, etc.).

thicknessfloat

Thickness of the liquid layer in Ångströms.

distancefloat, default=2.0

Distance between the current system surface and the liquid layer in Ångströms.

vacuumfloat, default=10.0

Vacuum space added above the liquid layer in Ångströms.

axisstr, default=’z’

Axis along which to add the layer (‘x’, ‘y’, or ‘z’).

Returns:
Self

The updated system with the liquid layer added.

Examples

>>> from cemd import AtomicSystem
>>> from cemd.build import SolutionBuilder
>>>
>>> surface = AtomicSystem.from_file("surface.lmp")
>>> blueprint = SolutionBuilder(
...     density=1.0,
...     molarities={'NaCl': 0.1}
... )
>>>
>>> # Add a 30 Å water layer on the surface
>>> system = surface.add_liquid_layer(blueprint, thickness=30.0, distance=2.0)