cmelab / planckton

Reproducible exploration of organic photovoltaic morphology self-assembly using molecular dynamics.
GNU General Public License v3.0
5 stars 6 forks source link

Allow for more ways to specify density #22

Open jennyfothergill opened 3 years ago

jennyfothergill commented 3 years ago

Being able to specify density in terms of volume fractions or number density are also important considerations if someone is using a coarse or toy model that doesn't have physical unit connections (yet).

mikemhenry commented 3 years ago

To support this will will have to see if unyt either has a dimensionless unit or if we will just have to make a custom unit to handle something like volume fraction or number density.

jennyfothergill commented 3 years ago

note for later: unyt does have a dimensionless quantity

import unyt as u

mass = 1 * u.kg
volume = 10 * u.m **3
density = mass/volume

number = 2 * u.dimensionless
number_density = number / volume

results in 0.1 kg/m**3 0.2 dimensionless/m**3

I think we can add some logic to detect different density inputs, (number density, density, maybe even occupied volume?)