49 { geometryModeType::gmCalculated,
"calculated" },
50 { geometryModeType::gmUser,
"user" },
57Foam::fv::tabulatedNTUHeatTransfer::ntuTable()
61 ntuTable_.reset(
new interpolation2DTable<scalar>(
coeffs_));
76 <<
" on mesh " <<
mesh.name()
85void 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,
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());
220 const basicThermo& thermoNbr = this->thermo(nbrMesh);
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();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
virtual bool read()
Re-read model coefficients if they have changed.
Abstract base-class for fluid and solid thermodynamic properties.
static const word dictName
virtual tmp< volScalarField > Cp() const =0
Heat capacity at constant pressure [J/kg/K].
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
Intermediate class for handling inter-region heat exchanges.
Base abstract class for handling finite volume options (i.e. fvOption).
dictionary coeffs_
Dictionary containing source coefficients.
Applies a tabulated heat transfer model for inter-region heat exchanges. The heat flux is calculated ...
static const Enum< geometryModeType > geometryModelNames_
Names for geometryModeType.
virtual void calculateHtc()
Calculate the heat transfer coefficient.
geometryModeType
Options for the geometry mode type.
2D table interpolation. The data must be in ascending order in both dimensions x and y.
Pyrolysis model which solves only the energy equation in the region.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & Cp
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gSum(const FieldField< Field, Type > &f)
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
#define forAll(list, i)
Loop across all elements in list.