I’m attempting to simulate a moving laser as a heat source to melt aluminum, but the simulation isn’t functioning as expected. Can someone assist me in identifying what might be wrong with it?
Step 6: Define the laser heating region - Melting of the first layer
region cylinder cylinder z 0.0 0.0 10.0 10 20 units box
group laser_region region cylinder
A: Add non-translational kinetic energy to atoms for laser irradiation
Besides your lack of clarity in explaining what the problem is:
And the horribly formatted post (don’t you read other posts? don’t you wonder why yours looks crap?), I see no time integrator, so not much would happen in your simulation. As your laser_heating is just a region of space which is thermostated to 1200 K (if you are using units real), then I suggest using a NVE integrator for all atoms, and keep the Langevin thermostat for the atoms in the cylindrical region.
Here you go:
# Step 6: Define the laser heating region - Melting of the first layer
region cylinder cylinder z 0.0 0.0 10.0 10 20 units box
group laser_region region cylinder
# A: Add non-translational kinetic energy to atoms for laser irradiation
fix laser_heating all langevin 1000 1200 400 654759
compute laser_temp laser_region temp
fix_modify laser_heating temp laser_temp
fix NVE all nve
run 10000
# B: Move the laser heating region along the y-direction
fix move_laser_region laser_region move linear 0.0 0.01 0.0 units box
run 50000
# C: Step 7: Remove the laser power and cool down the system
unfix laser_heating
unfix move_laser_region
The adjustments you recommended have raised the system temperature, yet it is not limited at 1200 K as intended; instead, it is showing unexpected increases
The fix increases the temperature from 1000 to 1200 in the first run 10000. Then, since you did not specify otherwise, another run is executed where the temperature is again raised from 1000 to 1200 as the region moves. As the simulation proceeds, the thermo output will likely report the global temperature computed on all atoms, which includes the sample’s part that is not thermostated but will likely absorbs energy from the laser_region. Show us the temperature profile of your simulation, and tell us what is unexpected about your findings.
Update Just noticed that you posted the same question on a new thread. As pointed out by @baerb
So for the region to behave any differently, the Langevin thermostat needs to be applied only to the atoms in the specific region:
I suspect you are seeing temperature changes because of your use of fix move. You really need to break your simulation down into simple parts and get one thing working before you try to add complexity. Some hints anyway:
The use of fix move to move the region is not going to give the behavior you expect. The region command itself has a move keyword that I think is more appropriate.
The group region command is a static assignment by default. The docs have more info on this as well as how to set a dynamic group.
In addition, a thermostat can only be applied to a region by using compute temp/region as a bias with fix_modify. The fix would then be applied to the group all. As before, details are in the documentation.
I think I’ve seen that implementation in one of the KAPPA examples but struggled to understand its purpose then. Is the intention of that method to skip the group assignment in the middle? As in changing from:
region->group->thermostat
Yes. Bias capable thermostats remove some part of the velocity before applying the thermostat and then restore it afterwards. This way you can create a temperature gradient with compute temp/profile or a regional thermostat with compute temp/region, or thermostat only a single direction with compute temp/partial and so on.