access partikel temperature/radius

Submitted by Silias on Fri, 04/29/2011 - 12:48

Hello,

To vary the particel temperature I'd like to access it by these commands:

variable ramp_temp equal 0.05
fix heattransfer all heat/gran 500

compute temp all property/atom Temp

variable d_Temp atom ${ramp_temp}*c_temp
fix Tramp all adapt 1000 atom Temp d_Temp

... which doesn't work...

The Manual says, that the compute needs per-atom quantities as input, which are stored by LAMMPS and Temp is not a per-atom quantity...

But what I don't understand is, why can I access the per-atom temperature by this command:

dump dmp all custom 500 post/dump.* f_Temp[0]

So, how can I access the temperature of the particles and vary it?

Thanks in advance,

cheers

Silias

ckloss's picture

ckloss | Fri, 04/29/2011 - 13:02

>>compute temp all property/atom Temp
This can not work, see the doc for this command...

Also, fix adapt currently does not work with per-particle macroscopic temperature, you would have to extend the code.
What you can do is to use the "set" command, as in heat_gran example #2

>>But what I don't understand is, why can I access the per-atom temperature by this command:
unlike other properties like x,v,radius, the macroscopic temperature is stored in a fix rather than in the atom class.
This has several implementational advantages .

Christoph

ckloss's picture

ckloss | Fri, 04/29/2011 - 15:33

PS: What would be required to code is that fix adapt can also take fixes as input.
I recommend you to look at other commands that take fixes as input, and then extend fix adapt
If you have question, feel free to ask :-)

Christoph

Silias | Fri, 06/17/2011 - 20:25

Hi Christoph,
I hope I didn't exploit your offer to feel free to ask, too much :)

I'm still working on accessing/manipulating peratom properties, but I swaped now from temperature to radius, what is correlated in my case. I'd like to explain now my plan and where I had to stop because it became too complicated for me and I hope you can give me some advice whether the steps I'm planing to take are reasonable and how I could proceede.

I believe that there are two alternatives to update the particle radius of a bulk in a cylinder - depending on their z-coord and the time - the fix adapt command and the set command.

I understood in the LAMMPS-manual that the fix adapt command is just capable to use equal-style variables, which wouldn't make sence to update the particles indiviually, or depending on their z-coord. However I realised that the fix adapt command is already modified in the LIGGGHTS version by adding the LIGGGHTS-class FixPropertyPerATom (by the way: that isn't mentioned in the doc of the fix adapt command).
Now I'm wondering
(this was approx the place where I had to stop within the LAMMPS/LIGGGHTS-labyrinth of code... at least still a labyrinth for me, but I'm working on that! ;)),
if I do can use the (LIGGGHTS-)fix adapt command to update the particles' radius by an atomstyle variable?
=> if yes, how could I create an atomstyle variable which stores data that is generated outside of LIGGGHTS?

The other possibility would be to use the set command with the keyword property/peratom to set/update the radius (which is a peratom property). I already found out that set.cpp searches for fixes where the variable, which has to be set, is defined and that you used that procedure within your heattransfer-examples where you defined a variable "Temp". I hoped that I could just use the variable "radius" and thus LIGGGHTS would update the atomproperty radius, but that doesn't work like I also already found out... ;) How should I proceed here?

Which of the two posibilities do you think is the most promising? I would tend to use the second one, because it would be very easy to define for example 10 regions within the zylinder, which would all have their specific spatial-averaged time-varying temperature and thus I just would have to define one time-varying variable for each region.

kind regards,
Sebastian

ckloss's picture

ckloss | Sat, 06/18/2011 - 10:26

Hi Sebastian,

>>by the way: that isn't mentioned in the doc of the fix adapt command).
If every detail of every feature would be documented, I would be writing doc all day and night
So if you see something that is missing, feel free to update the doc and send it to me, and I will put it online - that's how open source works

>>if I do can use the (LIGGGHTS-)fix adapt command to update the particles' radius by an atomstyle variable
Yes, see the packing tutorial example

>>=> if yes, how could I create an atomstyle variable which stores data that is generated outside of LIGGGHTS?
You will have to write a piece of code that does this :-) preferrably a fix

>>I already found out that set.cpp searches for fixes
You can set a particle's diameter with the keyword 'diameter'. Please read the doc :-)

>>Which of the two posibilities do you think is the most promising?
The first one is much more efficient, the second one is easier

Cheers,
Christoph

Silias | Mon, 07/25/2011 - 11:13

Hi Christoph,

I have two further questions, regarding the growing of particle radius by the fix adapt and an atom-style variable:

Is it a LIGGGHTS-Add-on that fix adapt can use atom-style variables? Because in the LAMMPS manual it says explicitly that only global variable can be used?

And here the question I'm currently most interested in:
>> >>=> if yes, how could I create an atomstyle variable which stores data that is generated outside of LIGGGHTS?
>>You will have to write a piece of code that does this :-) preferrably a fix

Can you give me a hint to start with that?
Maybe there is a fix, which does similar things and I just would have to modify it? Until now, the result of my investigations is that there is no fix, that reads in external data to use it during all the simulation time (read_data reads in data only one time, at the beginning)

I have two ideas and I'd like to ask you, to tell me your opinion which is the most promising and which rough steps should I take or if there is rather another better way to start with that:
1. read-in data from external database one time into an per-atom array. Each thermal step the next vector of the array is used to update the particles' radiuses.
2. read-in data from external database every thermal step into an per-atom vector, which updates the particles' radiuses

Thank you very much in advance,
Regards,

Sebastian

ckloss's picture

ckloss | Tue, 07/26/2011 - 12:49

>>Is it a LIGGGHTS-Add-on that fix adapt can use atom-style variables?
yes

>>Maybe there is a fix, which does similar things and I just would have to modify it?
Have a look at fix_cfd_coupling.h/cpp and cfd_datacoupling_file.h/cpp

Cheers,
Christoph