/*--------------------------------*- C++ -*----------------------------------*\
  Guide 14 - monitoring functions for a NEW copy of a porousBlockage case.
  Save as <case>/system/functions BEFORE run_campaign.sh.
  The FoamFile header is required: without it OpenFOAM 14 ignores the file.
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      functions;
}

// Pressure taps (kinematic p) and velocity on the channel axis, every time step.
// All points are cell centres of the 0.125 m mesh (y = 0 and y = 0.75 would lie on
// faces): x = -1.5625 far upstream, -0.5625 and +0.5625 first free cells next to
// the porous zone, +1.5625 far downstream; (2.5625 0.8125) lies in the wake and is
// used for the shedding frequency (probe index 4).
#includeFunc probes
(
    name=pressureTaps,
    points=((-1.5625 0.0625 0) (-0.5625 0.0625 0) (0.5625 0.0625 0) (1.5625 0.0625 0) (2.5625 0.8125 0)),
    fields=(p U)
)

// Area-averaged pressure on the inlet (the outlet is fixed at p = 0)
#includeFunc patchAverage(name=pInlet, patch=inlet, fields=(p))

// Volumetric flow rates [m3/s] for the mass balance (inlet negative, outlet positive)
#includeFunc patchFlowRate(name=Qinlet, patch=inlet)
#includeFunc patchFlowRate(name=Qoutlet, patch=outlet)

// Time averages after the initial transient (shedding cases)
#includeFunc fieldAverage(fields=(U p), startTime=20)

// ************************************************************************* //
