diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C index c54293f22b..9aeaa4f486 100644 --- a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C +++ b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C @@ -105,13 +105,13 @@ kappa() const { case FLUID: { - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = this->db().lookupObject ( "turbulenceModel" ); - return model.kappaEff(patch().index()); + return turbModel.kappaEff(patch().index()); } break; diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index 14448ca71c..4daa0454f7 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -92,13 +92,13 @@ Foam::tmp Foam::temperatureCoupledBase::kappa { case BASICTHERMO: { - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = mesh.lookupObject ( "turbulenceModel" ); - return model.kappaEff(patch_.index()); + return turbModel.kappaEff(patch_.index()); break; } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index f05919061e..e966e72954 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -200,23 +200,23 @@ void thermalBaffle1DFvPatchScalarField::updateCoeffs() const mappedPatchBase& mpp = refCast(patch().patch()); - const label patchI = patch().index(); + const label patchi = patch().index(); - const label nbrPatchI = mpp.samplePolyPatch().index(); + const label nbrPatchi = mpp.samplePolyPatch().index(); if (baffleActivated_) { - const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchI]; + const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchi]; - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = db().template lookupObject ( "turbulenceModel" ); - // local properties - const scalarField kappaw = model.kappaEff()().boundaryField()[patchI]; + + const scalarField kappaw(turbModel.kappaEff(patchi)); const fvPatchScalarField& Tp = patch().template lookupPatchField(TName_); @@ -229,17 +229,12 @@ void thermalBaffle1DFvPatchScalarField::updateCoeffs() // nbr properties - scalarField nbrKappaw = - model.kappaEff()().boundaryField()[nbrPatchI]; - mpp.map().distribute(nbrKappaw); + const scalarField nbrKappaw(turbModel.kappaEff(nbrPatchi)); const fvPatchScalarField& nbrTw = - model.thermo().T().boundaryField()[nbrPatchI]; + turbModel.thermo().T().boundaryField()[nbrPatchi]; - scalarField nbrQDot - ( - model.kappaEff()().boundaryField()[nbrPatchI]*nbrTw.snGrad() - ); + scalarField nbrQDot(nbrKappaw*nbrTw.snGrad()); mpp.map().distribute(nbrQDot); const thermalBaffle1DFvPatchScalarField& nbrField = @@ -255,11 +250,7 @@ void thermalBaffle1DFvPatchScalarField::updateCoeffs() nbrPatch.template lookupPatchField(TName_); mpp.map().distribute(nbrTp); - scalarField nbrh - ( - nbrPatch.deltaCoeffs() - *model.kappaEff()().boundaryField()[nbrPatchI] - ); + scalarField nbrh(nbrPatch.deltaCoeffs()*nbrKappaw); mpp.map().distribute(nbrh); diff --git a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C index 7207e3d7ac..fe041be3e0 100644 --- a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C +++ b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C @@ -70,25 +70,25 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs() if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0)) { - const incompressible::turbulenceModel& model = + const incompressible::turbulenceModel& turbModel = db().lookupObject ( "turbulenceModel" ); - const scalarField nuEffw = model.nuEff()().boundaryField()[patchI]; + const scalarField nuEffw = turbModel.nuEff()().boundaryField()[patchI]; jump_ = -sign(Un)*(I_*nuEffw + D_*0.5*magUn*length_)*magUn; } else { - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = db().lookupObject ( "turbulenceModel" ); - const scalarField muEffw = model.muEff()().boundaryField()[patchI]; + const scalarField muEffw = turbModel.muEff()().boundaryField()[patchI]; const scalarField rhow = patch().lookupPatchField("rho");