OpenFOAM-11,OpenFOAM-v2306
-
下面这个代码是foamRun的主程序。这个在之前都是处理速度、压力、各种离散的代码,目前里面的核心代码都处理成了类,全部动过库来处理。
本质上算法都是一样的。只不过代码全部推翻了重写。
int main(int argc, char *argv[]) { argList::addOption ( "solver", "name", "Solver name" ); #include "setRootCase.H" #include "createTime.H" // Read the solverName from the optional solver entry in controlDict word solverName ( runTime.controlDict().lookupOrDefault("solver", word::null) ); // Optionally reset the solver name from the -solver command-line argument args.optionReadIfPresent("solver", solverName); // Check the solverName has been set if (solverName == word::null) { args.printUsage(); FatalErrorIn(args.executable()) << "solver not specified in the controlDict or on the command-line" << exit(FatalError); } else { // Load the solver library solver::load(solverName); } // Create the default single region mesh #include "createMesh.H" // Instantiate the selected solver autoPtr<solver> solverPtr(solver::New(solverName, mesh)); solver& solver = solverPtr(); // Create the outer PIMPLE loop and control structure pimpleSingleRegionControl pimple(solver.pimple); // Set the initial time-step setDeltaT(runTime, solver); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< nl << "Starting time loop\n" << endl; while (pimple.run(runTime)) { solver.preSolve(); // Adjust the time-step according to the solver maxDeltaT adjustDeltaT(runTime, solver); runTime++; Info<< "Time = " << runTime.userTimeName() << nl << endl; // PIMPLE corrector loop while (pimple.loop()) { solver.moveMesh(); solver.fvModels().correct(); solver.prePredictor(); solver.momentumPredictor(); solver.thermophysicalPredictor(); solver.pressureCorrector(); solver.postCorrector(); } solver.postSolve(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } -
都瞅了瞅,基金会的版本改动大,学习成本高了。习惯了老版本,就算要换方向,必须用新版本,也会选择ESI的版本。个人观点。
-
@wangfei9088 你说的有道理。OpenFOAM基金会那面犟得很。哎。这肯定会有一拨人跑ESI版本那面去了
-
@李东岳 李老师,那您的CFD课会紧跟潮流普及新版本不?
-
@wangfei9088 是的。要的。要持续学习哎。要不然就被后浪拍死了。
-
@李东岳 oh, cool!
2023年7月13日 08:58
2/12
2023年7月14日 16:21