|
|
|
engineFoam.CGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Application 00026 engineFoam 00027 00028 Description 00029 Solver for internal combustion engines. 00030 00031 Combusting RANS code using the b-Xi two-equation model. 00032 Xi may be obtained by either the solution of the Xi transport 00033 equation or from an algebraic exression. Both approaches are 00034 based on Gulder's flame speed correlation which has been shown 00035 to be appropriate by comparison with the results from the 00036 spectral model. 00037 00038 Strain effects are encorporated directly into the Xi equation 00039 but not in the algebraic approximation. Further work need to be 00040 done on this issue, particularly regarding the enhanced removal rate 00041 caused by flame compression. Analysis using results of the spectral 00042 model will be required. 00043 00044 For cases involving very lean Propane flames or other flames which are 00045 very strain-sensitive, a transport equation for the laminar flame 00046 speed is present. This equation is derived using heuristic arguments 00047 involving the strain time scale and the strain-rate at extinction. 00048 the transport velocity is the same as that for the Xi equation. 00049 00050 \*---------------------------------------------------------------------------*/ 00051 00052 #include "fvCFD.H" 00053 #include "engineTime.H" 00054 #include "engineMesh.H" 00055 #include "hhuCombustionThermo.H" 00056 #include "turbulenceModel.H" 00057 #include "laminarFlameSpeed.H" 00058 #include "ignition.H" 00059 #include "Switch.H" 00060 #include "OFstream.H" 00061 00062 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00063 00064 int main(int argc, char *argv[]) 00065 { 00066 #include "setRootCase.H" 00067 00068 #include "createEngineTime.H" 00069 #include "createEngineMesh.H" 00070 #include "readCombustionProperties.H" 00071 #include "createFields.H" 00072 #include "initContinuityErrs.H" 00073 #include "readEngineTimeControls.H" 00074 #include "compressibleCourantNo.H" 00075 #include "setInitialDeltaT.H" 00076 #include "startSummary.H" 00077 00078 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00079 00080 Info << "\nStarting time loop\n" << endl; 00081 00082 while (runTime.run()) 00083 { 00084 #include "readPISOControls.H" 00085 #include "readEngineTimeControls.H" 00086 #include "compressibleCourantNo.H" 00087 #include "setDeltaT.H" 00088 00089 runTime++; 00090 00091 Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl; 00092 00093 mesh.move(); 00094 00095 #include "rhoEqn.H" 00096 00097 #include "UEqn.H" 00098 00099 // --- PISO loop 00100 for (int corr=1; corr<=nCorr; corr++) 00101 { 00102 #include "ftEqn.H" 00103 #include "bEqn.H" 00104 #include "huEqn.H" 00105 #include "hEqn.H" 00106 00107 if (!ign.ignited()) 00108 { 00109 hu == h; 00110 } 00111 00112 #include "pEqn.H" 00113 } 00114 00115 turbulence->correct(); 00116 00117 #include "logSummary.H" 00118 00119 rho = thermo.rho(); 00120 00121 runTime.write(); 00122 00123 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" 00124 << " ClockTime = " << runTime.elapsedClockTime() << " s" 00125 << nl << endl; 00126 } 00127 00128 Info<< "End\n" << endl; 00129 00130 return 0; 00131 } 00132 00133 00134 // ************************************************************************* // |