Skip to content

Commit

Permalink
Add specific heat capacities to Python interface (#223)
Browse files Browse the repository at this point in the history
* Added python methods for specific heat capacities

* Added changelog entry
  • Loading branch information
g-bauer authored Feb 8, 2024
1 parent 7335de9 commit 13b0314
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions feos-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Added
- Added specific isochoric and isobaric heat capacities to the Python interface. [#223](https://github.com/feos-org/feos/pull/223))

## [0.6.1] 2024-01-11
### Fixed
Expand Down
32 changes: 32 additions & 0 deletions feos-core/src/python/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,38 @@ macro_rules! impl_state {
PySINumber::from(self.0.specific_enthalpy(contributions))
}

/// Return mass specific isochoric heat capacity.
///
/// Parameters
/// ----------
/// contributions: Contributions, optional
/// the contributions of the Helmholtz energy.
/// Defaults to Contributions.Total.
///
/// Returns
/// -------
/// SINumber
#[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions)")]
fn specific_isochoric_heat_capacity(&self, contributions: Contributions) -> PySINumber {
PySINumber::from(self.0.specific_isochoric_heat_capacity(contributions))
}

/// Return mass specific isobaric heat capacity.
///
/// Parameters
/// ----------
/// contributions: Contributions, optional
/// the contributions of the Helmholtz energy.
/// Defaults to Contributions.Total.
///
/// Returns
/// -------
/// SINumber
#[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions)")]
fn specific_isobaric_heat_capacity(&self, contributions: Contributions) -> PySINumber {
PySINumber::from(self.0.specific_isobaric_heat_capacity(contributions))
}

#[getter]
fn get_total_moles(&self) -> PySINumber {
PySINumber::from(self.0.total_moles)
Expand Down

0 comments on commit 13b0314

Please sign in to comment.