-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6346e45
commit 74335f9
Showing
10 changed files
with
795 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Equilibrate | ||
|
||
`Equilibrate` is a chemical equilibrium solver which is based on [EasyChem](https://gitlab.com/EliseLei/easychem), which itself is a clone of the NASA CEA tool (described in [Gordon and McBride 1994](https://ntrs.nasa.gov/api/citations/19950013764/downloads/19950013764.pdf)). | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "wheel", "scikit-build", "cmake>=3.12", "ninja", "numpy", "cython"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from skbuild import setup | ||
from os import path | ||
|
||
this_directory = path.abspath(path.dirname(__file__)) | ||
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: | ||
long_description = f.read() | ||
|
||
with open("CMakeLists.txt",'r') as fil: | ||
lines = fil.readlines() | ||
for line in lines: | ||
if line.startswith("project(EQUILIBRATE"): | ||
version = line.split('"')[1] | ||
break | ||
|
||
setup( | ||
name="equilibrate", | ||
packages=['equilibrate'], | ||
python_requires='>=3.6', | ||
version=version, | ||
license="GNU General Public License v3.0", | ||
install_requires=['numpy'], | ||
author='Nicholas Wogan', | ||
author_email = '[email protected]', | ||
description = "A chemical equilibrium solver.", | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
url = "https://github.com/Nicholaswogan/Equilibrate", | ||
cmake_args=['-DCMAKE_BUILD_TYPE=Release',\ | ||
'-DBUILD_PYTHON_EQUILIBRATE=ON',\ | ||
'-DBUILD_EXECUTABLES=OFF'] | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import numpy as np | ||
from equilibrate import ChemEquiAnalysis | ||
|
||
def main(): | ||
atoms = [ | ||
'H ', | ||
'He', | ||
'C ', | ||
'N ', | ||
'O ', | ||
'Na', | ||
'Mg', | ||
'Al', | ||
'Si', | ||
'P ', | ||
'S ', | ||
'Cl', | ||
'K ', | ||
'Ca', | ||
'Ti', | ||
'V ', | ||
'Fe', | ||
'Ni' | ||
] | ||
X = np.array([ | ||
9.207539305000000e-01, | ||
7.836886940000000e-02, | ||
2.478241000000000e-04, | ||
6.225060569498810e-05, | ||
4.509658000000000e-04, | ||
1.600086943532050e-06, | ||
3.665587420553620e-05, | ||
2.595000000000000e-06, | ||
2.979500000000000e-05, | ||
2.366702019976680e-07, | ||
1.213790073460400e-05, | ||
2.911679584995890e-07, | ||
9.866056119256769e-08, | ||
2.014390114292550e-06, | ||
8.206228043663590e-08, | ||
7.836886940899920e-09, | ||
2.911679584995890e-05, | ||
1.528071168062810e-06 | ||
]) | ||
|
||
# | ||
cea = ChemEquiAnalysis('thermo_easy_chem_simp_own.yaml', atoms=atoms) | ||
converged = cea.solve(1.0e6, 1000.0, molfracs_atoms=X) | ||
|
||
# Check the solution | ||
ind = cea.species_names.index('H2') | ||
assert np.isclose(cea.molfracs_species[ind],8.531731613887943e-01,rtol=1e-4) | ||
|
||
if __name__ == '__main__': | ||
main() |