62 for (
const label pI : inletPatches)
73 if (geometricD[iDir] == -1)
75 length /= bounds.span()[iDir];
82 scalar perimeter =
Zero;
84 for (
const label pI : inletPatches)
90 const label nInternalEdges =
patch.nInternalEdges();
91 const label nEdges =
patch.nEdges();
94 label nActiveEdges(0);
95 forAll(isProcessorEdge, beI)
97 if (!isProcessorEdge[beI])
99 perimeter += edges[nInternalEdges + beI].mag(
points);
107 <<
"Number of boundary edges " 108 <<
returnReduce(nEdges - nInternalEdges, sumOp<label>())
109 <<
", Number of non-processor edges " 117 reduce(perimeter, sumOp<scalar>());
120 length = scalar(4)*
area/perimeter;
130 const polyPatch&
patch 133 const polyBoundaryMesh&
pbm = mesh_.boundaryMesh();
141 for (label procI = nNonProcessor; procI <
pbm.
size() ; ++procI)
143 const polyPatch& procPatch =
pbm[procI];
144 nProcEdges += procPatch.nEdges() - procPatch.nInternalEdges();
147 EdgeMap<bool> isInletEdge(nProcEdges);
149 for (label procI = nNonProcessor; procI <
pbm.
size() ; ++procI)
151 const polyPatch& procPatch =
pbm[procI];
152 const labelList& procMp = procPatch.meshPoints();
153 const label procInternalEdges = procPatch.nInternalEdges();
154 const label procEdges = procPatch.nEdges();
156 for (label edgeI = procInternalEdges; edgeI < procEdges; ++edgeI)
158 const edge&
e = procPatch.edges()[edgeI];
159 const edge meshE = edge(procMp[
e[0]], procMp[
e[1]]);
160 isInletEdge.insert(meshE,
false);
165 const label nInternalEdges =
patch.nInternalEdges();
166 const label nEdges =
patch.nEdges();
170 for (label edgeI = nInternalEdges; edgeI < nEdges; ++edgeI)
172 const edge&
e = edges[edgeI];
173 const edge meshE = edge(
mp[
e[0]],
mp[
e[1]]);
174 auto iter = isInletEdge.find(meshE);
194 boolList isProcessorEdge(nEdges - nInternalEdges,
false);
195 for (label edgeI = nInternalEdges; edgeI < nEdges; ++edgeI)
197 const edge&
e = edges[edgeI];
198 const edge meshE = edge(
mp[
e[0]],
mp[
e[1]]);
200 if (isInletEdge.lookup(meshE,
false))
202 isProcessorEdge[edgeI - nInternalEdges] =
true;
206 return isProcessorEdge;
212 Foam::betaMax::betaMax
233 auto* ctorPtr = dictionaryConstructorTable(modelType);
235 Info<<
"betaMax type " << modelType <<
endl;
244 *dictionaryConstructorTablePtr_
const polyBoundaryMesh & pbm
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
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.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
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.
#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.
Type gSum(const FieldField< Field, Type > &f)
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.
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.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
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)