-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzfactor.go
More file actions
32 lines (26 loc) · 1.12 KB
/
zfactor.go
File metadata and controls
32 lines (26 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2025 Ricky Kimani
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// Package zfactor provides a comprehensive library for thermodynamic property calculations
// and visualization. It includes tools for solving Cubic Equations of State (EOS),
// estimating properties using correlations like Lee-Kesler, calculating liquid properties,
// and generating Pressure-Volume (PV) diagrams.
package zfactor
const (
// RSI is the Universal Gas Constant in SI units [J/(mol·K)].
RSI = 8.314
// AtmPa is the standard atmospheric pressure in Pascals (Pa).
AtmPa = 101_325.0
// AtmKPa is the standard atmospheric pressure in Kilopascals (kPa).
AtmKPa = AtmPa * 1e-3
// AtmBar is the standard atmospheric pressure in Bars.
AtmBar = AtmPa * 1e-5
)
// Args holds the thermodynamic state arguments to prevent order-dependent errors.
// It is used to pass parameters like Temperature and Pressure safely.
type Args struct {
T float64 // Temperature
P float64 // Pressure
R float64 // Gas constant
B float64 // Second virial coefficient
C float64 // Third virial coefficient
}