Files
OpenFOAM-12/tutorials/modules/multiphaseEuler/hydrofoil/validation/createGraph
Will Bainbridge 8208ca6cc7 functionObjects: Added patchCutLayerAverage
This function object writes graphs of patch face values, area-averaged in
planes perpendicular to a given direction. It adaptively grades the
distribution of graph points to match the resolution of the mesh.

Example of function object specification:

    patchCutLayerAverage1
    {
        type            patchCutLayerAverage;
        libs            ("libpatchCutLayerAverageFunctionObject.so");

        writeControl    writeTime;
        writeInterval   1;

        patch           lowerWall;
        direction       (1 0 0);
        nPoints         100;
        interpolate     no;

        fields          (p U);

        axis            x;
        setFormat       raw;
    }

A packaged function object is also included, which permits the following
syntax to be used, either with #includeFunc in the system/controlDict,
or with the -func option to foamPostProcess:

    graphPatchCutLayerAverage
    (
        funcName=aerofoilLowerPressure,
        patch=aerofoilLower,
        direction=(0.15 -0.016 0),
        nPoints=100,
        p
    )
2022-12-06 13:00:56 +00:00

49 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
if ! which gnuplot > /dev/null 2>&1
then
echo 'gnuplot not found - skipping graph creation' >&2
exit 1
fi
lowerFile=postProcessing/hydrofoilLowerPressure/$(foamListTimes -latestTime)/patchCutLayerAverage.xy
upperFile=postProcessing/hydrofoilUpperPressure/$(foamListTimes -latestTime)/patchCutLayerAverage.xy
gnuplot<<EOF
\$experiment << end
0.05 -1.416
0.10 -1.400
0.20 -1.375
0.30 -1.148
0.40 -0.744
0.50 -0.695
0.60 -0.582
0.70 -0.520
0.80 -0.341
0.90 -0.108
0.50 0.040
end
set terminal postscript eps size 8,9 color enhanced font "Helvetica,20"
set output "./validation/$(basename "$PWD").eps"
set grid
c = 0.15
UInf = 5.33
pInf = 1e5
rhoInf = 998.4
set xlabel 'x/L'
set ylabel 'Cp'
plot [0:1] \
'$lowerFile' u (\$2/0.15):(2*(\$6-pInf)/(rhoInf*UInf*UInf)) w l lt 1 t 'Simulation Lower', \
'$upperFile' u (\$2/0.15):(2*(\$6-pInf)/(rhoInf*UInf*UInf)) w l lt 2 t 'Simulation Upper', \
'\$experiment' u 1:2 w p lt rgb "black" pt 4 t 'Experiment'
EOF
#------------------------------------------------------------------------------