SoftMatterDynamicsNonEquilibrium¶
Included in QATK.Dynamics
- class SoftMatterDynamicsNonEquilibrium(heat_source=None, heat_sink=None, call_interval=None)¶
Simulate heat flow by non-equilibrium momentum exchange in the soft matter dynamics framework as a hook function. This implements reverse non-equilibrium MD (RNEMD). In this method large momenta from atoms in a cold region are exchanged with low atomic momenta in a hot region. In this way heat flow is simulated in the material. This class also records the amount of energy transfer as a measurement in the trajectory.
- Parameters:
heat_source (str | list of ints | tuple of type (float, PhysicalQuantity of type length)) – The heat source atoms can be defined by giving a tag that specifies which atoms are in the heat source, a list of atomic indices, or by defining a spatial region. The spatial region is defined as 2-tuple of the origin and length. The origin is the fractional position along the c-axis and the length is the thickness along the c-axis.
heat_sink (str | list of ints | tuple of type (float, PhysicalQuantity of type length)) – The heat sink atoms can be defined by giving a tag that specifies which atoms are in the heat sink, a list of atomic indices, or by defining a spatial region. The spatial region is defined as 2-tuple of the origin and length. The origin is the fractional position along the c-axis and the length is the thickness along the c-axis.
call_interval (int) – After each call_interval iterations, a velocity swapping is performed between the hot and the cold heat region. Default:
100
- callInterval()¶
- Returns:
The call interval of the hook.
- Return type:
int
- heatSink()¶
- Returns:
The heat sink.
- Return type:
SpatialHeatRegion | IndicesHeatRegion
- heatSource()¶
- Returns:
The heat source.
- Return type:
SpatialHeatRegion | IndicesHeatRegion
- masses()¶
- Returns:
The masses for the entire system and for the two regions.
- Return type:
PhysicalQuantity of type mass
- uniqueString()¶
Return a unique string representing the state of the object.
Usage Examples¶
Calculate thermal transport in poly(methyl metacrylate) using non-equilibrium molecular dynamics. Hot and cold regions are set up along the C axis in the polymer melt. The thermal transport is calculated by determining the temperature gradient and energy transfer rates from the simulation.
# Set the non-equilibrium hook function
non_equilibrium = SoftMatterDynamicsNonEquilibrium(
heat_source=(0.0, 5.0 * Angstrom),
heat_sink=(0.5, 5.0 * Angstrom),
call_interval=100,
)
# Run the simulation
simulation.simulate(100000, hook_functions=[non_equilibrium])
Notes¶
The SoftMatterDynamicsNonEquilibrium class implements the reverse non-equilibrium momentum exchange
method for calculating thermal conductivity[1] and [2]. This class
operates as a hook function in the soft matter dynamics framework, and can be given to the simulate method in the
SoftMatterDynamicsSimulation using the hook_functions argument. This class also measures the energy
transfer rate as a measurement in the MDTrajectory which is used to calculate the thermal conductivity.
This hook function works in a nearly identical manner to the NonEquilibriumMomentumExchange class, which is
used for the same calculation in the molecular dynamics framework. A heat source and heat sink are selected based on
either a tag, list of atom indices, or on a spatial region along the C-axis. These define the regions in which
momentum is exchanged. The number of steps between exchange events is also specified with the call_frequency
argument. To be used in a simulation the hook function is then given to the simulate method in the
SoftMatterDynamicsNonEquilibrium using the hook_functions argument.
Once the calculation is complete, the thermal conductivity can be calculated using the average temperature gradient between the hot and cold regions \(<\partial T/\partial z>\), the cross-sectional area of the simulation cell perpendicular to the heat current \(A\) and the average energy transfer rate \(\dot{E}\). The thermal conductivity \(\lambda\) is then given as: