Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit d984c91

Browse files
authored
Merge pull request #14 from feos-org/model_record
Fix for `model_record` being non-optional
2 parents 7767850 + bd76d31 commit d984c91

1 file changed

Lines changed: 13 additions & 17 deletions

File tree

src/parameters.rs

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -246,23 +246,19 @@ impl Parameter for PcSaftParameters {
246246

247247
for (i, record) in pure_records.iter().enumerate() {
248248
component_index.insert(record.identifier.clone(), i);
249-
match &record.model_record {
250-
Some(r) => {
251-
m[i] = r.m;
252-
sigma[i] = r.sigma;
253-
epsilon_k[i] = r.epsilon_k;
254-
mu[i] = r.mu.unwrap_or(0.0);
255-
q[i] = r.q.unwrap_or(0.0);
256-
na[i] = r.na.unwrap_or(1.0);
257-
nb[i] = r.nb.unwrap_or(1.0);
258-
kappa_ab[i] = r.kappa_ab.unwrap_or(0.0);
259-
epsilon_k_ab[i] = r.epsilon_k_ab.unwrap_or(0.0);
260-
viscosity.push(r.viscosity);
261-
diffusion.push(r.diffusion);
262-
thermal_conductivity.push(r.thermal_conductivity);
263-
}
264-
None => panic!("No PcSaft parameters for {} found.", record.identifier.cas),
265-
};
249+
let r = &record.model_record;
250+
m[i] = r.m;
251+
sigma[i] = r.sigma;
252+
epsilon_k[i] = r.epsilon_k;
253+
mu[i] = r.mu.unwrap_or(0.0);
254+
q[i] = r.q.unwrap_or(0.0);
255+
na[i] = r.na.unwrap_or(1.0);
256+
nb[i] = r.nb.unwrap_or(1.0);
257+
kappa_ab[i] = r.kappa_ab.unwrap_or(0.0);
258+
epsilon_k_ab[i] = r.epsilon_k_ab.unwrap_or(0.0);
259+
viscosity.push(r.viscosity);
260+
diffusion.push(r.diffusion);
261+
thermal_conductivity.push(r.thermal_conductivity);
266262
molarweight[i] = record.molarweight;
267263
}
268264

0 commit comments

Comments
 (0)