[gmx-developers] Thermostatting in selected directions

Berk Hess hess at kth.se
Thu Feb 2 15:01:49 CET 2017


Hi,

You modify the code yourself easily.
In src/gromacs/mdlib/coupling.cpp in vrescale_tcoupl() replace 
trace(..ekin..) by (..ekin..[XX][XX] + ..ekin..[YY][YY]) and multiply 
nrdf by 2/3 (for the V-rescale thermostat, which I would suggest to use).
Then in src/gromacs/mdlib/update.cpp you need to replace lg* by (d==ZZ ? 
1 : lg)*

Cheers,

Berk

On 2017-02-02 14:39, Milan Predota wrote:
>
> Berk,
>
> thanks for a quick answer, but unfortunately the subtraction of  
> streaming velocity is not applicable in my case.
>
> I'm working on planar solid-liquid interfaces where the liquid flows 
> along the surface under external electric field along the surface.
>
> The streaming velocity profile is a complex function (from zero 
> velocity at sticking surface to homogeneous in the bulk), unknown in 
> advance and very dependent on the simulation conditions (surface 
> charge, composition and type of ions, applied field).
>
> I'm sure more people working on similar NEMD simulations, e.g. 
> applying Poiseuille flow on liquid in a planar or cylindrical slab, 
> must face this limitation.
>
> I understand to tweak thermostats is not easy since they enter the 
> integrator, but It is (at least in special cases) doable.
>
> Simply I measure the kinetic energy only in selected directions, 
> correct the number of degrees of freedom and scale/modify only 
> selected directions, with the effect of thermostat on the others set 
> to zero.
>
> In my own Fortran MD code and the simulations I mention, I have 
> checked that kinetic energy in the non-thermostated direction (as well 
> as rotational energy - I was working with rigid SPC/E water) is very 
> close to the ref_t.
>
> It is a pity - otherwise Gromacs offers great support for the 
> simulations I'm doing (e.g. semi-isotropic pressure coupling, external 
> field/forces acting on selected groups, etc.).
>
> I'd be happy to provide the physics if someone is able to modify the 
> codes.
>
> Thanks,
>
> Milan
>
>
>
> On 2/2/2017 2:20 PM, Berk Hess wrote:
>> Hi,
>>
>> It is impossible to do this correct for the general case. If there 
>> are constraints present you can not assume the degrees of freedom 
>> (removed) are distributed equally over the dimensions. I have not 
>> though deeply about other issues, but I could image there are more.
>> It is much better to only subtract the single flow degree of freedom, 
>> as is done for e.g. the cosine acceleration profile that can be 
>> applied in Gromacs.
>>
>> Cheers,
>>
>> Berk
>>
>> On 2017-02-02 13:45, Milan Predota wrote:
>>>
>>> Hi,
>>>
>>> I need to do NEMD simulations of flows and for correct 
>>> thermostatting I'd need to select only 1 or 2 velocity directions 
>>> used for setting the temperature.
>>>
>>> I need  e.g. to calculate  kinetic energy only from v_x and v_y and 
>>> avoid v_z where there is a nonzero and a priory unknown streaming 
>>> velocity.
>>>
>>> The temperature coupling would act of course only on the v_x and v_y 
>>> components, leaving the v_z to equilibrate due to intermolecular 
>>> interactions.
>>>
>>> I have done this in my own MD code (only water + ions) with success, 
>>> http://dx.doi.org/10.1021/acs.langmuir.6b02493
>>>
>>> but I'm now using Gromacs for more complex molecules.
>>>
>>> I don't find this feature even in Gromacs 2016. *Is there a plan to 
>>> incorporate this feature in Gromacs?*
>>>
>>> I guess to modify the source code by myself would be a tedious and 
>>> dangerous task.
>>>
>>> I have found out that LAMMPS probably has this feature
>>> http://lammps.sandia.gov/doc/compute_modify.html
>>> http://lammps.sandia.gov/doc/fix_temp_berendsen.html 
>>> <http://lammps.sandia.gov/doc/fix_temp_csvr.html>
>>> http://lammps.sandia.gov/doc/fix_temp_csvr.html
>>> http://lammps.sandia.gov/doc/fix_nh.html
>>>
>>> but I'd prefer to continue using Gromacs.
>>> Many thanks,
>>> Milan
>>>
>>> Institute of Physics and Biophysics
>>> Faculty of Science, University of South Bohemia
>>> Branisovska 1760, 370 05 Ceske Budejovice
>>> Czech Republic
>>>
>>>
>>
>>
>>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20170202/da6f8a67/attachment-0001.html>


More information about the gromacs.org_gmx-developers mailing list