一个简单的速度压力非迭代求解器
-
之前OKSS2课程的一部分:自定义求解器。在icoFoam中替换下述即可:
while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; #include "CourantNo.H" solve(fvm::ddt(U) + fvc::div(phi,U)); U.oldTime() = U; solve(fvm::ddt(U) - fvm::laplacian(nu, U)); phi = linearInterpolate(U) & mesh.Sf(); solve(fvm::laplacian(runTime.deltaT(), p) == fvc::div(phi)); U -= runTime.deltaT()*fvc::grad(p); phi = linearInterpolate(U) & mesh.Sf(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; }
-
这是什么原理啊,有没有资料参考下。
2020年3月9日 10:22
3/3
2020年3月10日 01:18