BUG: Update pyrolysis dictionaries and change null constructor for

noPyrolysis model
This commit is contained in:
Sergio Ferraris
2011-09-09 11:39:15 +01:00
parent 612150de9c
commit ecb1061d4f
5 changed files with 85 additions and 64 deletions

View File

@ -42,9 +42,18 @@ defineTypeNameAndDebug(noPyrolysis, 0);
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, mesh);
addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, dictionary);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void noPyrolysis::constructThermoChemistry()
{
solidChemistry_.reset
(
solidChemistryModel::New(regionMesh()).ptr()
);
solidThermo_.reset(&solidChemistry_->solidThermo());
}
bool noPyrolysis::read()
{
if (pyrolysisModel::read())
@ -77,10 +86,15 @@ bool noPyrolysis::read(const dictionary& dict)
noPyrolysis::noPyrolysis(const word& modelType, const fvMesh& mesh)
:
pyrolysisModel(modelType, mesh),
solidChemistry_(solidChemistryModel::New(regionMesh())),
solidThermo_(solidChemistry_->solidThermo())
{}
pyrolysisModel(mesh),
solidChemistry_(NULL),
solidThermo_(NULL)
{
if (active())
{
constructThermoChemistry();
}
}
noPyrolysis::noPyrolysis
@ -89,11 +103,15 @@ noPyrolysis::noPyrolysis
const fvMesh& mesh,
const dictionary& dict
):
pyrolysisModel(modelType, mesh, dict),
solidChemistry_(solidChemistryModel::New(regionMesh())),
solidThermo_(solidChemistry_->solidThermo())
{}
pyrolysisModel(mesh),
solidChemistry_(NULL),
solidThermo_(NULL)
{
if (active())
{
constructThermoChemistry();
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -114,33 +132,34 @@ void noPyrolysis::evolveRegion()
//Do nothing
}
const volScalarField& noPyrolysis::rho() const
{
return (solidThermo_.rho());
return (solidThermo_->rho());
}
const volScalarField& noPyrolysis::T() const
{
return (solidThermo_.T());
return (solidThermo_->T());
}
const tmp<volScalarField> noPyrolysis::Cp() const
{
return (solidThermo_.Cp());
return (solidThermo_->Cp());
}
const volScalarField& noPyrolysis::kappa() const
{
return (solidThermo_.kappa());
return (solidThermo_->kappa());
}
const volScalarField& noPyrolysis::K() const
{
return (solidThermo_.K());
return (solidThermo_->K());
}
@ -154,7 +173,7 @@ const surfaceScalarField& noPyrolysis::phiGas() const
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pyrolysisFilmModels
} // End namespace surfaceFilmModels
} // End namespace regionModels
} // End namespace Foam

View File

@ -76,11 +76,14 @@ protected:
//- Read control parameters from dictionary
virtual bool read(const dictionary& dict);
//- Reset solidChemistryModel and basicSolidThermo pointers
void constructThermoChemistry();
//- Reference to the solid chemistry model
autoPtr<solidChemistryModel> solidChemistry_;
//- Reference to solid thermo
basicSolidThermo& solidThermo_;
autoPtr<basicSolidThermo> solidThermo_;
public:
@ -103,7 +106,6 @@ public:
);
//- Destructor
virtual ~noPyrolysis();

View File

@ -142,30 +142,16 @@ scalar pyrolysisModelCollection::maxDiff() const
scalar pyrolysisModelCollection::solidRegionDiffNo() const
{
scalar regionDiNum = 0.0;
scalar totalDiNum = 0.0;
scalar totalDiNum = GREAT;
forAll(*this, i)
{
const pyrolysisModel& pyrolysis = this->operator[](i);
if (pyrolysis.regionMesh().nInternalFaces() > 0)
{
surfaceScalarField KrhoCpbyDelta
if
(
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 > this->operator[](i).solidRegionDiffNo()
)
{
totalDiNum = regionDiNum;
totalDiNum = this->operator[](i).solidRegionDiffNo();
}
}

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -11,10 +11,15 @@ FoamFile
format binary;
class dictionary;
location "constant";
object pyrolysisProperties;
object pyrolysisZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1
(
pyrolysis
{
active false;
pyrolysisModel none;
@ -33,5 +38,7 @@ reactingOneDimCoeffs
}
infoOutput false;
}
)
// ************************************************************************* //

View File

@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -11,10 +11,15 @@ FoamFile
format binary;
class dictionary;
location "constant";
object pyrolysisProperties;
object pyrolysisZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1
(
pyrolysis
{
active false;
pyrolysisModel none;
@ -33,5 +38,7 @@ reactingOneDimCoeffs
}
infoOutput false;
}
)
// ************************************************************************* //