MULES, CMULES and IMULES 测试
-
算例非常简单,就是1维对流问题。不过可以给你个思路制作求解器。改编
scalarTransportFoam
:#include "fvCFD.H" #include "simpleControl.H" #include "MULEStest.H" #include "FCT.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" simpleControl simple(mesh); #include "createFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating scalar transport\n" << endl; #include "CourantNo.H" while (simple.loop()) { Info<< "\n\nTime = " << runTime.timeName() << nl << endl; scalarField phiTout; while (simple.correctNonOrthogonal()) { phiT = phi * fvc::interpolate(T); phiTout = phiT.ref(); Info << "phiT before MULES " << phiTout << nl << nl; //MULEStest::explicitSolve(T, phi, phiT, 9, 0); FCT(T, phi, phiT, 9, 0); //fvScalarMatrix TEqn //( // fvm::ddt(T) // + fvc::div(phiT) //); //TEqn.relax(); //TEqn.solve(); } scalarField TOUTPUT = T.ref(); phiTout = phiT.ref(); Info << "\n\nT is " << TOUTPUT << nl; Info << "phiT after MULES " << phiTout << nl; runTime.write(); } //Info<< "End\n" << endl; return 0; }
通过MULES学习插值格式太复杂了