diff --git a/examples/df0DFoam/zeroD_cubicReactor/H2/pytorchIntegrator/constant/CanteraTorchProperties b/examples/df0DFoam/zeroD_cubicReactor/H2/pytorchIntegrator/constant/CanteraTorchProperties index dc261039..ebf63603 100644 --- a/examples/df0DFoam/zeroD_cubicReactor/H2/pytorchIntegrator/constant/CanteraTorchProperties +++ b/examples/df0DFoam/zeroD_cubicReactor/H2/pytorchIntegrator/constant/CanteraTorchProperties @@ -38,7 +38,7 @@ splittingStrategy off; TorchSettings { - torch off; + torch on; GPU off; log on; torchModel "HE04_Hydrogen_ESH2_GMS_sub_20221101"; diff --git a/src/dfChemistryModel/dfChemistryModel.C b/src/dfChemistryModel/dfChemistryModel.C index 3b086b86..94d5be83 100644 --- a/src/dfChemistryModel/dfChemistryModel.C +++ b/src/dfChemistryModel/dfChemistryModel.C @@ -839,26 +839,26 @@ void Foam::dfChemistryModel::getGPUProblems if (((Qdot_[cellI] < 3e7) && (T_[cellI] < 2000) && ( T_[cellI] >= 700)) || (T_[cellI] < 700))//choose1 { // if use CVODE - ode_problem.Y = problem.Y; - ode_problem.Ti = Ti; - ode_problem.pi = pi; - ode_problem.rhoi = rhoi; - ode_problem.deltaT = deltaT[cellI]; - ode_problem.cpuTime = cpuTimes_[cellI]; - ode_problem.cellid = cellI; - if (!(Pstream::myProcNo() % cores_)) // submaster - { - ode_problem.local = false; - } - CPUproblemList.append(ode_problem); + // ode_problem.Y = problem.Y; + // ode_problem.Ti = Ti; + // ode_problem.pi = pi; + // ode_problem.rhoi = rhoi; + // ode_problem.deltaT = deltaT[cellI]; + // ode_problem.cpuTime = cpuTimes_[cellI]; + // ode_problem.cellid = cellI; + // if (!(Pstream::myProcNo() % cores_)) // submaster + // { + // ode_problem.local = false; + // } + // CPUproblemList.append(ode_problem); - selectDNN_[cellI]=0; - continue; + // selectDNN_[cellI]=0; + // continue; // if use DNN - // problem.DNNid = 0; - // GPUproblemList.append(problem); - // continue; + problem.DNNid = 0; + GPUproblemList.append(problem); + continue; } if(((Qdot_[cellI] >= 3e7) && (T_[cellI] < 2000)&&(T_[cellI] >= 700))||((Qdot_[cellI] > 7e8) && T_[cellI] > 2000)) //choose2 { @@ -1570,9 +1570,9 @@ Foam::scalar Foam::dfChemistryModel::solve_DNN( /*=============================construct solutions=============================*/ std::chrono::steady_clock::time_point start6 = std::chrono::steady_clock::now(); - std::vector outputsVec0(star, star+outputLength[0] * 21); //the float number is sample_length*sample_number - std::vector outputsVec1(star+outputLength[0] * 21, star+outputLength[1] * 21); - std::vector outputsVec2(star+outputLength[1] * 21, star+outputLength[2] * 21); + std::vector outputsVec0(star, star+outputLength[0] * 7); //the float number is sample_length*sample_number + std::vector outputsVec1(star+outputLength[0] * 7, star+outputLength[1] * 7); + std::vector outputsVec2(star+outputLength[1] * 7, star+outputLength[2] * 7); std::vector> results = {outputsVec0, outputsVec1, outputsVec2}; updateSolutionBuffer(solutionBuffer, results, cellIDBuffer, problemCounter); std::chrono::steady_clock::time_point stop6 = std::chrono::steady_clock::now(); diff --git a/test/corrtest.cpp b/test/corrtest.cpp index 2099f3a4..a2b68593 100644 --- a/test/corrtest.cpp +++ b/test/corrtest.cpp @@ -25,10 +25,8 @@ float TGV400 = readTGV(1098,"2DTGV/4/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 + 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 }