diff --git a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C index fe55a6bc27..dd779a7d4e 100644 --- a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C +++ b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C @@ -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 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 diff --git a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.H b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.H index 9179ad1977..7a32de6a99 100644 --- a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.H +++ b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.H @@ -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 solidChemistry_; //- Reference to solid thermo - basicSolidThermo& solidThermo_; + autoPtr solidThermo_; public: @@ -103,7 +106,6 @@ public: ); - //- Destructor virtual ~noPyrolysis(); diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelCollection.C b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelCollection.C index 615aa3d84b..4ec1871f88 100644 --- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelCollection.C +++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModelCollection.C @@ -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) + if + ( + totalDiNum > this->operator[](i).solidRegionDiffNo() + ) { - 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; + totalDiNum = this->operator[](i).solidRegionDiffNo(); } } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisProperties b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisZones similarity index 63% rename from tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisProperties rename to tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisZones index 5683d872bb..d08aecbf8e 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisProperties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisZones @@ -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,27 +11,34 @@ FoamFile format binary; class dictionary; location "constant"; - object pyrolysisProperties; + object pyrolysisZones; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -active false; +1 +( + pyrolysis + { -pyrolysisModel none; + active false; -regionName panelRegion; + pyrolysisModel none; -reactingOneDimCoeffs -{ - filmCoupled false; + regionName panelRegion; - radFluxName Qr; + reactingOneDimCoeffs + { + filmCoupled false; - minimumDelta 1e-8; + radFluxName Qr; - moveMesh false; -} + minimumDelta 1e-8; -infoOutput false; + moveMesh false; + } + + infoOutput false; + } +) // ************************************************************************* // diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisProperties b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisZones similarity index 63% rename from tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisProperties rename to tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisZones index 5683d872bb..d08aecbf8e 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisProperties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisZones @@ -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,27 +11,34 @@ FoamFile format binary; class dictionary; location "constant"; - object pyrolysisProperties; + object pyrolysisZones; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -active false; +1 +( + pyrolysis + { -pyrolysisModel none; + active false; -regionName panelRegion; + pyrolysisModel none; -reactingOneDimCoeffs -{ - filmCoupled false; + regionName panelRegion; - radFluxName Qr; + reactingOneDimCoeffs + { + filmCoupled false; - minimumDelta 1e-8; + radFluxName Qr; - moveMesh false; -} + minimumDelta 1e-8; -infoOutput false; + moveMesh false; + } + + infoOutput false; + } +) // ************************************************************************* //