diffusivity model reads thermo...Properties to read transport parameters
This commit is contained in:
parent
0ce7b35a49
commit
934c66e1d3
3 changed files with 111 additions and 25 deletions
|
|
@ -13,7 +13,7 @@ PtrList<volScalarField>& Y = composition.Y();
|
|||
|
||||
word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
diffusivityModel diff();
|
||||
diffusivityModel diff(thermo);
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ License
|
|||
|
||||
#include "diffusivityModel.H"
|
||||
|
||||
#include "IFstream.H"
|
||||
#include "speciesTable.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "scalarMatrices.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
// const dataType Foam::diffusivityModel::staticData();
|
||||
|
|
@ -41,31 +46,73 @@ License
|
|||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::diffusivityModel::diffusivityModel()
|
||||
Foam::diffusivityModel::diffusivityModel(const psiReactionThermo& thermo)
|
||||
:
|
||||
data_()
|
||||
{}
|
||||
thermo_(thermo),
|
||||
D_(thermo_.composition().species().size())
|
||||
{
|
||||
|
||||
const speciesTable &species_(thermo_.composition().species());
|
||||
|
||||
const volScalarField::Mesh &mesh = thermo_.composition().Y(0).mesh();
|
||||
|
||||
dictionary transports
|
||||
(
|
||||
IFstream
|
||||
(
|
||||
fileName(thermo_.lookup("foamTransportFile")).expand()
|
||||
)()
|
||||
);
|
||||
|
||||
|
||||
Foam::diffusivityModel::diffusivityModel(const scalar& data)
|
||||
forAll(species_, i)
|
||||
{
|
||||
// transports[species_[i]];
|
||||
Info << species_[i] << endl;
|
||||
Info << thermo_.composition().W(i) << endl;
|
||||
Info << thermo_.composition().Qc(i) << endl;
|
||||
Info << thermo_.composition().z(i) << endl;
|
||||
Info << readScalar(transports.subDict(species_[i]).subDict("transport")["As"]) << endl;
|
||||
}
|
||||
/*
|
||||
*/
|
||||
|
||||
forAll(species_, i)
|
||||
{
|
||||
D_.set
|
||||
(
|
||||
i,
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"D." + species_[i],
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimArea/dimTime, 0.0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Foam::diffusivityModel::diffusivityModel(const diffusivityModel& dm)
|
||||
:
|
||||
data_(data)
|
||||
{}
|
||||
|
||||
|
||||
Foam::diffusivityModel::diffusivityModel(const diffusivityModel&)
|
||||
:
|
||||
data_()
|
||||
thermo_(dm.thermo_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::diffusivityModel>
|
||||
Foam::diffusivityModel::New()
|
||||
{
|
||||
return autoPtr<diffusivityModel>(new diffusivityModel);
|
||||
}
|
||||
// Foam::autoPtr<Foam::diffusivityModel>
|
||||
// Foam::diffusivityModel::New()
|
||||
// {
|
||||
// return autoPtr<diffusivityModel>(new diffusivityModel);
|
||||
// }
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
|
@ -76,6 +123,41 @@ Foam::diffusivityModel::~diffusivityModel()
|
|||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::diffusivityModel::correct()
|
||||
{
|
||||
const volScalarField &T = thermo_.T();
|
||||
const volScalarField &p = thermo_.p();
|
||||
|
||||
const speciesTable &species_(thermo_.composition().species());
|
||||
|
||||
scalarSymmetricSquareMatrix Dij(species_.size());
|
||||
|
||||
forAll (species_, celli)
|
||||
{
|
||||
const scalar pi = p[celli];
|
||||
const scalar Ti = T[celli];
|
||||
|
||||
label idx = 0;
|
||||
|
||||
forAll (species_, i)
|
||||
{
|
||||
for (label j = i; j < species_.size(); j++)
|
||||
{
|
||||
// Calculate Dij
|
||||
// Dij[idx] = interactions[idx].D(pi,Ti);
|
||||
Dij(i,j) = idx;
|
||||
Dij(j,i) = Dij(i,j);
|
||||
idx++;
|
||||
}
|
||||
|
||||
// DMat = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ SourceFiles
|
|||
|
||||
#include "scalar.H"
|
||||
#include "autoPtr.H"
|
||||
#include "psiReactionThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
|
@ -58,8 +59,11 @@ class diffusivityModel
|
|||
{
|
||||
// Private data
|
||||
|
||||
//- Description of data_
|
||||
scalar data_;
|
||||
//- Reference to thermo object
|
||||
const psiReactionThermo& thermo_;
|
||||
|
||||
//- Mixture averaged diffusivities field
|
||||
PtrList<volScalarField> D_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
|
@ -81,11 +85,8 @@ public:
|
|||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
diffusivityModel();
|
||||
|
||||
//- Construct from components
|
||||
diffusivityModel(const scalar& data);
|
||||
//- Construct from mixture
|
||||
diffusivityModel(const psiReactionThermo& thermo);
|
||||
|
||||
//- Construct from Istream
|
||||
diffusivityModel(Istream&);
|
||||
|
|
@ -97,7 +98,7 @@ public:
|
|||
// Selectors
|
||||
|
||||
//- Select null constructed
|
||||
static autoPtr<diffusivityModel> New();
|
||||
// static autoPtr<diffusivityModel> New();
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
|
@ -106,6 +107,9 @@ public:
|
|||
|
||||
// Member Functions
|
||||
|
||||
//- Correct diffusivities
|
||||
void correct();
|
||||
|
||||
// Access
|
||||
|
||||
// Check
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue