pimpleDyMFoam.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "fvCFD.H"
00037 #include "singlePhaseTransportModel.H"
00038 #include "turbulenceModel.H"
00039 #include "dynamicFvMesh.H"
00040
00041
00042
00043 int main(int argc, char *argv[])
00044 {
00045 #include "setRootCase.H"
00046
00047 #include "createTime.H"
00048 #include "createDynamicFvMesh.H"
00049 #include "readPIMPLEControls.H"
00050 #include "initContinuityErrs.H"
00051 #include "createFields.H"
00052 #include "readTimeControls.H"
00053
00054
00055
00056 Info<< "\nStarting time loop\n" << endl;
00057
00058 while (runTime.run())
00059 {
00060 #include "readControls.H"
00061 #include "CourantNo.H"
00062
00063
00064 fvc::makeAbsolute(phi, U);
00065
00066 #include "setDeltaT.H"
00067
00068 runTime++;
00069
00070 Info<< "Time = " << runTime.timeName() << nl << endl;
00071
00072 mesh.update();
00073
00074 if (mesh.changing() && correctPhi)
00075 {
00076 #include "correctPhi.H"
00077 }
00078
00079
00080 fvc::makeRelative(phi, U);
00081
00082 if (mesh.changing() && checkMeshCourantNo)
00083 {
00084 #include "meshCourantNo.H"
00085 }
00086
00087
00088 for (int ocorr=0; ocorr<nOuterCorr; ocorr++)
00089 {
00090 if (nOuterCorr != 1)
00091 {
00092 p.storePrevIter();
00093 }
00094
00095 #include "UEqn.H"
00096
00097
00098 for (int corr=0; corr<nCorr; corr++)
00099 {
00100 rAU = 1.0/UEqn.A();
00101
00102 U = rAU*UEqn.H();
00103 phi = (fvc::interpolate(U) & mesh.Sf());
00104
00105 if (p.needReference())
00106 {
00107 fvc::makeRelative(phi, U);
00108 adjustPhi(phi, U, p);
00109 fvc::makeAbsolute(phi, U);
00110 }
00111
00112 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00113 {
00114 fvScalarMatrix pEqn
00115 (
00116 fvm::laplacian(rAU, p) == fvc::div(phi)
00117 );
00118
00119 pEqn.setReference(pRefCell, pRefValue);
00120
00121 if
00122 (
00123 ocorr == nOuterCorr-1
00124 && corr == nCorr-1
00125 && nonOrth == nNonOrthCorr)
00126 {
00127 pEqn.solve(mesh.solver(p.name() + "Final"));
00128 }
00129 else
00130 {
00131 pEqn.solve(mesh.solver(p.name()));
00132 }
00133
00134 if (nonOrth == nNonOrthCorr)
00135 {
00136 phi -= pEqn.flux();
00137 }
00138 }
00139
00140 #include "continuityErrs.H"
00141
00142
00143 if (ocorr != nOuterCorr-1)
00144 {
00145 p.relax();
00146 }
00147
00148
00149 fvc::makeRelative(phi, U);
00150
00151 U -= rAU*fvc::grad(p);
00152 U.correctBoundaryConditions();
00153 }
00154 }
00155
00156 turbulence->correct();
00157
00158 runTime.write();
00159
00160 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
00161 << " ClockTime = " << runTime.elapsedClockTime() << " s"
00162 << nl << endl;
00163 }
00164
00165 Info<< "End\n" << endl;
00166
00167 return 0;
00168 }
00169
00170
00171
Copyright © 2000-2009 OpenCFD Ltd