dieselEngineFoam.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 #include "fvCFD.H"
00034 #include "engineTime.H"
00035 #include "engineMesh.H"
00036 #include "hCombustionThermo.H"
00037 #include "turbulenceModel.H"
00038 #include "spray.H"
00039 #include "psiChemistryModel.H"
00040 #include "chemistrySolver.H"
00041 #include "multivariateScheme.H"
00042 #include "Switch.H"
00043 #include "OFstream.H"
00044 #include "volPointInterpolation.H"
00045 #include "thermoPhysicsTypes.H"
00046
00047
00048
00049 int main(int argc, char *argv[])
00050 {
00051 #include "setRootCase.H"
00052 #include "createEngineTime.H"
00053 #include "createEngineMesh.H"
00054 #include "createFields.H"
00055 #include "readGravitationalAcceleration.H"
00056 #include "readCombustionProperties.H"
00057 #include "createSpray.H"
00058 #include "initContinuityErrs.H"
00059 #include "readEngineTimeControls.H"
00060 #include "compressibleCourantNo.H"
00061 #include "setInitialDeltaT.H"
00062 #include "startSummary.H"
00063
00064
00065
00066 Info << "\nStarting time loop\n" << endl;
00067
00068 while (runTime.run())
00069 {
00070 #include "readPISOControls.H"
00071 #include "readEngineTimeControls.H"
00072 #include "compressibleCourantNo.H"
00073 #include "setDeltaT.H"
00074
00075 runTime++;
00076
00077 Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
00078
00079 mesh.move();
00080 const_cast<volPointInterpolation&>
00081 (
00082 volPointInterpolation::New(mesh)
00083 ).updateMesh();
00084
00085 dieselSpray.evolve();
00086
00087 Info << "Solving chemistry" << endl;
00088
00089 chemistry.solve
00090 (
00091 runTime.value() - runTime.deltaT().value(),
00092 runTime.deltaT().value()
00093 );
00094
00095
00096 {
00097 volScalarField tk =
00098 Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon());
00099 volScalarField tc = chemistry.tc();
00100
00101
00102 kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);
00103 }
00104
00105 #include "rhoEqn.H"
00106 #include "UEqn.H"
00107
00108 for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
00109 {
00110 #include "YEqn.H"
00111 #include "hEqn.H"
00112
00113
00114 for (int corr=1; corr<=nCorr; corr++)
00115 {
00116 #include "pEqn.H"
00117 }
00118 }
00119
00120 turbulence->correct();
00121
00122 #include "logSummary.H"
00123 #include "spraySummary.H"
00124
00125 rho = thermo.rho();
00126
00127 if (runTime.write())
00128 {
00129 chemistry.dQ()().write();
00130 }
00131
00132 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
00133 << " ClockTime = " << runTime.elapsedClockTime() << " s"
00134 << nl << endl;
00135 }
00136
00137 Info<< "End\n" << endl;
00138
00139 return 0;
00140 }
00141
00142
00143
Copyright © 2000-2009 OpenCFD Ltd