Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ABC Simulator #13

Merged
merged 25 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ea500b7
Add adapter and factory for generating simulator classes
kspieks Mar 9, 2021
0e4e4c6
Add adapter for simulating with RMG
kspieks Feb 26, 2021
8a48960
Update main.py to reflect use of the simulate adapter
kspieks Mar 9, 2021
fba4bcd
Tests: Added RMG Simulator Adapter tests
kspieks Feb 25, 2021
afe2207
Tests: Modify test_main to account for simulate adapter
kspieks Feb 25, 2021
580366c
Update minimal_data to reflect new directory structure with adapters
kspieks Jun 18, 2020
254e0e5
Add validator to ensure RMG options block is filled with default values
kspieks Jul 2, 2020
5064229
Tests: Update test_writer to account for RMG options validator
kspieks Jul 2, 2020
3d0e1e2
Add RMS adapters
kspieks Feb 26, 2021
a867f71
Tests: Add tests for RMS adapter
kspieks Feb 25, 2021
ce06e22
Organize scripts that install Julia, RMS, and pyrms
kspieks Feb 20, 2021
cb0e63b
Add function that converts termination time to seconds for RMS
kspieks Jan 8, 2021
bc639f3
Initialize imports for the simulator modules
kspieks Feb 25, 2021
e3953c8
Reorganize simulate tests
kspieks Feb 19, 2021
d9e8538
Add Cantera adapter
kspieks Feb 26, 2021
ae40a1f
Tests: Add tests for Cantera adapter
kspieks Feb 25, 2021
02edf43
Minor: consolidate scripts so installation is one step
kspieks Sep 2, 2020
9e69a0b
Add notebooks showing how to use simulator adapters
kspieks Feb 25, 2021
e35f304
Minor: use consistent keys for sa_dict_max and sa_dict
kspieks Jan 9, 2021
a1f2571
Minor: add ignore_errors=True to all shutil.rmtree calls
kspieks Feb 18, 2021
59a5829
Use new `make install` command
kspieks Feb 19, 2021
1bc385c
Docs: add a tutorial for adding a new simulate adapter
kspieks Feb 20, 2021
aebe84e
Minor: update default sensitivity adapter to be RMGSimulatorConstantTP
kspieks Feb 25, 2021
25aab1a
Tests: ensure that the simulate adapter string is properly registered
kspieks Feb 25, 2021
3b0e16c
Minor: Update simulate adapter names
kspieks Feb 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions .github/workflows/cont_int.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,7 @@ jobs:
run: |
export PYTHONPATH=$PYTHONPATH:$(pwd)
conda activate t3_env
cd ..
git clone https://github.com/ReactionMechanismGenerator/ARC
cd ARC
export PYTHONPATH=$PYTHONPATH:$(pwd)
cd ..
git clone https://github.com/ReactionMechanismGenerator/RMG-Py
cd RMG-Py
export PYTHONPATH=$PYTHONPATH:$(pwd)
make
cd ..
git clone https://github.com/ReactionMechanismGenerator/RMG-database
cd T3
make install
echo $(pwd)
conda list

Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
#
################################################################################

install:
bash devtools/install_arc.sh
bash devtools/install_pyrms.sh

install-arc:
bash devtools/install_arc.sh

install-pyrms:
bash devtools/install_pyrms.sh

test:
pytest -ra -vv

Expand Down
3 changes: 3 additions & 0 deletions devtools/install_RMS_v032.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install RMS v0.3.2
import Pkg
Pkg.add(Pkg.PackageSpec(url="https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl", rev="v0.3.2"))
23 changes: 23 additions & 0 deletions devtools/install_arc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Temporarily change directory to $HOME to install software
pushd .

cd ..
# RMG-database
git clone https://github.com/ReactionMechanismGenerator/RMG-database
# RMG-Py
git clone https://github.com/ReactionMechanismGenerator/RMG-Py
cd RMG-Py
export PYTHONPATH=$PYTHONPATH:$(pwd)
echo "export PYTHONPATH=$PYTHONPATH:$(pwd)" >> ~/.bashrc
# compile RMG
make

cd ..
# ARC
git clone https://github.com/ReactionMechanismGenerator/ARC
cd ARC
export PYTHONPATH=$PYTHONPATH:$(pwd)
echo "export PYTHONPATH=$PYTHONPATH:$(pwd)" >> ~/.bashrc

# Restore original directory
popd || exit
3 changes: 3 additions & 0 deletions devtools/install_pycall.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install PyCall
import Pkg
Pkg.add("PyCall")
21 changes: 21 additions & 0 deletions devtools/install_pyrms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# check that Python and Julia are being accessed from the t3_env
echo checking which python...
which python
echo checking which julia...
which julia

echo linking python-jl to python...
ln -sfn $(which python-jl) $(which python)

echo installing PyCall...
julia devtools/install_pycall.jl

echo installing pyrms, RMS, and all required Julia packages...
python -c "import pyrms; pyrms.install()"

# the above line installs RMS v0.2.1
# v0.3.2 is needed to use the latest SA features
# once there is a functional package for v0.3.2,
# the line below can be deleted since pyrms.install() will pull the latest version
echo installing RMS v0.3.2...
julia devtools/install_RMS_v032.jl
24 changes: 0 additions & 24 deletions devtools/travis_ci_before_install.sh

This file was deleted.

10 changes: 9 additions & 1 deletion docs/how_to.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,15 @@ all_args (bool, optional):

## Writing simulation adapters

Coming soon!
T3 implements many common choices to simulate a chemical mechanism, such as using constant TP, UV,
or HP batch reactors. To create a custom simulator for your needs, first add a new file to `T3/t3/simulate/`,
which contains the new simulate adapter. The new class must inherit from the abstract adapter class in
`T3/t3/simulate/adapter.py` and should implement the following methods: `set_up()`, `simulate()`, `get_sa_coefficients()`,
and `get_idt_by_T()`. All simulate adapters must accept the same arguments; the currently implemented
Cantera, RMG, and RMS adapters provide examples. Finally, register the adapter at the bottom of the file,
and initialize the simulator by importing it in `T3/t3/simulate/__init__.py`. A more detailed coding example
can be found in the tutorials section. Adding a test to `T3/tests/test_simulate_adapters/` is also recommended.
We welcome pull-requests to incorporate new simulate adapters.


## Pre-QM, or: T3's iteration 0
Expand Down
Loading