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

Update README for PC-SAFT parameters and add new binary record files #200

Merged
merged 8 commits into from
Nov 23, 2023
Merged
16 changes: 10 additions & 6 deletions benches/dft_pore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn fmt(c: &mut Criterion) {
);
let bulk = State::new_pure(&func, KELVIN, 0.75 / NAV / ANGSTROM.powi::<P3>()).unwrap();
group.bench_function("liquid", |b| {
b.iter(|| pore.initialize(&bulk, None, None).solve(None))
b.iter(|| pore.initialize(&bulk, None, None).unwrap().solve(None))
});
}

Expand Down Expand Up @@ -54,11 +54,11 @@ fn pcsaft(c: &mut Criterion) {
let vle = PhaseEquilibrium::pure(&func, 300.0 * KELVIN, None, Default::default()).unwrap();
let bulk = vle.liquid();
group.bench_function("butane_liquid", |b| {
b.iter(|| pore.initialize(bulk, None, None).solve(None))
b.iter(|| pore.initialize(bulk, None, None).unwrap().solve(None))
});
let bulk = State::new_pure(&func, 300.0 * KELVIN, vle.vapor().density * 0.2).unwrap();
group.bench_function("butane_vapor", |b| {
b.iter(|| pore.initialize(&bulk, None, None).solve(None))
b.iter(|| pore.initialize(&bulk, None, None).unwrap().solve(None))
});

let parameters = PcSaftParameters::from_json(
Expand All @@ -80,15 +80,15 @@ fn pcsaft(c: &mut Criterion) {
.unwrap();
let bulk = vle.liquid();
group.bench_function("butane_pentane_liquid", |b| {
b.iter(|| pore.initialize(bulk, None, None).solve(None))
b.iter(|| pore.initialize(bulk, None, None).unwrap().solve(None))
});
let bulk = StateBuilder::new(&func)
.temperature(300.0 * KELVIN)
.partial_density(&(&vle.vapor().partial_density * 0.2))
.build()
.unwrap();
group.bench_function("butane_pentane_vapor", |b| {
b.iter(|| pore.initialize(&bulk, None, None).solve(None))
b.iter(|| pore.initialize(&bulk, None, None).unwrap().solve(None))
});
}

Expand Down Expand Up @@ -122,7 +122,11 @@ fn gc_pcsaft(c: &mut Criterion) {
.picard_iteration(None, None, Some(1e-5), None)
.anderson_mixing(None, None, None, None, None);
group.bench_function("butane_liquid", |b| {
b.iter(|| pore.initialize(bulk, None, None).solve(Some(&solver)))
b.iter(|| {
pore.initialize(bulk, None, None)
.unwrap()
.solve(Some(&solver))
})
});
}

Expand Down
Loading
Loading