49 { geometryModeType::gmCalculated,
"calculated" },
50 { geometryModeType::gmUser,
"user" },
57 Foam::fv::tabulatedNTUHeatTransfer::ntuTable()
61 ntuTable_.reset(
new interpolation2DTable<scalar>(
coeffs_));
76 <<
" on mesh " <<
mesh.name()
85 void Foam::fv::tabulatedNTUHeatTransfer::initialiseGeometry()
89 geometryMode_ = geometryModelNames_.get(
"geometryMode", coeffs_);
91 Info<<
"Region " << mesh_.name() <<
" " <<
type() <<
" " << name_
92 <<
" " << geometryModelNames_[geometryMode_] <<
" geometry:" <<
nl;
94 switch (geometryMode_)
99 mesh_.time().lookupObject<fvMesh>(nbrRegionName());
101 word inletPatchName(coeffs_.get<word>(
"inletPatch"));
102 word inletPatchNbrName(coeffs_.get<word>(
"inletPatchNbr"));
104 Info<<
" Inlet patch : " << inletPatchName <<
nl 105 <<
" Inlet patch neighbour : " << inletPatchNbrName
108 label patchI = mesh_.boundary().findPatchID(inletPatchName);
110 nbrMesh.boundary().findPatchID(inletPatchNbrName);
112 scalar
alpha(coeffs_.get<scalar>(
"inletBlockageRatio"));
114 if (alpha < 0 || alpha > 1)
117 <<
"Inlet patch blockage ratio must be between 0 and 1" 118 <<
". Current value: " <<
alpha 122 scalar alphaNbr(coeffs_.get<scalar>(
"inletBlockageRatioNbr"));
124 if (alphaNbr < 0 || alphaNbr > 1)
127 <<
"Inlet patch neighbour blockage ratio must be " 128 <<
"between 0 and 1. Current value: " << alphaNbr
133 <<
" Inlet blockage ratio neighbour : " << alphaNbr
138 *
gSum(mesh_.magSf().boundaryField()[patchI]);
141 (scalar(1) - alphaNbr)
142 *
gSum(nbrMesh.magSf().boundaryField()[patchINbr]);
144 scalar
beta(coeffs_.get<scalar>(
"coreBlockageRatio"));
146 if (beta < 0 || beta > 1)
149 <<
"Core volume blockage ratio must be between 0 and 1" 150 <<
". Current value: " <<
beta 154 Info<<
" Core volume blockage ratio : " <<
beta <<
nl;
156 Vcore_ = (scalar(1) -
beta)*meshInterp().V();
162 coeffs_.readEntry(
"Ain", Ain_);
163 coeffs_.readEntry(
"AinNbr", AinNbr_);
165 if (!coeffs_.readIfPresent(
"Vcore", Vcore_))
167 Vcore_ = meshInterp().V();
175 <<
"Unhandled enumeration " << geometryMode_
180 Info<<
" Inlet area local : " << Ain_ <<
nl 181 <<
" Inlet area neighbour : " << AinNbr_ <<
nl 182 <<
" Core volume : " << Vcore_ <<
nl 193 const word& modelType,
198 interRegionHeatTransferModel(
name, modelType,
dict,
mesh),
199 UName_(coeffs_.getOrDefault<
word>(
"U",
"U")),
200 UNbrName_(coeffs_.getOrDefault<
word>(
"UNbr",
"U")),
201 rhoName_(coeffs_.getOrDefault<
word>(
"rho",
"rho")),
202 rhoNbrName_(coeffs_.getOrDefault<
word>(
"rhoNbr",
"rho")),
204 geometryMode_(gmCalculated),
215 initialiseGeometry();
217 const auto& nbrMesh = mesh_.time().lookupObject<
fvMesh>(nbrRegionName());
230 const auto& UNbr = nbrMesh.lookupObject<
volVectorField>(UNbrName_);
234 nbrMesh.lookupObject<
volScalarField>(rhoNbrName_).internalField();
236 const scalarField mDotNbr(UMagNbrMapped*rhoNbrMapped*AinNbr_);
243 scalar Cpc =
Cp[cellI];
244 scalar CpcNbr = CpNbr[cellI];
245 scalar mDotc = mDot[cellI];
246 scalar mDotcNbr = mDotNbr[cellI];
247 scalar Cmin =
min(Cpc*mDotc, CpcNbr*mDotcNbr);
248 scalar ntu = ntuTable(mDotc, mDotcNbr);
250 htcc[cellI] = Cmin*ntu/Vcore_;
259 coeffs_.readIfPresent(
"U", UName_);
260 coeffs_.readIfPresent(
"UNbr", UNbrName_);
261 coeffs_.readIfPresent(
"rho", rhoName_);
262 coeffs_.readIfPresent(
"rhoNbr", rhoNbrName_);
266 initialiseGeometry();
word dictName() const
The local dictionary name (final part of scoped name)
virtual bool read(const dictionary &dict)
Read dictionary.
Abstract base-class for fluid and solid thermodynamic properties.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
2D table interpolation. The data must be in ascending order in both dimensions x and y...
Macros for easy insertion into run-time selection tables.
geometryModeType
Options for the geometry mode type.
#define forAll(list, i)
Loop across all elements in list.
psiReactionThermo & thermo
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Type gSum(const FieldField< Field, Type > &f)
tabulatedNTUHeatTransfer(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static const Enum< geometryModeType > geometryModelNames_
Names for geometryModeType.
A class for handling words, derived from Foam::string.
virtual bool read(const dictionary &dict)
Read source dictionary.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
const volScalarField & Cp
virtual void calculateHtc()
Calculate the heat transfer coefficient.
virtual tmp< volScalarField > Cp() const =0
Heat capacity at constant pressure [J/kg/K].
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Mesh data needed to do the Finite Volume discretisation.
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
dictionary coeffs_
Dictionary containing source coefficients.