diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwclean b/applications/solvers/multiphase/reactingEulerFoam/Allwclean index 414e7d3b2..40a8acade 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwclean +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwclean @@ -7,5 +7,6 @@ wclean libso interfacialCompositionModels wclean libso derivedFvPatchFields reactingTwoPhaseEulerFoam/Allwclean reactingMultiphaseEulerFoam/Allwclean +wclean libso functionObjects #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/Allwmake b/applications/solvers/multiphase/reactingEulerFoam/Allwmake index fe2a898dc..0414175eb 100755 --- a/applications/solvers/multiphase/reactingEulerFoam/Allwmake +++ b/applications/solvers/multiphase/reactingEulerFoam/Allwmake @@ -14,5 +14,6 @@ wmakeLnInclude reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels wmakeLnInclude reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels reactingTwoPhaseEulerFoam/Allwmake $targetType $* reactingMultiphaseEulerFoam/Allwmake $targetType $* +wmake $targetType functionObjects #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/files b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/files new file mode 100644 index 000000000..4e4b829d9 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/files @@ -0,0 +1,3 @@ +sizeDistribution/sizeDistribution.C + +LIB = $(FOAM_LIBBIN)/libreactingEulerFoamFunctionObjects diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/options b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/options new file mode 100644 index 000000000..6a0c4ab90 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/Make/options @@ -0,0 +1,10 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/functionObjects/field/lnInclude \ + -I../phaseSystems/lnInclude + +LIB_LIBS = \ + -lfieldFunctionObjects \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C new file mode 100644 index 000000000..52ea09b71 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C @@ -0,0 +1,602 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "sizeDistribution.H" +#include "sizeGroup.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace functionObjects +{ + defineTypeNameAndDebug(sizeDistribution, 0); + addToRunTimeSelectionTable(functionObject, sizeDistribution, dictionary); +} +} + +template<> +const char* +Foam::NamedEnum +< + Foam::functionObjects::sizeDistribution::regionTypes, + 2 +>::names[] = {"cellZone", "all"}; + +template<> +const char* +Foam::NamedEnum +< + Foam::functionObjects::sizeDistribution::functionTypes, + 4 +>::names[] = + { + "numberDensity", + "volumeDensity", + "numberConcentration", + "moments" + }; + +template<> +const char* +Foam::NamedEnum +< + Foam::functionObjects::sizeDistribution::abszissaTypes, + 2 +>::names[] = {"diameter", "volume"}; + +const Foam::NamedEnum +< + Foam::functionObjects::sizeDistribution::regionTypes, + 2 +> Foam::functionObjects::sizeDistribution::regionTypeNames_; + +const Foam::NamedEnum +< + Foam::functionObjects::sizeDistribution::functionTypes, + 4 +> Foam::functionObjects::sizeDistribution::functionTypeNames_; + +const Foam::NamedEnum +< + Foam::functionObjects::sizeDistribution::abszissaTypes, + 2 +> Foam::functionObjects::sizeDistribution::abszissaTypeNames_; + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void Foam::functionObjects::sizeDistribution::initialise +( + const dictionary& dict +) +{ + switch (functionType_) + { + case ftNdf: + { + break; + } + + case ftVdf: + { + break; + } + + case ftNc: + { + break; + } + + case ftMom: + { + break; + } + + default: + { + FatalErrorInFunction + << "Unknown function type. Valid function types are:" + << functionTypeNames_ << nl << exit(FatalError); + } + } + + switch (abszissaType_) + { + case atDiameter: + { + break; + } + + case atVolume: + { + break; + } + + default: + { + FatalErrorInFunction + << "Unknown abszissa type. Valid abszissa types are:" + << abszissaTypeNames_ << nl << exit(FatalError); + } + } + + setCellZoneCells(); + + if (nCells_ == 0) + { + FatalErrorInFunction + << type() << " " << name() << ": " + << regionTypeNames_[regionType_] << "(" << regionName_ << "):" << nl + << " Region has no cells" << exit(FatalError); + } + + volume_ = volume(); + + Info<< type() << " " << name() << ":" + << regionTypeNames_[regionType_] << "(" << regionName_ << "):" << nl + << " total cells = " << nCells_ << nl + << " total volume = " << volume_ + << nl << endl; + + Info<< nl << endl; +} + + +void Foam::functionObjects::sizeDistribution::setCellZoneCells() +{ + switch (regionType_) + { + case rtCellZone: + { + dict().lookup("name") >> regionName_; + + label zoneId = mesh().cellZones().findZoneID(regionName_); + + if (zoneId < 0) + { + FatalErrorInFunction + << "Unknown cell zone name: " << regionName_ + << ". Valid cell zones are: " << mesh().cellZones().names() + << nl << exit(FatalError); + } + + cellId_ = mesh().cellZones()[zoneId]; + nCells_ = returnReduce(cellId_.size(), sumOp