From 6d3a738e8b80019c3cc0d5f9b8f779301fa5b65e Mon Sep 17 00:00:00 2001 From: ignis Date: Thu, 21 Jun 2018 13:02:19 +0900 Subject: [PATCH] Electron and Electron Diffusivity based on scattering cross section --- Make/files | 2 + Make/options | 2 + diffusivityModel/Coulomb/Coulomb.C | 12 +- diffusivityModel/Coulomb/Coulomb.H | 7 + diffusivityModel/CrossSection/CrossSection.C | 95 ++++++++ diffusivityModel/CrossSection/CrossSection.H | 216 ++++++++++++++++++ diffusivityModel/CrossSection/CrossSectionI.H | 71 ++++++ diffusivityModel/Electron/Electron.C | 110 +++++++++ diffusivityModel/Electron/Electron.H | 153 +++++++++++++ diffusivityModel/Electron/ElectronI.H | 74 ++++++ .../diffusivityModel/diffusivityModel.C | 51 +++-- .../diffusivityModel/diffusivityModel.H | 14 +- 12 files changed, 786 insertions(+), 21 deletions(-) create mode 100644 diffusivityModel/CrossSection/CrossSection.C create mode 100644 diffusivityModel/CrossSection/CrossSection.H create mode 100644 diffusivityModel/CrossSection/CrossSectionI.H create mode 100644 diffusivityModel/Electron/Electron.C create mode 100644 diffusivityModel/Electron/Electron.H create mode 100644 diffusivityModel/Electron/ElectronI.H diff --git a/Make/files b/Make/files index 0bc792e..dc8e75e 100644 --- a/Make/files +++ b/Make/files @@ -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 diff --git a/Make/options b/Make/options index 2df0871..a84e016 100644 --- a/Make/options +++ b/Make/options @@ -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 \ diff --git a/diffusivityModel/Coulomb/Coulomb.C b/diffusivityModel/Coulomb/Coulomb.C index 7aea49b..4ccb5e2 100644 --- a/diffusivityModel/Coulomb/Coulomb.C +++ b/diffusivityModel/Coulomb/Coulomb.C @@ -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()))) { } + +/* */ diff --git a/diffusivityModel/Coulomb/Coulomb.H b/diffusivityModel/Coulomb/Coulomb.H index 2279478..a9f3914 100644 --- a/diffusivityModel/Coulomb/Coulomb.H +++ b/diffusivityModel/Coulomb/Coulomb.H @@ -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&); diff --git a/diffusivityModel/CrossSection/CrossSection.C b/diffusivityModel/CrossSection/CrossSection.C new file mode 100644 index 0000000..26612f4 --- /dev/null +++ b/diffusivityModel/CrossSection/CrossSection.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#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 * * * * * * * * * * * * * * // + + +// ************************************************************************* // diff --git a/diffusivityModel/CrossSection/CrossSection.H b/diffusivityModel/CrossSection/CrossSection.H new file mode 100644 index 0000000..e1b0ec7 --- /dev/null +++ b/diffusivityModel/CrossSection/CrossSection.H @@ -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 . + +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