Changes of class structures, additional models.

This commit is contained in:
Thomas Lichtenegger
2016-03-30 16:48:50 +02:00
parent 7e6aefc052
commit cc4dcedd4c
14 changed files with 687 additions and 41 deletions

View File

@ -21,6 +21,7 @@ License
#include "cfdemCloudEnergy.H"
#include "energyModel.H"
#include "thermCondModel.H"
#include "chemistryModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,7 +40,6 @@ cfdemCloudEnergy::cfdemCloudEnergy
:
cfdemCloud(mesh),
energyModels_(couplingProperties_.lookup("energyModels")),
chemistryModels_(couplingProperties_.lookup("energyModels")),
thermCondModel_
(
thermCondModel::New
@ -47,6 +47,14 @@ cfdemCloudEnergy::cfdemCloudEnergy
couplingProperties_,
*this
)
),
chemistryModel_
(
chemistryModel::New
(
couplingProperties_,
*this
)
)
{
energyModel_ = new autoPtr<energyModel>[nrEnergyModels()];
@ -59,16 +67,6 @@ cfdemCloudEnergy::cfdemCloudEnergy
energyModels_[i]
);
}
chemistryModel_ = new autoPtr<chemistryModel>[nrChemistryModels()];
for (int i=0;i<nrChemistryModels();i++)
{
chemistryModel_[i] = chemistryModel::New
(
couplingProperties_,
*this,
chemistryModels_[i]
);
}
}
@ -93,19 +91,14 @@ int cfdemCloudEnergy::nrEnergyModels()
return energyModels_.size();
}
int cfdemCloudEnergy::nrChemistryModels()
{
return chemistryModels_.size();
}
const energyModel& cfdemCloudEnergy::energyM(int i)
{
return energyModel_[i];
}
const chemistryModel& cfdemCloudEnergy::chemistryM(int i)
const chemistryModel& cfdemCloudEnergy::chemistryM()
{
return chemistryModel_[i];
return chemistryModel_;
}
const thermCondModel& cfdemCloudEnergy::thermCondM()

View File

@ -41,6 +41,7 @@ namespace Foam
// forward declarations
class energyModel;
class thermCondModel;
class chemistryModel;
/*---------------------------------------------------------------------------*\
Class cfdemCloudEnergy Declaration
\*---------------------------------------------------------------------------*/
@ -59,7 +60,7 @@ protected:
autoPtr<thermCondModel> thermCondModel_;
autoPtr<chemistryModel>* chemistryModel_;
autoPtr<chemistryModel> chemistryModel_;
void calcEnergyContributions();
@ -87,16 +88,12 @@ public:
const thermCondModel& thermCondM();
const chemistryModel& chemistryM(int);
const chemistryModel& chemistryM();
int nrEnergyModels();
int nrChemistryModels();
inline const wordList& energyModels();
inline const wordList& chemistryModels();
void energyContributions(volScalarField&);
bool evolve(volScalarField&,volVectorField&,volVectorField&);

View File

@ -30,10 +30,6 @@ inline const wordList& cfdemCloudEnergy::energyModels()
return energyModels_;
}
inline const wordList& cfdemCloudEnergy::chemistryModels()
{
return chemistryModels_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -86,14 +86,17 @@ public:
static autoPtr<chemistryModel> New
(
const dictionary& dict,
cfdemCloudEnergy& sm,
word chemistryType
cfdemCloudEnergy& sm
);
// Member Functions
void execute() = 0;
virtual void execute() = 0;
// virtual tmp<fvScalarMatrix> Smi (const label i) const = 0;
//
// virtual tmp<fvScalarMatrix> Sm () const = 0;
};

View File

@ -32,23 +32,26 @@ namespace Foam
autoPtr<chemistryModel> chemistryModel::New
(
const dictionary& dict,
cfdemCloudEnergy& sm,
word chemistryType
cfdemCloudEnergy& sm
)
{
word chemistryModelType
(
dict.lookup("chemistryModel")
);
Info<< "Selecting chemistryModel "
<< chemistryType << endl;
<< chemistryModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(chemistryType);
dictionaryConstructorTablePtr_->find(chemistryModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "chemistryModel::New(const dictionary&, const spray&) : "
<< "chemistryModel::New(const dictionary&, cfdemCloudEnergy&) : "
<< endl
<< " unknown chemistryModelType type "
<< chemistryType
<< chemistryModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid chemistryModel types are :"
<< endl;

View File

@ -0,0 +1,75 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "noChemistry.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(noChemistry, 0);
addToRunTimeSelectionTable(chemistryModel, noChemistry, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
noChemistry::noChemistry
(
const dictionary& dict,
cfdemCloudEnergy& sm
)
:
chemistryModel(dict,sm)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
noChemistry::~noChemistry()
{}
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * //
void noChemistry::execute()
{}
//tmp<Foam::fvScalarMatrix> noChemistry::Smi(const label i) const
//{
// return tmp<fvScalarMatrix>(new fvScalarMatrix(0, dimMass/dimTime));
//}
//tmp<Foam::fvScalarMatrix> noChemistry::Sm() const
//{
// return tmp<fvScalarMatrix>(new fvScalarMatrix(0, dimMass/dimTime));
//}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
Description
Chemistry turned off
\*---------------------------------------------------------------------------*/
#ifndef noChemistry_H
#define noChemistry_H
#include "fvCFD.H"
#include "cfdemCloudEnergy.H"
#include "chemistryModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class noChemistry Declaration
\*---------------------------------------------------------------------------*/
class noChemistry
:
public chemistryModel
{
private:
public:
//- Runtime type information
TypeName("off");
// Constructors
//- Construct from components
noChemistry
(
const dictionary& dict,
cfdemCloudEnergy& sm
);
// Destructor
virtual ~noChemistry();
// Member Functions
void execute();
// tmp<fvScalarMatrix> Smi(const label i) const;
//
// tmp<fvScalarMatrix> Sm() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -41,7 +41,7 @@ species::species
cfdemCloudEnergy& sm
)
:
energyModel(dict,sm),
chemistryModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
interpolation_(propsDict_.lookupOrDefault<bool>("interpolation",false))
{
@ -69,8 +69,22 @@ void species::allocateMyArrays() const
void species::execute()
{
// get Y_i, T, rho at particle positions, fill arrays with them and push to LIGGGHTS
// pull changeOfSpeciesMass_, transform onto fields changeOfSpeciesMassFields_, add them up on changeOfGasMassField_
}
//tmp<Foam::fvScalarMatrix> species::Smi(const label i) const
//{
// return tmp<fvScalarMatrix>(new fvScalarMatrix(changeOfSpeciesMassFields_[i], dimMass/dimTime));
//}
//tmp<Foam::fvScalarMatrix> species::Sm() const
//{
// return tmp<fvScalarMatrix>(new fvScalarMatrix(changeOfGasMassField_, dimMass/dimTime));
//}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -53,9 +53,23 @@ private:
// List<double**> concentrations_;
// List<double**> changeOfConcentrations_;
// List<double**> changeOfSpeciesMass_;
// List<volScalarField> changeOfConcentrationFields_;
// List<volScalarField> changeOfSpeciesMassFields_;
// volScalarField changeOfGasMassField_;
// word tempFieldName_;
// const volScalarField& tempField_; // ref to gas temperature field
// mutable double **partTemp_; // gas temperature at particle positions
// word densityFieldName_;
// const volScalarField& rho_;
// mutable double **partRho_; // gas density at particle positions
void allocateMyArrays() const;
@ -83,7 +97,11 @@ public:
void execute();
//
// tmp<fvScalarMatrix> Smi(const label i) const;
//
// tmp<fvScalarMatrix> Sm() const;
};

View File

@ -0,0 +1,85 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "SyamlalThermCond.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(SyamlalThermCond, 0);
addToRunTimeSelectionTable
(
thermCondModel,
SyamlalThermCond,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
SyamlalThermCond::SyamlalThermCond
(
const dictionary& dict,
cfdemCloud& sm
)
:
thermCondModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
rhoFieldName_(propsDict_.lookupOrDefault<word>("rhoFieldName","rho")),
rho_(sm.mesh().lookupObject<volScalarField> (rhoFieldName_))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
SyamlalThermCond::~SyamlalThermCond()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<volScalarField> SyamlalThermCond::thermCond() const
{
return (1-sqrt(1-voidfraction_+SMALL)) / (voidfraction_+SMALL) * kf0_;
}
tmp<volScalarField> SyamlalThermCond::thermDiff() const
{
// return (1-sqrt(1-voidfraction_+SMALL)) / (voidfraction_+SMALL) * kEff0_/(rho_*Cp_);
return thermCond()/(rho_*Cp_);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
Description
thermal conductivity of fluid phase in presence of particles according to
Syamlal, M. and Gidaspow, M. AIChE Journal 31.1 (1985)
Class
SyamlalThermCond
SourceFiles
SyamlalThermCond.C
\*---------------------------------------------------------------------------*/
#ifndef SyamlalThermCond_H
#define SyamlalThermCond_H
#include "thermCondModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class SyamlalThermCond Declaration
\*---------------------------------------------------------------------------*/
class SyamlalThermCond
:
public thermCondModel
{
private:
dictionary propsDict_;
word voidfractionFieldName_;
const volScalarField& voidfraction_;
word rhoFieldName_;
const volScalarField& rho_;
public:
//- Runtime type information
TypeName("SyamlalThermCond");
// Constructors
//- Construct from components
SyamlalThermCond
(
const dictionary& dict,
cfdemCloud& sm
);
// Destructor
~SyamlalThermCond();
// Member Functions
tmp<volScalarField> thermCond() const;
tmp<volScalarField> thermDiff() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "thermCondModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
autoPtr<thermCondModel> thermCondModel::New
(
const dictionary& dict,
cfdemCloud& sm
)
{
word thermCondModelType
(
dict.lookup("thermCondModel")
);
Info<< "Selecting thermCondModel "
<< thermCondModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(thermCondModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "thermCondModel::New(const dictionary&, const spray&) : "
<< endl
<< " unknown thermCondModelType type "
<< thermCondModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid thermCondModel types are :"
<< endl;
Info<< dictionaryConstructorTablePtr_->toc()
<< abort(FatalError);
}
return autoPtr<thermCondModel>(cstrIter()(dict,sm));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,78 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "thermCondModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(thermCondModel, 0);
defineRunTimeSelectionTable(thermCondModel, dictionary);
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
thermCondModel::thermCondModel
(
const dictionary& dict,
cfdemCloud& sm
)
:
dict_(dict),
particleCloud_(sm),
transportProperties_
(
IOobject
(
"transportProperties",
sm.mesh().time().constant(),
sm.mesh(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
),
kf0_(transportProperties_.lookup("kf")),
Cp_(transportProperties_.lookup("Cp"))
// kf0_(readScalar(transportProperties_.lookup("kf"))),
// Cp_(readScalar(transportProperties_.lookup("Cp")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
thermCondModel::~thermCondModel()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,123 @@
/*---------------------------------------------------------------------------*\
License
This 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.
This code 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 this code. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
Description
model for thermal conductivity of fluid phase in presence of particles
Class
thermCondModel
SourceFiles
thermCondModel.C
\*---------------------------------------------------------------------------*/
#ifndef thermCondModel_H
#define thermCondModel_H
#include "fvCFD.H"
#include "cfdemCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class thermCondModel Declaration
\*---------------------------------------------------------------------------*/
class thermCondModel
{
protected:
// Protected data
const dictionary& dict_;
cfdemCloud& particleCloud_;
IOdictionary transportProperties_;
dimensionedScalar kf0_;
dimensionedScalar Cp_;
public:
//- Runtime type information
TypeName("thermCondModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
thermCondModel,
dictionary,
(
const dictionary& dict,
cfdemCloud& sm
),
(dict,sm)
);
// Constructors
//- Construct from components
thermCondModel
(
const dictionary& dict,
cfdemCloud& sm
);
// Destructor
virtual ~thermCondModel();
// Selector
static autoPtr<thermCondModel> New
(
const dictionary& dict,
cfdemCloud& sm
);
// Member Functions
virtual tmp<volScalarField> thermCond() const = 0;
virtual tmp<volScalarField> thermDiff() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //