diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C index f85d85791a..e33fa644c2 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C @@ -51,7 +51,7 @@ temperatureThermoBaffle1DFvPatchScalarField baffleActivated_(true), thickness_(p.size()), Qs_(p.size()), - solid_(NULL) + solidPtr_(NULL) {} @@ -70,7 +70,7 @@ temperatureThermoBaffle1DFvPatchScalarField baffleActivated_(ptf.baffleActivated_), thickness_(ptf.thickness_), Qs_(ptf.Qs_), - solid_(ptf.solid_) + solidPtr_(ptf.solidPtr_) {} @@ -88,19 +88,19 @@ temperatureThermoBaffle1DFvPatchScalarField baffleActivated_(readBool(dict.lookup("baffleActivated"))), thickness_(scalarField("thickness", dict, p.size())), Qs_(scalarField("Qs", dict, p.size())), - solid_(new solidThermoData(dict)) + solidPtr_(new solidType(dict)) { if (!isA(this->patch().patch())) { FatalErrorIn ( "temperatureThermoBaffle1DFvPatchScalarField::" - "temperatureThermoBaffle1DFvPatchScalarField\n" - "(\n" - " const fvPatch& p,\n" - " const DimensionedField& iF,\n" - " const dictionary& dict\n" - ")\n" + "temperatureThermoBaffle1DFvPatchScalarField" + "(" + "const fvPatch&,\n" + "const DimensionedField&, " + "const dictionary&" + ")" ) << "\n patch type '" << patch().type() << "' not type '" << mappedPatchBase::typeName << "'" << "\n for patch " << patch().name() @@ -141,7 +141,7 @@ temperatureThermoBaffle1DFvPatchScalarField baffleActivated_(ptf.baffleActivated_), thickness_(ptf.thickness_), Qs_(ptf.Qs_), - solid_(ptf.solid_) + solidPtr_(ptf.solidPtr_) {} @@ -158,7 +158,7 @@ temperatureThermoBaffle1DFvPatchScalarField baffleActivated_(ptf.baffleActivated_), thickness_(ptf.thickness_), Qs_(ptf.Qs_), - solid_(ptf.solid_) + solidPtr_(ptf.solidPtr_) {} @@ -197,10 +197,8 @@ void temperatureThermoBaffle1DFvPatchScalarField::updateCoeffs() int oldTag = UPstream::msgType(); UPstream::msgType() = oldTag+1; - const mappedPatchBase& mpp = refCast - ( - patch().patch() - ); + const mappedPatchBase& mpp = + refCast(patch().patch()); const label patchI = patch().index(); @@ -208,8 +206,7 @@ void temperatureThermoBaffle1DFvPatchScalarField::updateCoeffs() if (baffleActivated_) { - const fvPatch& nbrPatch = - patch().boundaryMesh()[mpp.samplePolyPatch().index()]; + const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchI]; const compressible::turbulenceModel& model = db().template lookupObject @@ -248,10 +245,7 @@ void temperatureThermoBaffle1DFvPatchScalarField::updateCoeffs() const temperatureThermoBaffle1DFvPatchScalarField& nbrField = refCast ( - nbrPatch.template lookupPatchField - ( - TName_ - ) + nbrPatch.template lookupPatchField(TName_) ); scalarField nbrTi(nbrField.patchInternalField()); @@ -278,7 +272,8 @@ void temperatureThermoBaffle1DFvPatchScalarField::updateCoeffs() // Create fields for solid properties forAll(KDeltaw, i) { - KDeltaw[i] = solid_().kappa((Tp[i] + nbrTw[i])/2.0)/thickness_[i]; + KDeltaw[i] = + solidPtr_().kappa((Tp[i] + nbrTw[i])/2.0)/thickness_[i]; } const scalarField q @@ -362,7 +357,7 @@ write(Ostream& os) const os.writeKeyword("baffleActivated") << baffleActivated_ << token::END_STATEMENT << nl; Qs_.writeEntry("Qs", os); - solid_().write(os); + solidPtr_->write(os); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.H index 014dcb1951..524fb9c95a 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.H @@ -48,7 +48,7 @@ namespace compressible { /*---------------------------------------------------------------------------*\ - Class temperatureThermoBaffle1DFvPatchScalarField Declaration + Class temperatureThermoBaffle1DFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ template @@ -58,73 +58,6 @@ class temperatureThermoBaffle1DFvPatchScalarField { // Private data - class solidThermoData - { - // Solid thermo - autoPtr solidPtr_; - - // Solid dictionaries - dictionary specieDict_; - dictionary transportDict_; - dictionary radiationDict_; - dictionary thermoDict_; - dictionary eosDict_; - - - public: - - // Constructor from components - solidThermoData(const dictionary& dict) - : - solidPtr_(new solidType(dict)), - specieDict_(dict.subDict("specie")), - transportDict_(dict.subDict("transport")), - radiationDict_(dict.subDict("radiation")), - thermoDict_(dict.subDict("thermodynamics")), - eosDict_(dict.subDict("equationOfState")) - {} - - - // Null constructor - solidThermoData() - : - solidPtr_(), - specieDict_(), - transportDict_(), - radiationDict_(), - thermoDict_(), - eosDict_() - {} - - - // Destructor - virtual ~solidThermoData() - {} - - - // Member Functions - - void write(Ostream& os) const - { - os.writeKeyword("specie"); - os << specieDict_ << nl; - os.writeKeyword("transport"); - os << transportDict_ << nl; - os.writeKeyword("radiation"); - os << radiationDict_ << nl; - os.writeKeyword("thermodynamics"); - os << thermoDict_ << nl; - os.writeKeyword("equationOfState"); - os << eosDict_ << nl; - } - - scalar kappa(const scalar T) const - { - return solidPtr_().kappa(T); - } - }; - - //- Name of the temperature field word TName_; @@ -137,8 +70,16 @@ class temperatureThermoBaffle1DFvPatchScalarField //- Superficial heat source [W/m2] scalarField Qs_; - //- Solid thermo - autoPtr solid_; + // Solid thermo + autoPtr solidPtr_; + + + // Private Member Functions + + scalar kappa(const scalar T) const + { + return solidPtr_().kappa(T); + } public: