diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index 136b8542a..b0ce69423 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.C @@ -113,6 +113,68 @@ int main(int argc, char *argv[]) if (args.optionFound("writep")) { + // Find reference patch + label refPatch = -1; + scalar maxMagU = 0; + + // Go through all velocity patches and find the one that fixes + // velocity to the largest value + + forAll (U.boundaryField(), patchI) + { + const fvPatchVectorField& Upatch = U.boundaryField()[patchI]; + + if (Upatch.fixesValue()) + { + // Calculate mean velocity + scalar u = sum(mag(Upatch)); + label patchSize = Upatch.size(); + + reduce(u, sumOp()); + reduce(patchSize, sumOp