Issue with Defining Sinusoidal Heater Regions in LAMMPS for Condensation Simulation

I am currently simulating the condensation of Argon atoms on a Sine - nanostructured substrate. I need to define the curved region on the surface accurately to get accurate results.

I attempted to start this approach using LAMMPS, defining a variable ‘v’ to represent the sinusoidal surface. Only the create_atoms command works with this approach. As the region command in LAMMPS does not support defining surfaces with a variable(only standard shapes like prisms, spheres, and rectangular blocks), I am facing challenges in accurately defining our surface.

The file “rough_2.txt” is the substrate that I had created beforehand, I was just using the create_atoms command to check if the variable ‘v’ is defined properly.

# Initialize Simulation Parameters
package omp 18

units           metal
dimension       3
boundary        p f p

atom_style      atomic
neighbor        1 bin
neigh_modify    delay 3

# Read Initial Atomic Configuration
read_data       rough_2.txt

# Define regions for the simulation box

region          wall1 block 0 160 0 15 0 80 units box          # Solid region
region          liqA  block 0 160 17.42 57.42 0 80 units box   # Liquid region
region          gasA  block 0 160 60.32 930 0 80 units box     # Gas region
region          gas   block 0 160 65 925 0 80 units box        # Another gas region
region          liqB2 block 0 160 938 972 0 80 units box       # Another liquid region

# Create a solid upper wall region (before cutting)
region          upper_wall block 0 160 985 1042 0 80.36 units box

variable    xx internal 0.0
variable    yy internal 0.0

variable v equal "(v_yy - 1029 +39 - 6*sin(1.5*0.06238*v_xx)) > 0.0"

# Continue with the rest of the simulation
lattice         fcc 5.79 
create_atoms    3 region liqA

lattice         fcc 34
create_atoms    3 region gasA 
create_atoms    3 region liqB2

lattice         fcc 3.92 
create_atoms    4 region wall1

lattice         fcc 3.92


create_atoms    4 region upper_wall var v set x xx set y yy

write_data      whole_new.dat

The files:
sine
rough_2.txt (1.2 MB)

Has anyone encountered a similar issue or found a workaround to define complex surfaces like sinusoidal geometries in LAMMPS? Any advice or alternative approaches would be greatly appreciated.

It’s not clear what you are asking about, precisely – your own screenshot shows that you were able to create a sinusoidal surface with create_atoms. Note that as per the documentation the create_atoms command will also accept STL files that allow you to specify highly complex volumes.

Please explain what you mean by that. What is not accurate about the geometry you get and how can you tell the difference?

The alternate approach would be to first create a block of atoms with region block that exceeds the expected geometry. Then create an atom style variable that results in 0 for atoms to keep and 1 for atoms to delete using their coordinate values. This variable can be used with the “delete_atoms” command’s variable keyword. However, I fail to see how this should result in any different result.

I apologize for not providing complete context earlier.

I’m currently working on grouping all the atoms within the yellow-marked region of my geometry so that I can apply a thermostat using the fix command. I understand that I need to define this yellow-marked region using the region command, so that I can use the group command to specify all atoms in this region.

However, I’m encountering difficulties in specifying the exact space that contains the atoms where the heat needs to be applied. I was successful in creating the geometry using the create_atoms command with the variable v, but I was unsuccessful in using the region and group commands in combination with v to define the heating area.

Could you please guide me on how to effectively define and apply the region / group command in this context?

sine

So why can’t you use a block region? It will include some empty space, but there are no atoms there. Once the group is defined, the region doesn’t matter.

Besides, regions aren’t the only way how you can define a group, you can do it by atom type or by atom-style variable.

You are not making much sense here and you didn’t really answer my question in my previous reply. You have still not provided an explanation for why the “workarounds” you have found are not sufficient.

Note that you can assign any type you like during the create_atoms command. You can thus define an atom type that you will use exclusively for “heater atoms” and then select only atoms of that type as the “heater group”.