initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / solvers / combustion / PDRFoam / XiModels / XiGModels / instabilityG / instabilityG.C
blob420ef951972e6874edb6b1d075e6678ddd5caece
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 \*---------------------------------------------------------------------------*/
27 #include "instabilityG.H"
28 #include "addToRunTimeSelectionTable.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 namespace Foam
34 namespace XiGModels
36     defineTypeNameAndDebug(instabilityG, 0);
37     addToRunTimeSelectionTable(XiGModel, instabilityG, dictionary);
42 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
44 Foam::XiGModels::instabilityG::instabilityG
46     const dictionary& XiGProperties,
47     const hhuCombustionThermo& thermo,
48     const compressible::RASModel& turbulence,
49     const volScalarField& Su
52     XiGModel(XiGProperties, thermo, turbulence, Su),
53     GIn(XiGModelCoeffs_.lookup("GIn")),
54     lambdaIn(XiGModelCoeffs_.lookup("lambdaIn")),
55     XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
59 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
61 Foam::XiGModels::instabilityG::~instabilityG()
65 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
67 Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::G() const
69     volScalarField turbXiG = XiGModel_->G();
70     return GIn*GIn/(GIn + turbXiG) + turbXiG;
74 Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::Db() const
76     const objectRegistry& db = Su_.db();
77     const volScalarField& Xi = db.lookupObject<volScalarField>("Xi");
78     const volScalarField& rho = db.lookupObject<volScalarField>("rho");
79     const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
81     return XiGModel_->Db()
82         + rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn)/(mgb + 1.0/lambdaIn);
86 bool Foam::XiGModels::instabilityG::read(const dictionary& XiGProperties)
88     XiGModel::read(XiGProperties);
90     XiGModelCoeffs_.lookup("GIn") >> GIn;
91     XiGModelCoeffs_.lookup("lambdaIn") >> lambdaIn;
93     return true;
97 // ************************************************************************* //