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

113 lines
3.2 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 "Coulomb.H"
#include "Ion.H"
#include "Electron.H"
#include "error.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::Coulomb::Coulomb(const Ion& a, const Ion& b)
:
eij_(abs(a.z()*b.z())*sqr(a.e)
/(4.0*Foam::Ion::pi*Foam::Ion::eps0*Foam::Ion::k)),
Wij_(inv(inv(a.W()) + inv(b.W())))
{
}
Foam::Coulomb::Coulomb(const Electron& a, const Ion& b)
:
// a_(a),
// b_(b),
// eij_(abs(a_.z()*b_.z())*sqr(a_.e)/(4.0*a_.pi*a_.eps0*a_.k)),
// Wij_(1.0/(1.0/a_.W() + 1.0/b_.W()))
eij_(abs(a.z()*b.z())*sqr(a.e)
/(4.0*Foam::Ion::pi*Foam::Ion::eps0*Foam::Ion::k)),
Wij_(inv(inv(a.W()) + inv(b.W())))
{
}
Foam::Coulomb::Coulomb(const Electron& a, const Electron& b)
:
// a_(a),
// b_(b),
// eij_(abs(a_.z()*b_.z())*sqr(a_.e)/(4.0*a_.pi*a_.eps0*a_.k)),
// Wij_(1.0/(1.0/a_.W() + 1.0/b_.W()))
eij_(abs(a.z()*b.z())*sqr(a.e)
/(4.0*Foam::Ion::pi*Foam::Ion::eps0*Foam::Ion::k)),
Wij_(inv(inv(a.W()) + inv(b.W())))
{
}
/*
*/
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::Coulomb::~Coulomb()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
void Foam::Coulomb::operator=(const Coulomb& rhs)
{
// Check for assignment to self
if (this == &rhs)
{
FatalErrorInFunction
<< "Attempted assignment to self"
<< abort(FatalError);
}
}
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
// ************************************************************************* //