eReactingFoam-4.x/diffusivityModel/N64/N64.C

115 lines
4 KiB
C

/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "N64.H"
#include "error.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::scalar Foam::N64::a11[(M+1)*(M+2)/2] = {
0., -0.81508875, -0.06484549, 0.31926761, 0.35164219, -0.01484638,
-0.02385399, -0.14337633, -0.18493828, 0.05466979, -0.0010004, 0.01936938,
-0.0130214, 0.12179535, -0.05237791, -0.00172218, -0.00447904, 0.02211965,
0.00964791, -0.07566612, 0.02527412
};
const Foam::scalar Foam::N64::a22[(M+1)*(M+2)/2] = {
0.00000000e+00, -8.59231154e-01, -7.02815662e-02, 2.79760234e-01,
3.59026813e-01, -3.25082644e-01, -8.27621218e-03, -1.12825149e-01,
-2.07675933e-01, 1.02433682e+00, -4.59772292e-04, 1.03264160e-02,
-1.35152522e-02, 1.69188798e-01, -1.21839345e+00, -1.88957374e-03,
-4.45369981e-03, 2.07928092e-02, 7.40762555e-03, -9.71847966e-02,
5.07723424e-01
};
Foam::scalar Foam::N64::vec[(M+1)*(M+2)/2] = { 0.0 };
const Foam::scalar Foam::N64::digamma3 = 0.922784335098467139393487909917597568957840664060;
const Foam::scalar Foam::N64::trigamma3 = sqr(Ion::pi) / 6. - 5./4.;
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::N64::N64(const Ion& a, const Neutral& b)
:
a_(a),
b_(b),
ksiij_(a_.alpha()/(sqr(a_.z())*sqrt(b_.alpha())*(1.0+pow(2.0*a_.alpha()/b_.alpha(),2./3.)))),
sigmaij_(K1 * (pow(a_.alpha(), 1./3.) + pow(b_.alpha(), 1./3.)) / pow(a_.alpha()*b_.alpha()*(1. + 1./ksiij_), kappa)),
eij_(5.2 * b_.alpha() * sqr(a_.z()) * (1.0 + ksiij_) / pow4(sigmaij_) / (a_.k/a_.e)),
C6ij_(0.0),
gammaij_(0.0),
Wij_(1.0/(1.0/a_.W() + 1.0/b_.W()))
{
scalar aij = a_.alpha() / b_.alpha();
scalar aji = 1.0 / aij;
C6ij_ = 2.0 * a_.C6() * b_.C6() / (aji * a_.C6() + aij * b_.C6());
gammaij_ = ((2.0/sqr(a_.z())) * C6ij_ + b_.alphaQ()) / (b_.alpha() * sqr(sigmaij_));
Info << "N64, gamma = " << gammaij_ << endl;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::N64::~N64()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
void Foam::N64::operator=(const N64& rhs)
{
// Check for assignment to self
if (this == &rhs)
{
FatalErrorInFunction
<< "Attempted assignment to self"
<< abort(FatalError);
}
}
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
// ************************************************************************* //