Viscosity calculation using Green-kubo method

Dear experts,
I am going to calculate viscosity using Green-kubo method and for this purpose, I first apply the autocorrelation function on pxy pxz pyz variables to use them in Green-kubo method in post processing. However, the resulted viscosity value is always increasing without reaching to the platue. Please see the attachment. Any comment is highly appriciated.

Best regards,
Bahman
in.viscosity (3.8 KB)

Man, you always disregard the forum rules in your posts. It’s time to learn netiquette, before getting some advice.

2 Likes

Hi, sorry, I modified my question.
Yours, Bahman

I am not sure if debugging your script is really an effective way to help you. There are many gems that hints to either lack of care or understanding of what you are doing. Here my picks:

  • Multiplying by 1: variable nitrogen_molecules_in_1Ang3 equal "1.0*2.43e-05"
  • Use of metal units for pair_style lj/cut. Not an error, but I find it impractical.
  • A very generous timestep: timestep 0.005.
  • Your note to fix 1 all nvt temp 300.0 300.0 100:
    # A good choice for many models is a Tdamp of around 100 timesteps.
    How would you write 3 apples, if “apple” is a variable in a mathematical equation?

Please try to fix these simple issues yourself, it will save you (and us) time in the future.

My suggestion for handling users that do not follow the forum guidelines even after being reminded multiple times is to go to that user’s page (click on the icon twice) and then on the top right switch from “Normal” to “Ignored”. I usually choose to ignore people for a year.

This saves me the aggravation to have to look at people misbehaving and not following the established conventions. If they don’t get any more responses it may send a message. They’ll get another chance after 12 months to show if they have learned it.

Hi Hothello,

Thank you for your prompt response. Here are my replies to your questions:

  • Multiplying by 1: Since I am modeling under 1 bar of pressure, this helps me adjust the density of nitrogen molecules within the model to achieve that pressure.
  • Use of metal units for pair_style lj/cut: This is not an error. I want to have the pressure in bar and the temperature in K, among other units.
  • A generous timestep: timestep 0.005: You are right, but I have also varied it up to 1 fs.
  • Your note on fix 1 all nvt temp 300.0 300.0 100: This is directly from the LAMMPS documentation:
    # A good choice for many models is a Tdamp of around 100 timesteps.How would you write “3 apples” if “apple” were a variable in a mathematical equation? I couldn’t actually define Tdamp as a function of the timestep.
  • N_every, N_repeat, and N_frequency: I believe there might be an issue with how these parameters are set in the simulation. I will review them further.
    By the way, wha was wrong in my inquiry which make you all so mad. please let me know.

Best regards,
Bahman

What about $(100*dt)?

That you don’t follow the forum guidelines (have you ever read them?), and you do so consistently[1] in all your posts, despite being reminded every time.

Also, your questions are really about doing your homework. You could save much time by reading the documentation and searching the forum for similar questions. For instance:

If you believe there is an issue (which one?), then do some tests and work out for yourself how they should be set to suit your goal.

Initially I found the N_every N_repeat N_frequency an overkill, but with time I started appreciating the logic behind it. With three parameters you can first decide whether to average a value or just print it periodically. The non-average use (N_repeat = 1 is actually very useful to monitor running averages or tallied values, while a suitable combination of N_every and N_repeat allow you to chose the average interval and spacing of input values.


  1. You still don’t know how to quote LAMMPS commands, nor have any interest in learning markdown syntax. ↩︎