Skip to content

Commit

Permalink
Merge pull request #6 from DENG-MIT/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
ZhiyuShi authored Jul 5, 2020
2 parents 1a97b41 + 7df1468 commit ecb8b3f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions reactorch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .Solution import *
from . import chemical_kinetic
from . import load_mechanism
from . import import_kinetics
from . import kinetics
from .solution import *
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,4 @@ def set_reactions(self):
self.mat_transfer_type4_Troe[i,index] = 1

index_in_type4 = self.list_id_Troe_in_type4[i]
self.mat_transfer_type4_to_Troe[index_in_type4,i] = 1
self.mat_transfer_type4_to_Troe[index_in_type4,i] = 1
21 changes: 11 additions & 10 deletions reactorch/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@


class Solution(nn.Module):

from .import_kinetics import set_nasa
from .import_kinetics import set_reactions

from .kinetics import forward_rate_constants_func
from .kinetics import forward_rate_constants_func_vec
from .kinetics import forward_rate_constants_func_matrix
from .kinetics import equilibrium_constants_func
from .kinetics import reverse_rate_constants_func
from .kinetics import wdot_func

def __init__(self, mech_yaml=None, device=None,vectorize=False):
super(Solution, self).__init__()

Expand Down Expand Up @@ -56,9 +67,6 @@ def __init__(self, mech_yaml=None, device=None,vectorize=False):
self.set_nasa()

self.set_reactions()

from load_mechanism import set_nasa
from load_mechanism import set_reactions

def set_pressure(self, P):
self.P_ref = torch.Tensor([P]).to(self.device)
Expand Down Expand Up @@ -123,13 +131,6 @@ def update_transport(self):

self.binary_diff_coeffs_func()

from chemical_kinetic import forward_rate_constants_func
from chemical_kinetic import forward_rate_constants_func_vec
from chemical_kinetic import forward_rate_constants_func_matrix
from chemical_kinetic import equilibrium_constants_func
from chemical_kinetic import reverse_rate_constants_func
from chemical_kinetic import wdot_func

def set_transport(self, species_viscosities_poly, thermal_conductivity_poly, binary_diff_coeffs_poly):
# Transport Properties

Expand Down

0 comments on commit ecb8b3f

Please sign in to comment.