diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C index c54293f22b2295402f77d31dbc28c9183f119380..9aeaa4f48682c4e1dee96182042ceeed75b0526e 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<compressible::turbulenceModel> ( "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 14448ca71c8da21e63bc17d3348041afb45f48b6..4daa0454f7e6c8ea21e812eec167aa6679682cac 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::scalarField> Foam::temperatureCoupledBase::kappa { case BASICTHERMO: { - const compressible::turbulenceModel& model = + const compressible::turbulenceModel& turbModel = mesh.lookupObject<compressible::turbulenceModel> ( "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 f05919061eddd7b26a924da8772bea5786dc2b99..e966e7295428f2caceb92b63ca27f3223a06085c 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<solidType>::updateCoeffs() const mappedPatchBase& mpp = refCast<const mappedPatchBase>(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<compressible::turbulenceModel> ( "turbulenceModel" ); - // local properties - const scalarField kappaw = model.kappaEff()().boundaryField()[patchI]; + + const scalarField kappaw(turbModel.kappaEff(patchi)); const fvPatchScalarField& Tp = patch().template lookupPatchField<volScalarField, scalar>(TName_); @@ -229,17 +229,12 @@ void thermalBaffle1DFvPatchScalarField<solidType>::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<solidType>::updateCoeffs() nbrPatch.template lookupPatchField<volScalarField, scalar>(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 7207e3d7ac02ac7b3c1a812fce39925e5da72db5..fe041be3e07f6e7115745a84b276d0b31169ad58 100644 --- a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C +++ b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C @@ -70,25 +70,25 @@ void Foam::porousBafflePressureFvPatchField<Foam::scalar>::updateCoeffs() if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0)) { - const incompressible::turbulenceModel& model = + const incompressible::turbulenceModel& turbModel = db().lookupObject<incompressible::turbulenceModel> ( "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<compressible::turbulenceModel> ( "turbulenceModel" ); - const scalarField muEffw = model.muEff()().boundaryField()[patchI]; + const scalarField muEffw = turbModel.muEff()().boundaryField()[patchI]; const scalarField rhow = patch().lookupPatchField<volScalarField, scalar>("rho");