Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viscosity examples #62

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

cesaremalosso
Copy link

Added examples for the computation of viscosity

Cesare Malosso (cmalosso) and others added 4 commits July 6, 2022 15:39
@lorisercole lorisercole changed the base branch from master to develop July 7, 2022 09:58
@lorisercole lorisercole self-requested a review July 7, 2022 10:08
@lorisercole lorisercole self-assigned this Jul 7, 2022
@lorisercole lorisercole added the examples Example data and documentation label Jul 7, 2022
Copy link
Member

@lorisercole lorisercole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @cesaremalosso! Very neat. 👍
Here a couple of requests to finalize it.

  • examples/06_example_cepstrum_viscosity_h2o.ipynb
    • To be consistent with the other examples, could you please use the i_o module to load the data file? Like this:
jfile = st.i_o.TableFile('./data/h2o/h2o.dat')
jfile.read_datalines()

DT_FS = 1                                  # time step [fs]
TEMPERATURE = np.mean(jfile.data['Temp'])  # temperature [K] (983.173 K)
VOLUME = 1918.4149658                      # volume [A^3]
print(DT_FS, TEMPERATURE, VOLUME)

j = st.StressCurrent(np.column_stack([jfile.data['s_xy'], jfile.data['s_xz'], jfile.data['s_yz']]),
                     UNITS='real', DT_FS=DT_FS, TEMPERATURE=TEMPERATURE, VOLUME=VOLUME)
  • There is a typo in the first line of examples/data/h2o/lammps/h2o.in. It should be:
Temp    s_xy    s_xz    s_yz
  • Could you also try to setup a test? For reference, to see how it works, you can check the silica case in test_notebooks.py (you will need to add a function in that file, and the results of cepstral analysis in the tests/test_notebook folder.
  • If you feel brave, you could even setup another test alongside those in test_as_example.py. But I can help you out on this!

@@ -10,7 +10,8 @@ The `data` folder contains the trajectories, obtained from classical NVE molecul
These examples show how to use the `sportran` package in a Python script, step by step, to analyse a time series and perform cepstral analysis. Some of the tools and plot functions of the code are presented.

* [01 - Silica (single component)](01_example_cepstrum_singlecomp_silica.ipynb): analysis of solid amorphous silica, a one-component system.
* [02 - Liquid NaCl (multi-component)](02_example_cepstrum_doublecomp_NaCl.ipynb): analysis of molten NaCl, a two-component system.
* [02 - Liquid NaCl (multi-)](02_example_cepstrum_doublecomp_NaCl.ipynb): analysis of molten NaCl, a two-component system.
* [06 - Liquid h2o (viscosity)](06_example_cesptrum_viscosity_h2o.ipynb) : computation of the shear viscosity of liquid water.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [06 - Liquid h2o (viscosity)](06_example_cesptrum_viscosity_h2o.ipynb) : computation of the shear viscosity of liquid water.
* [06 - Liquid H2O (viscosity)](06_example_cesptrum_viscosity_h2o.ipynb) : computation of the shear viscosity of liquid water.

@@ -10,7 +10,8 @@ The `data` folder contains the trajectories, obtained from classical NVE molecul
These examples show how to use the `sportran` package in a Python script, step by step, to analyse a time series and perform cepstral analysis. Some of the tools and plot functions of the code are presented.

* [01 - Silica (single component)](01_example_cepstrum_singlecomp_silica.ipynb): analysis of solid amorphous silica, a one-component system.
* [02 - Liquid NaCl (multi-component)](02_example_cepstrum_doublecomp_NaCl.ipynb): analysis of molten NaCl, a two-component system.
* [02 - Liquid NaCl (multi-)](02_example_cepstrum_doublecomp_NaCl.ipynb): analysis of molten NaCl, a two-component system.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [02 - Liquid NaCl (multi-)](02_example_cepstrum_doublecomp_NaCl.ipynb): analysis of molten NaCl, a two-component system.
* [02 - Liquid NaCl (multi-component)](02_example_cepstrum_doublecomp_NaCl.ipynb): analysis of molten NaCl, a two-component system.


#######################################
### Read Structure
#######################################
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the lines

#######################################
### Read Structure
#######################################

or move read_data "h2o_64.init" under it, if it works for LAMMPS.

#########################################################################

thermo ${thermo_print_interval}
thermo_style custom temp c_thermo_press[4] c_thermo_press[5] c_thermo_press[6]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see where you defined a compute thermo_press. Maybe that line got lost?

@lorisercole lorisercole mentioned this pull request Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Example data and documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants