mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Removed hard-coded film coupling from pyrolysis models
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -42,61 +42,11 @@ defineTypeNameAndDebug(pyrolysisModel, 0);
|
|||||||
defineRunTimeSelectionTable(pyrolysisModel, mesh);
|
defineRunTimeSelectionTable(pyrolysisModel, mesh);
|
||||||
defineRunTimeSelectionTable(pyrolysisModel, dictionary);
|
defineRunTimeSelectionTable(pyrolysisModel, dictionary);
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void pyrolysisModel::constructMeshObjects()
|
|
||||||
{
|
|
||||||
// construct filmDelta field if coupled to film model
|
|
||||||
if (filmCoupled_)
|
|
||||||
{
|
|
||||||
filmDeltaPtr_.reset
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"filmDelta",
|
|
||||||
time_.timeName(),
|
|
||||||
regionMesh(),
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
regionMesh()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
const volScalarField& filmDelta = filmDeltaPtr_();
|
|
||||||
|
|
||||||
bool foundCoupledPatch = false;
|
|
||||||
forAll(filmDelta.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
const fvPatchField<scalar>& fvp = filmDelta.boundaryField()[patchI];
|
|
||||||
if (isA<mappedFieldFvPatchField<scalar> >(fvp))
|
|
||||||
{
|
|
||||||
foundCoupledPatch = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!foundCoupledPatch)
|
|
||||||
{
|
|
||||||
WarningIn("void pyrolysisModels::constructMeshObjects()")
|
|
||||||
<< "filmCoupled flag set to true, but no "
|
|
||||||
<< mappedFieldFvPatchField<scalar>::typeName
|
|
||||||
<< " patches found on " << filmDelta.name() << " field"
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void pyrolysisModel::readPyrolysisControls()
|
void pyrolysisModel::readPyrolysisControls()
|
||||||
{
|
{
|
||||||
filmCoupled_ = readBool(coeffs_.lookup("filmCoupled"));
|
// do nothing
|
||||||
reactionDeltaMin_ =
|
|
||||||
coeffs_.lookupOrDefault<scalar>("reactionDeltaMin", 0.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -132,24 +82,17 @@ bool pyrolysisModel::read(const dictionary& dict)
|
|||||||
|
|
||||||
pyrolysisModel::pyrolysisModel(const fvMesh& mesh)
|
pyrolysisModel::pyrolysisModel(const fvMesh& mesh)
|
||||||
:
|
:
|
||||||
regionModel1D(mesh),
|
regionModel1D(mesh)
|
||||||
filmCoupled_(false),
|
|
||||||
filmDeltaPtr_(NULL),
|
|
||||||
reactionDeltaMin_(0.0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
pyrolysisModel::pyrolysisModel(const word& modelType, const fvMesh& mesh)
|
pyrolysisModel::pyrolysisModel(const word& modelType, const fvMesh& mesh)
|
||||||
:
|
:
|
||||||
regionModel1D(mesh, "pyrolysis", modelType),
|
regionModel1D(mesh, "pyrolysis", modelType)
|
||||||
filmCoupled_(false),
|
|
||||||
filmDeltaPtr_(NULL),
|
|
||||||
reactionDeltaMin_(0.0)
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
read();
|
read();
|
||||||
constructMeshObjects();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,15 +104,11 @@ pyrolysisModel::pyrolysisModel
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
regionModel1D(mesh, "pyrolysis", modelType, dict),
|
regionModel1D(mesh, "pyrolysis", modelType, dict)
|
||||||
filmCoupled_(false),
|
|
||||||
filmDeltaPtr_(NULL),
|
|
||||||
reactionDeltaMin_(0.0)
|
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
constructMeshObjects();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,15 +131,6 @@ scalar pyrolysisModel::addMassSources
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void pyrolysisModel::preEvolveRegion()
|
|
||||||
{
|
|
||||||
if (filmCoupled_)
|
|
||||||
{
|
|
||||||
filmDeltaPtr_->correctBoundaryConditions();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar pyrolysisModel::solidRegionDiffNo() const
|
scalar pyrolysisModel::solidRegionDiffNo() const
|
||||||
{
|
{
|
||||||
return -GREAT;
|
return -GREAT;
|
||||||
|
|||||||
@ -80,18 +80,6 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected Data
|
|
||||||
|
|
||||||
//- Flag to indicate whether pyrolysis region coupled to a film region
|
|
||||||
bool filmCoupled_;
|
|
||||||
|
|
||||||
//- Pointer to film thickness field
|
|
||||||
autoPtr<volScalarField> filmDeltaPtr_;
|
|
||||||
|
|
||||||
//- Film height below which reactions can occur [m]
|
|
||||||
scalar reactionDeltaMin_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Read control parameters
|
//- Read control parameters
|
||||||
@ -115,8 +103,8 @@ public:
|
|||||||
pyrolysisModel,
|
pyrolysisModel,
|
||||||
mesh,
|
mesh,
|
||||||
(
|
(
|
||||||
const word& modelType,
|
const word& modelType,
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
),
|
),
|
||||||
(modelType, mesh)
|
(modelType, mesh)
|
||||||
);
|
);
|
||||||
@ -127,9 +115,9 @@ public:
|
|||||||
pyrolysisModel,
|
pyrolysisModel,
|
||||||
dictionary,
|
dictionary,
|
||||||
(
|
(
|
||||||
const word& modelType,
|
const word& modelType,
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
),
|
),
|
||||||
(modelType, mesh, dict)
|
(modelType, mesh, dict)
|
||||||
);
|
);
|
||||||
@ -234,12 +222,6 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
|
||||||
|
|
||||||
//- Pre-evolve region
|
|
||||||
virtual void preEvolveRegion();
|
|
||||||
|
|
||||||
|
|
||||||
// Helper function
|
// Helper function
|
||||||
|
|
||||||
//- Mean diffusion number of the solid region
|
//- Mean diffusion number of the solid region
|
||||||
|
|||||||
Reference in New Issue
Block a user