"Fix heat" Question

Dear LAMMPS Users and Develpers,

I am trying to run a program in LAMMPS to simulate a nanosecond Gaussian pulse laser in the form of variable using “fix heat” command. The program is restarting from an equilibrium file (different file), in which the time-steps has been defined “nano”.

I have some problems using “fix heat”:
Firstly, when I use “fix heat”, there is no dynamic in the system! So, if I remove the “fix nve” command, the atoms are just freezed at their own position and they do not show any movement as the result of increasing the temperature using the laser pulse command, either linear or Gaussian form. Even with “fix nve”, it is only showing the vibration of the atoms without melting (similar to the case that we do not have "fix heat". I wonder how I could deal with this problem and have the dynamic as a result of "fix heat"?

Secondly, I can not change the boundary condition to non-periodic in the surface where the heat comes. The reason is that it is showing escaping atoms from the surface with an error message from LAMMPS. To solve this problem, I make the box bigger than the size of atoms. However, the atoms are expanding to the size of the new box and still there is no expansion as the result of the heat!

I was wondering how I could deal with boundary condition in the top surface to see the melting process?

I have put the part of input script for heating at the bottom of this email and I will appreciate any light up in which point I am making mistake that prevents me from seeing desirable results.

Thanks indeed in advance and I look forward to hearing from you.

Best regards,
Somaiieh

read_restart restart.equil
reset_timestep 0
timestep 0.001

pair_style eam
pair_coeff * * Al.eam
neighbor 3.4 bin
neigh_modify delay 0 every 1 check yes page 500000 one 50000
neigh_modify every 10 delay 0 check yes

thermo 200
thermo_style custom step temp pe etotal press vol

velocity all create 300 1234156

fix 2 box_FE nve
run 1000

variable x loop 5
variable y loop 5

variable flux atom 1000exp(-(2(x/2.5)^2+2*(y/2.5)^2))

reset_timestep 0
fix 3 heat_MD heat 10 v_flux
dump 2 all xyz 100 Al_heat_50ns_Gaussian_p10.xyz
log loginfo_heat_50ns_Gaussian_p10.lammps
thermo 100
run 5000

unfix 3

Dear LAMMPS Users and Develpers,

I am trying to run a program in LAMMPS to simulate a nanosecond Gaussian pulse laser in the form of variable using “fix heat” command. The program is restarting from an equilibrium file (different file), in which the time-steps has been defined “nano”.

sorry, but what you write here doesn’t make sense to me. i get the reading a restart part, but not the “nano” part.

I have some problems using “fix heat”:
Firstly, when I use “fix heat”, there is no dynamic in the system! So, if I remove the “fix nve” command, the atoms are just freezed at their own position and they do not show any movement as the result of increasing the temperature using the laser pulse command, either linear or Gaussian form. Even with “fix nve”, it is only showing the vibration of the atoms without melting (similar to the case that we do not have "fix heat". I wonder how I could deal with this problem and have the dynamic as a result of "fix heat"?

please note that a) you are running for a very small number of time steps and b) you are only applying the heat transfer every 10 steps. have you made some estimates, how much energy is transferred in what period of time for the event that you want to simulate? and how this translates to the settings, that you have chosen?

Secondly, I can not change the boundary condition to non-periodic in the surface where the heat comes. The reason is that it is showing escaping atoms from the surface with an error message from LAMMPS. To solve this problem, I make the box bigger than the size of atoms. However, the atoms are expanding to the size of the new box and still there is no expansion as the result of the heat!

was wondering how I could deal with boundary condition in the top surface to see the melting process?

have you tried the “change_box” command?

otherwise, you could convert your restart file into a data file, which contains fewer settings and you can set the boundary as you wish. this is probably a good idea anyway, since this way you cannot be as easily surprised by settings stored in (and read from) the restart file, that you are not aware of and that may result in surprises.

I have put the part of input script for heating at the bottom of this email and I will appreciate any light up in which point I am making mistake that prevents me from seeing desirable results.

it is really difficult to give such specific advice with so limited information. it looks to me that for the most part, you may need to review your simulation settings and check if they are really meaningful.

axel.

1 Like

Dear Axel,

Thank you really much for your response and your time to look at my program. I modified the program and here is the change:

Firstly, “sorry, but what you write here doesn’t make sense to me. i get the reading a restart part, but not the “nano” part.”

Response: the “nano” comes from a part in the restart file which is not here and was the Unit. Now I changed that back to “metal”.

Secondly, “please note that a) you are running for a very small number of time steps and b) you are only applying the heat transfer every 10 steps. have you made some estimates, how much energy is transferred in what period of time for the event that you want to simulate? and how this translates to the settings, that you have chosen?

Response: I increased the number of steps for running the simulation to 100,000 time steps and also increased the number of time steps to apply the heat flux to 100 instead of 10. As you mentioned correctly, the energy that I am applying to the sample is really low and this is because of a very small number of atoms that I have in my system. According to the references, the minimum fluence required to ablate Al atoms is something between 2 to 4 J/m2 (according to the reference that I read). That means that if I want to apply that to my current system, I should decrease it significantly to find the equivalent energy and then change it to [eV/picosecond] in metal units to fit the “fix heat” command. With that change (3eV/picosecond), I am having reasonable results in terms of increasing the temperature.

Thirdly, "have you tried the “change_box” command?"

Response: YES. This time I also changed the box while turning off the “fix nve” command and there is no escaping the atoms. That is a good news!

But that happens because the problem is still there! The atoms are freezed and any increase of temperature seems that having absolutely no effect on the system, which makes me think that the simulation is wrong although I have chosen all the parameters precisely!

Finally, "otherwise, you could convert your restart file into a data file, which contains fewer settings and you can set the boundary as you wish. this is probably a good idea anyway, since this way you cannot be as easily surprised by settings stored in (and read from) the restart file, that you are not aware of and that may result in surprises."

Response: Thank you so much. That could be a good idea and I will find out how to do that. I was wondering if you think that might prevent me to see freezed atoms that only have moved to the new size of the box as if they are stretched a little bit but no deformation has happened to them as a result of applying heat flux?

I also wonder if any of the users have the same experience like me to see only freezed atoms after applying the “fix heat” command?

Thanks indeed in advance for your nice consideration and your time and I look forward to hearing from you.

Best regards,
Somaiieh

What does your lammps log say about the number of atoms in the group “heat_MD” when you run these tests?

Adrian

[…]

Thirdly, "have you tried the “change_box” command?"

Response: YES. This time I also changed the box while turning off the “fix nve” command and there is no escaping the atoms. That is a good news!

But that happens because the problem is still there! The atoms are freezed and any increase of temperature seems that having absolutely no effect on the system, which makes me think that the simulation is wrong although I have chosen all the parameters precisely!

if you are removing fix nve, you have no more time integration. without time integration, particles cannot move, since the positions are not updated from the velocities (and the velocities not from the forces).

Finally, “otherwise, you could convert your restart file into a data file, which contains fewer settings and you can set the boundary as you wish. this is probably a good idea anyway, since this way you cannot be as easily surprised by settings stored in (and read from) the restart file, that you are not aware of and that may result in surprises.”

Response: Thank you so much. That could be a good idea and I will find out how to do that. I was wondering if you think that might prevent me to see freezed atoms that only have moved to the new size of the box as if they are stretched a little bit but no deformation has happened to them as a result of applying heat flux?

it is difficult to discuss things without being able to reproduce what you are doing (like discussing colors with a blind person). atoms may move, but only very slowly, or atoms don’t move because of mistakes of yours. the fact that you start from a restart, makes it rather difficult, since we don’t know what the system in the restart consists of what what settings were used. you cannot really change units when using read_restart. you can use the info command to see what different simulations settings are active. try it before and after reading the restart.

I also wonder if any of the users have the same experience like me to see only freezed atoms after applying the “fix heat” command?

i don’t think this has anything to do with fix heat, but rather how you are setting up your simulation.

axel.

Dear Dr. Axel Kohlmeyer and Mr. Adrain,

Thank you really much for your answers and please excuse me for the delay in replying to your comments. I still could not write a data file instead of a restart file. Here are the new things I tried after I received your emails:

Adrain: “What does your lammps log say about the number of atoms in the group “heat_MD” when you run these tests?”
Well, I received different messages in the log file. Sometimes, I have “atoms lost” when I don’t use periodic BC. When I use periodic BC, there is no error message.

Axel: “if you are removing fix nve, you have no more time integration. without time integration, particles cannot move, since the positions are not updated from the velocities (and the velocities not from the forces).”
Yes. You were definitely right. When I turned on nve, I had the movements of atoms.

However, due to the periodic boundary conditions that I could not change, I can not see expansion of the atoms in the simulation box. In the code below, I used the command “change_box” and I gave the atoms extra space (from 20 to 24) to move. I also changed the BC from “p p p” to “p p m”, since I need the expansion to be in the “z” direction. With this change of box, the values of temperature and energy are not acceptable!

I also made some changes regarding the cutoff energy. Still, I can not apply non-periodic BC at the top surface.

Therefore, I was respectfully wondering if anyone can help me with using non-periodic boundary condition while having “fix heat” command without “atoms lost” error?

Axel: “it is difficult to discuss things without being able to reproduce what you are doing”
The code comes in the following to this email.

Thanks indeed in advance for your nice considerations and your time and I look forward to hearing from you.

Best regards,
S. Y.

Dear Dr. Axel Kohlmeyer and Mr. Adrain,

Thank you really much for your answers and please excuse me for the delay in replying to your comments. I still could not write a data file instead of a restart file. Here are the new things I tried after I received your emails:

you need to read the documentation more carefully! it is trivial to write out a data file. LAMMPS has a command for that.

Adrain: “What does your lammps log say about the number of atoms in the group “heat_MD” when you run these tests?”
Well, I received different messages in the log file. Sometimes, I have “atoms lost” when I don’t use periodic BC. When I use periodic BC, there is no error message.

obviously, but the question is, whether this is a meaningful simulation. i don’t think so.
you seem to be following the principle, that making an error go away is a step in the right direction. but i believe, that you have to understand the error first. first thing: you “lose” atoms because they get detached from your surface and once they are evaporated, they will continue until they leave the box. with periodic boundary conditions, those atoms will re-enter and adsorb to the surface on the opposite side. not likely something you want. the first question to answer is: should atoms evaporate or not? if not, you first have to figure out why this happens and then act accordingly. either you need to change your simulation settings and/or initial conditions, so that no evaporation happens or you need to either reflect those atoms back to the “vapor” area over the surface (using a suitable wall fix) or tell LAMMPS that it should remove those atoms from the simulation (i.e. ignore their loss) which corresponds to them vanishing in the infinite vacuum beyond the simulation cell.

Axel: “if you are removing fix nve, you have no more time integration. without time integration, particles cannot move, since the positions are not updated from the velocities (and the velocities not from the forces).”
Yes. You were definitely right. When I turned on nve, I had the movements of atoms.

However, due to the periodic boundary conditions that I could not change, I can not see expansion of the atoms in the simulation box. In the code below, I used the command “change_box” and I gave the atoms extra space (from 20 to 24) to move. I also changed the BC from “p p p” to “p p m”, since I need the expansion to be in the “z” direction. With this change of box, the values of temperature and energy are not acceptable!

that likely means, you did not make the change to the box correctly and probably moved atoms, too. carefully monitor the system geometry. and - as noted above - read the documentation more carefully. LAMMPS has often very detailed documentation that requires multiple readings and double checking to make certain, that you fully understand what you are doing. from all you are telling us here, it looks that you are lacking that kind of understanding.

I also made some changes regarding the cutoff energy. Still, I can not apply non-periodic BC at the top surface.

Therefore, I was respectfully wondering if anyone can help me with using non-periodic boundary condition while having “fix heat” command without “atoms lost” error?

Axel: “it is difficult to discuss things without being able to reproduce what you are doing”
The code comes in the following to this email.

from looking at your input, i don’t quite understand why you need to change the box in the first place.
wouldn’t it be better to start with the desired box dimensions and boundary conditions right away and equilibrate your system accordingly? what is the reason why you are using the approach of changing the box?

axel.