initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / solvers / combustion / engineFoam / engineFoam.C
blobb7f94eb6f7bdfec7e7bf53b298962b629f65e71a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Application
26     engineFoam
28 Description
29     Solver for internal combustion engines.
31     Combusting RANS code using the b-Xi two-equation model.
32     Xi may be obtained by either the solution of the Xi transport
33     equation or from an algebraic exression.  Both approaches are
34     based on Gulder's flame speed correlation which has been shown
35     to be appropriate by comparison with the results from the
36     spectral model.
38     Strain effects are encorporated directly into the Xi equation
39     but not in the algebraic approximation.  Further work need to be
40     done on this issue, particularly regarding the enhanced removal rate
41     caused by flame compression.  Analysis using results of the spectral
42     model will be required.
44     For cases involving very lean Propane flames or other flames which are
45     very strain-sensitive, a transport equation for the laminar flame
46     speed is present.  This equation is derived using heuristic arguments
47     involving the strain time scale and the strain-rate at extinction.
48     the transport velocity is the same as that for the Xi equation.
50 \*---------------------------------------------------------------------------*/
52 #include "fvCFD.H"
53 #include "engineTime.H"
54 #include "engineMesh.H"
55 #include "hhuCombustionThermo.H"
56 #include "RASModel.H"
57 #include "laminarFlameSpeed.H"
58 #include "ignition.H"
59 #include "Switch.H"
60 #include "OFstream.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 int main(int argc, char *argv[])
66 #   include "setRootCase.H"
68 #   include "createEngineTime.H"
69 #   include "createEngineMesh.H"
70 #   include "readPISOControls.H"
71 #   include "readCombustionProperties.H"
72 #   include "createFields.H"
73 #   include "initContinuityErrs.H"
74 #   include "readEngineTimeControls.H"
75 #   include "compressibleCourantNo.H"
76 #   include "setInitialDeltaT.H"
77 #   include "startSummary.H"
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81     Info << "\nStarting time loop\n" << endl;
83     while (runTime.run())
84     {
85 #       include "readPISOControls.H"
86 #       include "readEngineTimeControls.H"
87 #       include "compressibleCourantNo.H"
88 #       include "setDeltaT.H"
90         runTime++;
92         Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
94         mesh.move();
96 #       include "rhoEqn.H"
98 #       include "UEqn.H"
100         // --- PISO loop
101         for (int corr=1; corr<=nCorr; corr++)
102         {
103 #           include "ftEqn.H"
104 #           include "bEqn.H"
105 #           include "huEqn.H"
106 #           include "hEqn.H"
108             if (!ign.ignited())
109             {
110                 hu == h;
111             }
113 #           include "pEqn.H"
114         }
116         turbulence->correct();
118 #       include "logSummary.H"
120         rho = thermo->rho();
122         runTime.write();
124         Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
125             << "  ClockTime = " << runTime.elapsedClockTime() << " s"
126             << nl << endl;
127     }
129     Info<< "End\n" << endl;
131     return(0);
135 // ************************************************************************* //