2007-02-10 05:40:32 +08:00
|
|
|
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
|
|
|
|
|
|
|
|
:link(lws,http://lammps.sandia.gov)
|
|
|
|
:link(ld,Manual.html)
|
|
|
|
:link(lc,Section_commands.html#comm)
|
|
|
|
|
|
|
|
:line
|
|
|
|
|
|
|
|
compute pressure command :h3
|
|
|
|
|
|
|
|
[Syntax:]
|
|
|
|
|
2007-12-01 07:16:45 +08:00
|
|
|
compute ID group-ID pressure temp-ID keyword ... :pre
|
2007-02-10 05:40:32 +08:00
|
|
|
|
|
|
|
ID, group-ID are documented in "compute"_compute.html command
|
|
|
|
pressure = style name of this compute command
|
2007-12-01 07:16:45 +08:00
|
|
|
temp-ID = ID of compute that calculates temperature
|
|
|
|
zero or more keywords may be appended
|
|
|
|
keyword = {ke} or {pair} or {bond} or {angle} or {dihedral} or {improper} or {kspace} or {fix} :ul
|
2007-02-10 05:40:32 +08:00
|
|
|
|
|
|
|
[Examples:]
|
|
|
|
|
2007-12-01 07:16:45 +08:00
|
|
|
compute 1 all pressure myTemp
|
|
|
|
compute 1 all pressure thermo_temp pair bond :pre
|
2007-02-10 05:40:32 +08:00
|
|
|
|
|
|
|
[Description:]
|
|
|
|
|
2007-11-02 00:46:50 +08:00
|
|
|
Define a computation that calculates the pressure of the entire system
|
|
|
|
of atoms. The specified group must be "all". See the "compute
|
|
|
|
stress/atom"_compute_stress_atom.html command if you want per-atom
|
|
|
|
pressure (stress). These per-atom values could be summed for a group
|
2008-02-26 00:06:38 +08:00
|
|
|
of atoms via the "compute reduce"_compute_reduce.html command.
|
2007-02-10 05:40:32 +08:00
|
|
|
|
2007-11-02 00:46:50 +08:00
|
|
|
The pressure is computed by the formula
|
2007-02-10 05:40:32 +08:00
|
|
|
|
|
|
|
:c,image(Eqs/pressure.jpg)
|
|
|
|
|
|
|
|
where N is the number of atoms in the system (see discussion of DOF
|
2007-07-04 03:54:12 +08:00
|
|
|
below), Kb is the Boltzmann constant, T is the temperature, d is the
|
|
|
|
dimensionality of the system (2 or 3 for 2d/3d), V is the system
|
|
|
|
volume (or area in 2d), and the second term is the virial, computed
|
2007-12-01 07:16:45 +08:00
|
|
|
within LAMMPS for all pairwise as well as 2-body, 3-body, and 4-body,
|
|
|
|
and long-range interactions. "Fixes"_fix.html that impose constraints
|
2007-07-04 03:54:12 +08:00
|
|
|
(e.g. the "fix shake"_fix_shake.html command) also contribute to the
|
|
|
|
virial term.
|
2007-02-10 05:40:32 +08:00
|
|
|
|
2007-12-01 07:16:45 +08:00
|
|
|
A 6-component pressure tensor is also calculated by this compute whose
|
2008-03-01 09:13:20 +08:00
|
|
|
components can be output by the "thermo_style
|
2007-12-01 07:16:45 +08:00
|
|
|
custom"_thermo_style.html command or accessed by other
|
|
|
|
"compute"_compute.html and "fix"_fix.html commands. The equation for
|
|
|
|
the components of the tensor is the same as in above formula, except
|
|
|
|
that the first term uses the components of the kinetic energy tensor
|
|
|
|
(vx * vy instead of v^2 for temperature) and the second term uses Rx *
|
|
|
|
Fy for the Wxy component of the virial tensor, etc.
|
|
|
|
|
|
|
|
If no extra keywords are listed, the entire equation above is
|
|
|
|
calculated which includes a temperature term (or kinetic energy
|
|
|
|
tensor) and the virial as the sum of pair, bond, angle, dihedral,
|
|
|
|
improper, kspace (long-range), and fix contributions. If any extra
|
|
|
|
keywords are listed, then only those components are summed to compute
|
|
|
|
ke and/or the virial.
|
2007-02-10 05:40:32 +08:00
|
|
|
|
|
|
|
The temperature and kinetic energy tensor is not calculated by this
|
2007-12-01 07:16:45 +08:00
|
|
|
compute, but rather by the temperature compute specified with the
|
|
|
|
command. Normally this compute should calculate the temperature of
|
|
|
|
all atoms for consistency with the virial term, but any compute style
|
|
|
|
that calculates temperature can be used, e.g. one that excludes frozen
|
|
|
|
atoms or other degrees of freedom.
|
2007-02-10 05:40:32 +08:00
|
|
|
|
2007-12-01 07:16:45 +08:00
|
|
|
Note that the N is the above formula is really degrees-of-freedom
|
2007-02-10 05:40:32 +08:00
|
|
|
where the DOF is specified by the temperature compute. See the
|
|
|
|
various "compute temperature"_compute.html styles for details.
|
|
|
|
|
2008-01-18 07:46:30 +08:00
|
|
|
A compute of this style with the ID of "thermo_press" is created when
|
|
|
|
LAMMPS starts up, as if this command were in the input script:
|
2007-11-02 00:46:50 +08:00
|
|
|
|
2008-01-18 07:46:30 +08:00
|
|
|
compute thermo_press all pressure thermo_temp :pre
|
2007-11-02 00:46:50 +08:00
|
|
|
|
|
|
|
where "thermo_temp" is the ID of a similarly defined compute of style
|
|
|
|
"temp". See the "thermo_style" command for more details.
|
|
|
|
|
2008-01-03 03:25:15 +08:00
|
|
|
[Output info:]
|
|
|
|
|
|
|
|
The scalar value calculated by this compute is "intensive", meaning it
|
|
|
|
is independent of the number of atoms in the simulation. The vector
|
|
|
|
values are "extensive", meaning they scale with the number of atoms in
|
|
|
|
the simulation.
|
|
|
|
|
2007-02-10 05:40:32 +08:00
|
|
|
[Restrictions:] none
|
|
|
|
|
|
|
|
[Related commands:]
|
|
|
|
|
2007-12-01 07:16:45 +08:00
|
|
|
"compute temp"_compute_temp.html, "compute
|
|
|
|
stress/atom"_compute_stress_atom.html,
|
2008-03-01 09:13:20 +08:00
|
|
|
"thermo_style"_thermo_style.html,
|
2007-02-10 05:40:32 +08:00
|
|
|
|
|
|
|
[Default:] none
|