# problem with fix heat with variable eflux

Dear all,

I am trying to heat atoms with fix heat. I want the heating profile to be exponential: 1806exp(-(z-z0)) where 1806kcal/moltstep is eflux for all atoms with z=z0.

However, it seems that it just doesn’t work, no heating takes place whatsoever.

When I try to heat without a variable eflux but a constant eflux value - heating does work and the system gest hotter.

Am I missing here something ? (My input file is attached)

When I try to heat without a variable eflux but a constant eflux value -
heating does work and the system gest hotter.

The fix heat command does not allow for a variable eflux. The
doc page does not say that it does. Hence v_foo is being read
as a numeric value as 0.0. No command allows one of its arguments
to be specified as a dynamic variable, unless the doc page says
that it does.

Steve

Thank you Steve, I wasn’t aware of this restriction.
Can you tell me then if there’s any way around of pumping heat into atoms as a function of their position ?

Maybe modifying fix heat will do ? Would it be a simple task ?

I just posted a 13Jan patch that lets the eflux value be
an equal-style variable. I'm not clear that using an atom-style
variable makes sense, since the flux is meant to be a total
energy change for the entire group of atoms. If you can convince
me otherwise, it would be easy to allow an atom-style variable
to be used (e.g. dependent on atom position).

Paul, what do you think?

Steve

Well, if I have to simulate , for example, laser heated material then the absorbed energy in the material
is dependent on depth. (usually, an exponential law such as in my 1st post). Now, this depth variable could be some fractional length variable of the simulation box, or an atom coordinate in which case an atom-style variable should be used, doesn’t it ?

Well, if I have to simulate , for example, laser heated material then the
absorbed energy in the material
is dependent on depth. (usually, an exponential law such as in my 1st post).
Now, this depth variable could be some fractional length variable of the
simulation box, or an atom coordinate in which case an atom-style variable
should be used, doesn't it ?

what are you looking at when you say "absorbed energy"?
are you actually looking at the absorbed photons, or rather
the heat distribution resulting from that through the thermal
conductivity of the material? my guess is would be the latter.

i don't think that having just a (small) local zone heated where
you simply define the total energy that you transfer is a bad
model. what you describe is more of a macroscopic/continuum
view of the process and that is not always the best way to
implement a process in an atomistic simulation.

if you want to do a more detailed simulation of the process,
you'd have to compute the actual adsorption process through
some time-dependent quantum chemistry calculation or at
least some approximation of it, but that is extremely tedious
and slow and most likely not having a significant impact on
the larger scale effect.

just my \$0.02,
axel.

Fix heat isn’t designed to be used on a per-atom basis, but rather on a group of atoms or atoms in a given region. In other words, it can’t do the smoothly-varying, spatial-dependent heat flux that you want. I think that it could be adapted to do what you want, but there would be some gotchas and just switching eflux to be a per-atom variable will not work.

Some possible work-arounds:

1. Hack fix heat yourself to make it do what you want.

2. See if there are other fixes (perhaps in the USER-ATC package?) that can better do what you want.

3. Use multiple fix heat commands to make a stair-stepped heat flux pattern — won’t be smoothly-varying, but you’ll at least get some spatial dependence.

Paul

Just added support for atom-style variables to fix heat.
The returned variable value in this case is energy/atom not
energy for the whole group, so you'll have to adjust your
formula appropriately.

Try it out and see if it does what you want. I think it will
be quite easy to shoot yourself in the foot with this command.

Steve