ENH: Updated variable heat transfer inter-region model

This commit is contained in:
andy
2013-01-08 18:09:04 +00:00
parent 22442e2a7e
commit 373fdb1d8f
2 changed files with 25 additions and 43 deletions

View File

@ -60,7 +60,7 @@ Foam::fv::variableHeatTransfer::variableHeatTransfer
c_(0), c_(0),
ds_(0), ds_(0),
Pr_(0), Pr_(0),
area_() AoV_()
{ {
if (master_) if (master_)
{ {
@ -69,13 +69,13 @@ Foam::fv::variableHeatTransfer::variableHeatTransfer
c_ = readScalar(dict_.lookup("c")); c_ = readScalar(dict_.lookup("c"));
ds_ = readScalar(dict_.lookup("ds")); ds_ = readScalar(dict_.lookup("ds"));
Pr_ = readScalar(dict_.lookup("Pr")); Pr_ = readScalar(dict_.lookup("Pr"));
area_.reset AoV_.reset
( (
new volScalarField new volScalarField
( (
IOobject IOobject
( (
"area", "AoV",
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -100,42 +100,33 @@ Foam::fv::variableHeatTransfer::~variableHeatTransfer()
const Foam::tmp<Foam::volScalarField> const Foam::tmp<Foam::volScalarField>
Foam::fv::variableHeatTransfer::calculateHtc() Foam::fv::variableHeatTransfer::calculateHtc()
{ {
const fvMesh& secondaryMesh = const fvMesh& nbrMesh =
mesh_.time().lookupObject<fvMesh>(mapRegionName()); mesh_.time().lookupObject<fvMesh>(mapRegionName());
const compressible::turbulenceModel& turb = const compressible::turbulenceModel& nbrTurb =
secondaryMesh.lookupObject<compressible::turbulenceModel> nbrMesh.lookupObject<compressible::turbulenceModel>("turbulenceModel");
(
"turbulenceModel"
);
const fluidThermo& secondaryThermo = const fluidThermo& nbrThermo =
secondaryMesh.lookupObject<fluidThermo> nbrMesh.lookupObject<fluidThermo>("thermophysicalProperties");
(
"thermophysicalProperties"
);
const volVectorField& U = const volVectorField& U = nbrMesh.lookupObject<volVectorField>("U");
secondaryMesh.lookupObject<volVectorField>("U");
const volScalarField Re const volScalarField Re(mag(U)*ds_*nbrThermo.rho()/nbrTurb.mut());
(
mag(U)*ds_*secondaryThermo.rho()/turb.mut()
);
const volScalarField Nu(a_*pow(Re, b_)*pow(Pr_, c_)); const volScalarField Nu(a_*pow(Re, b_)*pow(Pr_, c_));
scalarField htcMapped(htc_.internalField().size(), 0.0); scalarField htcNbrMapped(htc_.internalField().size(), 0.0);
secondaryToPrimaryInterpPtr_->interpolateInternalField secondaryToPrimaryInterpPtr_->interpolateInternalField
( (
htcMapped, htcNbrMapped,
Nu*turb.kappaEff()/ds_, Nu*nbrTurb.kappaEff()/ds_,
meshToMesh::MAP, meshToMesh::MAP,
eqOp<scalar>() eqOp<scalar>()
); );
htc_.internalField() = htcMapped*area_/mesh_.V(); htc_.internalField() =
htcNbrMapped*AoV_*secondaryToPrimaryInterpPtr_->V()/mesh_.V();
return htc_; return htc_;
} }
@ -144,17 +135,12 @@ Foam::fv::variableHeatTransfer::calculateHtc()
void Foam::fv::variableHeatTransfer::writeData(Ostream& os) const void Foam::fv::variableHeatTransfer::writeData(Ostream& os) const
{ {
os << indent << token::BEGIN_BLOCK << incrIndent << nl; os << indent << token::BEGIN_BLOCK << incrIndent << nl;
interRegionHeatTransferModel::writeData(os); interRegionHeatTransferModel::writeData(os);
os.writeKeyword("a") << a_ << token::END_STATEMENT << nl; os << indent << type() + "Coeffs" << nl;
os.writeKeyword("b") << b_ << token::END_STATEMENT << nl;
os.writeKeyword("c") << c_ << token::END_STATEMENT << nl;
os.writeKeyword("ds") << ds_ << token::END_STATEMENT << nl;
os.writeKeyword("Pr") << Pr_ << token::END_STATEMENT << nl;
os << indent << "variableHeatTransfer"; coeffs_.write(os);
dict_.write(os);
os << decrIndent << indent << token::END_BLOCK << endl; os << decrIndent << indent << token::END_BLOCK << endl;
} }
@ -164,15 +150,11 @@ bool Foam::fv::variableHeatTransfer::read(const dictionary& dict)
{ {
if (option::read(dict)) if (option::read(dict))
{ {
coeffs_.readIfPresent("a", a_);
const dictionary& sourceDict = dict.subDict(name()); coeffs_.readIfPresent("b", b_);
const dictionary& subDictCoeffs = coeffs_.readIfPresent("c", c_);
sourceDict.subDict(typeName + "Coeffs"); coeffs_.readIfPresent("ds", ds_);
subDictCoeffs.readIfPresent("a", a_); coeffs_.readIfPresent("Pr", Pr_);
subDictCoeffs.readIfPresent("b", b_);
subDictCoeffs.readIfPresent("c", c_);
subDictCoeffs.readIfPresent("ds", ds_);
subDictCoeffs.readIfPresent("Pr", Pr_);
return true; return true;
} }

View File

@ -76,8 +76,8 @@ private:
//- Fluid Prandt number //- Fluid Prandt number
scalar Pr_; scalar Pr_;
//- Area of heat exchange //- Area per unit volume of heat exchanger
autoPtr<volScalarField> area_; autoPtr<volScalarField> AoV_;
public: public: