Physics-PVD

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

- RMS surface roughness
- Film density and porosity
- Composition profiles along growth direction
- Export to XYZ (OVITO/VMD) and LAMMPS data formats

### External Tool Interfaces

| Tool | Capabilities |
|------|-------------|
| **OpenFOAM** | dsmcFoam+ case generation, mesh, BCs, particle injection, parallel execution |
| **LAMMPS** | Deposition MD, sputtering cascades, post-deposition annealing, EAM/MEAM/Tersoff potentials, dump/log parsing |
| **QuantumATK** | DFT/DFTB binding energies, sputter yield (BCA+MD), adatom diffusion MD, electronic transport |

### Key Physics

- **Arrhenius kinetics**: temperature-dependent rates via `k = ν₀ exp(-Ea/kBT)`
- **Ehrlich-Schwoebel barrier**: step-edge descent asymmetry
- **Thompson energy distribution**: `P(E) ∝ E/(E+Eb)³`
- **Variable hard-sphere collisions**: energy-dependent cross-sections
- **Knudsen number classification**: free-molecular, transitional, continuum regimes
- **Shadow effects**: geometric shadowing for oblique-angle deposition

examples/lammps_cu_on_ta/in.sputter  view on Meta::CPAN

# LAMMPS Sputtering Simulation — Generated by Physics::PVD
# Ion bombardment to study sputter yield and cascade dynamics

units           metal
atom_style      atomic
boundary        p p s

lattice         bcc 3.3
region          target block 0 10 0 10 0 8
create_box      2 target
create_atoms    1 box

examples/lammps_cu_on_ta/in.sputter  view on Meta::CPAN

group           target type 1

velocity        target create 300 54321
velocity        ion set 0.0 0.0 -0.38048194400739

fix             nve_all all nve
fix             temp_ctrl target langevin 300 300 100.0 48279

timestep        1
thermo          100
dump            cascade all atom 50 ./lammps_cu_on_ta/dump.sputter.lammpstrj

run             5000
write_data      ./lammps_cu_on_ta/post_sputter.data

examples/lammps_pvd.pl  view on Meta::CPAN

    my $input_file = $lmp->generate_input(
        template => 'deposition',
        params   => {
            n_deposits  => 50,
            run_between => 2000,
            total_steps => 100000,
        },
    );
    printf "  Input script: %s\n", $input_file;

    # Generate sputtering cascade study
    my $sputter_file = $lmp->generate_input(
        template => 'sputtering',
        filename => './lammps_cu_on_ta/in.sputter',
        params   => {
            ion_energy  => 300,   # eV Ar ion
            total_steps => 5000,
        },
    );
    printf "  Sputtering script: %s\n", $sputter_file;

lib/Physics/PVD/Interface/LAMMPS.pm  view on Meta::CPAN

use strict;
use warnings;
use Carp;
use File::Temp qw(tempfile);
use File::Spec;

# ═══════════════════════════════════════════════════════════════════════════════
# Interface to LAMMPS for advanced PVD molecular dynamics
#
# Uses LAMMPS to perform:
#   - Classical MD of sputtering impact cascades
#   - Film growth with realistic interatomic potentials (EAM, MEAM, Tersoff)
#   - Substrate heating and thermal effects
#   - Stress evolution during deposition
#   - Adatom mobility on realistic surfaces
# ═══════════════════════════════════════════════════════════════════════════════

sub new {
    my ($class, %opts) = @_;
    my $self = bless {
        executable  => $opts{executable}  // 'lmp',

lib/Physics/PVD/Interface/LAMMPS.pm  view on Meta::CPAN

}

sub _template_sputtering {
    my ($self, %p) = @_;
    my $T  = $p{temperature};
    my $dt = $p{timestep};
    my $ion_energy = $p{ion_energy} // 500;  # eV

    return <<EOF;
# LAMMPS Sputtering Simulation — Generated by Physics::PVD
# Ion bombardment to study sputter yield and cascade dynamics

units           metal
atom_style      atomic
boundary        p p s

lattice         bcc 3.3
region          target block 0 10 0 10 0 8
create_box      2 target
create_atoms    1 box

lib/Physics/PVD/Interface/LAMMPS.pm  view on Meta::CPAN

group           target type 1

velocity        target create $T 54321
velocity        ion set 0.0 0.0 -@{[sqrt(2*$ion_energy*1.6e-19/(39.948*1.66e-27))*1e-5]}

fix             nve_all all nve
fix             temp_ctrl target langevin $T $T 100.0 48279

timestep        $dt
thermo          100
dump            cascade all atom 50 $self->{work_dir}/dump.sputter.lammpstrj

run             @{[$p{total_steps} // 10000]}
write_data      $self->{work_dir}/post_sputter.data
EOF
}

sub _template_annealing {
    my ($self, %p) = @_;
    my $T_start = $p{temperature};
    my $T_end   = $p{anneal_temp} // 600;  # K

lib/Physics/PVD/Interface/LAMMPS.pm  view on Meta::CPAN


__END__

=head1 NAME

Physics::PVD::Interface::LAMMPS - Interface to LAMMPS for advanced PVD MD

=head1 DESCRIPTION

Generates LAMMPS input scripts and manages molecular dynamics simulations
for PVD processes including deposition, sputtering cascades, and post-
deposition annealing. Supports EAM, MEAM, and Tersoff potentials.

=cut

lib/Physics/PVD/Interface/QuantumATK.pm  view on Meta::CPAN

    vy = 0.0
    vz = -speed * np.cos(ion_angle)

    # Add ion and run MD
    config = target.copy()
    config.addAtoms(elements=['$ion'], cartesian_coordinates=[[x, y, z_top]])
    config.setVelocities([vx, vy, vz], indices=[-1])

    md = MolecularDynamics(
        configuration=config,
        trajectory_filename='$self->{work_dir}/cascade_{}.hdf5'.format(i),
        steps=2000,
        time_step=0.5*fs,
        log_interval=100
    )
    md.run()

    # Count sputtered atoms (z > z_top)
    final = md.finalConfiguration()
    z_final = final.cartesianCoordinates()[:, 2]
    sputtered_atoms += np.sum(z_final > z_top)



( run in 1.574 second using v1.01-cache-2.11-cpan-e7c6538aa59 )