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

Handling of physical units #6

Open
doomphoenix-qxz opened this issue Apr 22, 2019 · 2 comments
Open

Handling of physical units #6

doomphoenix-qxz opened this issue Apr 22, 2019 · 2 comments

Comments

@doomphoenix-qxz
Copy link
Contributor

I see in the core code that there's some use of units from Unitful.jl. While I like the idea of integration with Unitful.jl, I think I would prefer it to be a non-default mode. It could be something like this:

pvtxstate(2.0, missing, 500.0, [0.3,0.4,0.3]) #defaults to bar, m^3/mol, K, but could be easily changed by a function like set_base_units("psi", "ft^3/mol", "R")

Or you could use

physical_units() pvtxstate(2.0u"bar", missing, 500.0u"K", [0.3,0.4, 0.3])

Actually, the physical_units function may be unnecessary--you could just dispatch on whether you receive physical quantities or ordinary numbers as input.

@longemen3000
Copy link
Owner

i'm gonna check on that, i'm right now fully invested in the equilibrium algorithm, so after having that working, i'm fixing this

@longemen3000
Copy link
Owner

i implemented a separation in the last commits, the core_(property) just gives the number, where (property) gives the value with units.
i'm thinking to put those functions with units in a separate module, something like this:

SI.pressure(model,v,T,x)

or (the new interfase)

SI.pressure(model,phase)

other options:

  • rename to si_property(properties,preferred units)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants