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
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ splittingStrategy off;

TorchSettings
{
torch off;
torch on;
GPU off;
log on;
torchModel "HE04_Hydrogen_ESH2_GMS_sub_20221101";
Expand Down
40 changes: 20 additions & 20 deletions src/dfChemistryModel/dfChemistryModel.C
Original file line number Diff line number Diff line change
Expand Up @@ -839,26 +839,26 @@ void Foam::dfChemistryModel<ThermoType>::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
{
Expand Down Expand Up @@ -1570,9 +1570,9 @@ Foam::scalar Foam::dfChemistryModel<ThermoType>::solve_DNN(

/*=============================construct solutions=============================*/
std::chrono::steady_clock::time_point start6 = std::chrono::steady_clock::now();
std::vector<double> outputsVec0(star, star+outputLength[0] * 21); //the float number is sample_length*sample_number
std::vector<double> outputsVec1(star+outputLength[0] * 21, star+outputLength[1] * 21);
std::vector<double> outputsVec2(star+outputLength[1] * 21, star+outputLength[2] * 21);
std::vector<double> outputsVec0(star, star+outputLength[0] * 7); //the float number is sample_length*sample_number
std::vector<double> outputsVec1(star+outputLength[0] * 7, star+outputLength[1] * 7);
std::vector<double> outputsVec2(star+outputLength[1] * 7, star+outputLength[2] * 7);
std::vector<std::vector<double>> results = {outputsVec0, outputsVec1, outputsVec2};
updateSolutionBuffer(solutionBuffer, results, cellIDBuffer, problemCounter);
std::chrono::steady_clock::time_point stop6 = std::chrono::steady_clock::now();
Expand Down
6 changes: 2 additions & 4 deletions test/corrtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down