Electron and Electron Diffusivity based on scattering cross section
This commit is contained in:
parent
6e4e4a96d6
commit
6d3a738e8b
12 changed files with 786 additions and 21 deletions
|
|
@ -1,11 +1,13 @@
|
|||
diffusivityModel/Particle/Particle.C
|
||||
diffusivityModel/Neutral/Neutral.C
|
||||
diffusivityModel/Ion/Ion.C
|
||||
diffusivityModel/Electron/Electron.C
|
||||
|
||||
diffusivityModel/Interaction/Interaction.C
|
||||
diffusivityModel/Stockmayer/Stockmayer.C
|
||||
diffusivityModel/Coulomb/Coulomb.C
|
||||
diffusivityModel/N64/N64.C
|
||||
diffusivityModel/CrossSection/CrossSection.C
|
||||
|
||||
diffusivityModel/diffusivityModel/diffusivityModel.C
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
EXE_INC = \
|
||||
-g \
|
||||
-IdiffusivityModel/Particle \
|
||||
-IdiffusivityModel/Electron \
|
||||
-IdiffusivityModel/Neutral \
|
||||
-IdiffusivityModel/Ion \
|
||||
-IdiffusivityModel/Interaction \
|
||||
-IdiffusivityModel/Stockmayer \
|
||||
-IdiffusivityModel/Coulomb \
|
||||
-IdiffusivityModel/N64 \
|
||||
-IdiffusivityModel/CrossSection \
|
||||
-IdiffusivityModel/diffusivityModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ License
|
|||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Coulomb.H"
|
||||
#include "Electron.H"
|
||||
|
||||
#include "error.H"
|
||||
|
||||
|
|
@ -49,15 +50,14 @@ Foam::Coulomb::Coulomb(const Ion& a, const Ion& b)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
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*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())))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -68,10 +68,12 @@ Foam::Coulomb::Coulomb(const Electron& a, const Electron& b)
|
|||
// 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*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())))
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class Ostream;
|
|||
|
||||
// Forward declaration of friend functions and operators
|
||||
class Coulomb;
|
||||
class Electron;
|
||||
Istream& operator>>(Istream&, Coulomb&);
|
||||
Ostream& operator<<(Ostream&, const Coulomb&);
|
||||
|
||||
|
|
@ -95,6 +96,12 @@ public:
|
|||
//- Construct from components
|
||||
Coulomb(const Ion& a, const Ion& b);
|
||||
|
||||
//- Construct from components
|
||||
Coulomb(const Electron& a, const Ion& b);
|
||||
|
||||
//- Construct from components
|
||||
Coulomb(const Electron& a, const Electron& b);
|
||||
|
||||
//- Construct from Istream
|
||||
Coulomb(Istream&);
|
||||
|
||||
|
|
|
|||
95
diffusivityModel/CrossSection/CrossSection.C
Normal file
95
diffusivityModel/CrossSection/CrossSection.C
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "CrossSection.H"
|
||||
|
||||
#include "error.H"
|
||||
#include "scalarMatrices.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Foam::scalarField Foam::CrossSection::vec((M+1), 0.0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::CrossSection::CrossSection(const Electron& a, const Neutral& b)
|
||||
:
|
||||
a_(a),
|
||||
b_(b),
|
||||
b11_((M+1), 0.0)
|
||||
{
|
||||
b_.name();
|
||||
if (a_.isTarget(b_.name()))
|
||||
{
|
||||
b11_ = a_.DejFitCoefs(b_.name());
|
||||
}
|
||||
else
|
||||
{
|
||||
b11_[0] = VGREAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::CrossSection::~CrossSection()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::CrossSection::operator=(const CrossSection& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
216
diffusivityModel/CrossSection/CrossSection.H
Normal file
216
diffusivityModel/CrossSection/CrossSection.H
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::CrossSection
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
CrossSectionI.H
|
||||
CrossSection.C
|
||||
CrossSectionIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CrossSection_H
|
||||
#define CrossSection_H
|
||||
|
||||
#include "scalar.H"
|
||||
#include "scalarField.H"
|
||||
#include "Electron.H"
|
||||
#include "Neutral.H"
|
||||
#include "Interaction.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class Istream;
|
||||
class Ostream;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
class CrossSection;
|
||||
Istream& operator>>(Istream&, CrossSection&);
|
||||
Ostream& operator<<(Ostream&, const CrossSection&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class CrossSection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class CrossSection
|
||||
: public Interaction
|
||||
{
|
||||
// Private data
|
||||
//
|
||||
//- Highest polynomial order of diffusivity fitting formular
|
||||
static constexpr label M = 7;
|
||||
|
||||
//- Collision participant ion a
|
||||
const Electron &a_;
|
||||
|
||||
//- Collision participant neutral b
|
||||
const Neutral &b_;
|
||||
|
||||
//- p * Dej Fit Coefficient
|
||||
scalarField b11_;
|
||||
|
||||
//- Buffer for polynomial feature
|
||||
static scalarField vec;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
CrossSection(const CrossSection&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const CrossSection&);
|
||||
|
||||
// primary template
|
||||
template <label Order>
|
||||
struct UnivarPolyFeat
|
||||
{
|
||||
static scalar transform (scalar x1, scalar *vec)
|
||||
{
|
||||
scalar highest = UnivarPolyFeat<Order-1>::transform(x1,vec) * x1;
|
||||
|
||||
*(vec+Order) = highest;
|
||||
|
||||
return highest;
|
||||
}
|
||||
};
|
||||
|
||||
// convenience function
|
||||
inline void transform (scalar x1, scalar *vec)
|
||||
{
|
||||
UnivarPolyFeat<M>::transform(x1,vec);
|
||||
}
|
||||
|
||||
// primary template
|
||||
template <label N>
|
||||
struct ScalarProduct
|
||||
{
|
||||
static scalar product (const scalar* first, const scalar* second)
|
||||
{
|
||||
return ScalarProduct<N-1>::product(first + 1, second + 1)
|
||||
+ *first * *second;
|
||||
}
|
||||
};
|
||||
|
||||
// convenience function
|
||||
inline scalar scalarProduct (const scalar *x1, const scalar *x2)
|
||||
{
|
||||
return ScalarProduct<(M+1)>::product(x1,x2);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
CrossSection();
|
||||
|
||||
//- Construct from components
|
||||
CrossSection(const Electron& a, const Neutral& b);
|
||||
|
||||
//- Construct from Istream
|
||||
CrossSection(Istream&);
|
||||
|
||||
//- Construct as copy
|
||||
// CrossSection(const CrossSection&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
~CrossSection();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
// Check
|
||||
|
||||
// Edit
|
||||
|
||||
// Write
|
||||
|
||||
inline scalar Dfit(const scalar T);
|
||||
|
||||
|
||||
inline scalar D(const scalar p, const scalar T);
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
|
||||
// Friend Functions
|
||||
|
||||
// Friend Operators
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>>(Istream&, CrossSection&);
|
||||
friend Ostream& operator<<(Ostream&, const CrossSection&);
|
||||
};
|
||||
|
||||
// partial specialization as end criteria
|
||||
template <>
|
||||
class CrossSection::UnivarPolyFeat<0>
|
||||
{
|
||||
public:
|
||||
static scalar transform (scalar x1, scalar *vec)
|
||||
{
|
||||
*vec = 1.0;
|
||||
return 1.0;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct CrossSection::ScalarProduct<1>
|
||||
{
|
||||
static scalar product (const scalar* first, const scalar* second) {
|
||||
return *first * *second;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "CrossSectionI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
71
diffusivityModel/CrossSection/CrossSectionI.H
Normal file
71
diffusivityModel/CrossSection/CrossSectionI.H
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
inline Foam::scalar Foam::CrossSection::Dfit(const scalar T)
|
||||
{
|
||||
transform (sqrt(T), vec.data());
|
||||
return scalarProduct (b11_.data(), vec.data());
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::CrossSection::D(const scalar p, const scalar T)
|
||||
{
|
||||
return Dfit (T) / p;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
110
diffusivityModel/Electron/Electron.C
Normal file
110
diffusivityModel/Electron/Electron.C
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "Electron.H"
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "scalarList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
// const dataType Foam::Electron::staticData();
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Electron::Electron(const dictionary& dict)
|
||||
:
|
||||
Particle(dict),
|
||||
fitDict_(dict.subDict("fitCoefs")),
|
||||
collisionTargets_(fitDict_.lookup("species")),
|
||||
DejFitCoefs_(collisionTargets_.size())
|
||||
{
|
||||
|
||||
forAll (DejFitCoefs_, idx)
|
||||
{
|
||||
|
||||
DejFitCoefs_.set(idx, new scalarList(fitDict_.lookup(collisionTargets_[idx])));
|
||||
|
||||
Info << DejFitCoefs_[idx] << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Electron::~Electron()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::Electron::operator=(const Electron& rhs)
|
||||
{
|
||||
// Check for assignment to self
|
||||
if (this == &rhs)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Attempted assignment to self"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const Electron& st)
|
||||
{
|
||||
os << static_cast<const Particle&>(st); // << tab
|
||||
/*
|
||||
<< st.alpha_ << tab
|
||||
<< st.C6_ << tab
|
||||
<< st.Zrot_ << tab
|
||||
<< st.n_ << tab
|
||||
<< st.rctTarget_ << tab
|
||||
<< st.Arct_ << tab
|
||||
<< st.Brct_;
|
||||
*/
|
||||
|
||||
os.check("Ostream& operator<<(Ostream& os, const specie& st)");
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
153
diffusivityModel/Electron/Electron.H
Normal file
153
diffusivityModel/Electron/Electron.H
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::Electron
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
ElectronI.H
|
||||
Electron.C
|
||||
ElectronIO.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Electron_H
|
||||
#define Electron_H
|
||||
|
||||
#include "Particle.H"
|
||||
#include "hashedWordList.H"
|
||||
#include "scalarList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class Istream;
|
||||
class Ostream;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
class Electron;
|
||||
Istream& operator>>(Istream&, Electron&);
|
||||
Ostream& operator<<(Ostream&, const Electron&);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Electron Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Electron
|
||||
:
|
||||
public Particle
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Resonant charge transfer targets
|
||||
const dictionary &fitDict_;
|
||||
|
||||
//- Resonant charge transfer targets
|
||||
hashedWordList collisionTargets_;
|
||||
|
||||
//- Resonant charge transfer targets
|
||||
PtrList<scalarList> DejFitCoefs_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
Electron(const Electron&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const Electron&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Static data members
|
||||
|
||||
//- Static data staticData
|
||||
// static const dataType staticData;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
Electron(const dictionary& dict);
|
||||
|
||||
//- Construct from Istream
|
||||
Electron(Istream&);
|
||||
|
||||
//- Construct as copy
|
||||
// Electron(const Electron&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
~Electron();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
inline bool isTarget(const word &target) const;
|
||||
|
||||
inline const scalarList& DejFitCoefs(const word &target) const;
|
||||
|
||||
// Check
|
||||
|
||||
// Edit
|
||||
|
||||
// Write
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
// void operator=(const Electron&);
|
||||
|
||||
|
||||
// Friend Functions
|
||||
|
||||
// Friend Operators
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>>(Istream&, Electron&);
|
||||
friend Ostream& operator<<(Ostream&, const Electron&);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "ElectronI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
74
diffusivityModel/Electron/ElectronI.H
Normal file
74
diffusivityModel/Electron/ElectronI.H
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
inline bool Foam::Electron::isTarget(const word &target)
|
||||
const
|
||||
{
|
||||
return collisionTargets_.contains(target);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline const Foam::scalarList& Foam::Electron::DejFitCoefs(const word &target)
|
||||
const
|
||||
{
|
||||
return DejFitCoefs_[collisionTargets_[target]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
@ -30,11 +30,13 @@ License
|
|||
#include "volFieldsFwd.H"
|
||||
#include "scalarMatrices.H"
|
||||
#include "Particle.H"
|
||||
#include "Electron.H"
|
||||
#include "Neutral.H"
|
||||
#include "Ion.H"
|
||||
#include "Stockmayer.H"
|
||||
#include "Coulomb.H"
|
||||
#include "N64.H"
|
||||
#include "CrossSection.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
|
@ -114,6 +116,8 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
|||
D_(thermo_.composition().species().size()),
|
||||
neutrals_(thermo_.composition().species().size()),
|
||||
ions_(thermo_.composition().species().size()),
|
||||
ecs_(thermo_.composition().species().size()),
|
||||
ens_(thermo_.composition().species().size()),
|
||||
nns_(thermo_.composition().species().size()*thermo_.composition().species().size()),
|
||||
ccs_(thermo_.composition().species().size()*thermo_.composition().species().size()),
|
||||
cns_(thermo_.composition().species().size()*thermo_.composition().species().size())
|
||||
|
|
@ -163,7 +167,8 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
|||
<< "Electron should be the first species in the list"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
// new Electron (tranDict);
|
||||
|
||||
electron_.set(new Electron (tranDict));
|
||||
}
|
||||
// Ions
|
||||
else if (zi != 0)
|
||||
|
|
@ -199,9 +204,10 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
|||
neutrals_.resize(nNeutral);
|
||||
nns_.resize(nNeutral*(nNeutral+1)/2);
|
||||
|
||||
ccs_.resize((nIon+1)*(nIon+2)/2 - 1);
|
||||
ccs_.resize((nIon+1)*(nIon)/2 - 1);
|
||||
cns_.resize(nNeutral*nIon);
|
||||
// ens_.resize(nNeutral);
|
||||
ecs_.resize(nIon+1);
|
||||
ens_.resize(nNeutral);
|
||||
// ee_;
|
||||
|
||||
forAll(species_, i)
|
||||
|
|
@ -253,6 +259,24 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
|||
}
|
||||
|
||||
label iPair = 0;
|
||||
|
||||
ecs_.set(iPair, new Coulomb(electron_(), electron_()));
|
||||
iPair++;
|
||||
|
||||
forAll(ions_, i)
|
||||
{
|
||||
ecs_.set(iPair, new Coulomb(electron_(), ions_[i]));
|
||||
iPair++;
|
||||
}
|
||||
|
||||
iPair = 0;
|
||||
forAll(neutrals_, i)
|
||||
{
|
||||
ens_.set(iPair, new CrossSection(electron_(), neutrals_[i]));
|
||||
iPair++;
|
||||
}
|
||||
|
||||
iPair = 0;
|
||||
forAll(ions_, i)
|
||||
{
|
||||
for (label j = i; j < ions_.size(); j++)
|
||||
|
|
@ -448,34 +472,35 @@ void Foam::diffusivityModel::correct()
|
|||
}
|
||||
|
||||
// Electron - Electron
|
||||
label idx = 0;
|
||||
|
||||
// muI[0] = nns_[idx].mu(pi,Ti);
|
||||
muI[0] = SMALL;
|
||||
muI[0] = ecs_[idx].mu(pi,Ti,rhoQc2i);
|
||||
// muI[0] = SMALL;
|
||||
|
||||
// Dii[0] = nns_[idx].D(pi,Ti);
|
||||
Dii[0] = SMALL;
|
||||
Dii[0] = ecs_[idx].D(pi,Ti,rhoQc2i);
|
||||
// Dii[0] = SMALL;
|
||||
Dij(0,0) = Dii[0];
|
||||
|
||||
label idx = 0;
|
||||
// Electron - Ions
|
||||
idx = 1;
|
||||
for (label J = 0; J < ions_.size(); J++)
|
||||
{
|
||||
label j = J + 1;
|
||||
// Calculate Dij
|
||||
// Dij(0,j) = nns_[idx].D(pi,Ti);
|
||||
Dij(0,j) = SMALL;
|
||||
Dij(0,j) = ecs_[idx].D(pi,Ti,rhoQc2i);
|
||||
// Dij(0,j) = SMALL;
|
||||
Dij(j,0) = Dij(0,j);
|
||||
idx++;
|
||||
}
|
||||
|
||||
idx = 0;
|
||||
// Electron - Neutrals
|
||||
idx = 0;
|
||||
for (label J = 0; J < neutrals_.size(); J++)
|
||||
{
|
||||
label j = J + ions_.size() + 1;
|
||||
// Calculate Dij
|
||||
// Dij(0,j) = nns_[idx].D(pi,Ti);
|
||||
Dij(0,j) = SMALL;
|
||||
Dij(0,j) = ens_[idx].D(pi,Ti);
|
||||
// Dij(0,j) = SMALL;
|
||||
Dij(j,0) = Dij(0,j);
|
||||
idx++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,11 +46,13 @@ namespace Foam
|
|||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class Electron;
|
||||
class Neutral;
|
||||
class Ion;
|
||||
class Stockmayer;
|
||||
class Coulomb;
|
||||
class N64;
|
||||
class CrossSection;
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
class diffusivityModel;
|
||||
|
|
@ -77,7 +79,7 @@ class diffusivityModel
|
|||
autoPtr<volScalarField> k_;
|
||||
|
||||
//- Electron object
|
||||
// autoPtr<Electron> electron_;
|
||||
autoPtr<Electron> electron_;
|
||||
|
||||
//- Ion object list
|
||||
PtrList<Ion> ions_;
|
||||
|
|
@ -85,13 +87,19 @@ class diffusivityModel
|
|||
//- Neutral object list
|
||||
PtrList<Neutral> neutrals_;
|
||||
|
||||
//- Coulomb potential list
|
||||
PtrList<Coulomb> ecs_;
|
||||
|
||||
//- Momentum transfer cross section list
|
||||
PtrList<CrossSection> ens_;
|
||||
|
||||
//- Stockmayer potential list
|
||||
PtrList<Stockmayer> nns_;
|
||||
|
||||
//- Stockmayer potential list
|
||||
//- Coulomb potential list
|
||||
PtrList<Coulomb> ccs_;
|
||||
|
||||
//- Stockmayer potential list
|
||||
//- (n,6,4) potential list
|
||||
PtrList<N64> cns_;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue