/*---------------------------------------------------------------------------*\ Particle(tranDict), ========= | \\ / 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 "Neutral.H" #include "dictionary.H" #include "scalarList.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // const dataType Foam::Neutral::staticData(); // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::Neutral::Neutral(const dictionary& thermoDict, const dictionary& tranDict) : Particle(thermoDict, tranDict), wellDepth_(tranDict.lookupOrDefault("wellDepth", 0.0)), diameter_(tranDict.lookupOrDefault("diameter", 0.0)), dipoleMoment_(tranDict.lookupOrDefault("dipoleMoment", 0.0)), alpha_(tranDict.lookupOrDefault("dipolePolarizability", 0.0)), alphaQ_(0.0), C6_(tranDict.lookupOrDefault("dispersionCoef", 0.0)) { const entry* entryPtr = tranDict.lookupEntryPtr("tranlib", false, true); if (entryPtr) { scalarList tranlib(entryPtr->stream()); wellDepth_ = tranlib[1]; diameter_ = tranlib[2]; dipoleMoment_ = tranlib[3]; alpha_ = tranlib[4]; Zrot_ = tranlib[5]; tranDict.readIfPresent("wellDepth", wellDepth_); tranDict.readIfPresent("diameter", diameter_); tranDict.readIfPresent("dipoleMoment", dipoleMoment_); tranDict.readIfPresent("dipolePolarizability", alpha_); tranDict.readIfPresent("dispersionCoef", C6_); tranDict.readIfPresent("rotationalRelaxation", Zrot_); } else { wellDepth_ = readScalar(tranDict.lookup("wellDepth")); diameter_ = readScalar(tranDict.lookup("diameter")); dipoleMoment_ = readScalar(tranDict.lookup("dipoleMoment")); alpha_ = readScalar(tranDict.lookup("dipolePolarizability")); C6_ = readScalar(tranDict.lookup("dispersionCoef")); Zrot_ = readScalar(tranDict.lookup("rotationalRelaxation")); } if (alpha_ > 0.0) { C6_ = exp(1.8846 * log(alpha_) - 0.4737); // * sqr(e); alphaQ_ = 2 * C6_; } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::Neutral::~Neutral() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // void Foam::Neutral::operator=(const Neutral& 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 Neutral& st) { os << static_cast(st) << tab << st.wellDepth_ << tab << st.diameter_ << tab << st.dipoleMoment_ << tab << st.alpha_ << tab << st.alphaQ_ << tab << st.C6_ << tab << st.Zrot_; os.check("Ostream& operator<<(Ostream& os, const specie& st)"); return os; } // ************************************************************************* //