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

Add dependencies to project #9

Open
caseykneale opened this issue Nov 2, 2019 · 10 comments
Open

Add dependencies to project #9

caseykneale opened this issue Nov 2, 2019 · 10 comments

Comments

@caseykneale
Copy link

Gotta add Sobol, Mapped Arrays, NLopt, Optim, BenchmarkTools to the project otherwise it won't build.

If you set up CI/CD it will help with these kinds of 'bugs'.

@longemen3000
Copy link
Owner

yeah, in a way, you are the first one really using the functions, so its time to do that

@longemen3000
Copy link
Owner

i added travis to the repository, but i need to run tests. i also updated project.toml and manifest.toml (i wasn't working on the pkg enviroment, my bad). so the package should run fine. in the master, is necessary julia 1.3, as i use Threads.@Spawn in the function pt_flash (when searching volumes in two phases)

@caseykneale
Copy link
Author

I will try this tomorrow. I don't have Julia 1.3 on my computer yet. Any chance we could get mass or molar densities :D? How hard would that be?

@longemen3000
Copy link
Owner

longemen3000 commented Nov 10, 2019

i have a function in solver_core.jl called volume_solver(model,P0,T0,x0,v0=nothing) that finds the the volume root that satisfies P(T0,v) = P0, via Roots.jl find_zeros. it works without problem but is heavy on the calculation if you don't provide an initial root (it uses newton when a volume root is provided, and bracketing when there are no roots provided). i'm thinking on these interfaces to that function:

core_mass_density(model,P0,T0,x0) #calculates v without a volume root
core_mass_density(model,P0,v0,T0,x0) #calculates v with the initial root v0
mass_density(model,P0,T0,x0) #calculates v and adds the corresponding unit
#this is the same for: mol_density, mol_volume and mass_volume

this is the same interface as core_gibbs(model,P0,T0,x0), and core_gibbs(model,P0,v0,T0,x0) where, if you provide the pressure, the calculation of the pressure as P(v,T) is skipped. what do you think?

@longemen3000
Copy link
Owner

Also, when a cubic model is developed, one can simply dispatch volume solver to just calculate the roots via polynomial solving, and skipping the initial volume if provided

@longemen3000
Copy link
Owner

added to latest commit:

water= IAPWS95()
julia> mass_density(water,1.0u"atm",100u"°C",[1.0])
958.3490079146466 kg m^-3

@caseykneale
Copy link
Author

Awesome!!! I'll test your multithread code on my machine tonight and let you know how it goes.

@caseykneale
Copy link
Author

Also need to add DiffRules, NLopt, Optim, BenchmarkTools, Sobol!
To do this go into the julia terminal at LavoisierCore's root directory

  1. press ] to enter the package manager mode.
  2. type Activate . to activate your package
  3. add the packages to the package environment eg: add Sobol add NLopt etc.

@caseykneale
Copy link
Author

Says mass_density not defined. Am I using an old version by accident?

@longemen3000
Copy link
Owner

not, my bad (again) forgot to add new file in module declaration

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