Skip to content

Commit

Permalink
printing PMVs
Browse files Browse the repository at this point in the history
  • Loading branch information
2AUK committed Oct 30, 2023
1 parent b2616a9 commit 22da0e4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
28 changes: 3 additions & 25 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,30 +88,8 @@ fn main() -> Result<(), lexopt::Error> {
&density,
&grid.rgrid,
);
// let td = TDDriver::new(solutions);
// println!(
// "Isothermal Compressibility: {}",
// td.isothermal_compressibility()
// );
// println!(
// "Molecular KB theory PMV: {} (A^3)",
// td.kb_partial_molar_volume()
// );
// println!(
// "Molecular KB theory PMV: {} (cm^3 / mol)",
// td.kb_partial_molar_volume() / 1e24 * 6.022e23
// );
// println!(
// "RISM KB theory PMV: {} (A^3)",
// td.rism_kb_partial_molar_volume()
// );
// println!(
// "RISM KB theory PMV: {} (cm^3 / mol)",
// td.rism_kb_partial_molar_volume() / 1e24 * 6.022e23
// );
// println!(
// "Dimensionless Molecular KB theory PMV: {} (A^3)",
// td.dimensionless_partial_molar_volume()
// );
let td = TDDriver::new(solutions);
td.print_thermo();

Ok(())
}
24 changes: 24 additions & 0 deletions src/thermo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ impl SFEs {
println!("HNC: {}", Self::integrate(hnc_sfed, dr));
println!("KH: {}", Self::integrate(kh_sfed, dr));
println!("GF: {}", Self::integrate(gf_sfed, dr));

SFEs {
hypernettedchain: 0.0,
kovalenko_hirata: 0.0,
Expand Down Expand Up @@ -74,6 +75,29 @@ impl TDDriver {
TDDriver { solutions }
}

pub fn print_thermo(&self) {
println!(
"Isothermal Compressibility: {}",
self.isothermal_compressibility()
);
println!(
"Molecular KB theory PMV: {} (A^3)",
self.kb_partial_molar_volume()
);
println!(
"Molecular KB theory PMV: {} (cm^3 / mol)",
self.kb_partial_molar_volume() / 1e24 * 6.022e23
);
println!(
"RISM KB theory PMV: {} (A^3)",
self.rism_kb_partial_molar_volume()
);
println!(
"RISM KB theory PMV: {} (cm^3 / mol)",
self.rism_kb_partial_molar_volume() / 1e24 * 6.022e23
);
}

fn isothermal_compressibility(&self) -> f64 {
let vv = &self.solutions.vv;
let grid = Grid::new(vv.data_config.npts, vv.data_config.radius);
Expand Down

0 comments on commit 22da0e4

Please sign in to comment.