# Initialization units lj dimension 3 boundary p p s atom_style bond # Ensure ghost atoms store velocities for DPD pair style comm_modify vel yes #comm_modify cutoff 2.5 # Define variables for upper and lower z-values of the fluid region variable fluid_z_up equal 15.25 # upper z value of fluid variable fluid_z_down equal -15.25 # lower z value of fluid variable xl equal -30 variable xh equal 30 variable yl equal -1.5 variable yh equal 1.5 # Define new variables for adjusted z-values for simulation box variable simbox_z_up equal ${fluid_z_up}+2 variable simbox_z_down equal ${fluid_z_down}-2 # Define variables for adjusted z-values for plates variable lower_plate_z_up equal ${fluid_z_down} variable lower_plate_z_down equal ${fluid_z_down}-2 variable upper_plate_z_down equal ${fluid_z_up} variable upper_plate_z_up equal ${fluid_z_up}+2 # Create simulation box with z boundaries based on fluid_z_up and fluid_z_down region simbox block v_xl v_xh v_yl v_yh v_simbox_z_down v_simbox_z_up create_box 2 simbox # Set masses for atom types mass 1 1.0 # Mass for plate particles (Group A) mass 2 1.0 # Mass for fluid particles (Group B) # Define regions for plates, fluid, and spherical wall region lower_plate block v_xl v_xh v_yl v_yh v_lower_plate_z_down v_lower_plate_z_up region upper_plate block v_xl v_xh v_yl v_yh v_upper_plate_z_down v_upper_plate_z_up region fluid_actual block v_xl v_xh v_yl v_yh v_fluid_z_down v_fluid_z_up # Create atoms for plates with high density lattice fcc 6 create_atoms 1 region lower_plate create_atoms 1 region upper_plate # Create atoms for fluid with lower density lattice fcc 4 create_atoms 2 region fluid_actual #group by type group walls type 1 group fluid type 2 # Define DPD settings pair_style dpd 1.0 1.0 12345 # standard #Set dpd coefficient pair_coeff 1 1 0.0 4.5 1.0 # No interaction between wall particles pair_coeff 1 2 9.68 4.5 1.0 # Interaction between wall and fluid particles, pair_coeff 2 2 18.75 4.5 1.0 # Interaction between fluid particles # Freeze wall particles fix freeze_walls walls setforce 0.0 0.0 0.0 # Reflective boundary conditions for fluid particles at plate boundaries fix wall_lower fluid wall/reflect zlo v_fluid_z_down fix wall_upper fluid wall/reflect zhi v_fluid_z_up # Apply a constant force to fluid particles to simulate gravity variable grav_x equal 0.02 # Adjust this value to set the strength of the gravitational field fix gravity fluid addforce v_grav_x 0.0 0.0 # Neighbor list settings neighbor 0.3 bin # Increase the skin distance neigh_modify delay 5 check yes # Initial velocities for fluid particles velocity fluid create 1.0 12345 # Time integration using NVT for thermostatting fix 2 all nve # Plain velocity verlet integration # Compute temperature for fluid region compute fluid_temp fluid temp/region fluid_actual # Output settings thermo 1000 thermo_style custom step temp c_fluid_temp pe ke etotal press dump 2 all custom 1000 dumpvelforce.lammpstrj id type x y z vx vy vz fx fy fz restart 100000 restart.lammpstrj # Run settings timestep 0.01 # Reduce the time step for stability run 10000000