thermal_conductivity_step package#

Submodules#

thermal_conductivity_step.metadata module#

This file contains metadata describing the results from ThermalConductivity

thermal_conductivity_step.metadata.metadata = {'results': {'P': {'description': 'The mean pressure', 'dimensionality': 'scalar', 'type': 'float', 'units': 'atm'}, 'P,stderr': {'description': 'The standard error of the pressure', 'dimensionality': 'scalar', 'type': 'float', 'units': 'atm'}, 'T': {'description': 'The mean temperature', 'dimensionality': 'scalar', 'type': 'float', 'units': 'K'}, 'T,stderr': {'description': 'The standard error of the temperature', 'dimensionality': 'scalar', 'type': 'float', 'units': 'K'}, 'V': {'description': 'The mean volume', 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å^3'}, 'bulk modulus': {'description': 'The bulk modulus used for the equilibrium density, from an NPT run', 'dimensionality': 'scalar', 'type': 'float', 'units': 'atm'}, 'density': {'description': 'The mean density', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/mL'}, 'density,stderr': {'description': 'The standard error of the density', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/mL'}, 'equilibrium density': {'description': 'The estimated density at the target pressure of runs at constant volume', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/mL'}, 'equilibrium density,stderr': {'description': 'The standard error of the estimated equilibrium density', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/mL'}, 'kappa': {'description': 'The thermal conductivity by Green-Kubo', 'dimensionality': 'scalar', 'property': 'thermal conductivity#Green-Kubo#{model}', 'type': 'float', 'units': 'W/m/K'}, 'kappa (Helfand derivative)': {'description': 'The thermal conductivity from the derivative of the Helfand moments', 'dimensionality': 'scalar', 'type': 'float', 'units': 'W/m/K'}, 'kappa (Helfand derivative),stderr': {'description': 'The standard error of the thermal conductivity from the derivative of the Helfand moments', 'dimensionality': 'scalar', 'type': 'float', 'units': 'W/m/K'}, 'kappa (Helfand)': {'description': 'The thermal conductivity from the Helfand moments', 'dimensionality': 'scalar', 'property': 'thermal conductivity#Helfand#{model}', 'type': 'float', 'units': 'W/m/K'}, 'kappa (Helfand),stderr': {'description': 'The standard error of the thermal conductivity from the Helfand moments', 'dimensionality': 'scalar', 'property': 'thermal conductivity,stderr#Helfand#{model}', 'type': 'float', 'units': 'W/m/K'}, 'kappa,stderr': {'description': 'The standard error of the thermal conductivity by Green-Kubo', 'dimensionality': 'scalar', 'property': 'thermal conductivity,stderr#Green-Kubo#{model}', 'type': 'float', 'units': 'W/m/K'}, 'kappa_xx': {'description': 'The xx component of the thermal conductivity, by Green-Kubo', 'dimensionality': 'scalar', 'type': 'float', 'units': 'W/m/K'}, 'kappa_xx,stderr': {'description': 'The standard error of the xx component of the thermal conductivity, by Green-Kubo', 'dimensionality': 'scalar', 'type': 'float', 'units': 'W/m/K'}, 'kappa_yy': {'description': 'The yy component of the thermal conductivity, by Green-Kubo', 'dimensionality': 'scalar', 'type': 'float', 'units': 'W/m/K'}, 'kappa_yy,stderr': {'description': 'The standard error of the yy component of the thermal conductivity, by Green-Kubo', 'dimensionality': 'scalar', 'type': 'float', 'units': 'W/m/K'}, 'kappa_zz': {'description': 'The zz component of the thermal conductivity, by Green-Kubo', 'dimensionality': 'scalar', 'type': 'float', 'units': 'W/m/K'}, 'kappa_zz,stderr': {'description': 'The standard error of the zz component of the thermal conductivity, by Green-Kubo', 'dimensionality': 'scalar', 'type': 'float', 'units': 'W/m/K'}, 'nruns': {'description': 'The number of MD runs analyzed', 'dimensionality': 'scalar', 'type': 'integer'}}}#

Description of the computational models for ThermalConductivity.

Hamiltonians, approximations, and basis set or parameterizations, only if appropriate for this code. For example:

metadata["computational models"] = {
    "Hartree-Fock": {
        "models": {
            "PM7": {
                "parameterizations": {
                    "PM7": {
                        "elements": "1-60,62-83",
                        "periodic": True,
                        "reactions": True,
                        "optimization": True,
                        "code": "mopac",
                    },
                    "PM7-TS": {
                        "elements": "1-60,62-83",
                        "periodic": True,
                        "reactions": True,
                        "optimization": False,
                        "code": "mopac",
                    },
                },
            },
        },
    },
}

thermal_conductivity_step.thermal_conductivity module#

Non-graphical part of the Thermal Conductivity step in a SEAMM flowchart.

The thermal conductivity is calculated from the fluctuations of the heat flux in equilibrium MD, by the Green-Kubo integral of its autocorrelation function and by the Helfand moments. The MD is run before this step – in a Loop for independent runs – or read from files; the step analyzes it.

thermal_conductivity_step.thermal_conductivity.DIAGONAL = ('κ_xx', 'κ_yy', 'κ_zz')#

The names of the diagonal and off-diagonal components

thermal_conductivity_step.thermal_conductivity.METHODS = ('Green-Kubo', 'Helfand moments', 'Helfand derivative')#

The methods, in the order of the tables

thermal_conductivity_step.thermal_conductivity.MIN_RUN_TIME = <Quantity(10.0, 'picosecond')>#

the correlation functions are kept to a tenth of it, and fitting them needs a little over 0.8 ps.

Type:

The shortest run, or block of a run, that can be analyzed

thermal_conductivity_step.thermal_conductivity.RESULT_KEYS = {'Green-Kubo': 'kappa', 'Helfand derivative': 'kappa (Helfand derivative)', 'Helfand moments': 'kappa (Helfand)'}#

the key of κ and its standard error

Type:

The results stored for each method

class thermal_conductivity_step.thermal_conductivity.ThermalConductivity(flowchart=None, title='Thermal Conductivity', extension=None, logger=<Logger thermal_conductivity_step.thermal_conductivity (WARNING)>)[source]#

Bases: Node

The non-graphical part of a Thermal Conductivity step in a flowchart.

parameters#

The control parameters for Thermal Conductivity.

Type:

ThermalConductivityParameters

See also

TkThermalConductivity, ThermalConductivity, ThermalConductivityParameters

analyze(indent='', P=None, configuration=None, source='runs', uncorrected=None, **kwargs)[source]#

Fit, print, plot and store the thermal conductivity.

The value of each method is the average over the runs (or blocks) of the average of the three diagonal components fitted to each run; its error is the standard error of these averages. The curves averaged over the runs are fitted too, for the graphs.

Parameters:
  • indent (str) – An extra indentation for the output

  • P (dict) – The values of the parameters.

  • configuration (molsystem._Configuration) – The configuration for the results.

  • source (str) – What the samples are: “runs” or “blocks”.

  • uncorrected ([str]) – The species of a mixture whose mass fluxes were not sampled, so the interdiffusion could not be removed; None for a pure substance.

check_configuration(configuration)[source]#

Called by an MD step before it runs MD that this step will analyze.

Returns:

Warnings about the structure, e.g. that it is small.

Return type:

[str]

Raises:

RuntimeError – If the system is not periodic.

check_flowchart(preceding)[source]#

Check, before the job runs, that the MD will sample what is needed and is set up for the analysis.

Parameters:

preceding ([seamm.Node]) – The steps that run before this one.

Returns:

A description of each problem; empty if none.

Return type:

[str]

create_parser()[source]#

Setup the command-line / config file parser

description_text(P=None, short=False)[source]#

Create the text description of what this step will do.

Parameters:
  • P (dict) – An optional dictionary of the current values of the control parameters.

  • short (bool) – Unused: the description is always short.

Returns:

A description of the current step.

Return type:

str

property git_revision#

The git version of this module.

md_requirements(P=None)[source]#

What the analysis needs from the MD: the heat flux at least every 4 fs, in a periodic cell. It analyzes the dynamics.

Sampling every dt adds the flux’s power at 1/dt and its multiples to the Green-Kubo integral. The flux of molecules with X-H bonds has a strong band at twice the X-H stretch, up to ~7400 cm^-1 for O-H: 4 fs (8340 cm^-1) stays above it, 5 fs (6670 cm^-1) does not for water, and 10 fs aliases ~20 % of the conductivity for an electrolyte (SEAMM job 5368, 2026-10-22).

plot_GK_integral(x, ts, err=None, fit=None, filename='GK_integral.graph')[source]#

Create a plot of the GK integrals and any fit to them.

Parameters:
  • x (numpy.ndarray(6, m)) – The cumulative integrals

  • ts ([float]) – List of times for the points, in ps

  • err (numpy.ndarray(6, m)) – The standard errors of the integrals (optional)

  • fit – The fit parameters for the integrals (optional)

  • filename (str) – The filename to write

plot_JJ_correlation(CCF, ts, err=None, fit=None, filename='JJ.graph')[source]#

Create a plot of the correlation functions and any fit to them.

Parameters:
  • CCF (numpy.ndarray(6, m)) – The cross-correlation functions.

  • ts ([float]) – List of times for the points, in ps

  • err (numpy.ndarray(6, m)) – The standard errors of the CCF (optional)

  • fit – The fit parameters for any fit of the CFF (optional)

  • filename (str) – The filename to write

plot_helfand_moment(M, ts, M_err=None, fit=None, filename='HelfandMoments.graph')[source]#

Create a plot of the Helfand moments and any fit to them.

Parameters:
  • M (numpy.ndarray(6, m)) – The Helfand moments.

  • ts ([float]) – List of times for the points, in ps

process_run(run, data, what='Run')[source]#

Calculate the Helfand moments and correlation functions of one run or block.

Parameters:
  • run (int) – The number of the run or block, for messages.

  • data ((numpy.ndarray, pint.Quantity, float, float, numpy.ndarray)) – The heat flux (3 × n, W/m^2), the sampling interval, the temperature (K), the volume (Å^3), and for a mixture the mass fluxes of all the species but one (k × 3 × n), or None.

  • what (str) – “Run” or “Block”, for messages.

run()[source]#

Run a Thermal Conductivity step.

Returns:

The next node object in the flowchart.

Return type:

seamm.Node

property version#

The semantic version of this module.

thermal_conductivity_step.thermal_conductivity.external_engine(path)[source]#

The fix through which an external engine supplied the forces of the MD in path – e.g. “mdi/qm” for a machine-learned forcefield or QM code over MDI – or None. Such an engine gives LAMMPS no per-atom energies or stresses, so the heat flux has only its kinetic term (2026-10-21: ChemAI job 5357 gave 72 ± 913 W/m/K for a carbonate electrolyte).

thermal_conductivity_step.thermal_conductivity_parameters module#

Control parameters for the Thermal Conductivity step in a SEAMM flowchart

class thermal_conductivity_step.thermal_conductivity_parameters.ThermalConductivityParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for Thermal Conductivity.

The MD to analyze is run earlier in the flowchart – in a Loop for independent runs – or in other jobs (see seamm_md_analysis.step_support.source_parameters). The thermal conductivity is calculated from the heat flux by the Green-Kubo and Helfand methods.

parameters = {'md files': {'applies_when': {'md source': 'files'}, 'default': '', 'default_units': '', 'description': 'H5MD files:', 'enumeration': (), 'format_string': 's', 'help_text': 'The md.h5md files to analyze, separated by spaces or commas. Each is an independent run. A relative path is in this job; job://<n>/<path> is in job n.', 'kind': 'string'}, 'md source': {'default': 'the last MD run of each loop iteration', 'default_units': '', 'description': 'MD to analyze:', 'enumeration': ('the last MD run', 'the last MD run of each loop iteration', 'files'), 'format_string': 's', 'help_text': "Where the MD for the thermal conductivity comes from: the last MD run of each iteration of the loop around the MD, as independent runs (or the one run, without a loop); the last MD run earlier in the flowchart; or the H5MD files (md.h5md) of earlier runs, including other jobs' (job://<n>/<path>).", 'kind': 'enum'}, 'number of blocks': {'default': 5, 'default_units': '', 'description': 'Blocks for errors from one run:', 'enumeration': (), 'format_string': 'd', 'help_text': 'When a single MD run is analyzed, it is divided into this many consecutive blocks, which are analyzed separately to estimate the errors. Each block must be much longer than the correlation time.', 'kind': 'integer'}}#
retired = ('nruns', 'errors', 'approach', 'T', 'ehex', 'nlayers', 'deltaT', 'swap frequency', 'n to swap')#

an older flowchart that stores them can still be read, and they are ignored. Any other unknown parameter is an error. A plug-in’s Parameters class sets this.

Type:

Parameters the step had once and has dropped

thermal_conductivity_step.thermal_conductivity_step module#

class thermal_conductivity_step.thermal_conductivity_step.ThermalConductivityStep(flowchart=None, gui=None)[source]#

Bases: object

Helper class needed for the stevedore integration.

This must provide a description() method that returns a dict containing a description of this node, and create_node() and create_tk_node() methods for creating the graphical and non-graphical nodes.

The dictionary for the description is the class variable just below these comments. The felds are as follows:

my_description{str, str}

A human-readable description of this step. It can be several lines long, and needs to be clear to non-expert users. It contains the following keys: description, group, name.

my_description[“description”]tuple

A description of the Thermal Conductivity step. It must be clear to non-experts.

my_description[“group”]str

Which group in the menus to put this step. If the group does not exist it will be created. Common groups are “Building”, “Control”, “Custom”, “Data”, and “Simulations”.

my_description[“name”]str

The name of this step, to be displayed in the menus.

create_node(flowchart=None, **kwargs)[source]#

Create and return the new node object.

Parameters:
  • flowchart (seamm.Node) – A non-graphical SEAMM node

  • **kwargs (keyword arguments) – Various keyword arguments such as title, namespace or extension representing the title displayed in the flowchart, the namespace for the plugins of a subflowchart and the extension, respectively.

Return type:

ThermalConductivity

create_tk_node(canvas=None, **kwargs)[source]#

Create and return the graphical Tk node object.

Parameters:
  • canvas (tk.Canvas) – The Tk Canvas widget

  • **kwargs (keyword arguments) – Various keyword arguments such as tk_flowchart, node, x, y, w, h representing a graphical flowchart object, a non-graphical node for a step, and dimensions of the graphical node.

Return type:

TkThermalConductivity

description()[source]#

Return a description of what this step does.

Returns:

description

Return type:

dict(str, str)

my_description = {'description': 'An interface for Thermal Conductivity', 'group': 'Properties', 'name': 'Thermal Conductivity'}#

thermal_conductivity_step.tk_thermal_conductivity module#

The graphical part of a Thermal Conductivity step

class thermal_conductivity_step.tk_thermal_conductivity.TkThermalConductivity(tk_flowchart=None, node=None, namespace='org.molssi.seamm.tk', canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNode

The graphical part of a Thermal Conductivity step in a flowchart.

tk_flowchart#

The flowchart that we belong to.

Type:

TkFlowchart = None

node#

The corresponding node of the non-graphical flowchart

Type:

Node = None

canvas#

The Tk Canvas to draw on

Type:

tkCanvas = None

dialog#

The Pmw dialog object

Type:

Dialog

x#

The x-coordinate of the center of the picture of the node

Type:

int = None

y#

The y-coordinate of the center of the picture of the node

Type:

int = None

w#

The width in pixels of the picture of the node

Type:

int = 200

h#

The height in pixels of the picture of the node

Type:

int = 50

self[widget]#

A dictionary of tk widgets built using the information contained in Thermal Conductivity_parameters.py

Type:

dict

See also

ThermalConductivity, TkThermalConductivity, ThermalConductivityParameters

create_dialog()[source]#

Create the dialog, with the widgets for the parameters.

reset_dialog(widget=None)[source]#

Lay out the widgets that apply, given the choices made.

Parameters:

widget (Tk Widget = None)

right_click(event)[source]#

Handles the right click event on the node.

Parameters:

event (Tk Event)

Return type:

None

See also

TkThermalConductivity.edit

Module contents#

thermal_conductivity_step A SEAMM plug-in for Thermal Conductivity