Compare commits
No commits in common. "trunk" and "version-4.1" have entirely different histories.
trunk
...
version-4.
307 changed files with 782 additions and 381929 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -7,8 +7,6 @@
|
||||||
*.bak
|
*.bak
|
||||||
*.bak[0-9][0-9]
|
*.bak[0-9][0-9]
|
||||||
\#*\#
|
\#*\#
|
||||||
.*.swp
|
|
||||||
.*.swo
|
|
||||||
|
|
||||||
# File-browser settings - anywhere
|
# File-browser settings - anywhere
|
||||||
.directory
|
.directory
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
before_script:
|
|
||||||
- "[[ -d ../ThirdParty-4.x ]] || git clone https://github.com/OpenFOAM/ThirdParty-4.x.git ../ThirdParty-4.x"
|
|
||||||
- source etc/bashrc
|
|
||||||
- rm -rf platforms
|
|
||||||
- wclean all
|
|
||||||
|
|
||||||
allmake:
|
|
||||||
script:
|
|
||||||
- ./Allwmake -j
|
|
||||||
4
COPYING
4
COPYING
|
|
@ -1,7 +1,7 @@
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
|
||||||
OpenFOAM is Copyright (C) 2011-2017 OpenFOAM Foundation
|
OpenFOAM(R) is Copyright (C) 2011 OpenFOAM Foundation
|
||||||
Contact: OpenFOAM Foundation, http://openfoam.org/contact
|
Contact: OpenFOAM Foundation (OpenFOAM.Foundation@gmail.com)
|
||||||
|
|
||||||
You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms
|
You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms
|
||||||
of GNU General Public License version 3, which is displayed below, or
|
of GNU General Public License version 3, which is displayed below, or
|
||||||
|
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "AMC.H"
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
//Amplitude Mapping Closure (from KIVA)
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::CMC::AMC(const scalarField& eta)
|
|
||||||
{
|
|
||||||
tmp<scalarField> tRes(new scalarField(eta.size(), 0.0));
|
|
||||||
|
|
||||||
scalarField& Res = tRes.ref();
|
|
||||||
|
|
||||||
for(label i=0 ; i<eta.size() ; i++)
|
|
||||||
{
|
|
||||||
Res[i] = AMC(eta[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tRes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,74 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Function
|
|
||||||
Foam::CMC::AMC
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
AMC.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef AMC_H
|
|
||||||
#define AMC_H
|
|
||||||
|
|
||||||
#include "tmp.H"
|
|
||||||
#include "scalarField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace CMC
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Function AMC Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
const scalar pi = 3.141592;
|
|
||||||
|
|
||||||
const scalar spi = Foam::sqrt(pi);
|
|
||||||
|
|
||||||
//Amplitude Mapping Closure (from KIVA)
|
|
||||||
tmp<scalarField> AMC(const scalarField& eta);
|
|
||||||
|
|
||||||
|
|
||||||
//Amplitude Mapping Closure (from KIVA)
|
|
||||||
//Define exp(-2*(erf^-1(2*eta - 1))^2)
|
|
||||||
inline scalar AMC(const scalar eta);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace CMC
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "AMCI.H"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
//Amplitude Mapping Closure (from KIVA)
|
|
||||||
//Define exp(-2*(erf^-1(2*eta - 1))^2)
|
|
||||||
inline Foam::scalar Foam::CMC::AMC(const scalar eta)
|
|
||||||
{
|
|
||||||
const scalar a0 = (2.0*eta - 1.0);
|
|
||||||
scalar a1 = 0.5;
|
|
||||||
scalar slope;
|
|
||||||
scalar da = GREAT;
|
|
||||||
|
|
||||||
while(mag(da) > SMALL)
|
|
||||||
{
|
|
||||||
slope = (2.0/spi)*Foam::exp(-1.0*Foam::pow(a1,2.0));
|
|
||||||
da = (a0 - Foam::erf(a1))/slope;
|
|
||||||
a1 = a1 + da;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Foam::exp(-2.0*Foam::pow(a1,2.0));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,120 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "BetaFunction.H"
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// const scalar Foam::CMC::BetaFunction::staticData();
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::CMC::BetaFunction::_setParameters()
|
|
||||||
{
|
|
||||||
scalar gamma = mf_*(1.0 - mf_)/(mfVar_ + SMALL) - 1.0;
|
|
||||||
|
|
||||||
if (gamma < SMALL || (mfVar_)/(mf_*(1 - mf_) + SMALL) < 0.001)
|
|
||||||
{
|
|
||||||
fdelta_ = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
a_ = max(mf_*gamma, 0.0);
|
|
||||||
b_ = max((1.0 - mf_)*gamma, 0.0);
|
|
||||||
|
|
||||||
if(a_ < 1.0)
|
|
||||||
{
|
|
||||||
delta0_ = true;
|
|
||||||
}
|
|
||||||
if(b_ < 1.0)
|
|
||||||
{
|
|
||||||
delta1_ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_limitAB();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::CMC::BetaFunction::_limitAB()
|
|
||||||
{
|
|
||||||
scalar fmax = 1.0/(1.0 + (b_ - 1.0)/(a_ - 1.0));
|
|
||||||
|
|
||||||
if(a_ > 500.0)
|
|
||||||
{
|
|
||||||
a_ = 500.0;
|
|
||||||
b_ = (a_ - 1.0 - fmax*(a_ - 2.0))/fmax;
|
|
||||||
}
|
|
||||||
else if(b_ > 500.0)
|
|
||||||
{
|
|
||||||
b_ = 500.0;
|
|
||||||
a_ = (1.0 + fmax*(b_ - 2.0))/(1.0 - fmax);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::CMC::BetaFunction::BetaFunction(const scalar mf, const scalar mfVar)
|
|
||||||
:
|
|
||||||
mf_(mf),
|
|
||||||
mfVar_(mfVar),
|
|
||||||
a_(0.0),
|
|
||||||
b_(0.0),
|
|
||||||
fdelta_(false),
|
|
||||||
delta0_(false),
|
|
||||||
delta1_(false)
|
|
||||||
{
|
|
||||||
_setParameters();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::CMC::BetaFunction::~BetaFunction()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,199 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::BetaFunction
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
BetaFunctionI.H
|
|
||||||
BetaFunction.C
|
|
||||||
BetaFunctionIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef BetaFunction_H
|
|
||||||
#define BetaFunction_H
|
|
||||||
|
|
||||||
#include "scalar.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
#include "scalarField.H"
|
|
||||||
#include "tmp.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
namespace CMC
|
|
||||||
{
|
|
||||||
class BetaFunction;
|
|
||||||
}
|
|
||||||
Istream& operator>>(Istream&, CMC::BetaFunction&);
|
|
||||||
Ostream& operator<<(Ostream&, const CMC::BetaFunction&);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class BetaFunction Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
namespace CMC
|
|
||||||
{
|
|
||||||
|
|
||||||
class BetaFunction
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Mean mixture fraction
|
|
||||||
scalar mf_;
|
|
||||||
|
|
||||||
//- Mixture fraction variance
|
|
||||||
scalar mfVar_;
|
|
||||||
|
|
||||||
//- Beta pdf parameter alpha
|
|
||||||
scalar a_;
|
|
||||||
|
|
||||||
//- Beta pdf parameter beta
|
|
||||||
scalar b_;
|
|
||||||
|
|
||||||
//- Flag beta pdf special case: forced-delta function
|
|
||||||
Switch fdelta_;
|
|
||||||
|
|
||||||
//- delta function at pure oxidizer stream
|
|
||||||
Switch delta0_;
|
|
||||||
|
|
||||||
//- delta function at pure fuel stream
|
|
||||||
Switch delta1_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Calculate alpha and beta and set special case flags
|
|
||||||
void _setParameters();
|
|
||||||
|
|
||||||
//- Limit too large value of beta pdf parameters
|
|
||||||
void _limitAB();
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
// BetaFunction(const BetaFunction&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
// void operator=(const BetaFunction&);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Static data members
|
|
||||||
|
|
||||||
//- Static data staticData
|
|
||||||
// static const scalar staticData;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
BetaFunction(const scalar mf, const scalar mfVar);
|
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
BetaFunction(Istream&);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
// BetaFunction(const BetaFunction&);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~BetaFunction();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
tmp<scalarField> etaFunc(const UList<scalar>& eta) const
|
|
||||||
{
|
|
||||||
return pow(eta, a_-1.0)*pow(1.0-eta, b_-1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
scalar etaFunc(const scalar eta) const
|
|
||||||
{
|
|
||||||
return Foam::pow(eta, a_-1.0)*Foam::pow(1.0-eta, b_-1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
Switch fdelta() const {return fdelta_;}
|
|
||||||
|
|
||||||
Switch delta0() const {return delta0_;}
|
|
||||||
|
|
||||||
Switch delta1() const {return delta1_;}
|
|
||||||
|
|
||||||
scalar mf() const {return mf_;}
|
|
||||||
|
|
||||||
scalar mfVar() const {return mfVar_;}
|
|
||||||
|
|
||||||
scalar alpha() const {return a_;}
|
|
||||||
|
|
||||||
scalar beta() const {return b_;}
|
|
||||||
|
|
||||||
// Check
|
|
||||||
|
|
||||||
// Edit
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
// void operator=(const BetaFunction&);
|
|
||||||
|
|
||||||
|
|
||||||
// Friend Functions
|
|
||||||
|
|
||||||
// Friend Operators
|
|
||||||
|
|
||||||
// IOstream Operators
|
|
||||||
|
|
||||||
friend Istream& ::Foam::operator>>(Istream&, BetaFunction&);
|
|
||||||
friend Ostream& ::Foam::operator<<(Ostream&, const BetaFunction&);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace CMC
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "BetaFunctionI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "BetaFunction.H"
|
|
||||||
#include "IOstreams.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::CMC::BetaFunction::BetaFunction(Istream& is)
|
|
||||||
{
|
|
||||||
// Check state of Istream
|
|
||||||
is.check("Foam::CMC::BetaFunction::BetaFunction(Foam::Istream&)");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::Istream& Foam::operator>>(Istream& is, CMC::BetaFunction&)
|
|
||||||
{
|
|
||||||
// Check state of Istream
|
|
||||||
is.check
|
|
||||||
(
|
|
||||||
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::CMC::BetaFunction&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
return is;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const CMC::BetaFunction&)
|
|
||||||
{
|
|
||||||
// Check state of Ostream
|
|
||||||
os.check
|
|
||||||
(
|
|
||||||
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
|
|
||||||
"const Foam::CMC::BetaFunction&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "BetaGrid.H"
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "SubList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// const scalar Foam::CMC::BetaGrid::staticData();
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::CMC::BetaGrid::BetaGrid(const dictionary& dict)
|
|
||||||
:
|
|
||||||
etaCut_(dict.lookup("detailedEta")),
|
|
||||||
nSpacings_(dict.lookup("detailedN")),
|
|
||||||
etaSpace_(sum(nSpacings_)+3)
|
|
||||||
{
|
|
||||||
// Check for input list size
|
|
||||||
if (etaCut_.size() != nSpacings_.size() + 1)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Number of grid interval points does not match number of grid sizes"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for evenness of number of spacings in each interval
|
|
||||||
forAll (nSpacings_, i)
|
|
||||||
{
|
|
||||||
if ((nSpacings_[i] % 2) == 1)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Number of spacings in intervals should be even"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(nSpacings_, i)
|
|
||||||
{
|
|
||||||
const label ns = nSpacings_[i];
|
|
||||||
const labelList::subList prev(nSpacings_, i);
|
|
||||||
const label baseI = sum(prev) + 1;
|
|
||||||
|
|
||||||
const scalar low = etaCut_[i];
|
|
||||||
const scalar upp = etaCut_[i+1];
|
|
||||||
const scalar delta = (upp - low) / scalar(ns);
|
|
||||||
|
|
||||||
for (label j = 0; j < ns; j++)
|
|
||||||
{
|
|
||||||
etaSpace_[baseI+j] = low + delta * j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
etaSpace_[0] = 0.0;
|
|
||||||
etaSpace_[etaSpace_.size()-2] = etaCut_.last();
|
|
||||||
etaSpace_[etaSpace_.size()-1] = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::CMC::BetaGrid::BetaGrid(const BetaGrid&)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::CMC::BetaGrid::~BetaGrid()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::CMC::BetaGrid::operator=(const BetaGrid& rhs)
|
|
||||||
{
|
|
||||||
// Check for assignment to self
|
|
||||||
if (this == &rhs)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Attempted assignment to self"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,161 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::BetaGrid
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
BetaGridI.H
|
|
||||||
BetaGrid.C
|
|
||||||
BetaGridIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef BetaGrid_H
|
|
||||||
#define BetaGrid_H
|
|
||||||
|
|
||||||
#include "scalarField.H"
|
|
||||||
#include "labelList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
namespace CMC
|
|
||||||
{
|
|
||||||
class BetaGrid;
|
|
||||||
}
|
|
||||||
class dictionary;
|
|
||||||
|
|
||||||
Istream& operator>>(Istream&, CMC::BetaGrid&);
|
|
||||||
Ostream& operator<<(Ostream&, const CMC::BetaGrid&);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class BetaGrid Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
namespace CMC
|
|
||||||
{
|
|
||||||
|
|
||||||
class BetaGrid
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Piecewise uniform interval points
|
|
||||||
scalarField etaCut_;
|
|
||||||
|
|
||||||
//- Sizes of piecewise uniform intervals
|
|
||||||
labelList nSpacings_;
|
|
||||||
|
|
||||||
//- Mixture fraction eta grid points
|
|
||||||
scalarField etaSpace_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
BetaGrid(const BetaGrid&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const BetaGrid&);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Static data members
|
|
||||||
|
|
||||||
//- Static data staticData
|
|
||||||
// static const scalar staticData;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
BetaGrid(const dictionary& dict);
|
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
BetaGrid(Istream&);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
// BetaGrid(const BetaGrid&);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~BetaGrid();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
const labelList& N() const {return nSpacings_;}
|
|
||||||
|
|
||||||
const scalarField& etaCut() const {return etaCut_;}
|
|
||||||
|
|
||||||
const scalarField& etaSpace() const {return etaSpace_;}
|
|
||||||
|
|
||||||
// Check
|
|
||||||
|
|
||||||
// Edit
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
// void operator=(const BetaGrid&);
|
|
||||||
|
|
||||||
|
|
||||||
// Friend Functions
|
|
||||||
|
|
||||||
// Friend Operators
|
|
||||||
|
|
||||||
// IOstream Operators
|
|
||||||
|
|
||||||
friend Istream& ::Foam::operator>>(Istream&, BetaGrid&);
|
|
||||||
friend Ostream& ::Foam::operator<<(Ostream&, const BetaGrid&);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace CMC
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "BetaGridI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "BetaGrid.H"
|
|
||||||
#include "IOstreams.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::CMC::BetaGrid::BetaGrid(Istream& is)
|
|
||||||
{
|
|
||||||
// Check state of Istream
|
|
||||||
is.check("Foam::CMC::BetaGrid::BetaGrid(Foam::Istream&)");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::Istream& Foam::operator>>(Istream& is, CMC::BetaGrid&)
|
|
||||||
{
|
|
||||||
// Check state of Istream
|
|
||||||
is.check
|
|
||||||
(
|
|
||||||
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::CMC::BetaGrid&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
return is;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const CMC::BetaGrid&)
|
|
||||||
{
|
|
||||||
// Check state of Ostream
|
|
||||||
os.check
|
|
||||||
(
|
|
||||||
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
|
|
||||||
"const Foam::CMC::BetaGrid&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,180 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "BetaIntegrator.H"
|
|
||||||
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "SubList.H"
|
|
||||||
#include "SubField.H"
|
|
||||||
#include "interpolateXY.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// const scalar Foam::CMC::BetaIntegrator::staticData();
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
//extended Simpson's rule (Numerical recipes, 2nd Ed. p.128)
|
|
||||||
//for equally spaced and even N intervals (or odd N+1 points)
|
|
||||||
Foam::scalar Foam::CMC::BetaIntegrator::simps
|
|
||||||
(const scalar xl, const scalar xh, const label n, const UList<scalar>& fx)
|
|
||||||
const
|
|
||||||
{
|
|
||||||
scalar evensum(0.0), oddsum(0.0), sum(0.0);
|
|
||||||
|
|
||||||
scalar h = (xh - xl)/scalar(n);
|
|
||||||
|
|
||||||
for(label i=0 ; i<fx.size() ; i++)
|
|
||||||
{
|
|
||||||
if(i%2 == 0)
|
|
||||||
{
|
|
||||||
evensum += fx[i];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
oddsum += fx[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sum = -1.0*fx.first() + 2.0*evensum + 4.0*oddsum - 1.0*fx.last();
|
|
||||||
|
|
||||||
return sum*(h/3.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::CMC::BetaIntegrator::sumSimps(const UList<scalar>& f) const
|
|
||||||
{
|
|
||||||
scalar total = 0.0;
|
|
||||||
|
|
||||||
const labelList &N(bg_.N());
|
|
||||||
const scalarField &etaCut(bg_.etaCut());
|
|
||||||
|
|
||||||
forAll(N, i)
|
|
||||||
{
|
|
||||||
const labelList::subList prev(N, i);
|
|
||||||
const label baseI = sum(prev) + 1;
|
|
||||||
|
|
||||||
const scalarField::subField subInterval(f, N[i]+1, baseI);
|
|
||||||
|
|
||||||
total += simps(etaCut[i], etaCut[i+1], N[i], subInterval);
|
|
||||||
}
|
|
||||||
|
|
||||||
return total;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::CMC::BetaIntegrator::BetaIntegrator(const BetaFunction& bf, const BetaGrid &bg)
|
|
||||||
:
|
|
||||||
etaSpace_(bg.etaSpace()),
|
|
||||||
pdfNum_(bg.etaSpace().size(), 0.0),
|
|
||||||
pdfDen_(0.0),
|
|
||||||
bf_(bf),
|
|
||||||
bg_(bg)
|
|
||||||
{
|
|
||||||
const scalarField::subField domain(etaSpace_, etaSpace_.size()-2, 1);
|
|
||||||
scalarField::subField range(pdfNum_, etaSpace_.size()-2, 1);
|
|
||||||
|
|
||||||
if (bf_.fdelta())
|
|
||||||
{
|
|
||||||
pdfDen_ = 1.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
range = bf_.etaFunc(domain);
|
|
||||||
|
|
||||||
if (!bf_.delta0())
|
|
||||||
{
|
|
||||||
pdfNum_.first() = bf_.etaFunc(etaSpace_.first());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bf_.delta1())
|
|
||||||
{
|
|
||||||
pdfNum_.last() = bf_.etaFunc(etaSpace_.last());
|
|
||||||
}
|
|
||||||
|
|
||||||
pdfDen_ = sumSimps(pdfNum_)
|
|
||||||
+ Foam::pow(etaSpace_[1], bf_.alpha())/(bf_.alpha() + SMALL)
|
|
||||||
+ Foam::pow(etaSpace_[1], bf_.beta())/(bf_.beta() + SMALL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::CMC::BetaIntegrator::~BetaIntegrator()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// beta-pdf weighted integration for given mf, mfVar and f
|
|
||||||
Foam::scalar Foam::CMC::BetaIntegrator::betaIntegrate(const scalarField& f) const
|
|
||||||
{
|
|
||||||
scalar result = 0.0;
|
|
||||||
|
|
||||||
if(bf_.fdelta())
|
|
||||||
{
|
|
||||||
result = interpolateXY(bf_.mf(), etaSpace_, f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar num = sumSimps (f * pdfNum_)
|
|
||||||
+ f.first()*Foam::pow(etaSpace_[1], bf_.alpha())/(bf_.alpha() + SMALL)
|
|
||||||
+ f.last()*Foam::pow(etaSpace_[1], bf_.beta())/(bf_.beta() + SMALL);
|
|
||||||
result = num/pdfDen_;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::CMC::BetaIntegrator::operator=(const BetaIntegrator& rhs)
|
|
||||||
{
|
|
||||||
// Check for assignment to self
|
|
||||||
if (this == &rhs)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Attempted assignment to self"
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,168 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::CMC::BetaIntegrator
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
BetaIntegratorI.H
|
|
||||||
BetaIntegrator.C
|
|
||||||
BetaIntegratorIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef BetaIntegrator_H
|
|
||||||
#define BetaIntegrator_H
|
|
||||||
|
|
||||||
#include "scalarField.H"
|
|
||||||
#include "BetaFunction.H"
|
|
||||||
#include "BetaGrid.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
namespace CMC
|
|
||||||
{
|
|
||||||
class BetaIntegrator;
|
|
||||||
}
|
|
||||||
Istream& operator>>(Istream&, CMC::BetaIntegrator&);
|
|
||||||
Ostream& operator<<(Ostream&, const CMC::BetaIntegrator&);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class BetaIntegrator Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
namespace CMC
|
|
||||||
{
|
|
||||||
|
|
||||||
class BetaIntegrator
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Quadrature points
|
|
||||||
const scalarField &etaSpace_;
|
|
||||||
|
|
||||||
//- Beta pdf numerators
|
|
||||||
scalarField pdfNum_;
|
|
||||||
|
|
||||||
//- Beta pdf denominator
|
|
||||||
scalar pdfDen_;
|
|
||||||
|
|
||||||
//- Description of data_
|
|
||||||
BetaFunction bf_;
|
|
||||||
|
|
||||||
//- Description of data_
|
|
||||||
const BetaGrid &bg_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Calculate integral using Simpson's rule
|
|
||||||
scalar simps(const scalar xl, const scalar xh, const label n, const UList<scalar>& fx) const;
|
|
||||||
|
|
||||||
//- Calculate integral using Simpson's rule
|
|
||||||
scalar sumSimps(const UList<scalar>& f) const;
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
BetaIntegrator(const BetaIntegrator&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
void operator=(const BetaIntegrator&);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Static data members
|
|
||||||
|
|
||||||
//- Static data staticData
|
|
||||||
// static const scalar staticData;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
BetaIntegrator(const BetaFunction& bf, const BetaGrid &bg);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
// BetaIntegrator(const BetaIntegrator&);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~BetaIntegrator();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
scalar betaIntegrate(const scalarField& f) const;
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
scalar pdfDen () const {return pdfDen_;}
|
|
||||||
|
|
||||||
// Check
|
|
||||||
|
|
||||||
// Edit
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
// void operator=(const BetaIntegrator&);
|
|
||||||
|
|
||||||
|
|
||||||
// Friend Functions
|
|
||||||
|
|
||||||
// Friend Operators
|
|
||||||
|
|
||||||
// IOstream Operators
|
|
||||||
|
|
||||||
friend Istream& ::Foam::operator>>(Istream&, BetaIntegrator&);
|
|
||||||
friend Ostream& ::Foam::operator<<(Ostream&, const BetaIntegrator&);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace CMC
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "BetaIntegratorI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "BetaIntegrator.H"
|
|
||||||
#include "IOstreams.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::Istream& Foam::operator>>(Istream& is, CMC::BetaIntegrator&)
|
|
||||||
{
|
|
||||||
// Check state of Istream
|
|
||||||
is.check
|
|
||||||
(
|
|
||||||
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::CMC::BetaIntegrator&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
return is;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const CMC::BetaIntegrator&)
|
|
||||||
{
|
|
||||||
// Check state of Ostream
|
|
||||||
os.check
|
|
||||||
(
|
|
||||||
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
|
|
||||||
"const Foam::CMC::BetaIntegrator&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,206 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "FlameStructure.H"
|
|
||||||
|
|
||||||
#include "fileName.H"
|
|
||||||
#include "IFstream.H"
|
|
||||||
#include "hashedWordList.H"
|
|
||||||
#include "interpolateXY.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::SLFM::FlameStructure::FlameStructure(const string& NstDir, scalarList NstList, const scalarField &etaGrid, const hashedWordList &spTable)
|
|
||||||
:
|
|
||||||
NstDir_(NstDir),
|
|
||||||
NstList_(NstList),
|
|
||||||
eta_(etaGrid),
|
|
||||||
species_(spTable),
|
|
||||||
Y_(spTable.size(), scalarFieldArray1d(NstList_.size(), scalarField(eta_.size(), 0.0))),
|
|
||||||
W_(spTable.size(), scalarFieldArray1d(NstList_.size(), scalarField(eta_.size(), 0.0))),
|
|
||||||
T_(NstList_.size(), scalarField(eta_.size(), 0.0)),
|
|
||||||
Q_(NstList_.size(), scalarField(eta_.size(), 0.0)),
|
|
||||||
h_(NstList_.size(), scalarField(eta_.size(), 0.0)),
|
|
||||||
rho_(NstList_.size(), scalarField(eta_.size(), 0.0)),
|
|
||||||
Rgas_(NstList_.size(), scalarField(eta_.size(), 0.0))
|
|
||||||
{
|
|
||||||
for (label n = 0; n < NstList_.size(); n++)
|
|
||||||
{
|
|
||||||
scalar N = NstList_[n];
|
|
||||||
|
|
||||||
fileName fname = "sdr"+Foam::name(N)+".inp";
|
|
||||||
IFstream fin(NstDir_/fname);
|
|
||||||
|
|
||||||
string gbg;
|
|
||||||
label etamax_SLFM, NoSpecies;
|
|
||||||
|
|
||||||
//INPUT FILE...
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//No.GRID...
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//Number of eta-point and species
|
|
||||||
fin >> etamax_SLFM >> NoSpecies;
|
|
||||||
|
|
||||||
//blank line
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//PRESSURE...
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//1.00...
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//MIXTURE...
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//read eta space (from SLFM library)
|
|
||||||
scalarField etaValue_SLFM(etamax_SLFM, 0.0);
|
|
||||||
for(label j = 0 ; j < etamax_SLFM ; j++)
|
|
||||||
{
|
|
||||||
fin>>etaValue_SLFM[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
//blank line
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//INITIAL...
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//species loop
|
|
||||||
scalarField temp(etamax_SLFM, 0.0);
|
|
||||||
for(label i = 0 ; i < NoSpecies ; i++)
|
|
||||||
{
|
|
||||||
word spName;
|
|
||||||
//H2... (species name)
|
|
||||||
fin >> spName;
|
|
||||||
const label spI (species_[spName]);
|
|
||||||
|
|
||||||
// Info << spI << spName << endl;
|
|
||||||
|
|
||||||
//read species mass fraction (from SLFM library)
|
|
||||||
for(label j=0 ; j<etamax_SLFM ; j++)
|
|
||||||
{
|
|
||||||
scalar Yj = 0.0;
|
|
||||||
fin >> Yj;
|
|
||||||
temp[j] = max(0.0, Yj);
|
|
||||||
}
|
|
||||||
|
|
||||||
Y_[spI][n] = interpolateXY(etaGrid, etaValue_SLFM, temp);
|
|
||||||
|
|
||||||
//read reaction rate (from SLFM library)
|
|
||||||
for(label j = 0 ; j < etamax_SLFM ; j++)
|
|
||||||
{
|
|
||||||
fin>>temp[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
W_[spI][n] = interpolateXY(etaGrid, etaValue_SLFM, temp);
|
|
||||||
|
|
||||||
//blank line
|
|
||||||
fin.getLine(gbg);
|
|
||||||
}
|
|
||||||
|
|
||||||
//read temperature
|
|
||||||
{
|
|
||||||
//H2... (species name)
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//read temperature
|
|
||||||
for(label j = 0 ; j < etamax_SLFM ; j++)
|
|
||||||
{
|
|
||||||
scalar Yj = 0.0;
|
|
||||||
fin >> Yj;
|
|
||||||
temp[j] = max(0.0, Yj);
|
|
||||||
}
|
|
||||||
|
|
||||||
T_[n] = interpolateXY(etaGrid, etaValue_SLFM, temp);
|
|
||||||
|
|
||||||
//read heat source
|
|
||||||
for(label j = 0 ; j < etamax_SLFM ; j++)
|
|
||||||
{
|
|
||||||
fin>>temp[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_[n] = interpolateXY(etaGrid, etaValue_SLFM, temp);
|
|
||||||
|
|
||||||
//blank line
|
|
||||||
fin.getLine(gbg);
|
|
||||||
}
|
|
||||||
|
|
||||||
//DENSITY...
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//read density (from SLFM library)
|
|
||||||
for(label j = 0 ; j < etamax_SLFM ; j++)
|
|
||||||
{
|
|
||||||
fin>>temp[j];
|
|
||||||
}
|
|
||||||
//Info<<rho_temp<<endl;
|
|
||||||
|
|
||||||
rho_[n] = interpolateXY(etaGrid, etaValue_SLFM, temp);
|
|
||||||
|
|
||||||
//blank line
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//ENTHALPY...
|
|
||||||
fin.getLine(gbg);
|
|
||||||
|
|
||||||
//read enthalpy (from SLFM library)
|
|
||||||
for(label j = 0 ; j < etamax_SLFM ; j++)
|
|
||||||
{
|
|
||||||
fin>>temp[j];
|
|
||||||
}
|
|
||||||
|
|
||||||
h_[n] = interpolateXY(etaGrid, etaValue_SLFM, temp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::SLFM::FlameStructure::~FlameStructure()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,215 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::SLFM::FlameStructure
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
FlameStructureI.H
|
|
||||||
FlameStructure.C
|
|
||||||
FlameStructureIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef FlameStructure_H
|
|
||||||
#define FlameStructure_H
|
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
#include "scalarField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
class hashedWordList;
|
|
||||||
|
|
||||||
namespace SLFM
|
|
||||||
{
|
|
||||||
class FlameStructure;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
Istream& operator>>(Istream&, SLFM::FlameStructure&);
|
|
||||||
Ostream& operator<<(Ostream&, const SLFM::FlameStructure&);
|
|
||||||
|
|
||||||
namespace SLFM
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class FlameStructure Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class FlameStructure
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
typedef List<scalarField> scalarFieldArray1d;
|
|
||||||
|
|
||||||
typedef List<scalarFieldArray1d> scalarFieldArray2d;
|
|
||||||
|
|
||||||
typedef List<scalarFieldArray2d> scalarFieldArray3d;
|
|
||||||
|
|
||||||
//- Species mass fraction
|
|
||||||
word NstDir_;
|
|
||||||
|
|
||||||
//- Species mass fraction
|
|
||||||
const scalarList NstList_;
|
|
||||||
|
|
||||||
//- Species mass fraction
|
|
||||||
const scalarField eta_;
|
|
||||||
|
|
||||||
//- Species mass fraction
|
|
||||||
const hashedWordList &species_;
|
|
||||||
|
|
||||||
//- Species mass fraction
|
|
||||||
scalarFieldArray2d Y_;
|
|
||||||
|
|
||||||
//- Species production rate
|
|
||||||
scalarFieldArray2d W_;
|
|
||||||
|
|
||||||
//- Temperature
|
|
||||||
scalarFieldArray1d T_;
|
|
||||||
|
|
||||||
//- Heat source
|
|
||||||
scalarFieldArray1d Q_;
|
|
||||||
|
|
||||||
//- Enthalpy
|
|
||||||
scalarFieldArray1d h_;
|
|
||||||
|
|
||||||
//- Density
|
|
||||||
scalarFieldArray1d rho_;
|
|
||||||
|
|
||||||
//- Specific gas constant for mean W
|
|
||||||
scalarFieldArray1d Rgas_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow Construct null
|
|
||||||
FlameStructure();
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
|
||||||
// FlameStructure(const FlameStructure&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
|
||||||
// void operator=(const FlameStructure&);
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Static data members
|
|
||||||
|
|
||||||
//- Static data staticData
|
|
||||||
// static const dataType staticData;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
FlameStructure(const string& NstDir, scalarList NstList, const scalarField &etaGrid, const hashedWordList& spTable);
|
|
||||||
|
|
||||||
//- Construct from Istream
|
|
||||||
// FlameStructure(Istream&);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
// FlameStructure(const FlameStructure&);
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
//- Select null constructed
|
|
||||||
// static autoPtr<FlameStructure> New();
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
~FlameStructure();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Select null constructed
|
|
||||||
scalarFieldArray2d& Y() {return Y_;}
|
|
||||||
|
|
||||||
//- Select null constructed
|
|
||||||
scalarFieldArray2d& W() {return W_;}
|
|
||||||
|
|
||||||
//- Select null constructed
|
|
||||||
scalarFieldArray1d& T() {return T_;}
|
|
||||||
|
|
||||||
//- Select null constructed
|
|
||||||
scalarFieldArray1d& Q() {return Q_;}
|
|
||||||
|
|
||||||
//- Select null constructed
|
|
||||||
scalarFieldArray1d& rho() {return rho_;}
|
|
||||||
|
|
||||||
//- Select null constructed
|
|
||||||
scalarFieldArray1d& h() {return h_;}
|
|
||||||
|
|
||||||
//- Select null constructed
|
|
||||||
scalarFieldArray1d& Rgas() {return Rgas_;}
|
|
||||||
|
|
||||||
// Check
|
|
||||||
|
|
||||||
// Edit
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
// void operator=(const FlameStructure&);
|
|
||||||
|
|
||||||
|
|
||||||
// Friend Functions
|
|
||||||
|
|
||||||
// Friend Operators
|
|
||||||
|
|
||||||
// IOstream Operators
|
|
||||||
|
|
||||||
friend Istream& operator>>(Istream&, FlameStructure&);
|
|
||||||
friend Ostream& operator<<(Ostream&, const FlameStructure&);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace SLFM
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "FlameStructureI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "FlameStructure.H"
|
|
||||||
#include "IOstreams.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
/*
|
|
||||||
Foam::SLFM::FlameStructure::FlameStructure(Istream& is)
|
|
||||||
:
|
|
||||||
base1(is),
|
|
||||||
base2(is),
|
|
||||||
member1(is),
|
|
||||||
member2(is)
|
|
||||||
{
|
|
||||||
// Check state of Istream
|
|
||||||
is.check("Foam::SLFM::FlameStructure::FlameStructure(Foam::Istream&)");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::Istream& Foam::operator>>(Istream& is, SLFM::FlameStructure&)
|
|
||||||
{
|
|
||||||
// Check state of Istream
|
|
||||||
is.check
|
|
||||||
(
|
|
||||||
"Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::SLFM::FlameStructure&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
return is;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const SLFM::FlameStructure&)
|
|
||||||
{
|
|
||||||
// Check state of Ostream
|
|
||||||
os.check
|
|
||||||
(
|
|
||||||
"Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
|
|
||||||
"const Foam::SLFM::FlameStructure&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
FlameStructure/FlameStructure.C
|
|
||||||
FlameStructure/FlameStructureIO.C
|
|
||||||
|
|
||||||
./AMC/AMC.C
|
|
||||||
|
|
||||||
./BetaFunction/BetaFunction.C
|
|
||||||
./BetaFunction/BetaFunctionIO.C
|
|
||||||
|
|
||||||
./BetaGrid/BetaGrid.C
|
|
||||||
./BetaGrid/BetaGridIO.C
|
|
||||||
|
|
||||||
./BetaIntegrator/BetaIntegrator.C
|
|
||||||
./BetaIntegrator/BetaIntegratorIO.C
|
|
||||||
|
|
||||||
SLFMFoam.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/SLFMFoam
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
EXE_INC = \
|
|
||||||
-I. \
|
|
||||||
-I./AMC \
|
|
||||||
-I./BetaFunction \
|
|
||||||
-I./BetaGrid \
|
|
||||||
-I./BetaIntegrator \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/ODE/lnInclude \
|
|
||||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/sampling/lnInclude
|
|
||||||
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools \
|
|
||||||
-lturbulenceModels \
|
|
||||||
-lcompressibleTurbulenceModels \
|
|
||||||
-lspecie \
|
|
||||||
-lcompressibleTransportModels \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lreactionThermophysicalModels \
|
|
||||||
-lchemistryModel \
|
|
||||||
-lODE \
|
|
||||||
-lcombustionModels \
|
|
||||||
-lfvOptions \
|
|
||||||
-lsampling
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
// mixture fraction equation
|
|
||||||
fvScalarMatrix mfEqn
|
|
||||||
(
|
|
||||||
fvm::div(phi, mf)
|
|
||||||
- fvm::laplacian((1/Sc)*turbulence->mut(), mf) //let 1/Sc = 1.47
|
|
||||||
);
|
|
||||||
|
|
||||||
mfEqn.relax();
|
|
||||||
|
|
||||||
mfEqn.solve();
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
//mixture fraction variance equation
|
|
||||||
//cf) mfVar should not be ZERO
|
|
||||||
SDR = turbulence->epsilon() * mfVar / turbulence->k();
|
|
||||||
volVectorField Gradmf = fvc::grad(mf);
|
|
||||||
|
|
||||||
fvScalarMatrix mfVarEqn
|
|
||||||
(
|
|
||||||
fvm::div(phi, mfVar)
|
|
||||||
- fvm::laplacian((1/Sc) * turbulence->mut(), mfVar)
|
|
||||||
==
|
|
||||||
2 * ((1/Sc) * turbulence->mut()) * (Gradmf & Gradmf)
|
|
||||||
- 2 * rho * SDR
|
|
||||||
);
|
|
||||||
|
|
||||||
mfVarEqn.relax();
|
|
||||||
|
|
||||||
mfVarEqn.solve();
|
|
||||||
|
|
@ -1,118 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
SLFMFoam
|
|
||||||
|
|
||||||
Description
|
|
||||||
Steady Laminar Flamelet Model(SLFM) solver for turbulent combustion. SLFM
|
|
||||||
assumes a turbulent flame composed of thin stretched laminar flamelets.
|
|
||||||
Each flamelet library is generated by external program and imported by
|
|
||||||
the solver.
|
|
||||||
|
|
||||||
References
|
|
||||||
A.Y. Klimenko, R.W. Bilger, Progress in Energy and Combustion Science 25 (1999) 595-687
|
|
||||||
N. Peters, Turbulent Combustion, Cambridge University Press (2000)
|
|
||||||
|
|
||||||
Contact
|
|
||||||
POSTECH combustion lab.
|
|
||||||
huh@postech.ac.kr
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "turbulentFluidThermoModel.H"
|
|
||||||
#include "rhoCombustionModel.H"
|
|
||||||
#include "fvOptions.H"
|
|
||||||
#include "simpleControl.H"
|
|
||||||
#include "FlameStructure/FlameStructure.H"
|
|
||||||
#include "interpolateXY.H"
|
|
||||||
|
|
||||||
#include "AMC.H"
|
|
||||||
#include "BetaFunction.H"
|
|
||||||
#include "BetaGrid.H"
|
|
||||||
#include "BetaIntegrator.H"
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
#include "postProcess.H"
|
|
||||||
|
|
||||||
#include "setRootCase.H"
|
|
||||||
#include "createTime.H"
|
|
||||||
#include "createMesh.H"
|
|
||||||
#include "createControl.H"
|
|
||||||
#include "createFields.H"
|
|
||||||
#include "createFieldRefs.H"
|
|
||||||
#include "createFvOptions.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
turbulence->validate();
|
|
||||||
|
|
||||||
//SLFM
|
|
||||||
Info<<"Read SLFM library"<<endl;
|
|
||||||
#include "readSLFMlib.H" //read SLFM library
|
|
||||||
|
|
||||||
Info<<"Construct Beta-PDF"<<endl;
|
|
||||||
#include "preIntegration.H" //AMC C1 coefficient pdf integration
|
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
|
||||||
|
|
||||||
while (simple.loop())
|
|
||||||
{
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
|
||||||
|
|
||||||
// --- Pressure-velocity SIMPLE corrector loop
|
|
||||||
{
|
|
||||||
#include "UEqn.H"
|
|
||||||
#include "Mixturefraction.H" //mean mixture fraction
|
|
||||||
#include "MixturefractionVar.H" //mean mixture fraction variance
|
|
||||||
#include "setSDR.H" //calculate scalar dissipation rate
|
|
||||||
#include "updateT_RHO.H" //update temperature and density
|
|
||||||
#include "pEqn.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
turbulence->correct();
|
|
||||||
|
|
||||||
if (runTime.write())
|
|
||||||
{
|
|
||||||
#include "updateYi.H" //update species
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
|
||||||
<< nl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
MRF.correctBoundaryVelocity(U);
|
|
||||||
|
|
||||||
tmp<fvVectorMatrix> tUEqn
|
|
||||||
(
|
|
||||||
fvm::div(phi, U)
|
|
||||||
+ MRF.DDt(rho, U)
|
|
||||||
+ turbulence->divDevRhoReff(U)
|
|
||||||
==
|
|
||||||
rho()*g
|
|
||||||
+ fvOptions(rho, U)
|
|
||||||
);
|
|
||||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
|
||||||
|
|
||||||
UEqn.relax();
|
|
||||||
|
|
||||||
fvOptions.constrain(UEqn);
|
|
||||||
|
|
||||||
solve(UEqn == -fvc::grad(p));
|
|
||||||
|
|
||||||
fvOptions.correct(U);
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
//const volScalarField& T = thermo.T();
|
|
||||||
|
|
@ -1,374 +0,0 @@
|
||||||
#include "readGravitationalAcceleration.H"
|
|
||||||
|
|
||||||
Info<< "Creating combustion model\n" << endl;
|
|
||||||
|
|
||||||
autoPtr<combustionModels::rhoCombustionModel> combustion
|
|
||||||
(
|
|
||||||
combustionModels::rhoCombustionModel::New(mesh)
|
|
||||||
);
|
|
||||||
|
|
||||||
rhoReactionThermo& thermo = combustion->thermo();
|
|
||||||
thermo.validate(args.executable(), "h", "e");
|
|
||||||
|
|
||||||
basicSpecieMixture& composition = thermo.composition();
|
|
||||||
PtrList<volScalarField>& Y = composition.Y();
|
|
||||||
|
|
||||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
|
||||||
|
|
||||||
if (!composition.contains(inertSpecie))
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
|
||||||
<< "species list. Available species:" << composition.species()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
|
||||||
volScalarField& T = thermo.T();
|
|
||||||
|
|
||||||
wordList rhoBoundaryTypes
|
|
||||||
(
|
|
||||||
T.boundaryField().size(),
|
|
||||||
zeroGradientFvPatchScalarField::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(composition.Y(inertSpecie).boundaryField(), patchi)
|
|
||||||
{
|
|
||||||
rhoBoundaryTypes[patchi]
|
|
||||||
= composition.Y(inertSpecie).boundaryField()[patchi].type();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
thermo.rho(),
|
|
||||||
rhoBoundaryTypes
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "\nReading field U\n" << endl;
|
|
||||||
volVectorField U
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
|
||||||
|
|
||||||
mesh.setFluxRequired(p.name());
|
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
|
||||||
(
|
|
||||||
dimensionedScalar::lookupOrDefault
|
|
||||||
(
|
|
||||||
"rhoMax",
|
|
||||||
simple.dict(),
|
|
||||||
dimDensity,
|
|
||||||
GREAT
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
dimensionedScalar::lookupOrDefault
|
|
||||||
(
|
|
||||||
"rhoMin",
|
|
||||||
simple.dict(),
|
|
||||||
dimDensity,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::turbulenceModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Set the turbulence into the combustion model
|
|
||||||
combustion->setTurbulence(turbulence());
|
|
||||||
|
|
||||||
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
fields.add(Y[i]);
|
|
||||||
}
|
|
||||||
fields.add(thermo.he());
|
|
||||||
|
|
||||||
|
|
||||||
// SLFM-related fields
|
|
||||||
|
|
||||||
Info<<"Creating field mf, mfVar, SDR\n"<<endl;
|
|
||||||
|
|
||||||
volScalarField mf //mixture fraction
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"mf",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField mfVar //mixture fraction variance
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"mfVar",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField SDR //scalar dissipation rate
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"SDR",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("SDR", dimEnergy/dimTime/dimEnergy, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField jlc //eta-index, lower
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"jlc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("jlc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField jhc //eta-index, higher
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"jhc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("jhc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField jfc //eta-factor
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"jfc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("jfc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField vlc //var-index, lower
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"vlc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("vlc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField vhc //var-index, higher
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"vhc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("vhc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField vfc //var-factor
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"vfc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("vfc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField nlc //sdr-index, lower
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"nlc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("nlc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField nhc //sdr-index, higher
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"nhc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("nhc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField nfc //sdr-factor
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"nfc",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("nfc", dimless, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
//SLFM property read
|
|
||||||
|
|
||||||
IOdictionary SLFMdict //SLFM properties dictionary
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"SLFMdict",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
const wordList postSpecieNames(SLFMdict.lookup("postSpecieNames"));
|
|
||||||
labelList postSpecieIndices(postSpecieNames.size(),-1);
|
|
||||||
forAll(postSpecieNames, i)
|
|
||||||
{
|
|
||||||
const word &spName (postSpecieNames[i]);
|
|
||||||
const label spI (composition.species()[spName]);
|
|
||||||
postSpecieIndices[i] = spI;
|
|
||||||
}
|
|
||||||
scalar stoiMF(readScalar(SLFMdict.lookup("stoiMF")));
|
|
||||||
scalar stretchFac(readScalar(SLFMdict.lookup("stretchFactor")));
|
|
||||||
scalar lowerN(readScalar(SLFMdict.lookup("lowerN")));
|
|
||||||
scalar upperN(readScalar(SLFMdict.lookup("upperN")));
|
|
||||||
scalar Sc(readScalar(SLFMdict.lookup("Sc")));
|
|
||||||
const label etamax(lowerN+upperN+1);
|
|
||||||
word outletName(SLFMdict.lookup("outletName"));
|
|
||||||
|
|
||||||
labelList nIntervals (SLFMdict.lookup("detailedN"));
|
|
||||||
|
|
||||||
CMC::BetaGrid bg(SLFMdict);
|
|
||||||
const scalarField &etaGrid(bg.etaSpace());
|
|
||||||
const scalarField amcGridValue(CMC::AMC(etaGrid));
|
|
||||||
|
|
||||||
Info << etaGrid << endl;
|
|
||||||
|
|
||||||
scalarField etaValue(etamax,0);
|
|
||||||
scalarField etaIndex(etamax,0);
|
|
||||||
scalarField deta_h(etamax,0);
|
|
||||||
scalarField deta_l(etamax,0);
|
|
||||||
scalarField deta_m(etamax,0);
|
|
||||||
|
|
||||||
#include "setEtaSpace.H"
|
|
||||||
|
|
||||||
Info<<"\nNumber of eta-point = "<<etamax<<endl;
|
|
||||||
|
|
||||||
|
|
||||||
scalar NVar(readScalar(SLFMdict.lookup("NVar")));
|
|
||||||
scalarField varValue(NVar+1,0);
|
|
||||||
scalarField varIndex(NVar+1,0);
|
|
||||||
|
|
||||||
#include "setVarSpace.H"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PtrList<volScalarField> Neta(etamax);
|
|
||||||
|
|
||||||
for(label j=0 ; j<etamax ; j++)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
word Netai = "Neta_"+Foam::name(j);
|
|
||||||
Neta.set
|
|
||||||
(
|
|
||||||
j,
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
Netai,
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar(Netai, dimless, 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "createMRF.H"
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
{
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
|
||||||
thermo.rho() -= psi*p;
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
|
||||||
tUEqn.clear();
|
|
||||||
surfaceScalarField phiHbyA
|
|
||||||
(
|
|
||||||
"phiHbyA",
|
|
||||||
fvc::interpolate(rho)*fvc::flux(HbyA)
|
|
||||||
);
|
|
||||||
|
|
||||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
|
||||||
|
|
||||||
// Update the pressure BCs to ensure flux consistency
|
|
||||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
fvc::div(phiHbyA)
|
|
||||||
- fvm::laplacian(rhorAUf, p)
|
|
||||||
==
|
|
||||||
fvOptions(psi, p, rho.name())
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve();
|
|
||||||
|
|
||||||
if (simple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
phi = phiHbyA + pEqn.flux();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p.relax();
|
|
||||||
|
|
||||||
// Second part of thermodynamic density update
|
|
||||||
thermo.rho() += psi*p;
|
|
||||||
|
|
||||||
#include "compressibleContinuityErrs.H"
|
|
||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p);
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
fvOptions.correct(U);
|
|
||||||
|
|
||||||
rho = max(rho, rhoMin);
|
|
||||||
rho = min(rho, rhoMax);
|
|
||||||
rho.relax();
|
|
||||||
|
|
||||||
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
|
||||||
}
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
scalarFieldArray1d C1table //AMC C1 coefficient table
|
|
||||||
(
|
|
||||||
etamax,
|
|
||||||
scalarField(NVar+1, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
scalarFieldArray2d Ttable
|
|
||||||
(
|
|
||||||
etamax,
|
|
||||||
scalarFieldArray1d
|
|
||||||
(
|
|
||||||
NVar+1,
|
|
||||||
scalarField(NstList.size(), 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
scalarFieldArray2d Rtable
|
|
||||||
(
|
|
||||||
etamax,
|
|
||||||
scalarFieldArray1d
|
|
||||||
(
|
|
||||||
NVar+1,
|
|
||||||
scalarField(NstList.size(), 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
scalarFieldArray3d Ytable
|
|
||||||
(
|
|
||||||
Y.size(),
|
|
||||||
scalarFieldArray2d
|
|
||||||
(
|
|
||||||
etamax,
|
|
||||||
scalarFieldArray1d
|
|
||||||
(
|
|
||||||
NVar+1,
|
|
||||||
scalarField(NstList.size(), 0)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<<"Construct C1 coefficient table"<<endl;
|
|
||||||
for(label j = 1; j < etamax - 1; j++)
|
|
||||||
{
|
|
||||||
for(label v = 1; v < varValue.size() - 1; v++)
|
|
||||||
{
|
|
||||||
const scalar mf = etaValue[j];
|
|
||||||
const scalar mfVar = varValue[v]*mf*(1.0-mf);
|
|
||||||
|
|
||||||
CMC::BetaFunction bf(mf, mfVar);
|
|
||||||
CMC::BetaIntegrator bi(bf, bg);
|
|
||||||
|
|
||||||
C1table[j][v] = 1.0/bi.betaIntegrate(amcGridValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<<"Construct Temp and Rgas table"<<endl;
|
|
||||||
for(label j=0 ; j<etamax ; j++)
|
|
||||||
{
|
|
||||||
for(label v=0 ; v<=NVar ; v++)
|
|
||||||
{
|
|
||||||
const scalar mf = etaValue[j];
|
|
||||||
const scalar mfVar = varValue[v]*mf*(1.0-mf);
|
|
||||||
|
|
||||||
CMC::BetaFunction bf(mf, mfVar);
|
|
||||||
CMC::BetaIntegrator bi(bf, bg);
|
|
||||||
|
|
||||||
for(label n=0 ; n<NstList.size() ; n++)
|
|
||||||
{
|
|
||||||
Ttable[j][v][n] = bi.betaIntegrate(T_SLFM[n]);
|
|
||||||
Rtable[j][v][n] = bi.betaIntegrate(Rgas_SLFM[n]);
|
|
||||||
forAll(Y, yi)
|
|
||||||
{
|
|
||||||
Ytable[yi][j][v][n] = bi.betaIntegrate(Y_SLFM[yi][n]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Info<<scalar(j+1)/etamax*100<<"%"<<endl;
|
|
||||||
}
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
Switch Equilibrium = SLFMdict.lookup("Equilibrium");
|
|
||||||
word NstFolder = SLFMdict.lookup("NstFolder");
|
|
||||||
scalarField NstList = SLFMdict.lookup("NstList");
|
|
||||||
scalarField NstIndex(NstList.size(),0);
|
|
||||||
|
|
||||||
forAll(NstList, n)
|
|
||||||
{
|
|
||||||
NstIndex[n] = n;
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef List<scalarField> scalarFieldArray1d;
|
|
||||||
typedef List<scalarFieldArray1d> scalarFieldArray2d;
|
|
||||||
typedef List<scalarFieldArray2d> scalarFieldArray3d;
|
|
||||||
|
|
||||||
SLFM::FlameStructure slfmLibrary(runTime.constant()/NstFolder, NstList, etaGrid, composition.species());
|
|
||||||
|
|
||||||
scalarFieldArray2d& Y_SLFM (slfmLibrary.Y());
|
|
||||||
scalarFieldArray2d& W_SLFM (slfmLibrary.W());
|
|
||||||
scalarFieldArray1d& T_SLFM (slfmLibrary.T());
|
|
||||||
scalarFieldArray1d& Q_SLFM (slfmLibrary.Q());
|
|
||||||
scalarFieldArray1d& rho_SLFM (slfmLibrary.rho());
|
|
||||||
scalarFieldArray1d& h_SLFM (slfmLibrary.h());
|
|
||||||
scalarFieldArray1d& Rgas_SLFM (slfmLibrary.Rgas());
|
|
||||||
|
|
||||||
for(label n=0 ; n<NstList.size() ; n++)
|
|
||||||
{
|
|
||||||
for(label i=0 ; i<Y.size() ; i++)
|
|
||||||
{
|
|
||||||
Rgas_SLFM[n] += Y_SLFM[i][n]/composition.W(i); // = 1/meanMW
|
|
||||||
}
|
|
||||||
Rgas_SLFM[n] = 8314.46*Rgas_SLFM[n]; //universal gas constant = 8314.46 [J/K.Kmole]
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
//set eta-space
|
|
||||||
scalar upperSum(0), upperDelta(0);
|
|
||||||
scalar lowerSum(0), lowerDelta(0);
|
|
||||||
|
|
||||||
//summation of geometric progression (eta > stoi)
|
|
||||||
upperSum = Foam::pow(stretchFac,upperN)-1.0;
|
|
||||||
upperSum = upperSum/(stretchFac-1.0);
|
|
||||||
|
|
||||||
//summation of geometric progression (eta < stoi)
|
|
||||||
lowerSum = Foam::pow(stretchFac,lowerN)-1.0;
|
|
||||||
lowerSum = lowerSum/(stretchFac-1.0);
|
|
||||||
|
|
||||||
//set reference delta eta
|
|
||||||
upperDelta = (1.0-stoiMF)/upperSum;
|
|
||||||
lowerDelta = stoiMF/lowerSum;
|
|
||||||
|
|
||||||
//set boundary and stoichiometric value of eta
|
|
||||||
etaValue[0] = 0.0;
|
|
||||||
etaValue[lowerN] = stoiMF;
|
|
||||||
etaValue.last() = 1.0;
|
|
||||||
|
|
||||||
//set internal value of eta (eta > stoi)
|
|
||||||
for(label j=0 ; j<upperN-1 ; j++)
|
|
||||||
{
|
|
||||||
etaValue[lowerN+j+1] = etaValue[lowerN+j] + upperDelta*pow(stretchFac,j);
|
|
||||||
}
|
|
||||||
|
|
||||||
//set internal value of eta (eta < stoi)
|
|
||||||
for(label j=0 ; j<lowerN-1 ; j++)
|
|
||||||
{
|
|
||||||
etaValue[lowerN-j-1] = etaValue[lowerN-j] - lowerDelta*pow(stretchFac,j);
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<<etaValue<<endl;
|
|
||||||
|
|
||||||
//calculate delta eta
|
|
||||||
for(label j=1 ; j<etamax-1 ; j++)
|
|
||||||
{
|
|
||||||
deta_h[j] = etaValue[j+1] - etaValue[j];
|
|
||||||
deta_l[j] = etaValue[j] - etaValue[j-1];
|
|
||||||
deta_m[j] = 0.5*(etaValue[j+1] - etaValue[j-1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Info<<deta_h<<endl;
|
|
||||||
//Info<<deta_l<<endl;
|
|
||||||
//Info<<deta_m<<endl;
|
|
||||||
|
|
||||||
for(label j=0 ; j<etamax ; j++)
|
|
||||||
{
|
|
||||||
etaIndex[j] = j;
|
|
||||||
}
|
|
||||||
|
|
@ -1,79 +0,0 @@
|
||||||
scalarField AMCcoeff(CMC::AMC(etaValue));
|
|
||||||
|
|
||||||
//cell loop
|
|
||||||
|
|
||||||
forAll(mf, cellI)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
scalar jl(0), jh(0), vl(0), vh(0);
|
|
||||||
scalar jfac(0), vfac(0);
|
|
||||||
scalar C1coeff(0);
|
|
||||||
|
|
||||||
//find eta-index, factor
|
|
||||||
if(mf[cellI] < etaValue[1])
|
|
||||||
{
|
|
||||||
jl = 0;
|
|
||||||
jh = 1;
|
|
||||||
}
|
|
||||||
else if(mf[cellI] > etaValue[etamax-2])
|
|
||||||
{
|
|
||||||
jl = etamax-2;
|
|
||||||
jh = etamax-1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
jl = label( interpolateXY(mf[cellI], etaValue, etaIndex) );
|
|
||||||
jh = jl+1;
|
|
||||||
}
|
|
||||||
jfac = max(0.0, (mf[cellI]-etaValue[jl])/(etaValue[jh]-etaValue[jl]));
|
|
||||||
|
|
||||||
//find var-index, factor
|
|
||||||
scalar scaledVar = min(0.99999, mfVar[cellI]/(mf[cellI]*(1.0-mf[cellI])+SMALL));
|
|
||||||
if(scaledVar < varValue[1])
|
|
||||||
{
|
|
||||||
vl = 0;
|
|
||||||
vh = 1;
|
|
||||||
}
|
|
||||||
else if(scaledVar > varValue[NVar-1])
|
|
||||||
{
|
|
||||||
vl = NVar-1;
|
|
||||||
vh = NVar;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vl = label( interpolateXY(scaledVar, varValue, varIndex) );
|
|
||||||
vh = vl+1;
|
|
||||||
}
|
|
||||||
vfac = max(0.0, (scaledVar-varValue[vl])/(varValue[vh]-varValue[vl]));
|
|
||||||
|
|
||||||
|
|
||||||
//Bi-linear interpolation on j and v
|
|
||||||
//Numerical recipes, 2nd Ed. p.117
|
|
||||||
C1coeff
|
|
||||||
= C1table[jl][vl]*(1-jfac)*(1-vfac)
|
|
||||||
+ C1table[jh][vl]*(jfac)*(1-vfac)
|
|
||||||
+ C1table[jh][vh]*(jfac)*(vfac)
|
|
||||||
+ C1table[jl][vh]*(1-jfac)*(vfac);
|
|
||||||
|
|
||||||
jlc[cellI] = jl;
|
|
||||||
jhc[cellI] = jh;
|
|
||||||
jfc[cellI] = jfac;
|
|
||||||
vlc[cellI] = vl;
|
|
||||||
vhc[cellI] = vh;
|
|
||||||
vfc[cellI] = vfac;
|
|
||||||
|
|
||||||
|
|
||||||
scalar Coeff = AMCcoeff[lowerN];
|
|
||||||
|
|
||||||
if (Equilibrium == true)
|
|
||||||
{
|
|
||||||
Neta[lowerN][cellI] = 0; //Equilibrium
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Neta[lowerN][cellI] = SDR[cellI]*Coeff*C1coeff; //CSDR at stoichiometic m.f.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
//set normalized variance space
|
|
||||||
{
|
|
||||||
scalar sum(0), del(0), fac(1.075);
|
|
||||||
|
|
||||||
sum = Foam::pow(fac,NVar) - 1.0;
|
|
||||||
sum = sum/(fac-1.0);
|
|
||||||
|
|
||||||
del = 1.0/sum;
|
|
||||||
|
|
||||||
varValue[0] = 0.0;
|
|
||||||
varValue[NVar] = 1.0;
|
|
||||||
|
|
||||||
for(label v=0 ; v<NVar-1 ; v++)
|
|
||||||
{
|
|
||||||
varValue[v+1] = varValue[v] + del*Foam::pow(fac,v);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(label v=0 ; v<=NVar ; v++)
|
|
||||||
{
|
|
||||||
varIndex[v] = v;
|
|
||||||
}
|
|
||||||
Info<<varValue<<endl;
|
|
||||||
}
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
//force the saving of the old-time values
|
|
||||||
//important!!
|
|
||||||
|
|
||||||
rho.oldTime();
|
|
||||||
|
|
||||||
forAll(rho, cellI)
|
|
||||||
{
|
|
||||||
scalar& Nst = Neta[lowerN][cellI];
|
|
||||||
|
|
||||||
//find Nst index
|
|
||||||
if(Nst < NstList.first())
|
|
||||||
{
|
|
||||||
nlc[cellI] = 0;
|
|
||||||
nfc[cellI] = 0;
|
|
||||||
}
|
|
||||||
else if(Nst > NstList[NstList.size()-2])
|
|
||||||
{
|
|
||||||
nhc[cellI] = NstList.size()-2; //just before extinction
|
|
||||||
nfc[cellI] = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nlc[cellI] = label( interpolateXY(Nst, NstList, NstIndex) );
|
|
||||||
nhc[cellI] = nlc[cellI]+1;
|
|
||||||
nfc[cellI] = (Nst-NstList[nlc[cellI]])
|
|
||||||
/(NstList[nhc[cellI]]-NstList[nlc[cellI]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//update Favre mean temp. and rho(=1/RT)
|
|
||||||
scalar jl = jlc[cellI], jh = jhc[cellI];
|
|
||||||
scalar vl = vlc[cellI], vh = vhc[cellI];
|
|
||||||
scalar nl = nlc[cellI], nh = nhc[cellI];
|
|
||||||
scalar jfac = jfc[cellI], vfac = vfc[cellI], nfac = nfc[cellI];
|
|
||||||
|
|
||||||
scalar T00 = Ttable[jl][vl][nl]*(1-jfac)+Ttable[jh][vl][nl]*jfac;
|
|
||||||
scalar T01 = Ttable[jl][vl][nh]*(1-jfac)+Ttable[jh][vl][nh]*jfac;
|
|
||||||
scalar T10 = Ttable[jl][vh][nl]*(1-jfac)+Ttable[jh][vh][nl]*jfac;
|
|
||||||
scalar T11 = Ttable[jl][vh][nh]*(1-jfac)+Ttable[jh][vh][nh]*jfac;
|
|
||||||
|
|
||||||
scalar T0 = T00*(1-vfac)+T10*vfac;
|
|
||||||
scalar T1 = T01*(1-vfac)+T11*vfac;
|
|
||||||
|
|
||||||
T[cellI] = T0*(1-nfac)+T1*nfac;
|
|
||||||
|
|
||||||
scalar R00 = Rtable[jl][vl][nl]*(1-jfac)+Rtable[jh][vl][nl]*jfac;
|
|
||||||
scalar R01 = Rtable[jl][vl][nh]*(1-jfac)+Rtable[jh][vl][nh]*jfac;
|
|
||||||
scalar R10 = Rtable[jl][vh][nl]*(1-jfac)+Rtable[jh][vh][nl]*jfac;
|
|
||||||
scalar R11 = Rtable[jl][vh][nh]*(1-jfac)+Rtable[jh][vh][nh]*jfac;
|
|
||||||
|
|
||||||
scalar R0 = R00*(1-vfac)+R10*vfac;
|
|
||||||
scalar R1 = R01*(1-vfac)+R11*vfac;
|
|
||||||
|
|
||||||
scalar Rgas = R0*(1-nfac)+R1*nfac;
|
|
||||||
rho[cellI] = p[cellI]/(Rgas*T[cellI]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//correct processor boundary value of T and rho
|
|
||||||
T.correctBoundaryConditions();
|
|
||||||
rho.correctBoundaryConditions();
|
|
||||||
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
//force the saving of the old-time values
|
|
||||||
//important!!
|
|
||||||
|
|
||||||
forAll(rho, cellI)
|
|
||||||
{
|
|
||||||
scalar& Nst = Neta[lowerN][cellI];
|
|
||||||
|
|
||||||
//find Nst index
|
|
||||||
if(Nst < NstList.first())
|
|
||||||
{
|
|
||||||
nlc[cellI] = 0;
|
|
||||||
nfc[cellI] = 0;
|
|
||||||
}
|
|
||||||
else if(Nst > NstList[NstList.size()-2])
|
|
||||||
{
|
|
||||||
nhc[cellI] = NstList.size()-2; //just before extinction
|
|
||||||
nfc[cellI] = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
nlc[cellI] = label( interpolateXY(Nst, NstList, NstIndex) );
|
|
||||||
nhc[cellI] = nlc[cellI]+1;
|
|
||||||
nfc[cellI] = (Nst-NstList[nlc[cellI]])
|
|
||||||
/(NstList[nhc[cellI]]-NstList[nlc[cellI]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//update Favre mean temp. and rho(=1/RT)
|
|
||||||
scalar jl = jlc[cellI], jh = jhc[cellI];
|
|
||||||
scalar vl = vlc[cellI], vh = vhc[cellI];
|
|
||||||
scalar nl = nlc[cellI], nh = nhc[cellI];
|
|
||||||
scalar jfac = jfc[cellI], vfac = vfc[cellI], nfac = nfc[cellI];
|
|
||||||
|
|
||||||
|
|
||||||
forAll(Y, yi)
|
|
||||||
{
|
|
||||||
scalar y00 = Ytable[yi][jl][vl][nl]*(1-jfac)+Ytable[yi][jh][vl][nl]*jfac;
|
|
||||||
scalar y01 = Ytable[yi][jl][vl][nh]*(1-jfac)+Ytable[yi][jh][vl][nh]*jfac;
|
|
||||||
scalar y10 = Ytable[yi][jl][vh][nl]*(1-jfac)+Ytable[yi][jh][vh][nl]*jfac;
|
|
||||||
scalar y11 = Ytable[yi][jl][vh][nh]*(1-jfac)+Ytable[yi][jh][vh][nh]*jfac;
|
|
||||||
|
|
||||||
scalar y0 = y00*(1-vfac)+y10*vfac;
|
|
||||||
scalar y1 = y01*(1-vfac)+y11*vfac;
|
|
||||||
|
|
||||||
scalar ygas = y0*(1-nfac)+y1*nfac;
|
|
||||||
|
|
||||||
Y[yi][cellI] = ygas;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//correct processor boundary value of T and rho
|
|
||||||
forAll(Y, yi)
|
|
||||||
{
|
|
||||||
Y[yi].correctBoundaryConditions();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#include "createMeshes.H"
|
#include "createMeshes.H"
|
||||||
|
|
||||||
if (!fluidRegions.size() && !solidRegions.size())
|
if (!fluidRegions.size())
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "No region meshes present" << exit(FatalError);
|
<< "No fluid meshes present" << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
fvMesh& mesh = fluidRegions.size() ? fluidRegions[0] : solidRegions[0];
|
fvMesh& mesh = fluidRegions[0];
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
{
|
|
||||||
volScalarField& he = thermo.he();
|
|
||||||
|
|
||||||
fvScalarMatrix EEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(alphac,rho, he) + mvConvection->fvmDiv(alphacPhi, he)
|
|
||||||
+ fvc::ddt(alphac,rho, K) + fvc::div(alphacPhi, K)
|
|
||||||
+ (
|
|
||||||
he.name() == "e"
|
|
||||||
? fvc::div
|
|
||||||
(
|
|
||||||
fvc::absolute(phi/fvc::interpolate(rho), U),
|
|
||||||
p,
|
|
||||||
"div(phiv,p)"
|
|
||||||
)
|
|
||||||
: -dpdt
|
|
||||||
)
|
|
||||||
- fvm::laplacian(alphac*turbulence->alphaEff(), he)
|
|
||||||
==
|
|
||||||
alphac*rho*(U&g)
|
|
||||||
+ parcels.Sh(he)
|
|
||||||
+ radiation->Sh(thermo)
|
|
||||||
+ combustion->Sh()
|
|
||||||
+ fvOptions(alphac,rho, he)
|
|
||||||
);
|
|
||||||
|
|
||||||
EEqn.relax();
|
|
||||||
|
|
||||||
fvOptions.constrain(EEqn);
|
|
||||||
|
|
||||||
EEqn.solve();
|
|
||||||
|
|
||||||
fvOptions.correct(he);
|
|
||||||
|
|
||||||
thermo.correct();
|
|
||||||
radiation->correct();
|
|
||||||
|
|
||||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
|
||||||
<< max(T).value() << endl;
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
ThermoMPPICFoam.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/ThermoMPPICFoam
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
EXE_INC = \
|
|
||||||
-I. \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
|
||||||
-I$(LIB_SRC)/ODE/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
|
||||||
-I$(FOAM_SOLVERS)/combustion/reactingFoam
|
|
||||||
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools \
|
|
||||||
-lturbulenceModels \
|
|
||||||
-lcompressibleTurbulenceModels \
|
|
||||||
-llagrangian \
|
|
||||||
-llagrangianIntermediate \
|
|
||||||
-llagrangianTurbulence \
|
|
||||||
-lspecie \
|
|
||||||
-lcompressibleTransportModels \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lliquidProperties \
|
|
||||||
-lliquidMixtureProperties \
|
|
||||||
-lsolidProperties \
|
|
||||||
-lsolidMixtureProperties \
|
|
||||||
-lthermophysicalFunctions \
|
|
||||||
-lreactionThermophysicalModels \
|
|
||||||
-lSLGThermo \
|
|
||||||
-lchemistryModel \
|
|
||||||
-lradiationModels \
|
|
||||||
-lODE \
|
|
||||||
-lregionModels \
|
|
||||||
-lsurfaceFilmModels \
|
|
||||||
-lcombustionModels \
|
|
||||||
-lfvOptions \
|
|
||||||
-lsampling
|
|
||||||
|
|
@ -1,147 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
ThermoMPPICFoam
|
|
||||||
|
|
||||||
Description
|
|
||||||
Transient solver for compressible, turbulent flow with a reacting,
|
|
||||||
multiphase particle cloud, and optional sources/constraints.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "turbulentFluidThermoModel.H"
|
|
||||||
#include "basicThermoKinematicMPPICCloud.H"
|
|
||||||
#include "rhoCombustionModel.H"
|
|
||||||
#include "radiationModel.H"
|
|
||||||
#include "fvOptions.H"
|
|
||||||
#include "SLGThermo.H"
|
|
||||||
#include "pimpleControl.H"
|
|
||||||
#include "localEulerDdtScheme.H"
|
|
||||||
#include "fvcSmooth.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
#include "postProcess.H"
|
|
||||||
|
|
||||||
#include "setRootCase.H"
|
|
||||||
#include "createTime.H"
|
|
||||||
#include "createMesh.H"
|
|
||||||
#include "createControl.H"
|
|
||||||
#include "createTimeControls.H"
|
|
||||||
#include "createRDeltaT.H"
|
|
||||||
#include "createFields.H"
|
|
||||||
#include "createFieldRefs.H"
|
|
||||||
#include "createFvOptions.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
turbulence->validate();
|
|
||||||
|
|
||||||
#include "compressibleCourantNo.H"
|
|
||||||
#include "setInitialDeltaT.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
|
||||||
|
|
||||||
while (runTime.run())
|
|
||||||
{
|
|
||||||
#include "readTimeControls.H"
|
|
||||||
#include "compressibleCourantNo.H"
|
|
||||||
#include "setDeltaT.H"
|
|
||||||
|
|
||||||
runTime++;
|
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
|
||||||
|
|
||||||
parcels.evolve();
|
|
||||||
|
|
||||||
// Update continuous phase volume fraction field
|
|
||||||
alphac = max(1.0 - parcels.theta(), alphacMin);
|
|
||||||
alphac.correctBoundaryConditions();
|
|
||||||
alphacf = fvc::interpolate(alphac);
|
|
||||||
alphacPhi = alphacf*phi;
|
|
||||||
|
|
||||||
fvVectorMatrix cloudSU(parcels.SU(U));
|
|
||||||
volVectorField cloudVolSUSu
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"cloudVolSUSu",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedVector
|
|
||||||
(
|
|
||||||
"0",
|
|
||||||
cloudSU.dimensions()/dimVolume,
|
|
||||||
vector::zero
|
|
||||||
),
|
|
||||||
zeroGradientFvPatchVectorField::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();
|
|
||||||
cloudVolSUSu.correctBoundaryConditions();
|
|
||||||
cloudSU.source() = vector::zero;
|
|
||||||
|
|
||||||
#include "rhoEqn.H"
|
|
||||||
|
|
||||||
// --- Pressure-velocity PIMPLE corrector loop
|
|
||||||
while (pimple.loop())
|
|
||||||
{
|
|
||||||
#include "UEqn.H"
|
|
||||||
#include "YEqn.H"
|
|
||||||
#include "EEqn.H"
|
|
||||||
|
|
||||||
// --- Pressure corrector loop
|
|
||||||
while (pimple.correct())
|
|
||||||
{
|
|
||||||
#include "pEqn.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pimple.turbCorr())
|
|
||||||
{
|
|
||||||
turbulence->correct();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
runTime.write();
|
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
|
||||||
<< nl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
fvVectorMatrix UEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(alphac, rho, U)
|
|
||||||
+ fvm::div(alphacPhi, U)
|
|
||||||
- fvm::laplacian(alphac*turbulence->muEff(),U)
|
|
||||||
- fvc::div(alphac*turbulence->muEff()*dev2(fvc::grad(U)().T()))
|
|
||||||
- fvm::Sp(fvc::ddt(alphac,rho) + fvc::div(alphacPhi), U)
|
|
||||||
==
|
|
||||||
cloudSU
|
|
||||||
+ fvOptions(alphac,rho, U)
|
|
||||||
);
|
|
||||||
|
|
||||||
UEqn.relax();
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
|
||||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
|
||||||
|
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
|
||||||
|
|
||||||
surfaceScalarField phicForces
|
|
||||||
(
|
|
||||||
(fvc::interpolate(rAU*cloudVolSUSu) & mesh.Sf())
|
|
||||||
+ alphacf*rhorAUf*(g & mesh.Sf())
|
|
||||||
);
|
|
||||||
|
|
||||||
fvOptions.constrain(UEqn);
|
|
||||||
|
|
||||||
if (pimple.momentumPredictor())
|
|
||||||
{
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
UEqn
|
|
||||||
==
|
|
||||||
fvc::reconstruct
|
|
||||||
(
|
|
||||||
phicForces/rAUf
|
|
||||||
)
|
|
||||||
- fvc::grad(p)
|
|
||||||
);
|
|
||||||
|
|
||||||
fvOptions.correct(U);
|
|
||||||
K = 0.5*magSqr(U);
|
|
||||||
}
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
tmp<fv::convectionScheme<scalar>> mvConvection
|
|
||||||
(
|
|
||||||
fv::convectionScheme<scalar>::New
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
fields,
|
|
||||||
phi,
|
|
||||||
mesh.divScheme("div(phi,Yi_h)")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
{
|
|
||||||
combustion->correct();
|
|
||||||
dQ = combustion->dQ();
|
|
||||||
label inertIndex = -1;
|
|
||||||
volScalarField Yt(0.0*Y[0]);
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
if (Y[i].name() != inertSpecie)
|
|
||||||
{
|
|
||||||
volScalarField& Yi = Y[i];
|
|
||||||
|
|
||||||
fvScalarMatrix YEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(alphac,rho, Yi)
|
|
||||||
+ mvConvection->fvmDiv(alphacPhi, Yi)
|
|
||||||
- fvm::laplacian(alphac*turbulence->muEff(), Yi)
|
|
||||||
==
|
|
||||||
combustion->R(Yi)
|
|
||||||
+ fvOptions(alphac,rho, Yi)
|
|
||||||
);
|
|
||||||
|
|
||||||
YEqn.relax();
|
|
||||||
|
|
||||||
fvOptions.constrain(YEqn);
|
|
||||||
|
|
||||||
YEqn.solve(mesh.solver("Yi"));
|
|
||||||
|
|
||||||
fvOptions.correct(Yi);
|
|
||||||
|
|
||||||
Yi.max(0.0);
|
|
||||||
Yt += Yi;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
inertIndex = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
|
||||||
Y[inertIndex].max(0.0);
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
Info<< "\nConstructing reacting cloud" << endl;
|
|
||||||
basicThermoKinematicMPPICCloud parcels
|
|
||||||
(
|
|
||||||
"reactingCloud",
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
slgThermo.thermo().mu(),
|
|
||||||
g
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Continuouse phase volume fraction lower limit
|
|
||||||
scalar alphacMin
|
|
||||||
(
|
|
||||||
1.0
|
|
||||||
- readScalar
|
|
||||||
(
|
|
||||||
parcels.particleProperties().subDict("constantProperties").lookup("alphaMax")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Update alphac from the particle locations
|
|
||||||
alphac = max(1.0 - parcels.theta(), alphacMin);
|
|
||||||
alphac.correctBoundaryConditions();
|
|
||||||
alphacf = fvc::interpolate(alphac);
|
|
||||||
alphacPhi = alphacf*phi;
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
const volScalarField& T = thermo.T();
|
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
|
|
@ -1,158 +0,0 @@
|
||||||
#include "readGravitationalAcceleration.H"
|
|
||||||
|
|
||||||
Info<< "Creating combustion model\n" << endl;
|
|
||||||
|
|
||||||
autoPtr<combustionModels::rhoCombustionModel> combustion
|
|
||||||
(
|
|
||||||
combustionModels::rhoCombustionModel::New(mesh)
|
|
||||||
);
|
|
||||||
|
|
||||||
rhoReactionThermo& thermo = combustion->thermo();
|
|
||||||
thermo.validate(args.executable(), "h", "e");
|
|
||||||
|
|
||||||
SLGThermo slgThermo(mesh, thermo);
|
|
||||||
|
|
||||||
basicSpecieMixture& composition = thermo.composition();
|
|
||||||
PtrList<volScalarField>& Y = composition.Y();
|
|
||||||
|
|
||||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
|
||||||
|
|
||||||
if (!composition.contains(inertSpecie))
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
|
||||||
<< "species list. Available species:" << composition.species()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
|
||||||
|
|
||||||
volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
thermo.rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "\nReading field U\n" << endl;
|
|
||||||
volVectorField U
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
|
||||||
|
|
||||||
mesh.setFluxRequired(p.name());
|
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
|
||||||
(
|
|
||||||
dimensionedScalar::lookupOrDefault
|
|
||||||
(
|
|
||||||
"rhoMax",
|
|
||||||
pimple.dict(),
|
|
||||||
dimDensity,
|
|
||||||
GREAT
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
dimensionedScalar::lookupOrDefault
|
|
||||||
(
|
|
||||||
"rhoMin",
|
|
||||||
pimple.dict(),
|
|
||||||
dimDensity,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::turbulenceModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Set the turbulence into the combustion model
|
|
||||||
combustion->setTurbulence(turbulence());
|
|
||||||
|
|
||||||
Info<< "Creating field dpdt\n" << endl;
|
|
||||||
volScalarField dpdt
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"dpdt",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating field kinetic energy K\n" << endl;
|
|
||||||
volScalarField K("K", 0.5*magSqr(U));
|
|
||||||
|
|
||||||
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
fields.add(Y[i]);
|
|
||||||
}
|
|
||||||
fields.add(thermo.he());
|
|
||||||
|
|
||||||
volScalarField dQ
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"dQ",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField alphac
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"alphac",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::READ_IF_PRESENT,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("0", dimless, 1)
|
|
||||||
);
|
|
||||||
|
|
||||||
surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
|
|
||||||
surfaceScalarField alphacPhi("alphacPhi", alphacf*phi);
|
|
||||||
|
|
||||||
volScalarField alphacrho("alphacrho", alphac*rho);
|
|
||||||
|
|
||||||
#include "createMRF.H"
|
|
||||||
#include "createRadiationModel.H"
|
|
||||||
#include "createClouds.H"
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
{
|
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
|
||||||
thermo.rho() -= psi*p;
|
|
||||||
|
|
||||||
rhorAUf= fvc::interpolate(rho*rAU);
|
|
||||||
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
|
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
|
||||||
HbyA = rAU*UEqn.H();
|
|
||||||
|
|
||||||
surfaceScalarField phiHbyA
|
|
||||||
(
|
|
||||||
"phiHbyA",
|
|
||||||
(
|
|
||||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
|
||||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
|
||||||
+ phicForces*rhof
|
|
||||||
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
|
||||||
|
|
||||||
// Update the pressure BCs to ensure flux consistency
|
|
||||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
|
||||||
|
|
||||||
fvScalarMatrix pDDtEqn
|
|
||||||
(
|
|
||||||
fvc::ddt(alphac,rho) + alphac*psi*correction(fvm::ddt(p))
|
|
||||||
+ fvc::div(alphacf*phiHbyA)
|
|
||||||
==
|
|
||||||
fvOptions(alphac*psi, p, rho.name())
|
|
||||||
);
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
pDDtEqn
|
|
||||||
- fvm::laplacian(alphacf*rhorAUf, p)
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
|
|
||||||
phi = phiHbyA + pEqn.flux()/alphacf;
|
|
||||||
|
|
||||||
alphacPhi = alphacf*phi;
|
|
||||||
|
|
||||||
p.relax();
|
|
||||||
|
|
||||||
thermo.rho() += psi*p;
|
|
||||||
|
|
||||||
#include "rhoEqn.H"
|
|
||||||
#include "compressibleContinuityErrs.H"
|
|
||||||
|
|
||||||
U = HbyA + rAU*fvc::reconstruct(phicForces/rAUf) - rAU*fvc::grad(p);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
fvOptions.correct(U);
|
|
||||||
K = 0.5*magSqr(U);
|
|
||||||
|
|
||||||
if (thermo.dpdt())
|
|
||||||
{
|
|
||||||
dpdt = fvc::ddt(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
rho = thermo.rho();
|
|
||||||
rho = max(rho, rhoMin);
|
|
||||||
rho = min(rho, rhoMax);
|
|
||||||
|
|
||||||
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
|
||||||
}
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Global
|
|
||||||
rhoEqn
|
|
||||||
|
|
||||||
Description
|
|
||||||
Solve the continuity for density.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
{
|
|
||||||
fvScalarMatrix rhoEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(alphac,rho)
|
|
||||||
+ fvc::div(alphacPhi)
|
|
||||||
==
|
|
||||||
fvOptions(alphac,rho)
|
|
||||||
);
|
|
||||||
|
|
||||||
rhoEqn.solve();
|
|
||||||
|
|
||||||
fvOptions.correct(rho);
|
|
||||||
|
|
||||||
Info<< "rho min/max = " << min(rho).value() << ", " << max(rho).value()
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
rho = max(rho, rhoMin);
|
|
||||||
rho = min(rho, rhoMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,134 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
{
|
|
||||||
volScalarField& rDeltaT = trDeltaT.ref();
|
|
||||||
|
|
||||||
const dictionary& pimpleDict = pimple.dict();
|
|
||||||
|
|
||||||
// Maximum flow Courant number
|
|
||||||
scalar maxCo(readScalar(pimpleDict.lookup("maxCo")));
|
|
||||||
|
|
||||||
// Maximum time scale
|
|
||||||
scalar maxDeltaT(pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT));
|
|
||||||
|
|
||||||
// Smoothing parameter (0-1) when smoothing iterations > 0
|
|
||||||
scalar rDeltaTSmoothingCoeff
|
|
||||||
(
|
|
||||||
pimpleDict.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Damping coefficient (1-0)
|
|
||||||
scalar rDeltaTDampingCoeff
|
|
||||||
(
|
|
||||||
pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 0.2)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Maximum change in cell temperature per iteration
|
|
||||||
// (relative to previous value)
|
|
||||||
scalar alphaTemp(pimpleDict.lookupOrDefault("alphaTemp", 0.05));
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "Time scales min/max:" << endl;
|
|
||||||
|
|
||||||
// Cache old reciprocal time scale field
|
|
||||||
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
|
|
||||||
|
|
||||||
// Flow time scale
|
|
||||||
{
|
|
||||||
rDeltaT.ref() =
|
|
||||||
(
|
|
||||||
fvc::surfaceSum(mag(phi))()()
|
|
||||||
/((2*maxCo)*mesh.V()*rho())
|
|
||||||
);
|
|
||||||
|
|
||||||
// Limit the largest time scale
|
|
||||||
rDeltaT.max(1/maxDeltaT);
|
|
||||||
|
|
||||||
Info<< " Flow = "
|
|
||||||
<< gMin(1/rDeltaT.primitiveField()) << ", "
|
|
||||||
<< gMax(1/rDeltaT.primitiveField()) << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reaction source time scale
|
|
||||||
{
|
|
||||||
volScalarField::Internal rDeltaTT
|
|
||||||
(
|
|
||||||
mag
|
|
||||||
(
|
|
||||||
parcels.hsTrans()/(mesh.V()*runTime.deltaT())
|
|
||||||
+ combustion->Sh()()
|
|
||||||
)
|
|
||||||
/(
|
|
||||||
alphaTemp
|
|
||||||
*rho()
|
|
||||||
*thermo.Cp()()()
|
|
||||||
*T()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< " Temperature = "
|
|
||||||
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
|
|
||||||
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
|
|
||||||
|
|
||||||
rDeltaT.ref() = max
|
|
||||||
(
|
|
||||||
rDeltaT(),
|
|
||||||
rDeltaTT
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update tho boundary values of the reciprocal time-step
|
|
||||||
rDeltaT.correctBoundaryConditions();
|
|
||||||
|
|
||||||
// Spatially smooth the time scale field
|
|
||||||
if (rDeltaTSmoothingCoeff < 1.0)
|
|
||||||
{
|
|
||||||
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Limit rate of change of time scale
|
|
||||||
// - reduce as much as required
|
|
||||||
// - only increase at a fraction of old time scale
|
|
||||||
if
|
|
||||||
(
|
|
||||||
rDeltaTDampingCoeff < 1.0
|
|
||||||
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
|
|
||||||
)
|
|
||||||
{
|
|
||||||
rDeltaT = max
|
|
||||||
(
|
|
||||||
rDeltaT,
|
|
||||||
(scalar(1.0) - rDeltaTDampingCoeff)*rDeltaT0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< " Overall = "
|
|
||||||
<< gMin(1/rDeltaT.primitiveField())
|
|
||||||
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
volScalarField& he = thermo.he();
|
|
||||||
|
|
||||||
fvScalarMatrix EEqn
|
|
||||||
(
|
|
||||||
mvConvection->fvmDiv(phi, he)
|
|
||||||
+ (
|
|
||||||
he.name() == "e"
|
|
||||||
? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho))
|
|
||||||
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
|
|
||||||
)
|
|
||||||
- fvm::laplacian(turbulence->alphaEff(), he)
|
|
||||||
==
|
|
||||||
parcels.Sh(he)
|
|
||||||
+ radiation->Sh(thermo)
|
|
||||||
+ combustion->Sh()
|
|
||||||
+ fvOptions(rho, he)
|
|
||||||
);
|
|
||||||
|
|
||||||
EEqn.relax();
|
|
||||||
|
|
||||||
fvOptions.constrain(EEqn);
|
|
||||||
|
|
||||||
EEqn.solve();
|
|
||||||
|
|
||||||
fvOptions.correct(he);
|
|
||||||
thermo.correct();
|
|
||||||
radiation->correct();
|
|
||||||
|
|
||||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
|
||||||
<< max(T).value() << endl;
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
simpleCoalcombustionFoam.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/simpleCoalcombustionFoam
|
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
EXE_INC = \
|
|
||||||
-I. \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
|
||||||
-I$(LIB_SRC)/ODE/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
|
||||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/combustionModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
|
||||||
-I$(FOAM_SOLVERS)/combustion/reactingFoam
|
|
||||||
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools \
|
|
||||||
-lturbulenceModels \
|
|
||||||
-lcompressibleTurbulenceModels \
|
|
||||||
-llagrangian \
|
|
||||||
-llagrangianIntermediate \
|
|
||||||
-lcoalCombustion \
|
|
||||||
-llagrangianTurbulence \
|
|
||||||
-lspecie \
|
|
||||||
-lcompressibleTransportModels \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lliquidProperties \
|
|
||||||
-lliquidMixtureProperties \
|
|
||||||
-lsolidProperties \
|
|
||||||
-lsolidMixtureProperties \
|
|
||||||
-lthermophysicalFunctions \
|
|
||||||
-lreactionThermophysicalModels \
|
|
||||||
-lSLGThermo \
|
|
||||||
-lchemistryModel \
|
|
||||||
-lradiationModels \
|
|
||||||
-lODE \
|
|
||||||
-lregionModels \
|
|
||||||
-lsurfaceFilmModels \
|
|
||||||
-lcombustionModels \
|
|
||||||
-lfvOptions \
|
|
||||||
-lsampling
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MRF.correctBoundaryVelocity(U);
|
|
||||||
|
|
||||||
tmp<fvVectorMatrix> tUEqn
|
|
||||||
(
|
|
||||||
fvm::div(phi, U)
|
|
||||||
+ MRF.DDt(rho, U)
|
|
||||||
+ turbulence->divDevRhoReff(U)
|
|
||||||
==
|
|
||||||
rho()*g
|
|
||||||
+ parcels.SU(U)
|
|
||||||
+ fvOptions(rho, U)
|
|
||||||
);
|
|
||||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
|
||||||
|
|
||||||
UEqn.relax();
|
|
||||||
|
|
||||||
fvOptions.constrain(UEqn);
|
|
||||||
|
|
||||||
solve(UEqn == -fvc::grad(p));
|
|
||||||
|
|
||||||
fvOptions.correct(U);
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
tmp<fv::convectionScheme<scalar>> mvConvection
|
|
||||||
(
|
|
||||||
fv::convectionScheme<scalar>::New
|
|
||||||
(
|
|
||||||
mesh,
|
|
||||||
fields,
|
|
||||||
phi,
|
|
||||||
mesh.divScheme("div(phi,Yi_h)")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
{
|
|
||||||
combustion->correct();
|
|
||||||
dQ = combustion->dQ();
|
|
||||||
label inertIndex = -1;
|
|
||||||
volScalarField Yt(0.0*Y[0]);
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
if (Y[i].name() != inertSpecie)
|
|
||||||
{
|
|
||||||
volScalarField& Yi = Y[i];
|
|
||||||
|
|
||||||
fvScalarMatrix YEqn
|
|
||||||
(
|
|
||||||
mvConvection->fvmDiv(phi, Yi)
|
|
||||||
- fvm::laplacian(turbulence->muEff(), Yi)
|
|
||||||
==
|
|
||||||
parcels.Srho(i)
|
|
||||||
+ combustion->R(Yi)
|
|
||||||
+ fvOptions(rho, Yi)
|
|
||||||
);
|
|
||||||
|
|
||||||
YEqn.relax();
|
|
||||||
|
|
||||||
fvOptions.constrain(YEqn);
|
|
||||||
|
|
||||||
YEqn.solve(mesh.solver("Yi"));
|
|
||||||
|
|
||||||
fvOptions.correct(Yi);
|
|
||||||
|
|
||||||
Yi.max(0.0);
|
|
||||||
Yt += Yi;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
inertIndex = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Y[inertIndex] = scalar(1) - Yt;
|
|
||||||
Y[inertIndex].max(0.0);
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
Info<< "\nConstructing reacting cloud" << endl;
|
|
||||||
coalCloudList parcels
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
g,
|
|
||||||
slgThermo
|
|
||||||
);
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
const volScalarField& T = thermo.T();
|
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
|
|
@ -1,123 +0,0 @@
|
||||||
#include "readGravitationalAcceleration.H"
|
|
||||||
|
|
||||||
Info<< "Creating combustion model\n" << endl;
|
|
||||||
|
|
||||||
autoPtr<combustionModels::rhoCombustionModel> combustion
|
|
||||||
(
|
|
||||||
combustionModels::rhoCombustionModel::New(mesh)
|
|
||||||
);
|
|
||||||
|
|
||||||
rhoReactionThermo& thermo = combustion->thermo();
|
|
||||||
thermo.validate(args.executable(), "h", "e");
|
|
||||||
|
|
||||||
SLGThermo slgThermo(mesh, thermo);
|
|
||||||
|
|
||||||
basicSpecieMixture& composition = thermo.composition();
|
|
||||||
PtrList<volScalarField>& Y = composition.Y();
|
|
||||||
|
|
||||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
|
||||||
|
|
||||||
if (!composition.contains(inertSpecie))
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
|
||||||
<< "species list. Available species:" << composition.species()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
|
||||||
|
|
||||||
volScalarField rho
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
thermo.rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "\nReading field U\n" << endl;
|
|
||||||
volVectorField U
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
|
||||||
|
|
||||||
mesh.setFluxRequired(p.name());
|
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
|
||||||
(
|
|
||||||
dimensionedScalar::lookupOrDefault
|
|
||||||
(
|
|
||||||
"rhoMax",
|
|
||||||
simple.dict(),
|
|
||||||
dimDensity,
|
|
||||||
GREAT
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
dimensionedScalar::lookupOrDefault
|
|
||||||
(
|
|
||||||
"rhoMin",
|
|
||||||
simple.dict(),
|
|
||||||
dimDensity,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
|
||||||
(
|
|
||||||
compressible::turbulenceModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Set the turbulence into the combustion model
|
|
||||||
combustion->setTurbulence(turbulence());
|
|
||||||
|
|
||||||
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
|
||||||
|
|
||||||
forAll(Y, i)
|
|
||||||
{
|
|
||||||
fields.add(Y[i]);
|
|
||||||
}
|
|
||||||
fields.add(thermo.he());
|
|
||||||
|
|
||||||
volScalarField dQ
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"dQ",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "createMRF.H"
|
|
||||||
#include "createRadiationModel.H"
|
|
||||||
#include "createClouds.H"
|
|
||||||
|
|
@ -1,57 +0,0 @@
|
||||||
{
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
|
||||||
thermo.rho() -= psi*p;
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
|
||||||
tUEqn.clear();
|
|
||||||
surfaceScalarField phiHbyA
|
|
||||||
(
|
|
||||||
"phiHbyA",
|
|
||||||
fvc::interpolate(rho)*fvc::flux(HbyA)
|
|
||||||
);
|
|
||||||
|
|
||||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
|
||||||
|
|
||||||
// Update the pressure BCs to ensure flux consistency
|
|
||||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
fvc::div(phiHbyA)
|
|
||||||
- fvm::laplacian(rhorAUf, p)
|
|
||||||
==
|
|
||||||
parcels.Srho()
|
|
||||||
+ fvOptions(psi, p, rho.name())
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve();
|
|
||||||
|
|
||||||
if (simple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
phi = phiHbyA + pEqn.flux();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p.relax();
|
|
||||||
|
|
||||||
// Second part of thermodynamic density update
|
|
||||||
thermo.rho() += psi*p;
|
|
||||||
|
|
||||||
#include "compressibleContinuityErrs.H"
|
|
||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p);
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
fvOptions.correct(U);
|
|
||||||
|
|
||||||
rho = thermo.rho();
|
|
||||||
rho = max(rho, rhoMin);
|
|
||||||
rho = min(rho, rhoMax);
|
|
||||||
rho.relax();
|
|
||||||
|
|
||||||
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
|
||||||
}
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
simpleCoalcombustionFoam
|
|
||||||
|
|
||||||
Description
|
|
||||||
Steady state solver for compressible, turbulent flow with reacting,
|
|
||||||
multiphase particle clouds and optional sources/constraints.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "turbulentFluidThermoModel.H"
|
|
||||||
#include "coalCloudList.H"
|
|
||||||
#include "rhoCombustionModel.H"
|
|
||||||
#include "radiationModel.H"
|
|
||||||
#include "IOporosityModelList.H"
|
|
||||||
#include "fvOptions.H"
|
|
||||||
#include "SLGThermo.H"
|
|
||||||
#include "simpleControl.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
#include "postProcess.H"
|
|
||||||
|
|
||||||
#include "setRootCase.H"
|
|
||||||
#include "createTime.H"
|
|
||||||
#include "createMesh.H"
|
|
||||||
#include "createControl.H"
|
|
||||||
#include "createFields.H"
|
|
||||||
#include "createFieldRefs.H"
|
|
||||||
#include "createFvOptions.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
turbulence->validate();
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
|
||||||
|
|
||||||
while (simple.loop())
|
|
||||||
{
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
|
||||||
|
|
||||||
parcels.evolve();
|
|
||||||
|
|
||||||
// --- Pressure-velocity SIMPLE corrector loop
|
|
||||||
{
|
|
||||||
#include "UEqn.H"
|
|
||||||
#include "YEqn.H"
|
|
||||||
#include "EEqn.H"
|
|
||||||
#include "pEqn.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
turbulence->correct();
|
|
||||||
|
|
||||||
runTime.write();
|
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
|
||||||
<< nl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -24,9 +24,6 @@ License
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "relativeVelocityModel.H"
|
#include "relativeVelocityModel.H"
|
||||||
#include "fixedValueFvPatchFields.H"
|
|
||||||
#include "slipFvPatchFields.H"
|
|
||||||
#include "partialSlipFvPatchFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
@ -36,34 +33,6 @@ namespace Foam
|
||||||
defineRunTimeSelectionTable(relativeVelocityModel, dictionary);
|
defineRunTimeSelectionTable(relativeVelocityModel, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::wordList Foam::relativeVelocityModel::UdmPatchFieldTypes() const
|
|
||||||
{
|
|
||||||
const volVectorField& U = mixture_.U();
|
|
||||||
|
|
||||||
wordList UdmTypes
|
|
||||||
(
|
|
||||||
U.boundaryField().size(),
|
|
||||||
calculatedFvPatchScalarField::typeName
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(U.boundaryField(), i)
|
|
||||||
{
|
|
||||||
if
|
|
||||||
(
|
|
||||||
isA<fixedValueFvPatchVectorField>(U.boundaryField()[i])
|
|
||||||
|| isA<slipFvPatchVectorField>(U.boundaryField()[i])
|
|
||||||
|| isA<partialSlipFvPatchVectorField>(U.boundaryField()[i])
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UdmTypes[i] = fixedValueFvPatchVectorField::typeName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return UdmTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
@ -86,12 +55,11 @@ Foam::relativeVelocityModel::relativeVelocityModel
|
||||||
"Udm",
|
"Udm",
|
||||||
alphac_.time().timeName(),
|
alphac_.time().timeName(),
|
||||||
alphac_.mesh(),
|
alphac_.mesh(),
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
alphac_.mesh(),
|
alphac_.mesh(),
|
||||||
dimensionedVector("Udm", dimVelocity, Zero),
|
dimensionedVector("Udm", dimVelocity, Zero)
|
||||||
UdmPatchFieldTypes()
|
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -52,16 +52,12 @@ class relativeVelocityModel
|
||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Return the list of patchFieldTypes for Udm derived from U
|
|
||||||
wordList UdmPatchFieldTypes() const;
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
relativeVelocityModel(const relativeVelocityModel&);
|
relativeVelocityModel(const relativeVelocityModel&);
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const relativeVelocityModel&);
|
void operator=(const relativeVelocityModel&);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -101,11 +101,7 @@ Foam::turbulentDispersionModels::Burns::D() const
|
||||||
*sqr(pair_.dispersed().d())
|
*sqr(pair_.dispersed().d())
|
||||||
)
|
)
|
||||||
*pair_.continuous().rho()
|
*pair_.continuous().rho()
|
||||||
*pair_.dispersed()
|
*(1.0 + pair_.dispersed()/max(pair_.continuous(), residualAlpha_));
|
||||||
*(
|
|
||||||
1.0/max(pair_.dispersed(), residualAlpha_)
|
|
||||||
+ 1.0/max(pair_.continuous(), residualAlpha_)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -101,11 +101,7 @@ Foam::turbulentDispersionModels::Burns::D() const
|
||||||
*sqr(pair_.dispersed().d())
|
*sqr(pair_.dispersed().d())
|
||||||
)
|
)
|
||||||
*pair_.continuous().rho()
|
*pair_.continuous().rho()
|
||||||
*pair_.dispersed()
|
*(1.0 + pair_.dispersed()/max(pair_.continuous(), residualAlpha_));
|
||||||
*(
|
|
||||||
1.0/max(pair_.dispersed(), residualAlpha_)
|
|
||||||
+ 1.0/max(pair_.continuous(), residualAlpha_)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
|
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||||
-ledgeMesh \
|
-ledgeMesh \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
-ldynamicMesh \
|
-ldynamicMesh \
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -62,7 +62,7 @@ Foam::tmp<Foam::Field<Type>> filterFarPoints
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<Field<Type>> tNewField(new Field<Type>(field.size()));
|
tmp<Field<Type>> tNewField(new Field<Type>(field.size()));
|
||||||
Field<Type>& newField = tNewField.ref();
|
Field<Type>& newField = tNewField();
|
||||||
|
|
||||||
label added = 0;
|
label added = 0;
|
||||||
label count = 0;
|
label count = 0;
|
||||||
|
|
@ -160,7 +160,7 @@ Foam::tmp<Foam::triadField> buildAlignmentField(const T& mesh)
|
||||||
(
|
(
|
||||||
new triadField(mesh.vertexCount(), triad::unset)
|
new triadField(mesh.vertexCount(), triad::unset)
|
||||||
);
|
);
|
||||||
triadField& alignments = tAlignments.ref();
|
triadField& alignments = tAlignments();
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
|
|
@ -188,7 +188,7 @@ Foam::tmp<Foam::pointField> buildPointField(const T& mesh)
|
||||||
(
|
(
|
||||||
new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT))
|
new pointField(mesh.vertexCount(), point(GREAT, GREAT, GREAT))
|
||||||
);
|
);
|
||||||
pointField& points = tPoints.ref();
|
pointField& points = tPoints();
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -30,7 +30,6 @@ License
|
||||||
#include "scalarIOField.H"
|
#include "scalarIOField.H"
|
||||||
#include "labelIOField.H"
|
#include "labelIOField.H"
|
||||||
#include "pointConversion.H"
|
#include "pointConversion.H"
|
||||||
#include "polyMesh.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ EXE_LIBS = \
|
||||||
-lconformalVoronoiMesh \
|
-lconformalVoronoiMesh \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
|
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||||
-ledgeMesh \
|
-ledgeMesh \
|
||||||
-lfileFormats \
|
-lfileFormats \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -311,7 +311,7 @@ tmp<scalarField> signedDistance
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tmp<scalarField> tfld(new scalarField(points.size(), Foam::sqr(GREAT)));
|
tmp<scalarField> tfld(new scalarField(points.size(), Foam::sqr(GREAT)));
|
||||||
scalarField& fld = tfld.ref();
|
scalarField& fld = tfld();
|
||||||
|
|
||||||
// Find nearest
|
// Find nearest
|
||||||
List<pointIndexHit> nearest;
|
List<pointIndexHit> nearest;
|
||||||
|
|
@ -647,8 +647,7 @@ int main(int argc, char *argv[])
|
||||||
forAll(fvm.C().boundaryField(), patchi)
|
forAll(fvm.C().boundaryField(), patchi)
|
||||||
{
|
{
|
||||||
const pointField& cc = fvm.C().boundaryField()[patchi];
|
const pointField& cc = fvm.C().boundaryField()[patchi];
|
||||||
fvPatchScalarField& fld =
|
fvPatchScalarField& fld = cellDistance.boundaryField()[patchi];
|
||||||
cellDistance.boundaryFieldRef()[patchi];
|
|
||||||
scalarField patchDistSqr
|
scalarField patchDistSqr
|
||||||
(
|
(
|
||||||
fld.patch().patchInternalField(distSqr)
|
fld.patch().patchInternalField(distSqr)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -33,7 +33,6 @@ Description
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "CGAL/number_utils.h"
|
|
||||||
#include "CGAL/Delaunay_triangulation_2.h"
|
#include "CGAL/Delaunay_triangulation_2.h"
|
||||||
|
|
||||||
#ifdef CGAL_INEXACT
|
#ifdef CGAL_INEXACT
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,6 @@ EXE_LIBS = \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
-ldynamicMesh \
|
-ldynamicMesh \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
|
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lfileFormats
|
-lfileFormats
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,4 @@ EXE_LIBS = \
|
||||||
-lgenericPatchFields \
|
-lgenericPatchFields \
|
||||||
-lrenumberMethods \
|
-lrenumberMethods \
|
||||||
$(LINK_FLAGS) \
|
$(LINK_FLAGS) \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp
|
||||||
-L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -84,12 +84,10 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
#include "createNamedPolyMesh.H"
|
#include "createNamedPolyMesh.H"
|
||||||
|
|
||||||
const fileName setsSubPath(mesh.dbDir()/polyMesh::meshSubDir/"sets");
|
|
||||||
|
|
||||||
// Search for list of objects for the time of the mesh
|
// Search for list of objects for the time of the mesh
|
||||||
word setsInstance = runTime.findInstance
|
word setsInstance = runTime.findInstance
|
||||||
(
|
(
|
||||||
setsSubPath,
|
polyMesh::meshSubDir/"sets",
|
||||||
word::null,
|
word::null,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
mesh.facesInstance()
|
mesh.facesInstance()
|
||||||
|
|
@ -97,7 +95,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets");
|
IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets");
|
||||||
|
|
||||||
Info<< "Searched : " << setsInstance/setsSubPath
|
Info<< "Searched : " << setsInstance/polyMesh::meshSubDir/"sets"
|
||||||
<< nl
|
<< nl
|
||||||
<< "Found : " << objects.names() << nl
|
<< "Found : " << objects.names() << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@ EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lgenericPatchFields \
|
-lgenericPatchFields \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \
|
-L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-ldynamicMesh
|
-ldynamicMesh
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -42,7 +42,7 @@ Description
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Turbulence constants - file-scope
|
// turbulence constants - file-scope
|
||||||
static const scalar Cmu(0.09);
|
static const scalar Cmu(0.09);
|
||||||
static const scalar kappa(0.41);
|
static const scalar kappa(0.41);
|
||||||
|
|
||||||
|
|
@ -130,14 +130,14 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
if (isA<incompressible::RASModel>(turbulence()))
|
if (isA<incompressible::RASModel>(turbulence()))
|
||||||
{
|
{
|
||||||
// Calculate nut
|
// Calculate nut - reference nut is calculated by the turbulence model
|
||||||
turbulence->validate();
|
// on its construction
|
||||||
tmp<volScalarField> tnut = turbulence->nut();
|
tmp<volScalarField> tnut = turbulence->nut();
|
||||||
volScalarField& nut = const_cast<volScalarField&>(tnut());
|
volScalarField& nut = tnut.ref();
|
||||||
volScalarField S(mag(dev(symm(fvc::grad(U)))));
|
volScalarField S(mag(dev(symm(fvc::grad(U)))));
|
||||||
nut = (1 - mask)*nut + mask*sqr(kappa*min(y, ybl))*::sqrt(2)*S;
|
nut = (1 - mask)*nut + mask*sqr(kappa*min(y, ybl))*::sqrt(2)*S;
|
||||||
|
|
||||||
// Do not correct BC - wall functions will 'undo' manipulation above
|
// do not correct BC - wall functions will 'undo' manipulation above
|
||||||
// by using nut from turbulence model
|
// by using nut from turbulence model
|
||||||
|
|
||||||
if (args.optionFound("writenut"))
|
if (args.optionFound("writenut"))
|
||||||
|
|
@ -151,11 +151,11 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Turbulence k
|
// Turbulence k
|
||||||
tmp<volScalarField> tk = turbulence->k();
|
tmp<volScalarField> tk = turbulence->k();
|
||||||
volScalarField& k = const_cast<volScalarField&>(tk());
|
volScalarField& k = tk.ref();
|
||||||
scalar ck0 = pow025(Cmu)*kappa;
|
scalar ck0 = pow025(Cmu)*kappa;
|
||||||
k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl)));
|
k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl)));
|
||||||
|
|
||||||
// Do not correct BC - operation may use inconsistent fields wrt these
|
// do not correct BC - operation may use inconsistent fields wrt these
|
||||||
// local manipulations
|
// local manipulations
|
||||||
// k.correctBoundaryConditions();
|
// k.correctBoundaryConditions();
|
||||||
|
|
||||||
|
|
@ -165,11 +165,11 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// Turbulence epsilon
|
// Turbulence epsilon
|
||||||
tmp<volScalarField> tepsilon = turbulence->epsilon();
|
tmp<volScalarField> tepsilon = turbulence->epsilon();
|
||||||
volScalarField& epsilon = const_cast<volScalarField&>(tepsilon());
|
volScalarField& epsilon = tepsilon.ref();
|
||||||
scalar ce0 = ::pow(Cmu, 0.75)/kappa;
|
scalar ce0 = ::pow(Cmu, 0.75)/kappa;
|
||||||
epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl);
|
epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl);
|
||||||
|
|
||||||
// Do not correct BC - wall functions will use non-updated k from
|
// do not correct BC - wall functions will use non-updated k from
|
||||||
// turbulence model
|
// turbulence model
|
||||||
// epsilon.correctBoundaryConditions();
|
// epsilon.correctBoundaryConditions();
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@ int main(int argc, char *argv[])
|
||||||
dimensionedScalar k0("VSMALL", k.dimensions(), VSMALL);
|
dimensionedScalar k0("VSMALL", k.dimensions(), VSMALL);
|
||||||
omega = (1 - mask)*omega + mask*epsilon/(Cmu*k + k0);
|
omega = (1 - mask)*omega + mask*epsilon/(Cmu*k + k0);
|
||||||
|
|
||||||
// Do not correct BC - wall functions will use non-updated k from
|
// do not correct BC - wall functions will use non-updated k from
|
||||||
// turbulence model
|
// turbulence model
|
||||||
// omega.correctBoundaryConditions();
|
// omega.correctBoundaryConditions();
|
||||||
|
|
||||||
|
|
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
|
||||||
volScalarField nuTilda(nuTildaHeader, mesh);
|
volScalarField nuTilda(nuTildaHeader, mesh);
|
||||||
nuTilda = nut;
|
nuTilda = nut;
|
||||||
|
|
||||||
// Do not correct BC
|
// do not correct BC
|
||||||
// nuTilda.correctBoundaryConditions();
|
// nuTilda.correctBoundaryConditions();
|
||||||
|
|
||||||
Info<< "Writing nuTilda\n" << endl;
|
Info<< "Writing nuTilda\n" << endl;
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ do
|
||||||
##DEBUG echo "remove>$wildcard<" 1>&2
|
##DEBUG echo "remove>$wildcard<" 1>&2
|
||||||
if [ -n "$wildcard" ]
|
if [ -n "$wildcard" ]
|
||||||
then
|
then
|
||||||
dirList=$(echo "$dirList:" | sed -e "s|${wildcard}[^:]*:||g")
|
dirList=$(echo "$dirList:" | sed -e "s@${wildcard}[^:]*:@@g")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
|
|
@ -32,6 +32,6 @@
|
||||||
Script=${0##*/}
|
Script=${0##*/}
|
||||||
|
|
||||||
echo $Script "has been superceded by the foamList utility:"
|
echo $Script "has been superceded by the foamList utility:"
|
||||||
echo "foamList -switches"
|
echo "foamList -debug"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# ========= |
|
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
# \\ / O peration |
|
|
||||||
# \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
|
||||||
# \\/ M anipulation |
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
# License
|
|
||||||
# This file is part of OpenFOAM.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
# Script
|
|
||||||
# stressComponents
|
|
||||||
#
|
|
||||||
# Description
|
|
||||||
# Script to suggest using the new "-postProcess" solver option.
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
Script=${0##*/}
|
|
||||||
|
|
||||||
echo $Script "has been superceded by the -postProcess solver option:"
|
|
||||||
echo "<solverName> -funcs '(R components(turbulenceProperties:R))'"
|
|
||||||
echo "e.g."
|
|
||||||
echo "simpleFoam -postProcess -funcs '(R components(turbulenceProperties:R))'"
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# ========= |
|
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
# \\ / O peration |
|
|
||||||
# \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
|
||||||
# \\/ M anipulation |
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
# License
|
|
||||||
# This file is part of OpenFOAM.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# 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
|
|
||||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
|
||||||
# Script
|
|
||||||
# wallGradU
|
|
||||||
#
|
|
||||||
# Description
|
|
||||||
# Script to suggest using the new "postProcess" utility.
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
Script=${0##*/}
|
|
||||||
|
|
||||||
echo $Script "has been superceded by the postProcess utility:"
|
|
||||||
echo " postProcess -func 'grad(U)'"
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
|
|
@ -168,7 +168,7 @@ STRIP_FROM_INC_PATH =
|
||||||
# support long names like on DOS, Mac, or CD-ROM.
|
# support long names like on DOS, Mac, or CD-ROM.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
SHORT_NAMES = NO
|
SHORT_NAMES = YES
|
||||||
|
|
||||||
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
|
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
|
||||||
# first line (until the first dot) of a Javadoc-style comment as the brief
|
# first line (until the first dot) of a Javadoc-style comment as the brief
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
export WM_PROJECT=OpenFOAM
|
export WM_PROJECT=OpenFOAM
|
||||||
export WM_PROJECT_VERSION=4.x
|
export WM_PROJECT_VERSION=4.1
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
@ -43,12 +43,15 @@ export WM_PROJECT_VERSION=4.x
|
||||||
# Please set to the appropriate path if the default is not correct.
|
# Please set to the appropriate path if the default is not correct.
|
||||||
#
|
#
|
||||||
[ $BASH_SOURCE ] && \
|
[ $BASH_SOURCE ] && \
|
||||||
export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \
|
export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \
|
||||||
export FOAM_INST_DIR=$HOME/$WM_PROJECT
|
export FOAM_INST_DIR=$HOME/$WM_PROJECT
|
||||||
# export FOAM_INST_DIR=~$WM_PROJECT
|
# export FOAM_INST_DIR=~$WM_PROJECT
|
||||||
# export FOAM_INST_DIR=/opt/$WM_PROJECT
|
# export FOAM_INST_DIR=/opt/$WM_PROJECT
|
||||||
# export FOAM_INST_DIR=/usr/local/$WM_PROJECT
|
# export FOAM_INST_DIR=/usr/local/$WM_PROJECT
|
||||||
#
|
#
|
||||||
|
# Build foamyHexMesh
|
||||||
|
export FOAMY_HEX_MESH=yes
|
||||||
|
#
|
||||||
# END OF (NORMAL) USER EDITABLE PART
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,6 @@
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
||||||
|
|
||||||
type forceCoeffs;
|
type forceCoeffs;
|
||||||
|
rhoInf 1; // Redundant for incompressible
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,6 @@ dragDir (1 0 0);
|
||||||
CofR (0 0 0);
|
CofR (0 0 0);
|
||||||
pitchAxis (0 1 0);
|
pitchAxis (0 1 0);
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
|
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsCompressible.cfg"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,4 @@
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
|
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
|
||||||
|
|
||||||
rho rhoInf;
|
|
||||||
rhoInf 1; // Redundant, but currently read in
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
@ -24,6 +24,6 @@ dragDir (1 0 0);
|
||||||
CofR (0 0 0);
|
CofR (0 0 0);
|
||||||
pitchAxis (0 1 0);
|
pitchAxis (0 1 0);
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forceCoeffsIncompressible.cfg"
|
#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ libs ("libforces.so");
|
||||||
writeControl timeStep;
|
writeControl timeStep;
|
||||||
writeInterval 1;
|
writeInterval 1;
|
||||||
|
|
||||||
|
rho rhoInf; // Incompressible solver
|
||||||
log off;
|
log off;
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,6 @@ patches (patch1 patch2);
|
||||||
CofR (0 0 0);
|
CofR (0 0 0);
|
||||||
pitchAxis (0 1 0);
|
pitchAxis (0 1 0);
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
#includeEtc "caseDicts/postProcessing/forces/forcesCompressible.cfg"
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
||||||
|
|
||||||
rho rhoInf;
|
rhoInf 1; // Redundant
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
@ -11,7 +11,7 @@ Description
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#includeEtc "caseDicts/postProcessing/forces/forcesIncompressible.cfg"
|
#includeEtc "caseDicts/postProcessing/forces/forces.cfg"
|
||||||
|
|
||||||
rhoInf 1.225; // Fluid density
|
rhoInf 1.225; // Fluid density
|
||||||
patches (patch1 patch2);
|
patches (patch1 patch2);
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Web: www.OpenFOAM.org
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
Description
|
|
||||||
Calculate intensive fields:
|
|
||||||
- UMean
|
|
||||||
- translationalT
|
|
||||||
- internalT
|
|
||||||
- overallT
|
|
||||||
from averaged extensive fields from a DSMC calculation.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
type dsmcFields;
|
|
||||||
libs ("liblagrangianFunctionObjects.so");
|
|
||||||
|
|
||||||
fields (rhoNMean rhoMMean momentumMean linearKEMean internalEMean
|
|
||||||
iDofMean fDMean);
|
|
||||||
|
|
||||||
executeControl writeTime;
|
|
||||||
writeControl writeTime;
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
|
|
@ -34,8 +34,6 @@
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
|
|
||||||
|
|
||||||
# Clean the PATH
|
# Clean the PATH
|
||||||
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
|
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
|
||||||
if ( $status == 0 ) setenv PATH $cleaned
|
if ( $status == 0 ) setenv PATH $cleaned
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ FoamFile
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
{
|
{
|
||||||
docBrowser "firefox -file %f";
|
docBrowser "firefox %f";
|
||||||
doxyDocDirs
|
doxyDocDirs
|
||||||
(
|
(
|
||||||
"$WM_PROJECT_USER_DIR/html"
|
"$WM_PROJECT_USER_DIR/html"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
setenv WM_PROJECT OpenFOAM
|
setenv WM_PROJECT OpenFOAM
|
||||||
setenv WM_PROJECT_VERSION 4.x
|
setenv WM_PROJECT_VERSION 4.1
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
||||||
|
|
@ -43,11 +43,15 @@ setenv WM_PROJECT_VERSION 4.x
|
||||||
#
|
#
|
||||||
setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | \
|
setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | \
|
||||||
sed 's%/'$WM_PROJECT'[^/]*/etc/cshrc%%'`
|
sed 's%/'$WM_PROJECT'[^/]*/etc/cshrc%%'`
|
||||||
|
echo $FOAM_INST_DIR
|
||||||
# setenv FOAM_INST_DIR $HOME/$WM_PROJECT
|
# setenv FOAM_INST_DIR $HOME/$WM_PROJECT
|
||||||
# setenv FOAM_INST_DIR ~$WM_PROJECT
|
# setenv FOAM_INST_DIR ~$WM_PROJECT
|
||||||
# setenv FOAM_INST_DIR /opt/$WM_PROJECT
|
# setenv FOAM_INST_DIR /opt/$WM_PROJECT
|
||||||
# setenv FOAM_INST_DIR /usr/local/$WM_PROJECT
|
# setenv FOAM_INST_DIR /usr/local/$WM_PROJECT
|
||||||
#
|
#
|
||||||
|
# Build foamyHexMesh
|
||||||
|
setenv FOAMY_HEX_MESH yes
|
||||||
|
#
|
||||||
# END OF (NORMAL) USER EDITABLE PART
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ divSchemes
|
||||||
div(phi,K) $turbulence;
|
div(phi,K) $turbulence;
|
||||||
div(phi,Ekp) $turbulence;
|
div(phi,Ekp) $turbulence;
|
||||||
|
|
||||||
div(phid,p) Gauss upwind;
|
div(phid,p) bounded Gauss upwind;
|
||||||
div((phi|interpolate(rho)),p) bounded Gauss upwind;
|
div((phi|interpolate(rho)),p) bounded Gauss upwind;
|
||||||
|
|
||||||
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||||
|
|
|
||||||
|
|
@ -64,24 +64,23 @@ Description
|
||||||
libs | Libraries containing implementation | yes |
|
libs | Libraries containing implementation | yes |
|
||||||
region | Name of region for multi-region cases | no |
|
region | Name of region for multi-region cases | no |
|
||||||
enabled | On/off switch | no | yes
|
enabled | On/off switch | no | yes
|
||||||
log | Log information to standard output | no | yes
|
|
||||||
timeStart| Start time | no |
|
timeStart| Start time | no |
|
||||||
timeEnd | End time | no |
|
timeEnd | End time | no |
|
||||||
executeControl | See time controls below | no | timeStep
|
evaluateControl | See time controls below | no | timeStep
|
||||||
executeInterval | Steps between each execute phase | no |
|
evaluateInterval | Steps between output | no |
|
||||||
writeControl | See time controls below | no | timeStep
|
writeControl | See time controls below | no | timeStep
|
||||||
writeInterval | Steps between each write phase | no |
|
writeInterval | Steps between output | no |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Time controls:
|
Time controls:
|
||||||
\table
|
\table
|
||||||
Option | Description
|
Option | Description
|
||||||
timeStep | Execute/write every 'Interval' time-steps
|
timeStep | Execute/write every 'writeInterval' time-steps
|
||||||
writeTime | Execute/write every 'Interval' output times
|
writeTime | Execute/write every 'writeInterval' output times
|
||||||
adjustableRunTime | Execute/write every 'Interval' run time period
|
adjustableRunTime | Execute/write every 'writeInterval' run time period
|
||||||
runTime | Execute/write every 'Interval' run time period
|
runTime | Execute/write every 'writeInterval' run time period
|
||||||
clockTime | Execute/write every 'Interval' clock time period
|
clockTime | Execute/write every 'writeInterval' clock time period
|
||||||
cpuTime | Execute/write every 'Interval' CPU time period
|
cpuTime | Execute/write every 'writeInterval' CPU time period
|
||||||
none | Execute/write every time-step
|
none | Execute/write every time-step
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
|
@ -92,14 +91,6 @@ Description
|
||||||
libraries and the \c libs entry is used to specify which library should be
|
libraries and the \c libs entry is used to specify which library should be
|
||||||
loaded.
|
loaded.
|
||||||
|
|
||||||
Each function object has two separate run phases:
|
|
||||||
|
|
||||||
- The \c execute phase is meant to be used for updating calculations
|
|
||||||
or for management tasks.
|
|
||||||
- The \c write phase is meant for writing the calculated data to disk.
|
|
||||||
|
|
||||||
For each phase the respective time controls are provided, as listed above.
|
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::functionObject
|
Foam::functionObject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ bool Foam::functionObjects::regionFunctionObject::store
|
||||||
if (cacheable && fieldName == tfield().name())
|
if (cacheable && fieldName == tfield().name())
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Cannot store cache-able field with the name used in the cache."
|
<< "Cannot store cache-able field with the named used in the cache."
|
||||||
<< nl
|
<< nl
|
||||||
<< " Either choose a different name or cache the field"
|
<< " Either choose a different name or cache the field"
|
||||||
<< " and use the 'writeObjects' functionObject."
|
<< " and use the 'writeObjects' functionObject."
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -211,7 +211,7 @@ DimensionedField<Type, GeoMesh>::DimensionedField
|
||||||
const DimensionedField<Type, GeoMesh>& df
|
const DimensionedField<Type, GeoMesh>& df
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
regIOobject(newName, df, newName != df.name()),
|
regIOobject(newName, df, newName == df.name()),
|
||||||
Field<Type>(df),
|
Field<Type>(df),
|
||||||
mesh_(df.mesh_),
|
mesh_(df.mesh_),
|
||||||
dimensions_(df.dimensions_)
|
dimensions_(df.dimensions_)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -1164,18 +1164,11 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
|
||||||
|
|
||||||
this->dimensions() = gf.dimensions();
|
this->dimensions() = gf.dimensions();
|
||||||
|
|
||||||
if (tgf.isTmp())
|
// Transfer the storage from the tmp
|
||||||
{
|
primitiveFieldRef().transfer
|
||||||
// Transfer the storage from the tmp
|
(
|
||||||
primitiveFieldRef().transfer
|
const_cast<Field<Type>&>(gf.primitiveField())
|
||||||
(
|
);
|
||||||
const_cast<Field<Type>&>(gf.primitiveField())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
primitiveFieldRef() = gf.primitiveField();
|
|
||||||
}
|
|
||||||
|
|
||||||
boundaryFieldRef() = gf.boundaryField();
|
boundaryFieldRef() = gf.boundaryField();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -35,9 +35,6 @@ namespace Foam
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::label Foam::lduMatrix::solver::defaultMaxIter_ = 1000;
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::lduMatrix::lduMatrix(const lduMesh& mesh)
|
Foam::lduMatrix::lduMatrix(const lduMesh& mesh)
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue