PDRFoam.C 5.4 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
5
    \\  /    A nd           | www.openfoam.com
6
     \\/     M anipulation  |
OpenFOAM bot's avatar
OpenFOAM bot committed
7
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
8
    Copyright (C) 2011-2017 OpenFOAM Foundation
9
10
11
12
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

13
14
15
16
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
17
18
19
20
21
22
23

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
24
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
25
26
27
28

Application
    PDRFoam

29
30
31
Group
    grpCombustionSolvers

32
Description
33
34
    Solver for compressible premixed/partially-premixed combustion with
    turbulence modelling.
35
36
37

    Combusting RANS code using the b-Xi two-equation model.
    Xi may be obtained by either the solution of the Xi transport
38
    equation or from an algebraic expression.  Both approaches are
39
40
41
42
    based on Gulder's flame speed correlation which has been shown
    to be appropriate by comparison with the results from the
    spectral model.

43
    Strain effects are incorporated directly into the Xi equation
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
    but not in the algebraic approximation.  Further work need to be
    done on this issue, particularly regarding the enhanced removal rate
    caused by flame compression.  Analysis using results of the spectral
    model will be required.

    For cases involving very lean Propane flames or other flames which are
    very strain-sensitive, a transport equation for the laminar flame
    speed is present.  This equation is derived using heuristic arguments
    involving the strain time scale and the strain-rate at extinction.
    the transport velocity is the same as that for the Xi equation.

    For large flames e.g. explosions additional modelling for the flame
    wrinkling due to surface instabilities may be applied.

    PDR (porosity/distributed resistance) modelling is included to handle
    regions containing blockages which cannot be resolved by the mesh.

61
    The fields used by this solver are:
62
63
64
65
66
67
68
    \plaintable
    betav  | Volume porosity
    Lobs   | Average diameter of obstacle in cell (m)
    Aw     | Obstacle surface area per unit volume (1/m)
    CR     | Drag tensor (1/m)
    CT     | Turbulence generation parameter (1/m)
    Nv     | Number of obstacles in cell per unit volume (m^-2)
69
    nsv    | Tensor whose diagonal indicates the number to subtract from
70
71
72
           | Nv to get the number of obstacles crossing the flow in each
           | direction.
    \endplaintable
73

74
75
76
\*---------------------------------------------------------------------------*/

#include "fvCFD.H"
Henry's avatar
Henry committed
77
#include "psiuReactionThermo.H"
78
#include "turbulentFluidThermoModel.H"
79
80
81
82
83
#include "laminarFlameSpeed.H"
#include "XiModel.H"
#include "PDRDragModel.H"
#include "ignition.H"
#include "bound.H"
andy's avatar
andy committed
84
#include "pimpleControl.H"
85
#include "fvOptions.H"
86
87
88
89
90

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
91
92
93
94
95
96
    argList::addNote
    (
        "Solver for compressible premixed/partially-premixed combustion with"
        " turbulence modelling."
    );

97
    #include "postProcess.H"
98

99
    #include "addCheckCaseOptions.H"
100
    #include "setRootCaseLists.H"
101
102
    #include "createTime.H"
    #include "createMesh.H"
103
    #include "createControl.H"
104
    #include "readCombustionProperties.H"
105
    #include "readGravitationalAcceleration.H"
106
    #include "createFields.H"
107
    #include "createFieldRefs.H"
108
    #include "initContinuityErrs.H"
109
    #include "createTimeControls.H"
sergio's avatar
sergio committed
110
    #include "compressibleCourantNo.H"
111
    #include "setInitialDeltaT.H"
112

113
    turbulence->validate();
114
    scalar StCoNum = 0.0;
115

116
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118
119
120
121

    Info<< "\nStarting time loop\n" << endl;

    while (runTime.run())
    {
122
        #include "readTimeControls.H"
sergio's avatar
sergio committed
123
        #include "compressibleCourantNo.H"
124
        #include "setDeltaT.H"
125

126
        ++runTime;
127
128
        Info<< "\n\nTime = " << runTime.timeName() << endl;

129
        #include "rhoEqn.H"
130

andy's avatar
andy committed
131
        // --- Pressure-velocity PIMPLE corrector loop
132
        while (pimple.loop())
133
        {
andy's avatar
andy committed
134
            #include "UEqn.H"
135

136
137
            // --- Pressure corrector loop
            while (pimple.correct())
138
            {
andy's avatar
andy committed
139
140
                #include "bEqn.H"
                #include "ftEqn.H"
141
142
                #include "EauEqn.H"
                #include "EaEqn.H"
andy's avatar
andy committed
143
144
145

                if (!ign.ignited())
                {
146
                    thermo.heu() == thermo.he();
andy's avatar
andy committed
147
148
149
                }

                #include "pEqn.H"
150
151
            }

andy's avatar
andy committed
152
153
154
155
            if (pimple.turbCorr())
            {
                turbulence->correct();
            }
156
157
158
159
        }

        runTime.write();

160
        runTime.printExecutionTime(Info);
161
162
    }

163
    Info<< "End\n";
164

165
    return 0;
166
167
168
169
}


// ************************************************************************* //