FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

engineFoam.C

Go 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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Application
00025     engineFoam
00026 
00027 Description
00028     Solver for internal combustion engines.
00029 
00030     Combusting RANS code using the b-Xi two-equation model.
00031     Xi may be obtained by either the solution of the Xi transport
00032     equation or from an algebraic exression.  Both approaches are
00033     based on Gulder's flame speed correlation which has been shown
00034     to be appropriate by comparison with the results from the
00035     spectral model.
00036 
00037     Strain effects are encorporated directly into the Xi equation
00038     but not in the algebraic approximation.  Further work need to be
00039     done on this issue, particularly regarding the enhanced removal rate
00040     caused by flame compression.  Analysis using results of the spectral
00041     model will be required.
00042 
00043     For cases involving very lean Propane flames or other flames which are
00044     very strain-sensitive, a transport equation for the laminar flame
00045     speed is present.  This equation is derived using heuristic arguments
00046     involving the strain time scale and the strain-rate at extinction.
00047     the transport velocity is the same as that for the Xi equation.
00048 
00049 Usage
00050     - engineFoam [OPTION]
00051 
00052     @param -case <dir> \n
00053     Specify the case directory
00054 
00055     @param -parallel \n
00056     Run the case in parallel
00057 
00058     @param -help \n
00059     Display short usage message
00060 
00061     @param -doc \n
00062     Display Doxygen documentation page
00063 
00064     @param -srcDoc \n
00065     Display source code
00066 
00067 \*---------------------------------------------------------------------------*/
00068 
00069 #include <finiteVolume/fvCFD.H>
00070 #include <engine/engineTime.H>
00071 #include <engine/engineMesh.H>
00072 #include <reactionThermophysicalModels/hhuCombustionThermo.H>
00073 #include <compressibleTurbulenceModel/turbulenceModel.H>
00074 #include <laminarFlameSpeedModels/laminarFlameSpeed.H>
00075 #include <engine/ignition.H>
00076 #include <OpenFOAM/Switch.H>
00077 #include <OpenFOAM/OFstream.H>
00078 
00079 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00080 
00081 int main(int argc, char *argv[])
00082 {
00083     #include <OpenFOAM/setRootCase.H>
00084 
00085     #include <engine/createEngineTime.H>
00086     #include <engine/createEngineMesh.H>
00087     #include "../XiFoam/readCombustionProperties.H"
00088     #include "../XiFoam/createFields.H"
00089     #include <finiteVolume/initContinuityErrs.H>
00090     #include "readEngineTimeControls.H"
00091     #include <finiteVolume/compressibleCourantNo.H>
00092     #include <finiteVolume/setInitialDeltaT.H>
00093     #include "startSummary.H"
00094 
00095     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00096 
00097     Info << "\nStarting time loop\n" << endl;
00098 
00099     while (runTime.run())
00100     {
00101         #include <finiteVolume/readPISOControls.H>
00102         #include "readEngineTimeControls.H"
00103         #include <finiteVolume/compressibleCourantNo.H>
00104         #include <finiteVolume/setDeltaT.H>
00105 
00106         runTime++;
00107 
00108         Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
00109 
00110         mesh.move();
00111 
00112         #include <finiteVolume/rhoEqn.H>
00113 
00114         #include "UEqn.H"
00115 
00116         // --- PISO loop
00117         for (int corr=1; corr<=nCorr; corr++)
00118         {
00119             #include "../XiFoam/ftEqn.H"
00120             #include "../XiFoam/bEqn.H"
00121             #include "../XiFoam/huEqn.H"
00122             #include "../XiFoam/hEqn.H"
00123 
00124             if (!ign.ignited())
00125             {
00126                 hu == h;
00127             }
00128 
00129             #include "pEqn.H"
00130         }
00131 
00132         turbulence->correct();
00133 
00134         #include "logSummary.H"
00135 
00136         rho = thermo.rho();
00137 
00138         runTime.write();
00139 
00140         Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
00141             << "  ClockTime = " << runTime.elapsedClockTime() << " s"
00142             << nl << endl;
00143     }
00144 
00145     Info<< "End\n" << endl;
00146 
00147     return 0;
00148 }
00149 
00150 
00151 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines