forked from AMReX-Combustion/PelePhysics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_ceptr.py
50 lines (37 loc) · 1.21 KB
/
test_ceptr.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""Tests for cepter."""
import pathlib
import cantera as ct
import ceptr.converter as converter
from ceptr import __version__
def mechanism_path(mname):
"""Determine mechanism path."""
this_file_dir = pathlib.Path(__file__).parent.resolve()
model_path = "Mechanism/Models"
return this_file_dir.parents[1] / model_path / mname
def test_version():
"""Test the version."""
assert __version__ == "0.1.0"
def test_air():
"""Test mechanism generation of air."""
mech_path = mechanism_path("air")
fname = mech_path / "mechanism.yaml"
mechanism = ct.Solution(fname)
conv = converter.Converter(mechanism)
conv.writer()
conv.formatter()
def test_lidryer():
"""Test mechanism generation of LiDryer."""
mech_path = mechanism_path("LiDryer")
fname = mech_path / "mechanism.yaml"
mechanism = ct.Solution(fname)
conv = converter.Converter(mechanism)
conv.writer()
conv.formatter()
def test_dodecane_lu():
"""Test mechanism generation of dodecane_lu."""
mech_path = mechanism_path("dodecane_lu")
fname = mech_path / "mechanism.yaml"
mechanism = ct.Solution(fname)
conv = converter.Converter(mechanism)
conv.writer()
conv.formatter()