Skip to content
Snippets Groups Projects
Commit e5e195a9 authored by andy's avatar andy
Browse files

ENH: Updated tabulated heat transfer inter-region model

parent c7ded822
Branches
Tags
No related merge requests found
......@@ -24,8 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "tabulatedHeatTransfer.H"
#include "turbulenceModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -45,37 +43,32 @@ namespace fv
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::fv::tabulatedHeatTransfer::tabulatedHeatTransfer
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
interRegionHeatTransferModel(name, modelType, dict, mesh),
hTable_(),
area_()
const Foam::interpolation2DTable<Foam::scalar>&
Foam::fv::tabulatedHeatTransfer::hTable()
{
if (master_)
if (!hTable_.valid())
{
hTable_.reset
(
new interpolation2DTable<scalar>
(
dict.subDict(typeName + "Coeffs")
)
);
area_.reset
hTable_.reset(new interpolation2DTable<scalar>(coeffs_));
}
return hTable_();
}
const Foam::volScalarField& Foam::fv::tabulatedHeatTransfer::AoV()
{
if (!AoV_.valid())
{
AoV_.reset
(
new volScalarField
(
IOobject
(
"area",
mesh_.time().timeName(),
"AoV",
startTimeName_,
mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
......@@ -84,9 +77,28 @@ Foam::fv::tabulatedHeatTransfer::tabulatedHeatTransfer
)
);
}
return AoV_();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::tabulatedHeatTransfer::tabulatedHeatTransfer
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
interRegionHeatTransferModel(name, modelType, dict, mesh),
hTable_(),
AoV_(),
startTimeName_(mesh.time().timeName())
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::fv::tabulatedHeatTransfer::~tabulatedHeatTransfer()
......@@ -95,35 +107,33 @@ Foam::fv::tabulatedHeatTransfer::~tabulatedHeatTransfer()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::tmp<Foam::volScalarField>
Foam::fv::tabulatedHeatTransfer::calculateHtc()
{
const fvMesh& secondaryMesh =
mesh_.time().lookupObject<fvMesh>(mapRegionName());
const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(mapRegionName());
const volVectorField& Usecondary =
secondaryMesh.lookupObject<volVectorField>("U");
const volVectorField& UNbr = nbrMesh.lookupObject<volVectorField>("U");
scalarField UMagMapped(htc_.internalField().size(), 0.0);
scalarField UMagNbrMapped(htc_.internalField().size(), 0.0);
secondaryToPrimaryInterpPtr_->interpolateInternalField
(
UMagMapped,
mag(Usecondary),
UMagNbrMapped,
mag(UNbr),
meshToMesh::MAP,
eqOp<scalar>()
);
const volVectorField& U = mesh_.lookupObject<volVectorField>("U");
forAll (htc_.internalField(), i)
scalarField& htcc = htc_.internalField();
forAll(htcc, i)
{
htc_.internalField()[i] =
hTable_->operator()(mag(U[i]), UMagMapped[i]);
htcc[i] = hTable()(mag(U[i]), UMagNbrMapped[i]);
}
htc_.internalField() = htc_*area_/mesh_.V();
htcc = htcc*AoV()*secondaryToPrimaryInterpPtr_->V()/mesh_.V();
return htc_;
}
......@@ -134,9 +144,9 @@ void Foam::fv::tabulatedHeatTransfer::writeData(Ostream& os) const
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
interRegionHeatTransferModel::writeData(os);
os << indent << "tabulatedHeatTransfer";
os << indent << type() + "Coeffs" << nl;
dict_.write(os);
coeffs_.write(os);
os << decrIndent << indent << token::END_BLOCK << endl;
}
......
......@@ -60,8 +60,17 @@ private:
//- 2D look up table
autoPtr<interpolation2DTable<scalar> > hTable_;
//- Area of heat exchange
autoPtr<volScalarField> area_;
//- Area per unit volume of heat exchanger
autoPtr<volScalarField> AoV_;
//- Heat transfer coefficient table
const interpolation2DTable<scalar>& hTable();
//- Field of area divided by volume
const volScalarField& AoV();
//- Start time name
const word startTimeName_;
public:
......@@ -99,7 +108,6 @@ public:
//- Read dictionary
virtual bool read(const dictionary& dict) ;
};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment