耦合换热求解器chtMultiRegionBoussinesqPimpleFoam
-
最近因写论文需要正在改写chtMultiRegionFoam为Boussinesq假设的chtMultiRegionBoussinesqPimpleFoam,现在遇到的问题是 关于每次求解过程中的上一次迭代出来的的变量存储以便亚松弛问题,也就是 #include "storeOldFluidFields.H"语句(见/******/内部分)
在官方求解器chtMultiRegionFoam中
int main(int argc, char *argv[]) { #define NO_CONTROL #define CREATE_MESH createMeshesPostProcess.H #include "postProcess.H" #include "setRootCase.H" #include "createTime.H" #include "createMeshes.H" #include "createFields.H" #include "initContinuityErrs.H" #include "createTimeControls.H" #include "readSolidTimeControls.H" #include "compressibleMultiRegionCourantNo.H" #include "solidRegionDiffusionNo.H" #include "setInitialMultiRegionDeltaT.H" while (runTime.run()) { #include "readTimeControls.H" #include "readSolidTimeControls.H" #include "readPIMPLEControls.H" #include "compressibleMultiRegionCourantNo.H" #include "solidRegionDiffusionNo.H" #include "setMultiRegionDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; /***********************????**************************************************************** if (nOuterCorr != 1) { forAll(fluidRegions, i) { #include "storeOldFluidFields.H" } } /***********************?????******************************************************************** bool allRegionsConverged = false; bool finalIter = false; // --- PIMPLE loop for (int oCorr=0; oCorr<nOuterCorr; oCorr++) { Info<< "Pimple iteration " << oCorr << "\n"; if (oCorr == nOuterCorr-1 || allRegionsConverged) { finalIter = true; } forAll(fluidRegions, i) { Info<< "\nSolving for fluid region " << fluidRegions[i].name() << endl; #include "setRegionFluidFields.H" #include "readFluidMultiRegionPIMPLEControls.H" #include "readFluidMultiRegionResidualControls.H" #include "solveFluid.H" #include "residualControlsFluid.H" } forAll(solidRegions, i) { Info<< "\nSolving for solid region " << solidRegions[i].name() << endl; #include "setRegionSolidFields.H" #include "readSolidMultiRegionPIMPLEControls.H" #include "readSolidMultiRegionResidualControls.H" #include "solveSolid.H" #include "residualControlsSolid.H" } #include "checkResidualControls.H" } runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; }
可以看出官方求解器在每个时间步内存储一下 (见上段程序/********/内)
但是!!!!!!在buoyantBoussinesqPimpleFoam中,却是在每次外循环,也就是pimple.loop()中存储 上一次循环的变量
那么,问题来了 我应该在我的chtMultiRegionBoussinesqPimpleFoam求解器中到底该把
/***********************????**************************************************************** if (nOuterCorr != 1) { forAll(fluidRegions, i) { #include "storeOldFluidFields.H" } } /***********************?????********************************************************************
这段话应该放在哪???????