QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: hydro on February 17, 2016, 06:03

Title: about temperatureProfile in NonEquilibriumMomentumExchange Methods
Post by: hydro on February 17, 2016, 06:03
Hi,I found "NonEquilibriumMomentumExchange Methods"
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.nonequilibriummomentumexchange.html
one of methods is "temperatureProfile()" .
so, how can i to use it? Is there a example?
Title: Re: about temperatureProfile in NonEquilibriumMomentumExchange Methods
Post by: Julian Schneider on February 17, 2016, 10:43
This method essentially does the same as the "Temperature Profile" analysis in the MDAnalyzer tool.
So if you set up your momentum-exchange-hook as

Code
momentum_exchange_hook = NonEquilibriumMomentumExchange(
    configuration=bulk_configuration,
    exchange_interval=100,
    heat_source='right',
    heat_sink='left',
    update_profile_interval=20,
    profile_resolution=2.0*Ang
)

To activate the calculation of the temperature profile make sure that the update_profile_interval is larger than zero, as this value determines how often the temperature profile is sampled.
Via the parameter profile_resolution the bin width of the temperature profile can be set.

Then, after the simulation has finished, you can query the temperature profile via

Code
(z_values, t_profile) = momentum_exchange_hook.temperatureProfile()

It will give you two PhysicalQuantity arrays z_values and t_profile, which you for example can plot it using pylab

Code
import pylab

pylab.plot(z_values.inUnitsOf(Ang), t_profile.inUnitsOf(Kelvin))
pylab.show()

or process the data in any other way you want.

However, I would recommend to use the corresponding feature in the MDAnalyzer, as this allows you to specify a start time which makes it easier to check for convergence of the profile.
Title: Re: about temperatureProfile in NonEquilibriumMomentumExchange Methods
Post by: Anders Blom on February 17, 2016, 10:54
See http://quantumwise.com/publications/tutorials/item/834-calculating-interfacial-thermal-conductance-using-molecular-dynamics for a lot of nice details
Title: Re: about temperatureProfile in NonEquilibriumMomentumExchange Methods
Post by: hydro on February 18, 2016, 16:52
This method essentially does the same as the "Temperature Profile" analysis in the MDAnalyzer tool.
So if you set up your momentum-exchange-hook as

Code
momentum_exchange_hook = NonEquilibriumMomentumExchange(
    configuration=bulk_configuration,
    exchange_interval=100,
    heat_source='right',
    heat_sink='left',
    update_profile_interval=20,
    profile_resolution=2.0*Ang
)

To activate the calculation of the temperature profile make sure that the update_profile_interval is larger than zero, as this value determines how often the temperature profile is sampled.
Via the parameter profile_resolution the bin width of the temperature profile can be set.

Then, after the simulation has finished, you can query the temperature profile via

Code
(z_values, t_profile) = momentum_exchange_hook.temperatureProfile()

It will give you two PhysicalQuantity arrays z_values and t_profile, which you for example can plot it using pylab

Code
import pylab

pylab.plot(z_values.inUnitsOf(Ang), t_profile.inUnitsOf(Kelvin))
pylab.show()

or process the data in any other way you want.

However, I would recommend to use the corresponding feature in the MDAnalyzer, as this allows you to specify a start time which makes it easier to check for convergence of the profile.

I will try it, thanks a lot :)
Title: Re: about temperatureProfile in NonEquilibriumMomentumExchange Methods
Post by: hydro on February 18, 2016, 16:52
See http://quantumwise.com/publications/tutorials/item/834-calculating-interfacial-thermal-conductance-using-molecular-dynamics for a lot of nice details

Thank you!  :)