Skip to content
Snippets Groups Projects
Commit 881c362d authored by andy's avatar andy
Browse files

Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

parents 87ddff15 fc362101
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -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();
......
......@@ -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
(
pyrolysis.regionMesh().surfaceInterpolation::deltaCoeffs()
* fvc::interpolate(pyrolysis.K())
/ fvc::interpolate(pyrolysis.Cp()*pyrolysis.rho())
);
regionDiNum =
max(KrhoCpbyDelta.internalField())
*pyrolysis.time().deltaTValue();
}
if (regionDiNum > totalDiNum)
if
(
totalDiNum > this->operator[](i).solidRegionDiffNo()
)
{
totalDiNum = regionDiNum;
totalDiNum = this->operator[](i).solidRegionDiffNo();
}
}
......
......@@ -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;
moveMesh false;
}
infoOutput false;
infoOutput false;
}
)
// ************************************************************************* //
......@@ -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;
moveMesh false;
}
infoOutput false;
infoOutput false;
}
)
// ************************************************************************* //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment