62 for (
const label pI : inletPatches)
67 reduce(length, sumOp<scalar>());
74 if (geometricD[iDir] == -1)
76 length /= bounds.span()[iDir];
83 scalar perimeter =
Zero;
85 for (
const label pI : inletPatches)
91 const label nInternalEdges =
patch.nInternalEdges();
92 const label nEdges =
patch.nEdges();
95 label nActiveEdges(0);
96 forAll(isProcessorEdge, beI)
98 if (!isProcessorEdge[beI])
100 perimeter += edges[nInternalEdges + beI].mag(
points);
108 <<
"Number of boundary edges " 109 <<
returnReduce(nEdges - nInternalEdges, sumOp<label>())
110 <<
", Number of non-processor edges " 118 reduce(perimeter, sumOp<scalar>());
121 length = scalar(4)*
area/perimeter;
131 const polyPatch&
patch 134 const polyBoundaryMesh&
pbm = mesh_.boundaryMesh();
142 for (label procI = nNonProcessor; procI <
pbm.
size() ; ++procI)
144 const polyPatch& procPatch =
pbm[procI];
145 nProcEdges += procPatch.nEdges() - procPatch.nInternalEdges();
148 EdgeMap<bool> isInletEdge(nProcEdges);
150 for (label procI = nNonProcessor; procI <
pbm.
size() ; ++procI)
152 const polyPatch& procPatch =
pbm[procI];
153 const labelList& procMp = procPatch.meshPoints();
154 const label procInternalEdges = procPatch.nInternalEdges();
155 const label procEdges = procPatch.nEdges();
157 for (label edgeI = procInternalEdges; edgeI < procEdges; ++edgeI)
159 const edge&
e = procPatch.edges()[edgeI];
160 const edge meshE = edge(procMp[
e[0]], procMp[
e[1]]);
161 isInletEdge.insert(meshE,
false);
166 const label nInternalEdges =
patch.nInternalEdges();
167 const label nEdges =
patch.nEdges();
171 for (label edgeI = nInternalEdges; edgeI < nEdges; ++edgeI)
173 const edge&
e = edges[edgeI];
174 const edge meshE = edge(
mp[
e[0]],
mp[
e[1]]);
175 auto iter = isInletEdge.find(meshE);
195 boolList isProcessorEdge(nEdges - nInternalEdges,
false);
196 for (label edgeI = nInternalEdges; edgeI < nEdges; ++edgeI)
198 const edge&
e = edges[edgeI];
199 const edge meshE = edge(
mp[
e[0]],
mp[
e[1]]);
201 if (isInletEdge.lookup(meshE,
false))
203 isProcessorEdge[edgeI - nInternalEdges] =
true;
207 return isProcessorEdge;
213 Foam::betaMax::betaMax
234 auto* ctorPtr = dictionaryConstructorTable(modelType);
236 Info<<
"betaMax type " << modelType <<
endl;
245 *dictionaryConstructorTablePtr_
const polyBoundaryMesh & pbm
const fvMesh & mesh_
Reference to mesh.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
List< edge > edgeList
List of edge.
labelHashSet patchSet(const UList< wordRe > &select, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
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.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
static autoPtr< betaMax > New(const fvMesh &mesh, const dictionary &dict)
Construct and return the selected betaMax model.
void reduce(T &value, [[maybe_unused]] BinaryOp bop, [[maybe_unused]] const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce)
#define forAll(list, i)
Loop across all elements in list.
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const dimensionedScalar e
Elementary charge.
const polyMesh & mesh() const noexcept
Return the mesh reference.
const wordList area
Standard area field types (scalar, vector, tensor, etc)
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of entries in the list.
boolList markProcessorEdges(const polyPatch &patch) const
Mark all common inlet - processor edges.
A List of wordRe with additional matching capabilities.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
int debug
Static debugging option.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
Base class for selecting the betaMax value, i.e. the value multiplying the Brinkman penalisation term...
defineTypeNameAndDebug(combustionModel, 0)
scalar computeLength(const dictionary &dict) const
Compute the characteristic length.
Mesh data needed to do the Finite Volume discretisation.
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
const boundBox & bounds() const noexcept
Return mesh bounding box.
Field< vector > vectorField
Specialisation of Field<T> for vector.
virtual scalar value() const
Get value.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
List< label > labelList
A List of labels.
label nNonProcessor() const
The number of patches before the first processor patch.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
List< bool > boolList
A List of bools.
const dimensionedScalar mp
Proton mass.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)