Skip to content

evnekdev/chemapp_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

chemapp-rs

A Rust interface for chemical thermodynamics calculations using ChemApp, providing safe and ergonomic access to native thermochemical equilibrium routines.

Rust Status


๐Ÿ“Œ Overview

chemapp-rs is a Rust library that wraps and interfaces with ChemApp, a widely used thermochemical calculation engine (provided by GTT Technologies).

This crate provides:

  • Safe Rust abstractions over native ChemApp bindings
  • Structured error handling
  • High-level calculation utilities
  • Modular design for extensibility

It is designed for:

  • Thermodynamic equilibrium calculations
  • Chemical process simulations
  • Scientific computing workflows

โœจ Features

  • ๐Ÿ”ฌ Interface to ChemApp native library
  • ๐Ÿงฎ Thermodynamic calculation utilities
  • โš™๏ธ Safe wrapper around unsafe FFI calls
  • ๐Ÿงฑ Modular architecture
  • โ— Robust error handling
  • ๐Ÿ”— Interaction modeling support

๐Ÿ› ๏ธ Tech Stack

  • Language: Rust
  • FFI: Native bindings (ChemApp)
  • Architecture: Modular Rust crate

๐Ÿ“‚ Project Structure

src/
โ”œโ”€โ”€ lib.rs           # Library entry point
โ”œโ”€โ”€ main.rs          # Example / CLI entry
โ”œโ”€โ”€ calculator.rs    # Core calculation logic
โ”œโ”€โ”€ interactions.rs  # Interaction modeling
โ”œโ”€โ”€ native.rs        # FFI bindings to ChemApp
โ”œโ”€โ”€ defs.rs          # Constants and definitions
โ”œโ”€โ”€ error.rs         # Error handling

๐Ÿš€ Getting Started

1. Clone the repository

git clone https://github.com/evnekdev/chemapp-rs.git
cd chemapp-rs

2. Build

cargo build

3. Run example

cargo run

โš ๏ธ Requirements

This crate depends on ChemApp, which is:

  • Proprietary software
  • Must be installed separately
  • Requires proper licensing

Ensure:

  • ChemApp libraries are installed
  • Environment variables / linker paths are configured correctly

๐Ÿ“Š Usage

Example (conceptual):

use chemapp_rs::calculator::Calculator;

fn main() {
    let mut calculator = Calculator::from_library(r"ca_vc_e_local.dll", r"c:\_WORK\Continuous\diagrams\007_Al2O3-SiO2\BETA_Al-Si-O.dat").unwrap();
	calculator.set_transform(&["SiO2","Al2O3"]);
	calculator.calculate_isothermal_d(&dvector![0.1, 0.9], 2200.0);
	for idx in (0..100).components_valid(&calculator).components_names(&calculator) {
		println!("idx = {:?}", &idx);
	}
	for idx in (0..100).phases_valid(&calculator).phases_status_eliminated(&calculator).phases_names(&calculator) {
		println!("idx = {:?}", &idx);
	}
	
	for idx in (0..100).phases_valid(&calculator).phases_constituents(&calculator).constituents_hm(&calculator){
		println!("idx = {:?}", &idx);
	}
}

๐Ÿงฉ Core Modules

native.rs

  • Low-level FFI bindings
  • Unsafe interface to ChemApp

calculator.rs

  • High-level API
  • Encapsulates computation workflows

interactions.rs

  • Models interactions between components

error.rs

  • Custom error types
  • Safe error propagation

defs.rs

  • Constants and shared definitions

๐Ÿงช Testing

cargo test

โš ๏ธ Limitations

  • Requires external ChemApp installation
  • Limited by ChemApp API capabilities
  • Platform-specific linking considerations

๐Ÿ“ˆ Roadmap

  • Improve documentation
  • Add more high-level APIs
  • Expand examples
  • Improve error reporting
  • Cross-platform support enhancements

๐Ÿค Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a branch
  3. Commit changes
  4. Open a Pull Request

๐Ÿ› Issues

Report bugs or request features:

https://github.com/evnekdev/chemapp-rs/issues


๐Ÿ“„ License

MIT


๐Ÿ“ฌ Contact

Evgenii Nekhoroshev
https://github.com/evnekdev

About

Port of ChemApp library (GTT-technologies) for thermodynamic calculations to Rust environment; includes native ChemApp functions starting with 'tq' and a higher-level interface for easier access to calculations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages