diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C index 33a6d6a13..d2da9b19e 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C @@ -123,6 +123,7 @@ Foam::TDACChemistryModel::TDACChemistryModel if (tabulation_->log()) { cpuAddFile_ = logFile("cpu_add.out"); + cpuGrowFile_ = logFile("cpu_grow.out"); cpuRetrieveFile_ = logFile("cpu_retrieve.out"); } @@ -613,6 +614,7 @@ Foam::scalar Foam::TDACChemistryModel::solve clockTime_.timeIncrement(); scalar reduceMechCpuTime_ = 0; scalar addNewLeafCpuTime_ = 0; + scalar growCpuTime_ = 0; scalar solveChemistryCpuTime_ = 0; scalar searchISATCpuTime_ = 0; @@ -703,17 +705,20 @@ Foam::scalar Foam::TDACChemistryModel::solve // (it will either expand the current data or add a new stored point). else { - clockTime_.timeIncrement(); + // Store total time waiting to attribute to add or grow + scalar timeTmp = clockTime_.timeIncrement(); + if (reduced) { // Reduce mechanism change the number of species (only active) mechRed_->reduceMechanism(c, Ti, pi); nActiveSpecies += mechRed_->NsSimp(); nAvg++; + scalar timeIncr = clockTime_.timeIncrement(); + reduceMechCpuTime_ += timeIncr; + timeTmp += timeIncr; } - reduceMechCpuTime_ += clockTime_.timeIncrement(); - // Calculate the chemical source terms while (timeLeft > SMALL) { @@ -742,7 +747,11 @@ Foam::scalar Foam::TDACChemistryModel::solve timeLeft -= dt; } - solveChemistryCpuTime_ += clockTime_.timeIncrement(); + { + scalar timeIncr = clockTime_.timeIncrement(); + solveChemistryCpuTime_ += timeIncr; + timeTmp += timeIncr; + } // If tabulation is used, we add the information computed here to // the stored points (either expand or add) @@ -768,13 +777,14 @@ Foam::scalar Foam::TDACChemistryModel::solve if (growOrAdd) { this->setTabulationResultsAdd(celli); + addNewLeafCpuTime_ += clockTime_.timeIncrement() + timeTmp; } else { this->setTabulationResultsGrow(celli); + growCpuTime_ += clockTime_.timeIncrement() + timeTmp; } } - addNewLeafCpuTime_ += clockTime_.timeIncrement(); // When operations are done and if mechanism reduction is active, // the number of species (which also affects nEqns) is set back @@ -822,6 +832,10 @@ Foam::scalar Foam::TDACChemistryModel::solve << this->time().timeOutputValue() << " " << searchISATCpuTime_ << endl; + cpuGrowFile_() + << this->time().timeOutputValue() + << " " << growCpuTime_ << endl; + cpuAddFile_() << this->time().timeOutputValue() << " " << addNewLeafCpuTime_ << endl; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H index 1e65270db..71af571b6 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H @@ -111,6 +111,9 @@ class TDACChemistryModel //- Log file for the average time spent adding tabulated data autoPtr cpuAddFile_; + //- Log file for the average time spent growing tabulated data + autoPtr cpuGrowFile_; + //- Log file for the average time spent retrieving tabulated data autoPtr cpuRetrieveFile_;