mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Addition of a collection of pyrolysys models
This commit is contained in:
@ -1,6 +1,3 @@
|
|||||||
Info<< "Creating pyrolysis model" << endl;
|
Info<< "Creating pyrolysis model" << endl;
|
||||||
|
|
||||||
autoPtr<regionModels::pyrolysisModels::pyrolysisModel> pyrolysis
|
regionModels::pyrolysisModels::pyrolysisModelCollection pyrolysis(mesh);
|
||||||
(
|
|
||||||
regionModels::pyrolysisModels::pyrolysisModel::New(mesh)
|
|
||||||
);
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "basicReactingCloud.H"
|
#include "basicReactingCloud.H"
|
||||||
#include "surfaceFilmModel.H"
|
#include "surfaceFilmModel.H"
|
||||||
#include "pyrolysisModel.H"
|
#include "pyrolysisModelCollection.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "SLGThermo.H"
|
#include "SLGThermo.H"
|
||||||
#include "solidChemistryModel.H"
|
#include "solidChemistryModel.H"
|
||||||
@ -84,7 +84,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
surfaceFilm.evolve();
|
surfaceFilm.evolve();
|
||||||
|
|
||||||
pyrolysis->evolve();
|
pyrolysis.evolve();
|
||||||
|
|
||||||
if (solvePrimaryRegion)
|
if (solvePrimaryRegion)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,6 +29,6 @@ Description
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
scalar maxDi = pyrolysis->maxDiff();
|
scalar maxDi = pyrolysis.maxDiff();
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
scalar DiNum = pyrolysis->solidRegionDiffNo();
|
scalar DiNum = pyrolysis.solidRegionDiffNo();
|
||||||
|
|||||||
@ -3,5 +3,6 @@ pyrolysisModel/pyrolysisModel.C
|
|||||||
pyrolysisModel/pyrolysisModelNew.C
|
pyrolysisModel/pyrolysisModelNew.C
|
||||||
reactingOneDim/reactingOneDim.C
|
reactingOneDim/reactingOneDim.C
|
||||||
noPyrolysis/noPyrolysis.C
|
noPyrolysis/noPyrolysis.C
|
||||||
|
pyrolysisModel/pyrolysisModelCollection.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libpyrolysisModels
|
LIB = $(FOAM_LIBBIN)/libpyrolysisModels
|
||||||
|
|||||||
@ -40,6 +40,8 @@ namespace pyrolysisModels
|
|||||||
|
|
||||||
defineTypeNameAndDebug(noPyrolysis, 0);
|
defineTypeNameAndDebug(noPyrolysis, 0);
|
||||||
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh);
|
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh);
|
||||||
|
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, dictionary);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -57,11 +59,39 @@ bool noPyrolysis::read()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool noPyrolysis::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (pyrolysisModel::read(dict))
|
||||||
|
{
|
||||||
|
// no additional info to read
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
noPyrolysis::noPyrolysis(const word& modelType, const fvMesh& mesh)
|
noPyrolysis::noPyrolysis(const word& modelType, const fvMesh& mesh)
|
||||||
:
|
:
|
||||||
pyrolysisModel(mesh)
|
pyrolysisModel(modelType, mesh),
|
||||||
|
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
||||||
|
solidThermo_(solidChemistry_->solidThermo())
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
noPyrolysis::noPyrolysis
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
):
|
||||||
|
pyrolysisModel(modelType, mesh, dict),
|
||||||
|
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
||||||
|
solidThermo_(solidChemistry_->solidThermo())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -73,60 +103,44 @@ noPyrolysis::~noPyrolysis()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void noPyrolysis::preEvolveRegion()
|
||||||
|
{
|
||||||
|
//Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void noPyrolysis::evolveRegion()
|
||||||
|
{
|
||||||
|
//Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
const volScalarField& noPyrolysis::rho() const
|
const volScalarField& noPyrolysis::rho() const
|
||||||
{
|
{
|
||||||
FatalErrorIn("const volScalarField& noPyrolysis::rho() const")
|
return (solidThermo_.rho());
|
||||||
<< "rho field not available for " << type() << abort(FatalError);
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const volScalarField& noPyrolysis::T() const
|
const volScalarField& noPyrolysis::T() const
|
||||||
{
|
{
|
||||||
FatalErrorIn("const volScalarField& noPyrolysis::T() const")
|
return (solidThermo_.T());
|
||||||
<< "T field not available for " << type() << abort(FatalError);
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const tmp<volScalarField> noPyrolysis::Cp() const
|
const tmp<volScalarField> noPyrolysis::Cp() const
|
||||||
{
|
{
|
||||||
FatalErrorIn("const tmp<volScalarField>& noPyrolysis::Cp() const")
|
return (solidThermo_.Cp());
|
||||||
<< "Cp field not available for " << type() << abort(FatalError);
|
|
||||||
|
|
||||||
return tmp<volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"noPyrolysis::Cp",
|
|
||||||
time().timeName(),
|
|
||||||
primaryMesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
primaryMesh(),
|
|
||||||
dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const volScalarField& noPyrolysis::kappa() const
|
const volScalarField& noPyrolysis::kappa() const
|
||||||
{
|
{
|
||||||
FatalErrorIn("const volScalarField& noPyrolysis::kappa() const")
|
return (solidThermo_.kappa());
|
||||||
<< "kappa field not available for " << type() << abort(FatalError);
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const volScalarField& noPyrolysis::K() const
|
const volScalarField& noPyrolysis::K() const
|
||||||
{
|
{
|
||||||
FatalErrorIn("const volScalarField& noPyrolysis::K() const")
|
return (solidThermo_.K());
|
||||||
<< "K field not available for " << type() << abort(FatalError);
|
|
||||||
return volScalarField::null();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -140,7 +154,7 @@ const surfaceScalarField& noPyrolysis::phiGas() const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace surfaceFilmModels
|
} // End namespace pyrolysisFilmModels
|
||||||
} // End namespace regionModels
|
} // End namespace regionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
|||||||
@ -73,6 +73,15 @@ protected:
|
|||||||
//- Read control parameters from dictionary
|
//- Read control parameters from dictionary
|
||||||
virtual bool read();
|
virtual bool read();
|
||||||
|
|
||||||
|
//- Read control parameters from dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Reference to the solid chemistry model
|
||||||
|
autoPtr<solidChemistryModel> solidChemistry_;
|
||||||
|
|
||||||
|
//- Reference to solid thermo
|
||||||
|
basicSolidThermo& solidThermo_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -85,6 +94,15 @@ public:
|
|||||||
//- Construct from type name and mesh
|
//- Construct from type name and mesh
|
||||||
noPyrolysis(const word& modelType, const fvMesh& mesh);
|
noPyrolysis(const word& modelType, const fvMesh& mesh);
|
||||||
|
|
||||||
|
//- Construct from type name and mesh and dict
|
||||||
|
noPyrolysis
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~noPyrolysis();
|
virtual ~noPyrolysis();
|
||||||
@ -111,6 +129,16 @@ public:
|
|||||||
|
|
||||||
//- Return the total gas mass flux to primary region [kg/m2/s]
|
//- Return the total gas mass flux to primary region [kg/m2/s]
|
||||||
virtual const surfaceScalarField& phiGas() const;
|
virtual const surfaceScalarField& phiGas() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Evolution
|
||||||
|
|
||||||
|
//- Pre-evolve region
|
||||||
|
virtual void preEvolveRegion();
|
||||||
|
|
||||||
|
//- Evolve the pyrolysis equations
|
||||||
|
virtual void evolveRegion();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,7 @@ namespace pyrolysisModels
|
|||||||
|
|
||||||
defineTypeNameAndDebug(pyrolysisModel, 0);
|
defineTypeNameAndDebug(pyrolysisModel, 0);
|
||||||
defineRunTimeSelectionTable(pyrolysisModel, mesh);
|
defineRunTimeSelectionTable(pyrolysisModel, mesh);
|
||||||
|
defineRunTimeSelectionTable(pyrolysisModel, dictionary);
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -91,14 +92,33 @@ void pyrolysisModel::constructMeshObjects()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void pyrolysisModel::readPyrolysisControls()
|
||||||
|
{
|
||||||
|
filmCoupled_ = readBool(coeffs_.lookup("filmCoupled"));
|
||||||
|
reactionDeltaMin_ =
|
||||||
|
coeffs_.lookupOrDefault<scalar>("reactionDeltaMin", 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool pyrolysisModel::read()
|
bool pyrolysisModel::read()
|
||||||
{
|
{
|
||||||
if (regionModel1D::read())
|
if (regionModel1D::read())
|
||||||
{
|
{
|
||||||
filmCoupled_ = readBool(coeffs_.lookup("filmCoupled"));
|
readPyrolysisControls();
|
||||||
reactionDeltaMin_ =
|
return true;
|
||||||
coeffs_.lookupOrDefault<scalar>("reactionDeltaMin", 0.0);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool pyrolysisModel::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (regionModel1D::read(dict))
|
||||||
|
{
|
||||||
|
readPyrolysisControls();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -134,6 +154,26 @@ pyrolysisModel::pyrolysisModel(const word& modelType, const fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pyrolysisModel::pyrolysisModel
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
regionModel1D(mesh, "pyrolysis", modelType, dict),
|
||||||
|
filmCoupled_(false),
|
||||||
|
filmDeltaPtr_(NULL),
|
||||||
|
reactionDeltaMin_(0.0)
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
read(dict);
|
||||||
|
constructMeshObjects();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
pyrolysisModel::~pyrolysisModel()
|
pyrolysisModel::~pyrolysisModel()
|
||||||
@ -175,7 +215,7 @@ scalar pyrolysisModel::maxDiff() const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace surfaceFilmModels
|
} // End namespace pyrolysisModels
|
||||||
} // End namespace regionModels
|
} // End namespace regionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
|||||||
@ -70,6 +70,9 @@ private:
|
|||||||
//- Construct fields
|
//- Construct fields
|
||||||
void constructMeshObjects();
|
void constructMeshObjects();
|
||||||
|
|
||||||
|
//- Read pyrolysis controls
|
||||||
|
void readPyrolysisControls();
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
pyrolysisModel(const pyrolysisModel&);
|
pyrolysisModel(const pyrolysisModel&);
|
||||||
|
|
||||||
@ -93,9 +96,12 @@ protected:
|
|||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Read control parameters from dictionary
|
//- Read control parameters
|
||||||
virtual bool read();
|
virtual bool read();
|
||||||
|
|
||||||
|
//- Read control parameters from dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -117,6 +123,20 @@ public:
|
|||||||
(modelType, mesh)
|
(modelType, mesh)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
pyrolysisModel,
|
||||||
|
dictionary,
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
),
|
||||||
|
(modelType, mesh, dict)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null from mesh
|
//- Construct null from mesh
|
||||||
@ -125,12 +145,58 @@ public:
|
|||||||
//- Construct from type name and mesh
|
//- Construct from type name and mesh
|
||||||
pyrolysisModel(const word& modelType, const fvMesh& mesh);
|
pyrolysisModel(const word& modelType, const fvMesh& mesh);
|
||||||
|
|
||||||
|
//- Construct from type name and mesh and dictionary
|
||||||
|
pyrolysisModel
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Return clone
|
||||||
|
autoPtr<pyrolysisModel> clone() const
|
||||||
|
{
|
||||||
|
notImplemented("autoPtr<pyrolysisModel> clone() const");
|
||||||
|
return autoPtr<pyrolysisModel>(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
// Selectors
|
||||||
|
|
||||||
//- Return a reference to the selected surface film model
|
//- Return a reference to the selected pyrolysis film model
|
||||||
static autoPtr<pyrolysisModel> New(const fvMesh& mesh);
|
static autoPtr<pyrolysisModel> New(const fvMesh& mesh);
|
||||||
|
|
||||||
|
//- Return a reference to a named selected pyrolysis model
|
||||||
|
static autoPtr<pyrolysisModel> New
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Return pointer to new pyrolysis created on freestore from Istream
|
||||||
|
class iNew
|
||||||
|
{
|
||||||
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
iNew(const fvMesh& mesh)
|
||||||
|
:
|
||||||
|
mesh_(mesh)
|
||||||
|
{}
|
||||||
|
|
||||||
|
autoPtr<pyrolysisModel> operator()(Istream& is) const
|
||||||
|
{
|
||||||
|
keyType key(is);
|
||||||
|
dictionary dict(is);
|
||||||
|
|
||||||
|
return autoPtr<pyrolysisModel>
|
||||||
|
(
|
||||||
|
pyrolysisModel::New(mesh_, dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~pyrolysisModel();
|
virtual ~pyrolysisModel();
|
||||||
|
|||||||
@ -0,0 +1,180 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "pyrolysisModelCollection.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace regionModels
|
||||||
|
{
|
||||||
|
namespace pyrolysisModels
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
defineTemplateTypeNameAndDebug(IOPtrList<pyrolysisModel>, 0);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
pyrolysisModelCollection::pyrolysisModelCollection
|
||||||
|
(
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
IOPtrList<pyrolysisModel>
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"pyrolysisZones",
|
||||||
|
mesh.time().constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
pyrolysisModel::iNew(mesh)
|
||||||
|
),
|
||||||
|
mesh_(mesh)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
void pyrolysisModelCollection::preEvolveRegion()
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
this->operator[](i).preEvolveRegion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void pyrolysisModelCollection::evolveRegion()
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
this->operator[](i).evolveRegion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void pyrolysisModelCollection::evolve()
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
pyrolysisModel& pyrolysis = this->operator[](i);
|
||||||
|
|
||||||
|
if (pyrolysis.active())
|
||||||
|
{
|
||||||
|
if (pyrolysis.primaryMesh().changing())
|
||||||
|
{
|
||||||
|
FatalErrorIn("pyrolysisModelCollection::evolve()")
|
||||||
|
<< "Currently not possible to apply "
|
||||||
|
<< pyrolysis.modelName()
|
||||||
|
<< " model to moving mesh cases" << nl<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pre-evolve
|
||||||
|
pyrolysis.preEvolveRegion();
|
||||||
|
|
||||||
|
// Increment the region equations up to the new time level
|
||||||
|
pyrolysis.evolveRegion();
|
||||||
|
|
||||||
|
// Provide some feedback
|
||||||
|
if (pyrolysis.infoOutput())
|
||||||
|
{
|
||||||
|
Info<< incrIndent;
|
||||||
|
pyrolysis.info();
|
||||||
|
Info<< endl << decrIndent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void pyrolysisModelCollection::info() const
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
this->operator[](i).info();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
scalar pyrolysisModelCollection::maxDiff() const
|
||||||
|
{
|
||||||
|
scalar maxDiff = 0.0;
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
if (maxDiff < this->operator[](i).maxDiff())
|
||||||
|
{
|
||||||
|
maxDiff = this->operator[](i).maxDiff();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return maxDiff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
scalar pyrolysisModelCollection::solidRegionDiffNo() const
|
||||||
|
{
|
||||||
|
scalar regionDiNum = 0.0;
|
||||||
|
scalar totalDiNum = 0.0;
|
||||||
|
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
const pyrolysisModel& pyrolysis = this->operator[](i);
|
||||||
|
|
||||||
|
if (pyrolysis.regionMesh().nInternalFaces() > 0)
|
||||||
|
{
|
||||||
|
surfaceScalarField KrhoCpbyDelta
|
||||||
|
(
|
||||||
|
pyrolysis.regionMesh().surfaceInterpolation::deltaCoeffs()
|
||||||
|
* fvc::interpolate(pyrolysis.K())
|
||||||
|
/ fvc::interpolate(pyrolysis.Cp()*pyrolysis.rho())
|
||||||
|
);
|
||||||
|
|
||||||
|
regionDiNum =
|
||||||
|
max(KrhoCpbyDelta.internalField())
|
||||||
|
*pyrolysis.time().deltaTValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (regionDiNum > totalDiNum)
|
||||||
|
{
|
||||||
|
totalDiNum = regionDiNum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return totalDiNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // End namespace pyrolysisModels
|
||||||
|
} // End namespace regionModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,122 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::pyrolysisModelCollection
|
||||||
|
|
||||||
|
Description
|
||||||
|
A centralized pyrolysis collection.
|
||||||
|
|
||||||
|
Container class for a set of pyrolysis with functions implemented
|
||||||
|
to loop over the functions for each type.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
pyrolysisModelCollection.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef pyrolysisModelCollection_H
|
||||||
|
#define pyrolysisModelCollection_H
|
||||||
|
|
||||||
|
#include "IOPtrList.H"
|
||||||
|
#include "pyrolysisModel.H"
|
||||||
|
#include "fvc.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
class fvMesh;
|
||||||
|
|
||||||
|
namespace regionModels
|
||||||
|
{
|
||||||
|
namespace pyrolysisModels
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class pyrolysisModelCollection Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class pyrolysisModelCollection
|
||||||
|
:
|
||||||
|
public IOPtrList<pyrolysisModel>
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Reference to the finite volume mesh this zone is part of
|
||||||
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
pyrolysisModelCollection(const pyrolysisModelCollection&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const pyrolysisModelCollection&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
pyrolysisModelCollection(const fvMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Pre-evolve regions
|
||||||
|
void preEvolveRegion();
|
||||||
|
|
||||||
|
//- Evolve the pyrolysis equation regions
|
||||||
|
void evolveRegion();
|
||||||
|
|
||||||
|
//- Evolve regions
|
||||||
|
void evolve();
|
||||||
|
|
||||||
|
//- Provide some feedback from pyrolysis regions
|
||||||
|
void info() const;
|
||||||
|
|
||||||
|
//- Return max diffusivity allowed in the solid
|
||||||
|
scalar maxDiff() const;
|
||||||
|
|
||||||
|
//- Mean diffusion number of the solid regions
|
||||||
|
scalar solidRegionDiffNo() const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace pyrolysisModels
|
||||||
|
} // End namespace regionModels
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -75,6 +75,33 @@ autoPtr<pyrolysisModel> pyrolysisModel::New(const fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
autoPtr<pyrolysisModel> pyrolysisModel::New
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
const word modelType = dict.lookup("pyrolysisModel");
|
||||||
|
|
||||||
|
Info<< "Selecting pyrolysisModel " << modelType << endl;
|
||||||
|
|
||||||
|
dictionaryConstructorTable::iterator cstrIter =
|
||||||
|
dictionaryConstructorTablePtr_->find(modelType);
|
||||||
|
|
||||||
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn("pyrolysisModel::New(const fvMesh&, const dictionary&)")
|
||||||
|
<< "Unknown pyrolysisModel type " << modelType
|
||||||
|
<< nl << nl << "Valid pyrolisisModel types are:" << nl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<pyrolysisModel>(cstrIter()(modelType, mesh, dict));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace surfaceFilmModels
|
} // End namespace surfaceFilmModels
|
||||||
|
|||||||
@ -48,19 +48,40 @@ namespace pyrolysisModels
|
|||||||
defineTypeNameAndDebug(reactingOneDim, 0);
|
defineTypeNameAndDebug(reactingOneDim, 0);
|
||||||
|
|
||||||
addToRunTimeSelectionTable(pyrolysisModel, reactingOneDim, mesh);
|
addToRunTimeSelectionTable(pyrolysisModel, reactingOneDim, mesh);
|
||||||
|
addToRunTimeSelectionTable(pyrolysisModel, reactingOneDim, dictionary);
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
bool reactingOneDim::read()
|
void reactingOneDim::readReactingOneDimControls()
|
||||||
{
|
{
|
||||||
if (pyrolysisModel::read())
|
|
||||||
{
|
|
||||||
const dictionary& solution = this->solution().subDict("SIMPLE");
|
const dictionary& solution = this->solution().subDict("SIMPLE");
|
||||||
solution.lookup("nNonOrthCorr") >> nNonOrthCorr_;
|
solution.lookup("nNonOrthCorr") >> nNonOrthCorr_;
|
||||||
time_.controlDict().lookup("maxDi") >> maxDiff_;
|
time_.controlDict().lookup("maxDi") >> maxDiff_;
|
||||||
|
|
||||||
coeffs().lookup("radFluxName") >> primaryRadFluxName_;
|
coeffs().lookup("radFluxName") >> primaryRadFluxName_;
|
||||||
coeffs().lookup("minimumDelta") >> minimumDelta_;
|
coeffs().lookup("minimumDelta") >> minimumDelta_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool reactingOneDim::read()
|
||||||
|
{
|
||||||
|
if (pyrolysisModel::read())
|
||||||
|
{
|
||||||
|
readReactingOneDimControls();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool reactingOneDim::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (pyrolysisModel::read(dict))
|
||||||
|
{
|
||||||
|
readReactingOneDimControls();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -420,6 +441,108 @@ reactingOneDim::reactingOneDim(const word& modelType, const fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
reactingOneDim::reactingOneDim
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
pyrolysisModel(modelType, mesh, dict),
|
||||||
|
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
||||||
|
solidThermo_(solidChemistry_->solidThermo()),
|
||||||
|
kappa_(solidThermo_.kappa()),
|
||||||
|
K_(solidThermo_.K()),
|
||||||
|
rho_(solidThermo_.rho()),
|
||||||
|
Ys_(solidThermo_.composition().Y()),
|
||||||
|
T_(solidThermo_.T()),
|
||||||
|
primaryRadFluxName_(dict.lookupOrDefault<word>("radFluxName", "Qr")),
|
||||||
|
nNonOrthCorr_(-1),
|
||||||
|
maxDiff_(10),
|
||||||
|
minimumDelta_(1e-4),
|
||||||
|
|
||||||
|
phiGas_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phiGas",
|
||||||
|
time().timeName(),
|
||||||
|
regionMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
regionMesh(),
|
||||||
|
dimensionedScalar("zero", dimMass/dimTime, 0.0)
|
||||||
|
),
|
||||||
|
|
||||||
|
phiHsGas_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phiHsGas",
|
||||||
|
time().timeName(),
|
||||||
|
regionMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
regionMesh(),
|
||||||
|
dimensionedScalar("zero", dimEnergy/dimTime, 0.0)
|
||||||
|
),
|
||||||
|
|
||||||
|
chemistrySh_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"chemistrySh",
|
||||||
|
time().timeName(),
|
||||||
|
regionMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
regionMesh(),
|
||||||
|
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0)
|
||||||
|
),
|
||||||
|
|
||||||
|
QrCoupled_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
primaryRadFluxName_,
|
||||||
|
time().timeName(),
|
||||||
|
regionMesh(),
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
regionMesh()
|
||||||
|
),
|
||||||
|
|
||||||
|
Qr_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"QrPyr",
|
||||||
|
time().timeName(),
|
||||||
|
regionMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
regionMesh(),
|
||||||
|
dimensionedScalar("zero", dimEnergy/dimArea/dimTime, 0.0),
|
||||||
|
zeroGradientFvPatchVectorField::typeName
|
||||||
|
),
|
||||||
|
|
||||||
|
lostSolidMass_(dimensionedScalar("zero", dimMass, 0.0)),
|
||||||
|
addedGasMass_(dimensionedScalar("zero", dimMass, 0.0)),
|
||||||
|
totalGasMassFlux_(0.0),
|
||||||
|
totalHeatRR_(dimensionedScalar("zero", dimEnergy/dimTime, 0.0))
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
read(dict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
reactingOneDim::~reactingOneDim()
|
reactingOneDim::~reactingOneDim()
|
||||||
@ -560,6 +683,8 @@ void reactingOneDim::preEvolveRegion()
|
|||||||
|
|
||||||
void reactingOneDim::evolveRegion()
|
void reactingOneDim::evolveRegion()
|
||||||
{
|
{
|
||||||
|
Info<< "\nEvolving pyrolysis in region: " << regionMesh().name() << endl;
|
||||||
|
|
||||||
const scalarField mass0 = rho_*regionMesh().V();
|
const scalarField mass0 = rho_*regionMesh().V();
|
||||||
|
|
||||||
solidChemistry_->solve
|
solidChemistry_->solve
|
||||||
@ -591,7 +716,7 @@ void reactingOneDim::evolveRegion()
|
|||||||
|
|
||||||
void reactingOneDim::info() const
|
void reactingOneDim::info() const
|
||||||
{
|
{
|
||||||
Info<< "\nPyrolysis: " << type() << endl;
|
Info<< "\nPyrolysis in region: " << regionMesh().name() << endl;
|
||||||
|
|
||||||
Info<< indent << "Total gas mass produced [kg] = "
|
Info<< indent << "Total gas mass produced [kg] = "
|
||||||
<< addedGasMass_.value() << nl
|
<< addedGasMass_.value() << nl
|
||||||
|
|||||||
@ -66,6 +66,9 @@ private:
|
|||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const reactingOneDim&);
|
void operator=(const reactingOneDim&);
|
||||||
|
|
||||||
|
//- Read model controls
|
||||||
|
void readReactingOneDimControls();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -154,6 +157,9 @@ protected:
|
|||||||
//- Read control parameters from dictionary
|
//- Read control parameters from dictionary
|
||||||
bool read();
|
bool read();
|
||||||
|
|
||||||
|
//- Read control parameters from dict
|
||||||
|
bool read(const dictionary& dict);
|
||||||
|
|
||||||
//- Update submodels
|
//- Update submodels
|
||||||
void updateFields();
|
void updateFields();
|
||||||
|
|
||||||
@ -193,6 +199,16 @@ public:
|
|||||||
//- Construct from type name and mesh
|
//- Construct from type name and mesh
|
||||||
reactingOneDim(const word& modelType, const fvMesh& mesh);
|
reactingOneDim(const word& modelType, const fvMesh& mesh);
|
||||||
|
|
||||||
|
//- Construct from type name, mesh and dictionary
|
||||||
|
reactingOneDim
|
||||||
|
(
|
||||||
|
const word& modelType,
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~reactingOneDim();
|
virtual ~reactingOneDim();
|
||||||
|
|||||||
@ -11,27 +11,35 @@ FoamFile
|
|||||||
format binary;
|
format binary;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
location "constant";
|
location "constant";
|
||||||
object pyrolysisProperties;
|
object pyrolysisZones;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
active true;
|
1
|
||||||
|
(
|
||||||
|
pyrolysis
|
||||||
|
{
|
||||||
|
active true;
|
||||||
|
|
||||||
pyrolysisModel reactingOneDim;
|
pyrolysisModel reactingOneDim;
|
||||||
|
|
||||||
regionName panelRegion;
|
regionName panelRegion;
|
||||||
|
|
||||||
reactingOneDimCoeffs
|
reactingOneDimCoeffs
|
||||||
{
|
{
|
||||||
filmCoupled false;
|
filmCoupled false;
|
||||||
|
|
||||||
radFluxName Qr;
|
radFluxName Qr;
|
||||||
|
|
||||||
minimumDelta 1e-8;
|
minimumDelta 1e-8;
|
||||||
|
|
||||||
moveMesh false;
|
reactionDeltaMin 1e-8;
|
||||||
}
|
|
||||||
|
|
||||||
infoOutput true;
|
moveMesh false;
|
||||||
|
}
|
||||||
|
|
||||||
|
infoOutput true;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user