BUG: Thermal baffle models - moved radiation model to derived type (needs thermo before it can be created)

This commit is contained in:
andy
2012-10-12 17:55:44 +01:00
parent 9ceac87124
commit 3285851e57
4 changed files with 21 additions and 20 deletions

View File

@ -203,7 +203,8 @@ thermoBaffle2D::thermoBaffle2D
dimEnergy/dimVolume/dimTime, dimEnergy/dimVolume/dimTime,
pTraits<scalar>::zero pTraits<scalar>::zero
) )
) ),
radiation_(radiation::radiationModel::New(thermo_->T()))
{ {
init(); init();
thermo_->correct(); thermo_->correct();
@ -255,7 +256,8 @@ thermoBaffle2D::thermoBaffle2D
dimEnergy/dimVolume/dimTime, dimEnergy/dimVolume/dimTime,
pTraits<scalar>::zero pTraits<scalar>::zero
) )
) ),
radiation_(radiation::radiationModel::New(thermo_->T()))
{ {
init(); init();
thermo_->correct(); thermo_->correct();
@ -341,6 +343,7 @@ const solidThermo& thermoBaffle2D::thermo() const
void thermoBaffle2D::info() const void thermoBaffle2D::info() const
{ {
const labelList& coupledPatches = intCoupledPatchIDs(); const labelList& coupledPatches = intCoupledPatchIDs();
forAll(coupledPatches, i) forAll(coupledPatches, i)
{ {
const label patchI = coupledPatches[i]; const label patchI = coupledPatches[i];

View File

@ -100,6 +100,12 @@ protected:
volScalarField Q_; volScalarField Q_;
// Sub models
//- Pointer to radiation model
autoPtr<radiation::radiationModel> radiation_;
// Protected member functions // Protected member functions
//- Read control parameters IO dictionary //- Read control parameters IO dictionary

View File

@ -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
@ -107,7 +107,8 @@ void thermoBaffleModel::init()
const label patchI = intCoupledPatchIDs_[i]; const label patchI = intCoupledPatchIDs_[i];
const polyPatch& pp = rbm[patchI]; const polyPatch& pp = rbm[patchI];
if ( if
(
!isA<mappedVariableThicknessWallPolyPatch>(pp) !isA<mappedVariableThicknessWallPolyPatch>(pp)
&& oneD_ && oneD_
&& !constantThickness_ && !constantThickness_
@ -192,9 +193,6 @@ void thermoBaffleModel::init()
} }
} }
} }
// Create radiation model
radiation_.reset(radiation::radiationModel::New(T()).ptr());
} }
} }
@ -207,8 +205,7 @@ thermoBaffleModel::thermoBaffleModel(const fvMesh& mesh)
thickness_(), thickness_(),
delta_("delta", dimLength, 0.0), delta_("delta", dimLength, 0.0),
oneD_(false), oneD_(false),
constantThickness_(true), constantThickness_(true)
radiation_(NULL)
{} {}
@ -224,8 +221,7 @@ thermoBaffleModel::thermoBaffleModel
thickness_(), thickness_(),
delta_("delta", dimLength, 0.0), delta_("delta", dimLength, 0.0),
oneD_(false), oneD_(false),
constantThickness_(dict.lookupOrDefault<bool>("constantThickness", true)), constantThickness_(dict.lookupOrDefault<bool>("constantThickness", true))
radiation_(NULL)
{ {
init(); init();
} }
@ -237,8 +233,7 @@ thermoBaffleModel::thermoBaffleModel(const word& modelType, const fvMesh& mesh)
thickness_(), thickness_(),
delta_("delta", dimLength, 0.0), delta_("delta", dimLength, 0.0),
oneD_(false), oneD_(false),
constantThickness_(lookupOrDefault<bool>("constantThickness", true)), constantThickness_(lookupOrDefault<bool>("constantThickness", true))
radiation_(NULL)
{ {
init(); init();
} }

View File

@ -90,9 +90,6 @@ protected:
//- Is thickness constant //- Is thickness constant
bool constantThickness_; bool constantThickness_;
//- Pointer to radiation model
autoPtr<radiation::radiationModel> radiation_;
// Protected Member Functions // Protected Member Functions