ThermodynamicQuantities

class hoomd.md.compute.ThermodynamicQuantities(filter)

Bases: Compute

Compute thermodynamic properties of a subset of the system.

Parameters:

filter (hoomd.filter) – Particle filter to compute thermodynamic properties for.

ThermodynamicQuantities acts on a subset of particles in the system and calculates thermodynamic properties of those particles. Add a ThermodynamicQuantities instance to a logger to save these quantities to a file, see hoomd.logging.Logger for more details.

Note

For compatibility with hoomd.md.constrain.Rigid, ThermodynamicQuantities performs all sums ifilter\sum_{i \in \mathrm{filter}} over free particles and rigid body centers - ignoring constituent particles to avoid double counting.

Examples:

f = filter.Type("A")
compute.ThermodynamicQuantities(filter=f)

Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...


Members defined in ThermodynamicQuantities:

property degrees_of_freedom

Number of degrees of freedom in the subset NdofN_{\mathrm{dof}}.

Ndof=Ndof,translational+Ndof,rotationalN_\mathrm{dof} = N_\mathrm{dof, translational} + N_\mathrm{dof, rotational}

See also

hoomd.State.update_group_dof describes when NdofN_{\mathrm{dof}} is updated.

(Loggable: category=”scalar”)

property kinetic_energy

Total kinetic energy KK of the subset [energy][\mathrm{energy}].

K=Krotational+KtranslationalK = K_\mathrm{rotational} + K_\mathrm{translational}

(Loggable: category=”scalar”)

property kinetic_temperature

Instantaneous thermal energy kTkkT_k of the subset [energy][\mathrm{energy}].

kTk=2KNdofkT_k = 2 \cdot \frac{K}{N_{\mathrm{dof}}}

(Loggable: category=”scalar”)

property num_particles

Number of particles NN in the subset.

(Loggable: category=”scalar”)

property potential_energy

Potential energy UU that the subset contributes to the system [energy][\mathrm{energy}].

U=Unet,additional+ifilterUnet,i,U = U_{\mathrm{net},\mathrm{additional}} + \sum_{i \in \mathrm{filter}} U_{\mathrm{net},i},

where the net energy terms are computed by hoomd.md.Integrator over all of the forces in hoomd.md.Integrator.forces.

(Loggable: category=”scalar”)

property pressure

Instantaneous pressure PP of the subset [pressure][\mathrm{pressure}].

P=2Ktranslational+WisotropicDV,P = \frac{ 2 \cdot K_{\mathrm{translational}} + W_\mathrm{isotropic} }{D \cdot V},

where DD is the dimensionality of the system, VV is the volume of the simulation box (or area in 2D), and WisotropicW_\mathrm{isotropic} is the isotropic virial:

W_\mathrm{isotropic} = & \left( W_{\mathrm{net},\mathrm{additional}}^{xx} + W_{\mathrm{net},\mathrm{additional}}^{yy} + W_{\mathrm{net},\mathrm{additional}}^{zz} \right) \\ + & \sum_{i \in \mathrm{filter}} \left( W_\mathrm{{net},i}^{xx} + W_\mathrm{{net},i}^{yy} + W_\mathrm{{net},i}^{zz} \right)

where the net virial terms are computed by hoomd.md.Integrator over all of the forces in hoomd.md.Integrator.forces and Wzz=0W^{zz}=0 in 2D simulations.

(Loggable: category=”scalar”)

property pressure_tensor

Instantaneous pressure tensor of the subset [pressure][\mathrm{pressure}].

The six components of the pressure tensor are given in the order: (PxxP^{xx}, PxyP^{xy}, PxzP^{xz}, PyyP^{yy}, PyzP^{yz}, PzzP^{zz}):

Pkl=1V(Wnet,additionalkl+ifiltermivikvil+Wnet,ikl),P^{kl} = \frac{1}{V} \left( W_{\mathrm{net},\mathrm{additional}}^{kl} + \sum_{i \in \mathrm{filter}} m_i \cdot v_i^k \cdot v_i^l + W_{\mathrm{net},i}^{kl} \right),

where the net virial terms are computed by hoomd.md.Integrator over all of the forces in hoomd.md.Integrator.forces, vikv_i^k is the k-th component of the velocity of particle ii and VV is the total simulation box volume (or area in 2D).

(Loggable: category=”sequence”)

property rotational_degrees_of_freedom

Number of rotational degrees of freedom in the subset Ndof,rotationalN_\mathrm{dof, rotational}.

Integration methods (hoomd.md.methods) determine the number of degrees of freedom they give to each particle. Each integration method operates on a subset of the system filterm\mathrm{filter}_m that may be distinct from the subset from the subset given to ThermodynamicQuantities.

When hoomd.md.Integrator.integrate_rotational_dof is False, Ndof,rotational=0N_\mathrm{dof, rotational} = 0. When it is True, the given degrees of freedom depend on the dimensionality of the system.

In 2D:

Ndof,rotational=mmethods  ifilterfilterm[Iz,i>0]N_\mathrm{dof, rotational} = \sum_{m \in \mathrm{methods}} \; \sum_{i \in \mathrm{filter} \cup \mathrm{filter}_m} \left[ I_{z,i} > 0 \right]

where II is the particles’s moment of inertia.

In 3D:

Ndof,rotational=mmethods  ifilterfilterm[Ix,i>0]+[Iy,i>0]+[Iz,i>0]N_\mathrm{dof, rotational} = \sum_{m \in \mathrm{methods}} \; \sum_{i \in \mathrm{filter} \cup \mathrm{filter}_m} \left[ I_{x,i} > 0 \right] + \left[ I_{y,i} > 0 \right] + \left[ I_{z,i} > 0 \right]

See also

hoomd.State.update_group_dof describes when Ndof,rotationalN_{\mathrm{dof, rotational}} is updated.

(Loggable: category=”scalar”)

property rotational_kinetic_energy

Rotational kinetic energy KrotationalK_\mathrm{rotational} of the subset [energy][\mathrm{energy}].

Krotational,d=12ifilter{Ld,i2Id,iIid>00Iid=0Krotational=Krotational,x+Krotational,y+Krotational,zK_\mathrm{rotational,d} = \frac{1}{2} \sum_{i \in \mathrm{filter}} \begin{cases} \frac{L_{d,i}^2}{I_{d,i}} & I^d_i > 0 \\ 0 & I^d_i = 0 \end{cases} K_\mathrm{rotational} = K_\mathrm{rotational,x} + K_\mathrm{rotational,y} + K_\mathrm{rotational,z}

II is the moment of inertia and LL is the angular momentum in the (diagonal) reference frame of the particle.

(Loggable: category=”scalar”)

property translational_degrees_of_freedom

Number of translational degrees of freedom in the subset Ndof,translationalN_{\mathrm{dof, translational}}.

When using a single integration method on all particles that is momentum conserving, the center of mass motion is conserved and the number of translational degrees of freedom is:

Ndof,translational=DNDNNparticlesNconstraints(filter)N_\mathrm{dof, translational} = DN - D\frac{N}{N_\mathrm{particles}} - N_\mathrm{constraints}(\mathrm{filter})

where DD is the dimensionality of the system and Nconstraints(filter)N_\mathrm{constraints}(\mathrm{filter}) is the number of degrees of freedom removed by constraints (hoomd.md.constrain) in the subset. The fraction NNparticles\frac{N}{N_\mathrm{particles}} distributes the momentum conservation constraint evenly when ThermodynamicQuantities is applied to multiple subsets.

Note

When using rigid bodies (hoomd.md.constrain.Rigid), NN is the number of rigid body centers plus free particles selected by the filter and NparticlesN_\mathrm{particles} is total number of rigid body centers plus free particles in the whole system.

When hoomd.md.Integrator.rigid is not set, NN is the total number of particles selected by the filter and NparticlesN_\mathrm{particles} is the total number of particles in the system, regardless of their body value.

When using multiple integration methods, a single integration method on fewer than all particles, or a single integration method that is not momentum conserving, hoomd.md.Integrator assumes that linear momentum is not conserved and counts the center of mass motion in the degrees of freedom:

Ndof,translational=DNNconstraints(filter)N_{\mathrm{dof, translational}} = DN - N_\mathrm{constraints}(\mathrm{filter})

(Loggable: category=”scalar”)

property translational_kinetic_energy

Translational kinetic energy KtranslationalK_{\mathrm{translational}} of the subset [energy][\mathrm{energy}].

Ktranslational=12ifiltermivi2K_\mathrm{translational} = \frac{1}{2} \sum_{i \in \mathrm{filter}} m_i v_i^2

(Loggable: category=”scalar”)

property volume

Volume VV of the simulation box (area in 2D) [lengthD][\mathrm{length}^{D}].

(Loggable: category=”scalar”)