BUG: Typo in temperatureCoupledBase constructor from components

This commit is contained in:
sergio
2014-05-20 09:31:55 +01:00
committed by Andrew Heather
parent e775be6e1c
commit 8f4960bd34
6 changed files with 47 additions and 23 deletions

View File

@ -64,7 +64,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"), temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
mode_(unknown), mode_(unknown),
q_(p.size(), 0.0), q_(p.size(), 0.0),
h_(p.size(), 0.0), h_(p.size(), 0.0),
@ -88,7 +88,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(ptf, p, iF, mapper), mixedFvPatchScalarField(ptf, p, iF, mapper),
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.kappaName()), temperatureCoupledBase(patch(), ptf),
mode_(ptf.mode_), mode_(ptf.mode_),
q_(ptf.q_, mapper), q_(ptf.q_, mapper),
h_(ptf.h_, mapper), h_(ptf.h_, mapper),
@ -194,7 +194,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(tppsf, iF), mixedFvPatchScalarField(tppsf, iF),
temperatureCoupledBase(patch(), tppsf.KMethod(), tppsf.kappaName()), temperatureCoupledBase(patch(), tppsf),
mode_(tppsf.mode_), mode_(tppsf.mode_),
q_(tppsf.q_), q_(tppsf.q_),
h_(tppsf.h_), h_(tppsf.h_),

View File

@ -58,13 +58,14 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
( (
const fvPatch& patch, const fvPatch& patch,
const word& calculationType, const word& calculationType,
const word& kappaName const word& kappaName,
const word& alphaAniName
) )
: :
patch_(patch), patch_(patch),
method_(KMethodTypeNames_[calculationType]), method_(KMethodTypeNames_[calculationType]),
kappaName_(kappaName), kappaName_(kappaName),
alphaAniName_(alphaAniName_) alphaAniName_(alphaAniName)
{} {}
@ -81,6 +82,19 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
{} {}
Foam::temperatureCoupledBase::temperatureCoupledBase
(
const fvPatch& patch,
const temperatureCoupledBase& base
)
:
patch_(patch),
method_(base.method_),
kappaName_(base.kappaName_),
alphaAniName_(base.alphaAniName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
@ -89,6 +103,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
) const ) const
{ {
const fvMesh& mesh = patch_.boundaryMesh().mesh(); const fvMesh& mesh = patch_.boundaryMesh().mesh();
const label patchI = patch_.index();
switch (method_) switch (method_)
{ {
@ -101,14 +116,14 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
const turbulenceModel& turbModel = const turbulenceModel& turbModel =
mesh.lookupObject<turbulenceModel>("turbulenceModel"); mesh.lookupObject<turbulenceModel>("turbulenceModel");
return turbModel.kappaEff(patch_.index()); return turbModel.kappaEff(patchI);
} }
else if (mesh.foundObject<fluidThermo>("thermophysicalProperties")) else if (mesh.foundObject<fluidThermo>("thermophysicalProperties"))
{ {
const fluidThermo& thermo = const fluidThermo& thermo =
mesh.lookupObject<fluidThermo>("thermophysicalProperties"); mesh.lookupObject<fluidThermo>("thermophysicalProperties");
return thermo.kappa(patch_.index()); return thermo.kappa(patchI);
} }
else else
{ {
@ -129,7 +144,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
const solidThermo& thermo = const solidThermo& thermo =
mesh.lookupObject<solidThermo>("thermophysicalProperties"); mesh.lookupObject<solidThermo>("thermophysicalProperties");
return thermo.kappa(patch_.index()); return thermo.kappa(patchI);
break; break;
} }
@ -138,14 +153,15 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
const solidThermo& thermo = const solidThermo& thermo =
mesh.lookupObject<solidThermo>("thermophysicalProperties"); mesh.lookupObject<solidThermo>("thermophysicalProperties");
const symmTensorField& Anialpha = const symmTensorField& alphaAni =
patch_.lookupPatchField<volSymmTensorField, scalar> patch_.lookupPatchField<volSymmTensorField, scalar>
( (
alphaAniName_ alphaAniName_
); );
const symmTensorField kappa = const scalarField& pp = thermo.p().boundaryField()[patchI];
Anialpha*thermo.Cp()().boundaryField()[patch_.index()];
const symmTensorField kappa(alphaAni*thermo.Cp(pp, Tp, patchI));
const vectorField n(patch_.nf()); const vectorField n(patch_.nf());

View File

@ -102,7 +102,8 @@ public:
( (
const fvPatch& patch, const fvPatch& patch,
const word& calculationMethod, const word& calculationMethod,
const word& KName const word& kappaName,
const word& alphaAniName
); );
//- Construct from patch and dictionary //- Construct from patch and dictionary
@ -112,6 +113,13 @@ public:
const dictionary& dict const dictionary& dict
); );
//- Construct from patch and temperatureCoupledBase
temperatureCoupledBase
(
const fvPatch& patch,
const temperatureCoupledBase& base
);
// Member functions // Member functions

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,7 +76,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField
) )
: :
fixedGradientFvPatchScalarField(p, iF), fixedGradientFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"), temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
heatSource_(hsPower), heatSource_(hsPower),
q_(p.size(), 0.0), q_(p.size(), 0.0),
QrName_("undefinedQr") QrName_("undefinedQr")
@ -93,7 +93,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField
) )
: :
fixedGradientFvPatchScalarField(ptf, p, iF, mapper), fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.kappaName()), temperatureCoupledBase(patch(), ptf),
heatSource_(ptf.heatSource_), heatSource_(ptf.heatSource_),
q_(ptf.q_, mapper), q_(ptf.q_, mapper),
QrName_(ptf.QrName_) QrName_(ptf.QrName_)
@ -135,7 +135,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField
) )
: :
fixedGradientFvPatchScalarField(thftpsf), fixedGradientFvPatchScalarField(thftpsf),
temperatureCoupledBase(patch(), thftpsf.KMethod(), thftpsf.kappaName()), temperatureCoupledBase(patch(), thftpsf),
heatSource_(thftpsf.heatSource_), heatSource_(thftpsf.heatSource_),
q_(thftpsf.q_), q_(thftpsf.q_),
QrName_(thftpsf.QrName_) QrName_(thftpsf.QrName_)
@ -150,7 +150,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField
) )
: :
fixedGradientFvPatchScalarField(thftpsf, iF), fixedGradientFvPatchScalarField(thftpsf, iF),
temperatureCoupledBase(patch(), thftpsf.KMethod(), thftpsf.kappaName()), temperatureCoupledBase(patch(), thftpsf),
heatSource_(thftpsf.heatSource_), heatSource_(thftpsf.heatSource_),
q_(thftpsf.q_), q_(thftpsf.q_),
QrName_(thftpsf.QrName_) QrName_(thftpsf.QrName_)

View File

@ -46,7 +46,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"), temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
TnbrName_("undefined-Tnbr"), TnbrName_("undefined-Tnbr"),
thicknessLayers_(0), thicknessLayers_(0),
kappaLayers_(0), kappaLayers_(0),
@ -68,7 +68,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
) )
: :
mixedFvPatchScalarField(ptf, p, iF, mapper), mixedFvPatchScalarField(ptf, p, iF, mapper),
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.kappaName()), temperatureCoupledBase(patch(), ptf),
TnbrName_(ptf.TnbrName_), TnbrName_(ptf.TnbrName_),
thicknessLayers_(ptf.thicknessLayers_), thicknessLayers_(ptf.thicknessLayers_),
kappaLayers_(ptf.kappaLayers_), kappaLayers_(ptf.kappaLayers_),
@ -155,7 +155,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
) )
: :
mixedFvPatchScalarField(wtcsf, iF), mixedFvPatchScalarField(wtcsf, iF),
temperatureCoupledBase(patch(), wtcsf.KMethod(), wtcsf.kappaName()), temperatureCoupledBase(patch(), wtcsf),
TnbrName_(wtcsf.TnbrName_), TnbrName_(wtcsf.TnbrName_),
thicknessLayers_(wtcsf.thicknessLayers_), thicknessLayers_(wtcsf.thicknessLayers_),
kappaLayers_(wtcsf.kappaLayers_), kappaLayers_(wtcsf.kappaLayers_),

View File

@ -46,7 +46,7 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"), temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
TnbrName_("undefined-Tnbr"), TnbrName_("undefined-Tnbr"),
QrNbrName_("undefined-QrNbr"), QrNbrName_("undefined-QrNbr"),
QrName_("undefined-Qr"), QrName_("undefined-Qr"),
@ -70,7 +70,7 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
) )
: :
mixedFvPatchScalarField(psf, p, iF, mapper), mixedFvPatchScalarField(psf, p, iF, mapper),
temperatureCoupledBase(patch(), psf.KMethod(), psf.kappaName()), temperatureCoupledBase(patch(), psf),
TnbrName_(psf.TnbrName_), TnbrName_(psf.TnbrName_),
QrNbrName_(psf.QrNbrName_), QrNbrName_(psf.QrNbrName_),
QrName_(psf.QrName_), QrName_(psf.QrName_),
@ -161,7 +161,7 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
) )
: :
mixedFvPatchScalarField(psf, iF), mixedFvPatchScalarField(psf, iF),
temperatureCoupledBase(patch(), psf.KMethod(), psf.kappaName()), temperatureCoupledBase(patch(), psf),
TnbrName_(psf.TnbrName_), TnbrName_(psf.TnbrName_),
QrNbrName_(psf.QrNbrName_), QrNbrName_(psf.QrNbrName_),
QrName_(psf.QrName_), QrName_(psf.QrName_),