Crates.io | feos-campd |
lib.rs | feos-campd |
version | |
source | src |
created_at | 2022-10-19 18:24:49.175542 |
updated_at | 2025-01-27 09:52:08.251923 |
description | Computer-aided molecular and process design using the FeOs framework. |
homepage | https://github.com/feos-org |
repository | https://github.com/feos-org/feos-campd |
max_upload_size | |
id | 691818 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Computer-aided molecular and process design based on the FeOs
framework.
The package provides infrastructure to perform a computer-aided molecular and process design. It consists of
The underlying NLP subproblems are solved using IPOPT via the ipopt-ad
crate. For the solution of th MILP master problems, the solver is linked to the good_lp
crate that offers a common interface to various open-source MILP solvers.
Just add the dependency to your Cargo.toml
feos-campd = "0.3"
The following sections demonstrates the usage of the framework, for the API details, check out the documentation.
// define the molecular representation using a molecule superstructure
let molecule = SuperMolecule::alkane(min_size, size);
// or a combination of superstructures
let molecule = SuperMolecule::non_associating(min_size, size);
// or use group and structure definitions for CoMT-CAMD
// (currently not further customizable)
let molecule = CoMTCAMD;
// The property model for heterosegmented gc-PC-SAFT is not customizable. It does not include association.
let property_model = GcPcSaftPropertyModel;
// For homosegmented PC-SAFT, the group parameters can be passes as arguments
// and it is available as the full model
let property_model = PcSaftPropertyModel::full("rehner2023_homo.json", Some("rehner2023_homo_binary.json"));
// or non-associating (ignoring all associating groups)
let property_model = PcSaftPropertyModel::non_associating("rehner2023_homo.json", Some("rehner2023_homo_binary.json"));
//To define a process model in Rust, implement the `ProcessModel` trait for your struct.
impl<E: TotalHelmholtzEnergy<N: ...>> ProcessModel<E, N_X: ..., N: ...> for YourModel {
fn variables(&self) -> [ContinuousVariable; N_X] {
[
ContinuousVariable::new(..., ..., ...),
...
]
}
fn constraints(&self) -> Vec<GeneralConstraint> {
vec![
GeneralConstraint::Inequality(..., ...),
GeneralConstraint::Equality(...),
...
]
}
fn evaluate<D: DualNum<f64> + Copy>(
&self,
eos: &HelmholtzEnergyWrapper<E, D, N>,
chemical_records: [&ChemicalRecord<D>; N],
x: [D; 3],
) -> EosResult<(D, Vec<D>)> {
...
}
}
// combine molecular representation, property model, and process model in an optimization problem
let campd = IntegratedDesign::new(molecule, property_model, process);
// and pass it to the outer approximation solver
let solver = OuterApproximation::new(&campd);
// to determine a ranking of the optimal molecules for a pur component
solver.solve_ranking(y0, highs, runs, options);
// where highs can be replaced with any of the other MILP solvers provided by the good_lp crate.
Molecular representations and property models can be combined according to:
PC-SAFT | gc-PC-SAFT | |
---|---|---|
CoMTCAMD |
yes | no |
SuperMolecule |
yes | yes |
If you find FeOs-torch useful for your own research, consider citing our publication from which this library resulted.
@article{rehner2023molecule_superstructures,
author = {Rehner, Philipp and Schilling, Johannes and Bardow, André},
title = {Molecule superstructures for computer-aided molecular and process design}
journal = {Molecular Systems Design & Engineering},
volume = {8},
issue = {4},
number = {12},
pages = {488-499},
year = {2023}
}