62 for (
const label pI : inletPatches)
65 length +=
sum(patch.magSf());
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)
87 const polyPatch&
patch =
mesh_.boundaryMesh()[pI];
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>());
119 reduce(area, sumOp<scalar>());
121 length = scalar(4)*
area/perimeter;
142 for (label procI = nNonProcessor; procI <
pbm.
size() ; ++procI)
145 nProcEdges += procPatch.nEdges() - procPatch.nInternalEdges();
150 for (label procI = nNonProcessor; procI <
pbm.
size() ; ++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];
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];
201 if (isInletEdge.lookup(meshE,
false))
203 isProcessorEdge[edgeI - nInternalEdges] =
true;
207 return isProcessorEdge;
213Foam::betaMax::betaMax
232 const word modelType(
dict.getOrDefault<
word>(
"betaMaxType",
"value"));
234 auto* ctorPtr = dictionaryConstructorTable(modelType);
236 Info<<
"betaMax type " << modelType <<
endl;
245 *dictionaryConstructorTablePtr_
const polyBoundaryMesh & pbm
Map from edge (expressed as its endpoints) to value. Hashing (and ==) on an edge is symmetric.
const T & lookup(const Key &key, const T &deflt) const
Return hashed entry if it exists, or return the given default.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
iterator find(const Key &key)
Find and return an iterator set at the hashed entry.
label nEdges() const
Number of edges in patch.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
label nInternalEdges() const
Number of internal edges.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
label size() const noexcept
The number of entries in the list.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Base class for selecting the betaMax value, i.e. the value multiplying the Brinkman penalisation term...
const fvMesh & mesh_
Reference to mesh.
virtual scalar value() const
Get value.
scalar value_
betaMax value
static autoPtr< betaMax > New(const fvMesh &mesh, const dictionary &dict)
Construct and return the selected betaMax model.
boolList markProcessorEdges(const polyPatch &patch) const
Mark all common inlet - processor edges.
scalar computeLength(const dictionary &dict) const
Compute the characteristic length.
A bounding box defined in terms of min/max extrema points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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.
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...
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
label nNonProcessor() const
The number of patches before the first processor patch.
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.
const polyMesh & mesh() const noexcept
Return the mesh reference.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
const boundBox & bounds() const noexcept
Return mesh bounding box.
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
A patch is a list of labels that address the faces in the global face list.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Namespace for bounding specifications. At the moment, mostly for tables.
const dimensionedScalar mp
Proton mass.
Namespace for handling debugging switches.
const wordList area
Standard area field types (scalar, vector, tensor, etc).
const std::string patch
OpenFOAM patch number as a std::string.
List< edge > edgeList
List of edge.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
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.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
Field< vector > vectorField
Specialisation of Field<T> for vector.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
List< bool > boolList
A List of bools.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.