lammps/doc/compute_pressure.html

103 lines
4.1 KiB
HTML
Raw Normal View History

<HTML>
<CENTER><A HREF = "http://lammps.sandia.gov">LAMMPS WWW Site</A> - <A HREF = "Manual.html">LAMMPS Documentation</A> - <A HREF = "Section_commands.html#comm">LAMMPS Commands</A>
</CENTER>
<HR>
<H3>compute pressure command
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID pressure temp-ID keyword ...
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command
<LI>pressure = style name of this compute command
<LI>temp-ID = ID of compute that calculates temperature
<LI>zero or more keywords may be appended
<LI>keyword = <I>ke</I> or <I>pair</I> or <I>bond</I> or <I>angle</I> or <I>dihedral</I> or <I>improper</I> or <I>kspace</I> or <I>fix</I>
</UL>
<P><B>Examples:</B>
</P>
<PRE>compute 1 all pressure myTemp
compute 1 all pressure thermo_temp pair bond
</PRE>
<P><B>Description:</B>
</P>
<P>Define a computation that calculates the pressure of the entire system
of atoms. The specified group must be "all". See the <A HREF = "compute_stress_atom.html">compute
stress/atom</A> command if you want per-atom
pressure (stress). These per-atom values could be summed for a group
of atoms via the <A HREF = "compute_reduce.html">compute reduce</A> command.
</P>
<P>The pressure is computed by the formula
</P>
<CENTER><IMG SRC = "Eqs/pressure.jpg">
</CENTER>
<P>where N is the number of atoms in the system (see discussion of DOF
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
within LAMMPS for all pairwise as well as 2-body, 3-body, and 4-body,
and long-range interactions. <A HREF = "fix.html">Fixes</A> that impose constraints
(e.g. the <A HREF = "fix_shake.html">fix shake</A> command) also contribute to the
virial term.
</P>
<P>A 6-component pressure tensor is also calculated by this compute whose
components can be output by the <A HREF = "thermo_style.html">thermo_style
custom</A> command or accessed by other
<A HREF = "compute.html">compute</A> and <A HREF = "fix.html">fix</A> 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.
</P>
<P>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.
</P>
<P>The temperature and kinetic energy tensor is not calculated by this
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.
</P>
<P>Note that the N is the above formula is really degrees-of-freedom
where the DOF is specified by the temperature compute. See the
various <A HREF = "compute.html">compute temperature</A> styles for details.
</P>
<P>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:
</P>
<PRE>compute thermo_press all pressure thermo_temp
</PRE>
<P>where "thermo_temp" is the ID of a similarly defined compute of style
"temp". See the "thermo_style" command for more details.
</P>
<P><B>Output info:</B>
</P>
<P>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.
</P>
<P><B>Restrictions:</B> none
</P>
<P><B>Related commands:</B>
</P>
<P><A HREF = "compute_temp.html">compute temp</A>, <A HREF = "compute_stress_atom.html">compute
stress/atom</A>,
<A HREF = "thermo_style.html">thermo_style</A>,
</P>
<P><B>Default:</B> none
</P>
</HTML>