Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/CPU_inferencce_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
. ~/miniconda3/etc/profile.d/conda.sh
conda create -n libcantera python=3.8
conda activate libcantera
conda install -c cantera libcantera-devel
conda install -c cantera libcantera-devel=2.6
conda install pytorch pybind11
conda install --channel https://conda.anaconda.org/zhaofeng-shu33 easydict
git clone https://github.com/deepmodeling/deepflame-dev.git
Expand All @@ -52,7 +52,7 @@ jobs:
&& cp -r flareFGM_Table_Download/SandiaD/flare.tbl examples/dfLowMachFoam/2DSandiaD_flareFGM/
&& git clone https://github.com/intelligent-algorithm-team/intelligent-combustion.git
&& cp -r intelligent-combustion/DeePCK/Model/HE04_Hydrogen_ESH2_GMS_sub_20221101/ mechanisms/ && source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc
&& . configure.sh --use_pytorch && source ./bashrc && . install.sh
&& . configure.sh && source ./bashrc && . install.sh
&& cd test && ./Allrun && conda deactivate "

- name: test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ def forward(self, x):
model0= NN_MLP(layers)
model1= NN_MLP(layers)
model2= NN_MLP(layers)

state_dict = (torch.load('Temporary_Chemical.pt'))['state_dict']
if torch.cuda.is_available()==False:
state_dict = (torch.load('Temporary_Chemical.pt',map_location='cpu'))['state_dict']
else:
state_dict = (torch.load('Temporary_Chemical.pt'))['state_dict']

new_state_dict = {}
for k, v in state_dict.items():
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)


file(COPY ./pytorchIntegrator/postProcessing/probes/0/T DESTINATION 0DH2)


file(COPY ./oneD_detonationH2/postProcessing/minMax/0/fieldMinMax.dat DESTINATION 1Ddetonation)
file(COPY ./dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/postProcessing/sample/0.0005/data_T.xy DESTINATION 2DTGV/5)
Expand Down
16 changes: 8 additions & 8 deletions test/corrtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ float readTGV(int k, string file);
float readHighSpeed();
float v = readHighSpeed();

float H2maxT = readmaxTH2();
float H2midT = readmidTH2();
// float H2maxT = readmaxTH2();
// float H2midT = readmidTH2();


float TGV500 = readTGV(806,"2DTGV/5/data_T.xy");
Expand All @@ -32,12 +32,12 @@ float T4 = readSandia(4,"2DSandia/data_T.xy");
float T5 = readSandia(5,"2DSandia/data_T.xy");
float T6 = readSandia(6,"2DSandia/data_T.xy");

TEST(corrtest,df0DFoam_H2){
EXPECT_FLOAT_EQ(H2maxT,2588.48); // compare the maximum temperature of H2 case
EXPECT_FLOAT_EQ(H2midT,1021.41); // compare the temperature of H2 case at the maximum gradient when t = 0.000245s
//EXPECT_FLOAT_EQ(H2maxT,2586.21); // compare the maximum temperature of H2 case
//EXPECT_FLOAT_EQ(H2midT,1020.71); // compare the temperature of H2 case at the maximum gradient when t = 0.000245s
}
// TEST(corrtest,df0DFoam_H2){
// EXPECT_FLOAT_EQ(H2maxT,2588.48); // compare the maximum temperature of H2 case
// EXPECT_FLOAT_EQ(H2midT,1021.41); // compare the temperature of H2 case at the maximum gradient when t = 0.000245s
// //EXPECT_FLOAT_EQ(H2maxT,2586.21); // compare the maximum temperature of H2 case
// //EXPECT_FLOAT_EQ(H2midT,1020.71); // compare the temperature of H2 case at the maximum gradient when t = 0.000245s
// }



Expand Down
1 change: 0 additions & 1 deletion test/pytorchIntegrator

This file was deleted.