ENH: Removed hard-coded film coupling from pyrolysis models
This commit is contained in:
parent
7888a0d8bb
commit
83f311c628
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,61 +42,11 @@ defineTypeNameAndDebug(pyrolysisModel, 0);
|
||||
defineRunTimeSelectionTable(pyrolysisModel, mesh);
|
||||
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 * * * * * * * * * * * //
|
||||
|
||||
void pyrolysisModel::readPyrolysisControls()
|
||||
{
|
||||
filmCoupled_ = readBool(coeffs_.lookup("filmCoupled"));
|
||||
reactionDeltaMin_ =
|
||||
coeffs_.lookupOrDefault<scalar>("reactionDeltaMin", 0.0);
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
@ -132,24 +82,17 @@ bool pyrolysisModel::read(const dictionary& dict)
|
||||
|
||||
pyrolysisModel::pyrolysisModel(const fvMesh& mesh)
|
||||
:
|
||||
regionModel1D(mesh),
|
||||
filmCoupled_(false),
|
||||
filmDeltaPtr_(NULL),
|
||||
reactionDeltaMin_(0.0)
|
||||
regionModel1D(mesh)
|
||||
{}
|
||||
|
||||
|
||||
pyrolysisModel::pyrolysisModel(const word& modelType, const fvMesh& mesh)
|
||||
:
|
||||
regionModel1D(mesh, "pyrolysis", modelType),
|
||||
filmCoupled_(false),
|
||||
filmDeltaPtr_(NULL),
|
||||
reactionDeltaMin_(0.0)
|
||||
regionModel1D(mesh, "pyrolysis", modelType)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
read();
|
||||
constructMeshObjects();
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,15 +104,11 @@ pyrolysisModel::pyrolysisModel
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
regionModel1D(mesh, "pyrolysis", modelType, dict),
|
||||
filmCoupled_(false),
|
||||
filmDeltaPtr_(NULL),
|
||||
reactionDeltaMin_(0.0)
|
||||
regionModel1D(mesh, "pyrolysis", modelType, dict)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
read(dict);
|
||||
constructMeshObjects();
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,15 +131,6 @@ scalar pyrolysisModel::addMassSources
|
||||
}
|
||||
|
||||
|
||||
void pyrolysisModel::preEvolveRegion()
|
||||
{
|
||||
if (filmCoupled_)
|
||||
{
|
||||
filmDeltaPtr_->correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
scalar pyrolysisModel::solidRegionDiffNo() const
|
||||
{
|
||||
return -GREAT;
|
||||
|
@ -80,18 +80,6 @@ private:
|
||||
|
||||
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
|
||||
|
||||
//- Read control parameters
|
||||
@ -115,8 +103,8 @@ public:
|
||||
pyrolysisModel,
|
||||
mesh,
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
const word& modelType,
|
||||
const fvMesh& mesh
|
||||
),
|
||||
(modelType, mesh)
|
||||
);
|
||||
@ -127,9 +115,9 @@ public:
|
||||
pyrolysisModel,
|
||||
dictionary,
|
||||
(
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
),
|
||||
(modelType, mesh, dict)
|
||||
);
|
||||
@ -234,12 +222,6 @@ public:
|
||||
);
|
||||
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Pre-evolve region
|
||||
virtual void preEvolveRegion();
|
||||
|
||||
|
||||
// Helper function
|
||||
|
||||
//- Mean diffusion number of the solid region
|
||||
|
Loading…
Reference in New Issue
Block a user