59 const this_bctype& ptf,
65 parent_bctype(ptf,
p, iF, mapper),
67 internal_(ptf.internal_),
79 parent_bctype(
p, iF,
dict),
98 const fvMesh& thisMesh =
patch().boundaryMesh().mesh();
103 dict_.readIfPresent(
"internal", internal_);
113 if (!extrudeMeshPtr_)
120 baffle_->rename(baffleName);
127 const this_bctype& ptf,
131 parent_bctype(ptf, iF),
133 internal_(ptf.internal_),
140 void thermalBaffleFvPatchScalarField::createPatchMesh()
142 const fvMesh& thisMesh =
patch().boundaryMesh().mesh();
147 List<dictionary> dicts(regionPatches.size());
155 patchTypes[bottomPatchID] = mappedWallPolyPatch::typeName;
159 patchTypes[topPatchID] = mappedWallPolyPatch::typeName;
166 if (dict_.
get<
bool>(
"columnCells"))
168 patchTypes[sidePatchID] = emptyPolyPatch::typeName;
172 patchTypes[sidePatchID] = polyPatch::typeName;
175 const auto& mpp = refCast<const mappedPatchBase>(
patch().patch(), dict_);
177 const word coupleGroup(mpp.coupleGroup());
180 inGroups[0] = coupleGroup;
183 dicts[bottomPatchID].add(
"coupleGroup", coupleGroup);
184 dicts[bottomPatchID].add(
"inGroups", inGroups);
185 dicts[bottomPatchID].add(
"sampleMode", mpp.sampleModeNames_[mpp.mode()]);
186 dicts[bottomPatchID].add(
"samplePatch",
patch().
name());
187 dicts[bottomPatchID].add(
"sampleRegion", thisMesh.name());
192 const word coupleGroupSlave =
193 coupleGroup.substr(0, coupleGroup.find(
'_')) +
"_slave";
195 inGroups[0] = coupleGroupSlave;
196 dicts[topPatchID].add(
"coupleGroup", coupleGroupSlave);
197 dicts[topPatchID].add(
"inGroups", inGroups);
198 dicts[topPatchID].add(
"sampleMode", mpp.sampleModeNames_[mpp.mode()]);
202 forAll(regionPatches, patchi)
205 patchDict.set(
"nFaces", 0);
206 patchDict.set(
"startFace", 0);
217 thisMesh.boundaryMesh()
222 extrudeMeshPtr_.reset
236 const auto& extrPbm = extrudeMeshPtr_().boundaryMesh();
237 const auto* topPtr = isA<const mappedPatchBase>(extrPbm[topPatchID]);
241 const auto& top = extrPbm[topPatchID];
242 const auto& bottom = extrPbm[bottomPatchID];
244 if (top.size() != bottom.size())
247 <<
" size " << top.size()
248 <<
" has different size from bottom patch " << bottom.name()
249 <<
" size " << bottom.size() <<
endl 250 <<
" Disabling mapping offset calculation." <<
endl;
255 const vectorField offsets(bottom.faceCentres()-top.faceCentres());
256 const_cast<mappedPatchBase&
>(*topPtr).setOffset(offsets);
259 <<
"Adjusting patch " << top.name()
266 const auto& thisPbm = thisMesh.boundaryMesh();
267 const auto& groupPatchLookup = thisPbm.groupPatchIDs();
268 const auto&
group = topPtr->coupleGroup();
274 <<
" on region " << thisMesh.name()
275 <<
" contains more than one patch : " 281 isA<const mappedPatchBase>(thisPbm[
patchIDs[0]]);
284 const_cast<mappedPatchBase&
>(*thisPp).setOffset(-offsets);
287 <<
"Adjusting patch " << thisPbm[
patchIDs[0]].name()
288 <<
" offsets to " << thisPp->offsets()
294 extrudeMeshPtr_->write();
326 os.
writeEntry(
"expansionRatio", dict_.
get<scalar>(
"expansionRatio"));
352 thermalBaffleFvPatchScalarField
void writeEntry(Ostream &os) const
Write sub-dictionary with its dictName as its header.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
wordList patchTypes(nPatches)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
Mixed boundary condition for temperature and radiation heat transfer, suitable for multiregion cases...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const Time & time() const
Return the top-level database.
Ostream & writeEntryIfDifferent(const word &key, const T &refValue, const T &value)
Write a keyword/value entry only if the value differs from the reference value.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Macros for easy insertion into run-time selection tables.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
#define forAll(list, i)
Loop across all elements in list.
Top level extrusion model class.
constexpr const char *const group
Group name for atomic constants.
makePatchTypeField(fvPatchScalarField, alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField)
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
fvPatchField< scalar > fvPatchScalarField
A class for handling words, derived from Foam::string.
A FieldMapper for finite-volume patch fields.
wordList patchNames(nPatches)
A wrapper for dictionary content, without operators that could affect inheritance patterns...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void write(Ostream &) const
Write.
virtual void write(Ostream &os) const
Write.
thermalBaffleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
List< word > wordList
List of word.
decomposeUsingBbs false
Use bounding boxes (default) or unique decomposition of triangles (i.e. do not duplicate triangles) ...
#define WarningInFunction
Report a warning using Foam::Warning.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
Mesh data needed to do the Finite Volume discretisation.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return pointer to a new patch created on freestore from components.
bool foundObject(const word &name, const bool recursive=false) const
Contains the named Type?
List< label > labelList
A List of labels.
#define DebugPoutInFunction
Report an information message using Foam::Pout.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.