TwoTemperatureModelRegion¶
Included in QATK.Dynamics
- class TwoTemperatureModelRegion(*args, **kwargs)¶
Initializes the TwoTemperatureModelRegion.
- assignAtoms(coordinates, indices=None)¶
Assign a set of points to the grid cells. Points outside the grid are ignored.
- Parameters:
coordinates (numpy.ndarray) – The coordinates of the atoms to assign to the grid.
indices (list of int or None) – The indices of the atoms to assign to the grid. If None, all atoms are assigned.
- static createGridFromTag(configuration, tags, number_of_cells, initial_electronic_temperature=None, electronic_thermal_conductivity=None, electron_ion_coupling=None, electronic_specific_heat=None, grid_size=None, buffer_length=None, origin=None, periodic_boundary_conditions=[True, True, True])¶
Creates a grid that covers the atoms with the given tag in the configuration, or by the specified grid size. This method uses Grid.createGridFromTag to create the grid and then sets the initial electronic temperature and the electronic thermal conductivity on the grid.
- Parameters:
configuration (
BulkConfiguration) – The configuration to use.tags (list of strings) – The tags defining the region for the grid.
number_of_cells (list of int) – The number of cells in the grid along each direction.
initial_electronic_temperature (PhysicalQuantity of type temperature) – The initial electronic temperature in the grid.
electronic_thermal_conductivity (PhysicalQuantity of type power per meter per temperature) – The electronic thermal conductivity in the grid.
electron_ion_coupling (PhysicalQuantity of type power per volume per temperature) – The electron-ion coupling in the grid.
electronic_specific_heat (PhysicalQuantity of type energy per volume per temperature) – The electronic specific heat in the grid.
grid_size (list of float) – The size of the grid along each direction.
buffer_length (float) – The buffer length to add around the atoms with the given tags.
origin (list of float) – The origin of the grid.
periodic_boundary_conditions (list of bool) – The periodic boundary conditions for the grid.
- Returns:
The created grid.
- Return type:
Grid
- static createSlabFromTags(configuration, tags, number_of_cells, z_bounds=None, initial_electronic_temperature=None, electronic_thermal_conductivity=None, electron_ion_coupling=None, electronic_specific_heat=None, interfaces=None, periodic_boundary_conditions=None)¶
Creates a grid by stitching together multiple sub-grids defined by the atom tags. The sub-grids are stitched along the z-direction. By default the grid is periodic in the x- and y- directions and non-periodic in the z-direction.
- Parameters:
configuration (
BulkConfiguration) – The configuration to use.tags (list of strings) – The tags defining the regions for the sub-grids.
number_of_cells (list of int | list of list of int) – The number of cells in each sub-grid. This can be either a list of integers, in which case each integer defines the number of cells in the z-direction for the corresponding sub-grid (with 1 cell in the x- and y-directions), or a list of lists of 3 integers, in which case each list defines the number of cells in the x-, y-, and z-directions for the corresponding sub-grid.
z_bounds (list of PhysicalQuantity of type length or Automatic) – The z-coordinate bounds of the entire grid. If None, the whole unit cell will be used. If Automatic is given for either bound, the corresponding minimum or maximum z-coordinate of the atoms in the configuration will be used.
initial_electronic_temperature (PhysicalQuantity of type temperature) – The initial electronic temperature in each sub-grid.
electronic_thermal_conductivity (PhysicalQuantity of type power per length per temperature) – The electronic thermal conductivity in each sub-grid.
electron_ion_coupling (PhysicalQuantity of type power per volume per temperature) – The electron-ion coupling in each sub-grid.
electronic_specific_heat (PhysicalQuantity of type energy per volume per temperature) – The electronic specific heat in each sub-grid.
interfaces (list of
TwoTemperatureModelInterface) – The interfaces between the sub-grids. The interfaces should be ordered with increasing z-coordinate.periodic_boundary_conditions (list of bool) – The periodic boundary conditions for the grid.
- Returns:
The created grid.
- Return type:
Grid
- initialize()¶
Initializes the TwoTemperatureModelRegion by building the grid and setting the conductivity tensors.
- interfaces()¶
Get the interfaces of the grid.
- Returns:
The interfaces of the grid.
- Return type:
list of
GridInterface
- numberOfCells()¶
Returns the number of cells in the grid.
- Returns:
The number of cells in the grid.
- Return type:
int
- shape()¶
Returns the shape of the grid.
- Returns:
The shape of the grid.
- Return type:
numpy.ndarray of shape (3,)
- stitch(other, direction=None, interface=None, new_origin=None, max_allowed_deviation=None)¶
Stitch this grid with another grid along the given direction. The two grids must be adjacent along the given direction and have the same number of cells in the other two directions. The cells at the interface will be merged into a single cell. Warning: This method invalidates self and other.
- Parameters:
other (
Grid) – The other grid to stitch with.direction (numpy.ndarray of shape (3,) or None) – The direction to stitch the grids along. If None, the direction will be determined automatically.
interface (
GridInterfaceor None) – The interface to use at the boundary between the two grids. If None, a default interface will be used.new_origin (numpy.ndarray of shape (3,) or None) – The origin of the new stitched grid. If None, the origin will be set to the origin of the first grid.
max_allowed_deviation (PhysicalQuantity of type length) – The maximum allowed deviation between the two grids at the interface. If the deviation is larger than this value, an exception will be raised. Default: 1e-5 * Angstrom.
- Returns:
A new grid that is the result of stitching the two grids together.
- Return type:
Grid
- uniqueString()¶
Return a unique string representing the state of the object.
Usage Examples¶
In the below example, a grid that includes an interface beween two materials is created. The
interface is planar and orthogonal to the z-axis. The grid is created using the
createSlabFromTags() helper method. First an interface object
(TwoTemperatureModelInterface) is created to define the properties of the interface
between the two materials. Different values for the electronic properties are used for the two
materials. The grid is then created by specifying the tags corresponding to each material region
along with their thermal properties. The interface is created such that its z-coordinate lies
between the two regions. The created grid covers the entire simulation cell in the x- and
y-directions, while in the z-direction it spans only the regions containing atoms with the specified
tags (specified by using the Automatic flag in the z_bounds argument). It is also possible
to explicitly set the z-bounds of the grid using the z_bounds argument. By default, the entire
simulation cell is used. The periodic_boundary_conditions parameter defaults to [True, True, False]
for this method, meaning that the grid is periodic in the x- and y-directions but not in the
z-direction.
interface = TwoTemperatureModelInterface(
electronic_thermal_conductance=1e7 * Watt / (meter**2 * Kelvin),
)
grid = TwoTemperatureModelRegion.createSlabFromTags(
bulk_configuration,
tags=["cu", "ag"],
number_of_cells=[10, 10], # Number of cells in each sub-grid
electronic_thermal_conductivity=[401, 429] * Watt / meter / Kelvin,
electron_ion_coupling=[2.6e17, 2.7e16] * Watt / (meter**3 * Kelvin),
electronic_specific_heat=[96.8, 62.8] * Joule / (meter**3 * Kelvin),
z_bounds=[Automatic, Automatic],
initial_electronic_temperature=[300, 300] * Kelvin,
interfaces=[interface],
)
Notes¶
This class contains factory methods for creating grids for use with the
TwoTemperatureModelHook. It contains two main factory methods:
createGridFromTag(): Creates a TTM grid based on tags assigned to atoms in the configuration. All atoms with the specified tag(s) are included in the TTM region.createSlabFromTags(): Creates a TTM grid of slab geometry based on tags assigned to atoms in the configuration. Each tagged region can have different thermal properties and between each tagged region an interface is created. The method also allows for passing in interfaces with specific properties using theTwoTemperatureModelInterface.
These grids are used to represent the electronic temperature field in real space in molecular dynamics simulations that utilize the Two-Temperature Model Hook.