diff --git a/applications/solvers/dfHighSpeedFoam/createFields.H b/applications/solvers/dfHighSpeedFoam/createFields.H index dfcc53eaa..ee65208b0 100644 --- a/applications/solvers/dfHighSpeedFoam/createFields.H +++ b/applications/solvers/dfHighSpeedFoam/createFields.H @@ -7,6 +7,13 @@ if (mesh.schemesDict().readIfPresent("timeScheme", ddtSchemes)) { Info<< "ddtSchemes: " << ddtSchemes << endl; } + else + { + FatalErrorInFunction + << "This timeScheme is not a valid choice. " + << "Please use RK2SSP or RK3SSP scheme." + << abort(FatalError); + } } word chemScheme("ode"); diff --git a/applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C b/applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C index 7d53318f9..8ba02a46e 100644 --- a/applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C +++ b/applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C @@ -83,6 +83,8 @@ int main(int argc, char *argv[]) double time_monitor_chem=0; double time_monitor_Y=0; double time_monitor_AMR=0; + double time_monitor_E=0; + double time_monitor_corrDiff=0; clock_t start, end; turbulence->validate(); @@ -170,10 +172,13 @@ int main(int argc, char *argv[]) // --- Solve species #include "rhoYEqn.H" + start = std::clock(); // --- Solve energy #include "rhoEEqn.H" + end = std::clock(); + time_monitor_E += double(end - start) / double(CLOCKS_PER_SEC); - if ((nrk == rk-1) && (chemScheme == "RR")) + if ((nrk == rk-1) && (chemScheme == "ode")) { #include "calculateR.H" } @@ -208,19 +213,25 @@ int main(int argc, char *argv[]) // --- Solve species #include "rhoYEqn.H" + start = std::clock(); // --- Solve energy #include "rhoEEqn.H" + end = std::clock(); + time_monitor_E += double(end - start) / double(CLOCKS_PER_SEC); } turbulence->correct(); runTime.write(); - Info<< "MonitorTime_chem = " << time_monitor_chem << " s" << nl << endl; - Info<< "MonitorTime_Y = " << time_monitor_Y << " s" << nl << endl; - Info<< "MonitorTime_flow = " << time_monitor_flow << " s" << nl << endl; - Info<< "MonitorTime_AMR = " << time_monitor_AMR << " s" << nl << endl; - + Info<< "========Time Spent in diffenet parts========"<< endl; + Info<< "MonitorTime_AMR = " << time_monitor_AMR << " s" << endl; + Info<< "MonitorTime_flow = " << time_monitor_flow << " s" << endl; + Info<< "Diffusion Correction Time = " << time_monitor_corrDiff << " s" << endl; + Info<< "MonitorTime_chem = " << time_monitor_chem << " s" << endl; + Info<< "MonitorTime_Y = " << time_monitor_Y << " s" << endl; + Info<< "MonitorTime_E = " << time_monitor_E << " s" << endl; + Info<< "============================================"<> mvConvection ) ); +end = std::clock(); +time_monitor_corrDiff += double(end - start) / double(CLOCKS_PER_SEC); + { + start = std::clock(); + if((ddtSchemes == "RK2SSP") || (ddtSchemes == "RK3SSP")) { - if(chemScheme == "wrate") + if(chemScheme == "direct") { - start = std::clock(); - chemistry->calculateW(); - - label flag_mpi_init; - MPI_Initialized(&flag_mpi_init); - if(flag_mpi_init) MPI_Barrier(PstreamGlobals::MPI_COMM_FOAM); - end = std::clock(); - time_monitor_chem += double(end - start) / double(CLOCKS_PER_SEC); } } else { - start = std::clock(); - combustion->correct(); - - label flag_mpi_init; - MPI_Initialized(&flag_mpi_init); - if(flag_mpi_init) MPI_Barrier(PstreamGlobals::MPI_COMM_FOAM); - end = std::clock(); - time_monitor_chem += double(end - start) / double(CLOCKS_PER_SEC); - } + } + + label flag_mpi_init; + MPI_Initialized(&flag_mpi_init); + if(flag_mpi_init) MPI_Barrier(PstreamGlobals::MPI_COMM_FOAM); + end = std::clock(); + time_monitor_chem += double(end - start) / double(CLOCKS_PER_SEC); volScalarField Yt(0.0*Y[0]); @@ -69,7 +66,7 @@ tmp> mvConvection { rhoYi_rhs = -fvc::div(phiYi[i]); - if(chemScheme == "wrate") + if(chemScheme == "direct") { rhoYi_rhs.ref() += chemistry->wrate(i); Info <<"max reaction rate "<< Yi.name() << " is " << max(chemistry->wrate(i)).value() << endl;