Thermo BCs: Update to use patch-based thermo access functions

This commit is contained in:
Henry
2013-02-06 10:56:03 +00:00
parent 4f3bb273a4
commit e4968c6bea
4 changed files with 18 additions and 27 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -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");