Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add docstrings and readme for parameters
  • Loading branch information
prehner committed Oct 16, 2025
commit c26532ebca085660ffab3d35b3ae0cdf70432ba7
20 changes: 13 additions & 7 deletions crates/feos/src/multiparameter/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
use std::f64::consts::E;
//! High-precision multiparameter equations of state for common pure fluids.
//!
//! The residual and ideal gas contributions are always parametrized jointly for
//! multiparameter equations of state. Construct the equation of state by reading
//! parameters, e.g., [MultiParameterParameters::from_json], and passing them to
//! the equation of state with [MultiParameter::new].

use feos_core::parameter::Parameters;
use feos_core::{EquationOfState, IdealGas, Molarweight, ResidualDyn, StateHD, Subset};
use nalgebra::DVector;
use num_dual::DualNum;
use quantity::MolarWeight;
use serde::Deserialize;
use std::f64::consts::E;

mod ideal_gas_function;
mod residual_function;
use ideal_gas_function::{IdealGasFunction, IdealGasFunctionJson};
use residual_function::{ResidualFunction, ResidualFunctionJson};

// record

/// Pure-component parameters for a multiparameter equation of state
/// (residual and ideal gas contributions).
#[derive(Clone, Deserialize)]
pub struct MultiParameterRecord {
tc: f64,
Expand All @@ -22,10 +28,10 @@ pub struct MultiParameterRecord {
ideal_gas: Vec<IdealGasFunctionJson>,
}

/// Parameter set required for the multiparameter equation of state.
pub type MultiParameterParameters = Parameters<MultiParameterRecord, (), ()>;

// structs

/// Residual contribution of the multiparameter equation of state.
#[derive(Clone)]
pub struct MultiParameter {
tc: f64,
Expand All @@ -34,13 +40,15 @@ pub struct MultiParameter {
molar_weight: MolarWeight<DVector<f64>>,
}

/// Ideal gas contribution of the multiparameter equation of state.
#[derive(Clone)]
pub struct MultiParameterIdealGas {
tc: f64,
rhoc: f64,
terms: Vec<IdealGasFunction>,
}

/// Multiparameter equation of state consisting of a residual and a corresponding ideal gas contribution.
pub type MultiParameterEquationOfState =
EquationOfState<Vec<MultiParameterIdealGas>, MultiParameter>;

Expand Down Expand Up @@ -70,8 +78,6 @@ impl MultiParameter {
}
}

// eos trait implementations

impl ResidualDyn for MultiParameter {
fn components(&self) -> usize {
1
Expand Down
1 change: 1 addition & 0 deletions crates/feos/src/pcsaft/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ impl PcSaftRecord {
}
}

/// Association parameters for the PC-SAFT equation of state.
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
pub struct PcSaftAssociationRecord {
/// Association volume parameter
Expand Down
19 changes: 4 additions & 15 deletions parameters/multiparameter/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
# Parameters for pure-component Helmholtz energy models TODO
# Parameters for pure-component Helmholtz energy models

This directory contains files with parameters for different models for ideal gas heat capacities.
The files named according to the pattern `NameYear.json` correspond to published parameters. The corresponding publication is provided in the [`literature.bib`](literature.bib) file.
This directory contains files with parameters for multiparameter equations of state.

## DIPPR correlations

The parameters published in the DIPPR database itself are not publicly available. If you have a valid license, contact us to obtain a compatible input file.

|file|description|publication(s)|
|-|-|:-:|
[`poling2000.json`](poling2000.json) | correlation parameters published in "The Properties of Gases and Liquids, 5th edition" | |

## Joback group-contribution model

|file|description|publication(s)|
|file|description|Link|
|-|-|:-:|
[`joback1987.json`](joback1987.json) | group parameters by Joback and Reid; adjusted to the groups of [Sauer et al.](../pcsaft/README.md) | [&#128279;](https://doi.org/10.1080/00986448708960487)|
[`coolprop.json`](coolprop.json) | the list of pure fluids contained in the open-source software CoolProp | [&#128279;](https://coolprop.org/fluid_properties/PurePseudoPure.html) |