Particles now have their own gasHThermoPhysics object and diffusivityModel are fixed with gasHThermoPhysics Mixture
This commit is contained in:
parent
c6dcfeb5d7
commit
ddc0b20e9d
9 changed files with 72 additions and 51 deletions
|
|
@ -44,10 +44,10 @@ License
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Electron::Electron(const dictionary& dict)
|
Foam::Electron::Electron(const dictionary& thermoDict, const dictionary& tranDict)
|
||||||
:
|
:
|
||||||
Particle(dict),
|
Particle(thermoDict, tranDict),
|
||||||
fitDict_(dict.subDict("fitCoefs")),
|
fitDict_(tranDict.subDict("fitCoefs")),
|
||||||
collisionTargets_(fitDict_.lookup("species")),
|
collisionTargets_(fitDict_.lookup("species")),
|
||||||
DejFitCoefs_(collisionTargets_.size())
|
DejFitCoefs_(collisionTargets_.size())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public:
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
Electron(const dictionary& dict);
|
Electron(const dictionary& thermoDict, const dictionary& tranDict);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
Electron(Istream&);
|
Electron(Istream&);
|
||||||
|
|
|
||||||
|
|
@ -44,16 +44,16 @@ License
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Ion::Ion(const dictionary& dict)
|
Foam::Ion::Ion(const dictionary& thermoDict, const dictionary& tranDict)
|
||||||
:
|
:
|
||||||
Particle(dict),
|
Particle(thermoDict, tranDict),
|
||||||
alpha_(dict.lookupOrDefault("dipolePolarizability", 0.0)),
|
alpha_(tranDict.lookupOrDefault("dipolePolarizability", 0.0)),
|
||||||
C6_(0.0),
|
C6_(0.0),
|
||||||
Zrot_(dict.lookupOrDefault("rotationalRelaxation", 0.0)),
|
Zrot_(tranDict.lookupOrDefault("rotationalRelaxation", 0.0)),
|
||||||
n_(dict.lookupOrDefault("nStockmayer", 12)),
|
n_(tranDict.lookupOrDefault("nStockmayer", 12)),
|
||||||
rctTarget_(dict.lookupOrDefault("rctTargets", hashedWordList())),
|
rctTarget_(tranDict.lookupOrDefault("rctTargets", hashedWordList())),
|
||||||
Arct_(dict.lookupOrDefault("Arct", scalarList())),
|
Arct_(tranDict.lookupOrDefault("Arct", scalarList())),
|
||||||
Brct_(dict.lookupOrDefault("Brct", scalarList()))
|
Brct_(tranDict.lookupOrDefault("Brct", scalarList()))
|
||||||
{
|
{
|
||||||
if (z() > 0)
|
if (z() > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ public:
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
Ion(const dictionary& dict);
|
Ion(const dictionary& thermoDict, const dictionary& tranDict);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
Ion(Istream&);
|
Ion(Istream&);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Particle(tranDict),
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
|
|
@ -44,19 +45,19 @@ License
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Neutral::Neutral(const dictionary& dict)
|
Foam::Neutral::Neutral(const dictionary& thermoDict, const dictionary& tranDict)
|
||||||
:
|
:
|
||||||
Particle(dict),
|
Particle(thermoDict, tranDict),
|
||||||
wellDepth_(dict.lookupOrDefault("wellDepth", 0.0)),
|
wellDepth_(tranDict.lookupOrDefault("wellDepth", 0.0)),
|
||||||
diameter_(dict.lookupOrDefault("diameter", 0.0)),
|
diameter_(tranDict.lookupOrDefault("diameter", 0.0)),
|
||||||
dipoleMoment_(dict.lookupOrDefault("dipoleMoment", 0.0)),
|
dipoleMoment_(tranDict.lookupOrDefault("dipoleMoment", 0.0)),
|
||||||
alpha_(dict.lookupOrDefault("dipolePolarizability", 0.0)),
|
alpha_(tranDict.lookupOrDefault("dipolePolarizability", 0.0)),
|
||||||
alphaQ_(0.0),
|
alphaQ_(0.0),
|
||||||
C6_(dict.lookupOrDefault("dispersionCoef", 0.0)),
|
C6_(tranDict.lookupOrDefault("dispersionCoef", 0.0)),
|
||||||
Zrot_(dict.lookupOrDefault("rotationalRelaxation", 0.0))
|
Zrot_(tranDict.lookupOrDefault("rotationalRelaxation", 0.0))
|
||||||
{
|
{
|
||||||
|
|
||||||
const entry* entryPtr = dict.lookupEntryPtr("tranlib", false, true);
|
const entry* entryPtr = tranDict.lookupEntryPtr("tranlib", false, true);
|
||||||
|
|
||||||
if (entryPtr)
|
if (entryPtr)
|
||||||
{
|
{
|
||||||
|
|
@ -68,21 +69,21 @@ Foam::Neutral::Neutral(const dictionary& dict)
|
||||||
alpha_ = tranlib[4];
|
alpha_ = tranlib[4];
|
||||||
Zrot_ = tranlib[5];
|
Zrot_ = tranlib[5];
|
||||||
|
|
||||||
dict.readIfPresent("wellDepth", wellDepth_);
|
tranDict.readIfPresent("wellDepth", wellDepth_);
|
||||||
dict.readIfPresent("diameter", diameter_);
|
tranDict.readIfPresent("diameter", diameter_);
|
||||||
dict.readIfPresent("dipoleMoment", dipoleMoment_);
|
tranDict.readIfPresent("dipoleMoment", dipoleMoment_);
|
||||||
dict.readIfPresent("dipolePolarizability", alpha_);
|
tranDict.readIfPresent("dipolePolarizability", alpha_);
|
||||||
dict.readIfPresent("dispersionCoef", C6_);
|
tranDict.readIfPresent("dispersionCoef", C6_);
|
||||||
dict.readIfPresent("rotationalRelaxation", Zrot_);
|
tranDict.readIfPresent("rotationalRelaxation", Zrot_);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wellDepth_ = readScalar(dict.lookup("wellDepth"));
|
wellDepth_ = readScalar(tranDict.lookup("wellDepth"));
|
||||||
diameter_ = readScalar(dict.lookup("diameter"));
|
diameter_ = readScalar(tranDict.lookup("diameter"));
|
||||||
dipoleMoment_ = readScalar(dict.lookup("dipoleMoment"));
|
dipoleMoment_ = readScalar(tranDict.lookup("dipoleMoment"));
|
||||||
alpha_ = readScalar(dict.lookup("dipolePolarizability"));
|
alpha_ = readScalar(tranDict.lookup("dipolePolarizability"));
|
||||||
C6_ = readScalar(dict.lookup("dispersionCoef"));
|
C6_ = readScalar(tranDict.lookup("dispersionCoef"));
|
||||||
Zrot_ = readScalar(dict.lookup("rotationalRelaxation"));
|
Zrot_ = readScalar(tranDict.lookup("rotationalRelaxation"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alpha_ > 0.0)
|
if (alpha_ > 0.0)
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ public:
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
Neutral(const dictionary& dict);
|
Neutral(const dictionary& thermoDict, const dictionary& tranDict);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
Neutral(Istream&);
|
Neutral(Istream&);
|
||||||
|
|
|
||||||
|
|
@ -70,15 +70,16 @@ const Foam::scalar Foam::Particle::eps0 = constant::electromagnetic::epsilon0.va
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Particle::Particle(const dictionary& dict)
|
Foam::Particle::Particle(const dictionary& thermoDict, const dictionary& tranDict)
|
||||||
:
|
:
|
||||||
name_(dict["name"]),
|
name_(tranDict["name"]),
|
||||||
W_(readScalar(dict["W"])),
|
W_(readScalar(tranDict["W"])),
|
||||||
z_(readScalar(dict["z"]))
|
z_(readScalar(tranDict["z"])),
|
||||||
|
thermo_(thermoDict)
|
||||||
{
|
{
|
||||||
label geometry = 0;
|
label geometry = 0;
|
||||||
|
|
||||||
const entry* entryPtr = dict.lookupEntryPtr("tranlib", false, true);
|
const entry* entryPtr = tranDict.lookupEntryPtr("tranlib", false, true);
|
||||||
|
|
||||||
if (entryPtr)
|
if (entryPtr)
|
||||||
{
|
{
|
||||||
|
|
@ -87,7 +88,7 @@ Foam::Particle::Particle(const dictionary& dict)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
geometry = readLabel(dict.lookup("geometry"));
|
geometry = readLabel(tranDict.lookup("geometry"));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(geometry)
|
switch(geometry)
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ SourceFiles
|
||||||
|
|
||||||
#include "word.H"
|
#include "word.H"
|
||||||
#include "scalar.H"
|
#include "scalar.H"
|
||||||
|
#include "thermoPhysicsTypes.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
@ -72,6 +73,8 @@ public:
|
||||||
NONLINEAR = 3
|
NONLINEAR = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//- The type of thermodynamics this mixture is instantiated for
|
||||||
|
typedef gasHThermoPhysics thermoType;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
@ -89,6 +92,9 @@ protected:
|
||||||
//- Geometry
|
//- Geometry
|
||||||
Geometry geometry_;
|
Geometry geometry_;
|
||||||
|
|
||||||
|
//- Thermophysics Object
|
||||||
|
thermoType thermo_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|
@ -131,7 +137,7 @@ public:
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
Particle(const dictionary& dict);
|
Particle(const dictionary& thermoDict, const dictionary& tranDict);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
Particle(Istream&);
|
Particle(Istream&);
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ License
|
||||||
#include "speciesTable.H"
|
#include "speciesTable.H"
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
#include "scalarMatrices.H"
|
#include "scalarMatrices.H"
|
||||||
|
#include "multiComponentMixture.H"
|
||||||
|
#include "thermoPhysicsTypes.H"
|
||||||
|
|
||||||
#include "Particle.H"
|
#include "Particle.H"
|
||||||
#include "Electron.H"
|
#include "Electron.H"
|
||||||
#include "Neutral.H"
|
#include "Neutral.H"
|
||||||
|
|
@ -323,8 +326,8 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
||||||
thermo_.composition().Y(0).mesh(),
|
thermo_.composition().Y(0).mesh(),
|
||||||
dimensionedScalar("zero", dimForce/dimTime/dimTemperature, 0.0)
|
dimensionedScalar("zero", dimForce/dimTime/dimTemperature, 0.0)
|
||||||
),
|
),
|
||||||
neutrals_(thermo_.composition().species().size()),
|
|
||||||
ions_(thermo_.composition().species().size()),
|
ions_(thermo_.composition().species().size()),
|
||||||
|
neutrals_(thermo_.composition().species().size()),
|
||||||
ecs_(thermo_.composition().species().size()),
|
ecs_(thermo_.composition().species().size()),
|
||||||
ens_(thermo_.composition().species().size()),
|
ens_(thermo_.composition().species().size()),
|
||||||
nns_(thermo_.composition().species().size()*thermo_.composition().species().size()),
|
nns_(thermo_.composition().species().size()*thermo_.composition().species().size()),
|
||||||
|
|
@ -332,6 +335,10 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
||||||
cns_(thermo_.composition().species().size()*thermo_.composition().species().size())
|
cns_(thermo_.composition().species().size()*thermo_.composition().species().size())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
typedef multiComponentMixture<gasHThermoPhysics> gasMix;
|
||||||
|
|
||||||
|
const gasMix &mcm (dynamicCast<const gasMix>(thermo_));
|
||||||
|
|
||||||
const speciesTable &species_(thermo_.composition().species());
|
const speciesTable &species_(thermo_.composition().species());
|
||||||
|
|
||||||
const volScalarField::Mesh &mesh = thermo_.composition().Y(0).mesh();
|
const volScalarField::Mesh &mesh = thermo_.composition().Y(0).mesh();
|
||||||
|
|
@ -344,6 +351,14 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
||||||
)()
|
)()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
dictionary thermos
|
||||||
|
(
|
||||||
|
IFstream
|
||||||
|
(
|
||||||
|
fileName(thermo_.lookup("foamChemistryThermoFile")).expand()
|
||||||
|
)()
|
||||||
|
);
|
||||||
|
|
||||||
Switch readIons = false;
|
Switch readIons = false;
|
||||||
Switch readNeutrals = false;
|
Switch readNeutrals = false;
|
||||||
|
|
||||||
|
|
@ -356,16 +371,14 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
||||||
const scalar Wi = thermo_.composition().W(i);
|
const scalar Wi = thermo_.composition().W(i);
|
||||||
const label zi = thermo_.composition().z(i);
|
const label zi = thermo_.composition().z(i);
|
||||||
|
|
||||||
|
dictionary thermoDict(thermos.subDict(species_[i]));
|
||||||
|
|
||||||
dictionary tranDict(transports.subDict(species_[i]).subDict("transport"));
|
dictionary tranDict(transports.subDict(species_[i]).subDict("transport"));
|
||||||
tranDict.add("name", namei);
|
tranDict.add("name", namei);
|
||||||
tranDict.add("W", Wi);
|
tranDict.add("W", Wi);
|
||||||
tranDict.add("z", zi);
|
tranDict.add("z", zi);
|
||||||
|
|
||||||
Particle p(tranDict);
|
const Particle::thermoType &thermoData(mcm.speciesData()[i]);
|
||||||
|
|
||||||
// Info << namei << endl << tranDict << endl;
|
|
||||||
// Info << p << endl;
|
|
||||||
// Info << scalarList(tranDict["tranlib"]) << endl;
|
|
||||||
|
|
||||||
// Electron
|
// Electron
|
||||||
if (species_[i] == "E-")
|
if (species_[i] == "E-")
|
||||||
|
|
@ -377,7 +390,7 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
electron_.set(new Electron (tranDict));
|
electron_.set(new Electron (thermoDict, tranDict));
|
||||||
}
|
}
|
||||||
// Ions
|
// Ions
|
||||||
else if (zi != 0)
|
else if (zi != 0)
|
||||||
|
|
@ -391,7 +404,7 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
||||||
|
|
||||||
readIons = true;
|
readIons = true;
|
||||||
|
|
||||||
ions_.set(nIon, new Ion(tranDict));
|
ions_.set(nIon, new Ion(thermoDict, tranDict));
|
||||||
|
|
||||||
nIon++;
|
nIon++;
|
||||||
|
|
||||||
|
|
@ -402,7 +415,7 @@ Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
||||||
{
|
{
|
||||||
readNeutrals = true;
|
readNeutrals = true;
|
||||||
|
|
||||||
neutrals_.set(nNeutral, new Neutral(tranDict));
|
neutrals_.set(nNeutral, new Neutral(thermoDict, tranDict));
|
||||||
|
|
||||||
nNeutral++;
|
nNeutral++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue