40 tabulatedNTUHeatTransfer,
48 Foam::fv::tabulatedNTUHeatTransfer::geometryModeType,
58 Foam::fv::tabulatedNTUHeatTransfer::geometryModelNames_;
64 Foam::fv::tabulatedNTUHeatTransfer::ntuTable()
66 if (!ntuTable_.valid())
68 ntuTable_.reset(
new interpolation2DTable<scalar>(coeffs_));
80 if (!
mesh.foundObject<basicThermo>(
"thermophysicalProperties"))
83 <<
" on mesh " <<
mesh.name()
84 <<
" could not find thermophysicalProperties "
88 return mesh.lookupObject<basicThermo>(
"thermophysicalProperties");
92 void Foam::fv::tabulatedNTUHeatTransfer::initialiseGeometry()
97 geometryModelNames_.read(coeffs_.lookup(
"geometryMode"));
99 Info<<
"Region " << mesh_.name() <<
" " <<
type() <<
" " << name_ <<
" "
100 << geometryModelNames_[geometryMode_] <<
" geometry:" <<
nl;
102 switch (geometryMode_)
106 const fvMesh& nbrMesh =
107 mesh_.time().lookupObject<fvMesh>(nbrRegionName());
109 word inletPatchName(coeffs_.lookup(
"inletPatch"));
110 word inletPatchNbrName(coeffs_.lookup(
"inletPatchNbr"));
112 Info<<
" Inlet patch : " << inletPatchName <<
nl
113 <<
" Inlet patch neighbour : " << inletPatchNbrName
116 label patchI = mesh_.boundary().findPatchID(inletPatchName);
118 nbrMesh.boundary().findPatchID(inletPatchNbrName);
125 <<
"Inlet patch blockage ratio must be between 0 and 1"
126 <<
". Current value: " <<
alpha
132 readScalar(coeffs_.lookup(
"inletBlockageRatioNbr"))
135 if ((alphaNbr < 0) || (alphaNbr > 1))
138 <<
"Inlet patch neighbour blockage ratio must be "
139 <<
"between 0 and 1. Current value: " << alphaNbr
144 <<
" Inlet blockage ratio neighbour : " << alphaNbr
149 *
gSum(mesh_.magSf().boundaryField()[patchI]);
152 (scalar(1) - alphaNbr)
153 *
gSum(nbrMesh.magSf().boundaryField()[patchINbr]);
160 <<
"Core volume blockage ratio must be between 0 and 1"
161 <<
". Current value: " <<
beta
165 Info<<
" Core volume blockage ratio : " <<
beta <<
nl;
167 Vcore_ = (scalar(1) -
beta)*meshInterp().V();
173 coeffs_.lookup(
"Ain") >> Ain_;
174 coeffs_.lookup(
"AinNbr") >> AinNbr_;
176 if (!coeffs_.readIfPresent(
"Vcore", Vcore_))
178 Vcore_ = meshInterp().V();
186 <<
"Unhandled enumeration " << geometryMode_
191 Info<<
" Inlet area local : " << Ain_ <<
nl
192 <<
" Inlet area neighbour : " << AinNbr_ <<
nl
193 <<
" Core volume : " << Vcore_ <<
nl
201 Foam::fv::tabulatedNTUHeatTransfer::tabulatedNTUHeatTransfer
204 const word& modelType,
205 const dictionary&
dict,
209 interRegionHeatTransferModel(
name, modelType,
dict,
mesh),
210 UName_(coeffs_.lookupOrDefault<word>(
"UName",
"U")),
211 UNbrName_(coeffs_.lookupOrDefault<word>(
"UNbrName",
"U")),
212 rhoName_(coeffs_.lookupOrDefault<word>(
"rhoName",
"rho")),
213 rhoNbrName_(coeffs_.lookupOrDefault<word>(
"rhoNbrName",
"rho")),
215 geometryMode_(gmCalculated),
224 Foam::fv::tabulatedNTUHeatTransfer::~tabulatedNTUHeatTransfer()
230 void Foam::fv::tabulatedNTUHeatTransfer::calculateHtc()
232 initialiseGeometry();
234 const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName());
237 const basicThermo& thermoNbr = this->
thermo(nbrMesh);
254 const scalarField mDotNbr(UMagNbrMapped*rhoNbrMapped*AinNbr_);
258 const interpolation2DTable<Foam::scalar>& ntuTable = this->ntuTable();
262 scalar Cpc = Cp[cellI];
263 scalar CpcNbr = CpNbr[cellI];
264 scalar mDotc = mDot[cellI];
265 scalar mDotcNbr = mDotNbr[cellI];
266 scalar Cmin =
min(Cpc*mDotc, CpcNbr*mDotcNbr);
267 scalar ntu = ntuTable(mDotc, mDotcNbr);
269 htcc[cellI] = Cmin*ntu/Vcore_;
278 coeffs_.readIfPresent(
"UName", UName_);
279 coeffs_.readIfPresent(
"UNbrName", UNbrName_);
280 coeffs_.readIfPresent(
"rhoName", rhoName_);
281 coeffs_.readIfPresent(
"rhoNbrName", rhoNbrName_);
285 initialiseGeometry();