Skip to content

Commit

Permalink
made PMV density private
Browse files Browse the repository at this point in the history
Gearing up for release, made the PMV density method private until confirmed working
  • Loading branch information
2AUK committed Nov 7, 2023
1 parent 21d1c29 commit 8cdee94
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 22 deletions.
15 changes: 15 additions & 0 deletions cSPCE_XRISM_methane.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Thermodynamics:
Temperature: 298 K
Total Density: 0.03334 (1/A^3)
Isothermal Compressibility: 2.8463004387886266
Pressure: 0.11471833387699402
Molecular KB PMV: 46.165832464842346 A^3
27.801064310328062 cm^3/mol
RISM KB PMV: 24.537378650848414 A^3
14.776409423540915 cm^3/mol
Solvation Free Energies (kcal/mol):
HNC: 4.5412608811536845
KH: 3.95018245073662
GF: 0.9976563903001927
PW: 1.049303521801797
PC+: 2.8148871965342535
21 changes: 11 additions & 10 deletions cSPCE_XRISM_methane_bin.td
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ Thermodynamics:
Temperature: 298 K
Total Density: 0.03334 (1/A^3)
Isothermal Compressibility: 2.0551008211240576
Pressure: 0.1301482933204075
Molecular KB PMV: 36.26842490181737 A^3
21.84084547587442 cm^3/mol
RISM KB PMV: 20.928795633108077 A^3
12.603320730257684 cm^3/mol
Pressure: 0.13014829345466444
Molecular KB PMV: 36.26842491276564 A^3
21.84084548246747 cm^3/mol
RISM KB PMV: 20.92879566105751 A^3
12.603320747088834 cm^3/mol
Solvation Free Energies (kcal/mol):
HNC: 5.305707342467774
KH: 4.735545964473704
GF: 1.8391241355373364
PW: 1.899593828698622
PC+: 2.723847032900614
HNC: 5.305709067465914
KH: 4.735547689322212
GF: 1.8391258550414786
PW: 1.8983067960707345
PC+: 2.7238470393480205
PW - PC+ -0.825540243277286
4 changes: 2 additions & 2 deletions src/io/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl<'a> RISMWriter<'a> {
"KH".to_string(),
"GF".to_string(),
"PW".to_string(),
"PMV".to_string(),
//"PMV".to_string(),
];
wtr.write_record(header.as_slice())?;
let densities = self.thermo.sfed.as_ref().unwrap();
Expand All @@ -139,7 +139,7 @@ impl<'a> RISMWriter<'a> {
densities.kovalenko_hirata[[i]].to_string(),
densities.gaussian_fluctuations[[i]].to_string(),
densities.partial_wave[[i]].to_string(),
densities.partial_molar_volume[[i]].to_string(),
//densities.partial_molar_volume[[i]].to_string(),
];
wtr.write_record(data.as_slice())?;
}
Expand Down
35 changes: 25 additions & 10 deletions src/thermodynamics/thermo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ impl std::fmt::Display for SFEs {
\tKH: {}
\tGF: {}
\tPW: {}
\tPC+: {}",
\tPC+: {}
\tPW - PC+ {}",
self.hypernettedchain,
self.kovalenko_hirata,
self.gaussian_fluctuations,
self.partial_wave,
self.pc_plus
self.pc_plus,
self.partial_wave - self.pc_plus,
)
}
}
Expand All @@ -54,7 +56,7 @@ pub struct Densities {
pub kovalenko_hirata: Array1<f64>,
pub gaussian_fluctuations: Array1<f64>,
pub partial_wave: Array1<f64>,
pub partial_molar_volume: Array1<f64>,
partial_molar_volume: Array1<f64>,

Check warning on line 59 in src/thermodynamics/thermo.rs

View workflow job for this annotation

GitHub Actions / Test Suite

field `partial_molar_volume` is never read
}

impl Densities {
Expand Down Expand Up @@ -192,12 +194,26 @@ impl<'a> TDDriver<'a> {
let pressure = self.pressure();
let sfe = SFEs::new(&sfed, pressure, rism_kb_pmv, grid.dr);
let temperature = self.solutions.config.data_config.temp;

println!(
"1: {}\n2: {}",
SFEs::integrate(&self.rism_kb_partial_molar_volume_density(), grid.dr),
SFEs::integrate(&self.rism_kb_partial_molar_volume_density_2(), grid.dr)
);
//
// println!(
// "1: {}\n2: {}\n3: {}\n4: {}",
// SFEs::integrate(&self.rism_kb_partial_molar_volume_density(), grid.dr),
// SFEs::integrate(&self.rism_kb_partial_molar_volume_density_2(), grid.dr),
// SFEs::integrate(
// &(&self.rism_kb_partial_molar_volume_density()
// - self.isothermal_compressibility()),
// grid.dr
// ) + self.isothermal_compressibility(),
// SFEs::integrate(
// &(&self.rism_kb_partial_molar_volume_density_2()
// - self.isothermal_compressibility_density()),
// grid.dr
// ) + SFEs::integrate(
// &(&self.isothermal_compressibility_density()
// - (1.0 / self.total_density())),
// grid.dr
// ) + (1.0 / self.total_density()),
// );

Thermodynamics {
temperature,
Expand Down Expand Up @@ -396,7 +412,6 @@ fn hnc_functional_impl(
//let r = r.slice(s![.., NewAxis, NewAxis]).to_owned();
let mut r = r.broadcast((1, 1, r.len())).unwrap();
r.swap_axes(0, 2);
println!("density: {:?}", density);
Zip::from(_out.outer_iter_mut())
.and(tr.outer_iter())
.and(cr.outer_iter())
Expand Down

0 comments on commit 8cdee94

Please sign in to comment.