1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Solver for diesel spray and combustion.
30 \*---------------------------------------------------------------------------*/
33 #include "hCombustionThermo.H"
34 #include "turbulenceModel.H"
36 #include "psiChemistryModel.H"
37 #include "chemistrySolver.H"
39 #include "multivariateScheme.H"
43 #include "mathematicalConstants.H"
44 #include "pimpleControl.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 int main(int argc, char *argv[])
50 #include "setRootCase.H"
51 #include "createTime.H"
52 #include "createMesh.H"
53 #include "createFields.H"
54 #include "readGravitationalAcceleration.H"
55 #include "readCombustionProperties.H"
56 #include "createSpray.H"
57 #include "initContinuityErrs.H"
58 #include "readTimeControls.H"
59 #include "compressibleCourantNo.H"
60 #include "setInitialDeltaT.H"
62 pimpleControl pimple(mesh);
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 Info<< "\nStarting time loop\n" << endl;
70 #include "compressibleCourantNo.H"
71 #include "setDeltaT.H"
74 Info<< "Time = " << runTime.timeName() << nl << endl;
76 Info<< "Evolving Spray" << endl;
80 Info<< "Solving chemistry" << endl;
84 runTime.value() - runTime.deltaTValue(),
88 // turbulent time scale
92 Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon())
94 volScalarField tc(chemistry.tc());
96 // Chalmers PaSR model
97 kappa = (runTime.deltaT() + tc)/(runTime.deltaT()+tc+tk);
100 chemistrySh = kappa*chemistry.Sh()();
104 // --- Pressure-velocity PIMPLE corrector loop
105 for (pimple.start(); pimple.loop(); pimple++)
112 for (int corr=0; corr<pimple.nCorr(); corr++)
117 if (pimple.turbCorr())
119 turbulence->correct();
123 #include "spraySummary.H"
129 chemistry.dQ()().write();
132 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
133 << " ClockTime = " << runTime.elapsedClockTime() << " s"
137 Info<< "End\n" << endl;
143 // ************************************************************************* //