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