Unverified Commit 0c287a55 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1092 from RomainVermorel/master

New stress/mop and stress/mop/profile computes for USER-MISC 
parents 6ae4bdea 44fcdc40
Loading
Loading
Loading
Loading
+111 −0
Original line number Diff line number Diff line
"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 stress/mop command :h3
compute stress/mop/profile command :h3


[Syntax:]

compute ID group-ID style dir args keywords ... :pre

ID, group-ID are documented in "compute"_compute.html command
style = {stress/mop} or {stress/mop/profile}
dir = {x} or {y} or {z} is the direction normal to the plane
args = argument specific to the compute style
keywords = {kin} or {conf} or {total} (one of more can be specified) :ul
  {stress/mop} args = pos
    pos = {lower} or {center} or {upper} or coordinate value (distance units) is the position of the plane
  {stress/mop/profile} args = origin delta
    origin = {lower} or {center} or {upper} or coordinate value (distance units) is the position of the first plane
    delta = value (distance units) is the distance between planes :pre

compute 1 all stress/mop x lower total
compute 1 liquid stress/mop z 0.0 kin conf
fix 1 all ave/time 10 1000 10000 c_1\[*\] file mop.time
fix 1 all ave/time 10 1000 10000 c_1\[2\] file mop.time :pre

compute 1 all stress/mop/profile x lower 0.1 total
compute 1 liquid stress/mop/profile z 0.0 0.25 kin conf
fix 1 all ave/time 500 20 10000 c_1\[*\] ave running overwrite file mopp.time mode vector :pre


[Description:]

Compute {stress/mop} and compute {stress/mop/profile} define computations that
calculate components of the local stress tensor using the method of
planes "(Todd)"_#mop-todd.  Specifically in compute {stress/mop} calculates 3
components are computed in directions {dir},{x}; {dir},{y}; and
{dir},{z}; where {dir} is the direction normal to the plane, while
in compute {stress/mop/profile} the profile of the stress is computed.

Contrary to methods based on histograms of atomic stress (i.e. using
"compute stress/atom"_compute_stress_atom.html), the method of planes is
compatible with mechanical balance in heterogeneous systems and at
interfaces "(Todd)"_#mop-todd.

The stress tensor is the sum of a kinetic term and a configurational
term, which are given respectively by Eq. (21) and Eq. (16) in
"(Todd)"_#mop-todd. For the kinetic part, the algorithm considers that
atoms have crossed the plane if their positions at times t-dt and t are
one on either side of the plane, and uses the velocity at time t-dt/2
given by the velocity-Verlet algorithm.

Between one and three keywords can be used to indicate which
contributions to the stress must be computed: kinetic stress (kin),
configurational stress (conf), and/or total stress (total).

NOTE 1: The configurational stress is computed considering all pairs of atoms where at least one atom belongs to group group-ID. 

NOTE 2: The local stress does not include any Lennard-Jones tail
corrections to the pressure added by the "pair_modify tail
yes"_pair_modify.html command, since those are contributions to the global system pressure.

[Output info:]

Compute {stress/mop} calculates a global vector (indices starting at 1), with 3
values for each declared keyword (in the order the keywords have been
declared). For each keyword, the stress tensor components are ordered as
follows: stress_dir,x, stress_dir,y, and stress_dir,z.

Compute {stress/mop/profile} instead calculates a global array, with 1 column
giving the position of the planes where the stress tensor was computed,
and with 3 columns of values for each declared keyword (in the order the
keywords have been declared). For each keyword, the profiles of stress
tensor components are ordered as follows: stress_dir,x; stress_dir,y;
and stress_dir,z.

The values are in pressure "units"_units.html. 

The values produced by this compute can be accessed by various "output commands"_Howto_output.html. For instance, the results can be written to a file using the "fix ave/time"_fix_ave_time.html command. Please see the example in the examples/USER/mop folder.

[Restrictions:] 

These styles are part of the USER-MISC package. They are only enabled if
LAMMPS is built with that package. See the "Build package"_Build_package.html
doc page on for more info.

The method is only implemented for 3d orthogonal simulation boxes whose
size does not change in time, and axis-aligned planes.

The method only works with two-body pair interactions, because it
requires the class method pair->single() to be implemented. In
particular, it does not work with more than two-body pair interactions,
intra-molecular interactions, and long range (kspace) interactions.

[Related commands:]

"compute stress/atom"_compute_stress_atom.html

[Default:] none

:line

:link(mop-todd)
[(Todd)] B. D. Todd, Denis J. Evans, and Peter J. Daivis: "Pressure tensor for inhomogeneous fluids", 
Phys. Rev. E 52, 1627 (1995).
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ Computes :h1
   compute_sna_atom
   compute_spin
   compute_stress_atom
   compute_stress_mop
   compute_tally
   compute_tdpd_cc_atom
   compute_temp
+1 −0
Original line number Diff line number Diff line
@@ -497,6 +497,7 @@ compute_smd_vol.html
compute_sna_atom.html
compute_spin.html
compute_stress_atom.html
compute_stress_mop.html
compute_tally.html
compute_tdpd_cc_atom.html
compute_temp.html
+2467 −0

File added.

Preview size limit exceeded, changes collapsed.

+40 −0
Original line number Diff line number Diff line
variable T equal 0.8
variable p_solid equal 0.05

read_data data.mop

pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0
pair_coeff 1 2 0.5 1.0 
pair_coeff 2 2 0.0 0.0
neigh_modify delay 0

group liquid type 1
group solid type 2
region bottom block INF INF INF INF INF 7.0
group bottom region bottom
group solid_bottom intersect solid bottom
group solid_up subtract solid solid_bottom

variable faSolid equal ${p_solid}*lx*ly/count(solid_up)
fix piston_up solid_up aveforce NULL NULL -${faSolid} 
fix freeze_up solid_up setforce 0.0 0.0 NULL 
fix freeze_bottom solid_bottom setforce 0.0 0.0 0.0
fix nvesol solid nve
compute Tliq liquid temp
fix nvtliq liquid nvt temp $T $T 0.5
fix_modify nvtliq temp Tliq

thermo 1000
thermo_modify flush yes temp Tliq

fix fxbal all balance 1000 1.05 shift z 10 1.05

compute mopz0 all stress/mop z center kin conf
fix mopz0t all ave/time 1 1 1 c_mopz0[*] file mopz0.time

compute moppz liquid stress/mop/profile z 0.0 0.1 kin conf
fix moppzt all ave/time 1 1 1 c_moppz[*] ave running overwrite file moppz.time mode vector

run 0
Loading