From 134a5114885d82ae404e51a362c970a82933d73c Mon Sep 17 00:00:00 2001 From: mathiasvangoe Date: Fri, 28 Jul 2017 13:25:32 +0200 Subject: [PATCH] Reorginzied function objects and updated plot script --- .../tankDrainage/CFD/system/controlDict | 6 ++---- .../tankDrainage/CFD/system/flowRatePatch | 19 +++++++++++++++++++ .../tankDrainage/CFD/system/patchAverage | 19 +++++++++++++++++++ .../tankDrainage/volFlow.m | 10 +++++----- 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/flowRatePatch create mode 100644 tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage diff --git a/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/controlDict b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/controlDict index 4d7ea793..e9638c20 100644 --- a/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/controlDict +++ b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/controlDict @@ -57,10 +57,8 @@ libs ( functions { - #includeFunc flowRatePatch(name=outlet) - #includeFunc patchAverage(alpha.water,name=outlet) - #includeFunc patchAverage(alpha.oil,name=outlet) - #includeFunc patchAverage(alpha.air,name=outlet) + #includeFunc flowRatePatch + #includeFunc patchAverage } // ************************************************************************* // diff --git a/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/flowRatePatch b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/flowRatePatch new file mode 100644 index 00000000..3a097f3e --- /dev/null +++ b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/flowRatePatch @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Web: www.OpenFOAM.org + \\/ M anipulation | +------------------------------------------------------------------------------- +Description + Calculates the flow rate through a specified patch by summing the flux on + patch faces. For solvers where the flux is volumetric, the flow rate is + volumetric; where flux is mass flux, the flow rate is mass flow rate. + +\*---------------------------------------------------------------------------*/ + +name outlet; + +#includeEtc "caseDicts/postProcessing/flowRate/flowRatePatch.cfg" + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage new file mode 100644 index 00000000..69c4a772 --- /dev/null +++ b/tutorials/cfdemSolverMultiphase/tankDrainage/CFD/system/patchAverage @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Web: www.OpenFOAM.org + \\/ M anipulation | +------------------------------------------------------------------------------- +Description + Calculates the average value of one or more fields on a patch. + +\*---------------------------------------------------------------------------*/ + +name outlet; +fields (alpha.air alpha.water alpha.oil); + +operation average; +#includeEtc "caseDicts/postProcessing/surfaceRegion/patch.cfg" + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverMultiphase/tankDrainage/volFlow.m b/tutorials/cfdemSolverMultiphase/tankDrainage/volFlow.m index 84191cbf..2d8de325 100644 --- a/tutorials/cfdemSolverMultiphase/tankDrainage/volFlow.m +++ b/tutorials/cfdemSolverMultiphase/tankDrainage/volFlow.m @@ -4,11 +4,11 @@ close all graphics_toolkit gnuplot -time = dlmread('./CFD/postProcessing/flowRatePatch(name=outlet)/0/surfaceRegion.dat','\t',4,0)(:,1); -phi = dlmread('./CFD/postProcessing/flowRatePatch(name=outlet)/0/surfaceRegion.dat','\t',4,1); -alphaAir = dlmread('./CFD/postProcessing/patchAverage(alpha.air,name=outlet)/0/surfaceRegion.dat','\t',4,1); -alphaWater = dlmread('./CFD/postProcessing/patchAverage(alpha.water,name=outlet)/0/surfaceRegion.dat','\t',4,1); -alphaOil = dlmread('./CFD/postProcessing/patchAverage(alpha.oil,name=outlet)/0/surfaceRegion.dat','\t',4,1); +time = dlmread('./CFD/postProcessing/flowRatePatch/0/surfaceRegion.dat','\t',4,0)(:,1); +phi = dlmread('./CFD/postProcessing/flowRatePatch/0/surfaceRegion.dat','\t',4,0)(:,2); +alphaAir = dlmread('./CFD/postProcessing/patchAverage/0/surfaceRegion.dat','\t',4,0)(:,2); +alphaWater = dlmread('./CFD/postProcessing/patchAverage/0/surfaceRegion.dat','\t',4,0)(:,3); +alphaOil = dlmread('./CFD/postProcessing/patchAverage/0/surfaceRegion.dat','\t',4,0)(:,4); volflowAir = phi.*alphaAir; volflowWater = phi.*alphaWater;