mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: moved thermo/pdfs->lagrangian/distributionModels
This commit is contained in:
@ -35,4 +35,4 @@ EXE_LIBS = \
|
|||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lpdf
|
-ldistributionModels
|
||||||
|
|||||||
@ -32,5 +32,5 @@ EXE_LIBS = \
|
|||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|||||||
@ -5,7 +5,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
|
|||||||
@ -5,7 +5,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
|
|||||||
@ -2,7 +2,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I${LIB_SRC}/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
|
|||||||
@ -4,7 +4,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
|
|||||||
@ -5,7 +5,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
|
|||||||
@ -41,7 +41,7 @@ EXE_LIBS = \
|
|||||||
-lmolecule \
|
-lmolecule \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lOpenFOAM \
|
-lOpenFOAM \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lpotential \
|
-lpotential \
|
||||||
-lradiationModels \
|
-lradiationModels \
|
||||||
-lrandomProcesses \
|
-lrandomProcesses \
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude
|
-I$(LIB_SRC)/sampling/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lsampling
|
-lsampling
|
||||||
|
|||||||
@ -22,7 +22,14 @@
|
|||||||
|
|
||||||
cachedRandom rndGen(label(0), -1);
|
cachedRandom rndGen(label(0), -1);
|
||||||
|
|
||||||
autoPtr<pdfs::pdf> p(pdfs::pdf::New(pdfDictionary, rndGen));
|
autoPtr<distributionModels::distributionModel> p
|
||||||
|
(
|
||||||
|
distributionModels::distributionModel::New
|
||||||
|
(
|
||||||
|
pdfDictionary,
|
||||||
|
rndGen
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
const scalar xMin = p->minValue();
|
const scalar xMin = p->minValue();
|
||||||
const scalar xMax = p->maxValue();
|
const scalar xMax = p->maxValue();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,7 +27,7 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
#include "makeGraph.H"
|
#include "makeGraph.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
|
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
wmake $makeOption pdfs
|
wmake $makeOption distributionModels
|
||||||
wmake $makeOption basic
|
wmake $makeOption basic
|
||||||
wmake $makeOption solidParticle
|
wmake $makeOption solidParticle
|
||||||
wmake $makeOption intermediate
|
wmake $makeOption intermediate
|
||||||
|
|||||||
@ -3,7 +3,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
@ -25,7 +25,7 @@ LIB_LIBS = \
|
|||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquidProperties \
|
-lliquidProperties \
|
||||||
|
|||||||
@ -13,7 +13,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
@ -26,4 +26,4 @@ LIB_LIBS = \
|
|||||||
-lliquidMixtureProperties \
|
-lliquidMixtureProperties \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lpdf
|
-ldistributionModels
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -52,11 +52,11 @@ Foam::ChomiakInjector::ChomiakInjector
|
|||||||
:
|
:
|
||||||
injectorModel(dict, sm),
|
injectorModel(dict, sm),
|
||||||
ChomiakDict_(dict.subDict(typeName + "Coeffs")),
|
ChomiakDict_(dict.subDict(typeName + "Coeffs")),
|
||||||
dropletPDF_
|
dropletDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New
|
distributionModels::distributionModel::New
|
||||||
(
|
(
|
||||||
ChomiakDict_.subDict("dropletPDF"),
|
ChomiakDict_.subDict("dropletDistributionModel"),
|
||||||
sm.rndGen()
|
sm.rndGen()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@ -101,7 +101,7 @@ Foam::scalar Foam::ChomiakInjector::d0
|
|||||||
const scalar
|
const scalar
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return dropletPDF_->sample();
|
return dropletDistributionModel_->sample();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -113,8 +113,8 @@ Foam::vector Foam::ChomiakInjector::direction
|
|||||||
const scalar d
|
const scalar d
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
scalar dMin = dropletPDF_->minValue();
|
scalar dMin = dropletDistributionModel_->minValue();
|
||||||
scalar dMax = dropletPDF_->maxValue();
|
scalar dMax = dropletDistributionModel_->maxValue();
|
||||||
|
|
||||||
scalar angle =
|
scalar angle =
|
||||||
(d - dMax)*maxSprayAngle_[n]
|
(d - dMax)*maxSprayAngle_[n]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,7 +27,7 @@ Class
|
|||||||
Description
|
Description
|
||||||
Injector model based on an idea of Jerzy Chomiak.
|
Injector model based on an idea of Jerzy Chomiak.
|
||||||
|
|
||||||
Given the initial droplet size pdf in an interval d = (d0, d1),
|
Given the initial droplet size distributionModel in an interval d = (d0, d1),
|
||||||
the spray angle phi = phi(d), such that
|
the spray angle phi = phi(d), such that
|
||||||
the largest droplets have zero spray angle
|
the largest droplets have zero spray angle
|
||||||
and the smallest droplets have maximum spray angle.
|
and the smallest droplets have maximum spray angle.
|
||||||
@ -41,7 +41,7 @@ Description
|
|||||||
|
|
||||||
#include "injectorModel.H"
|
#include "injectorModel.H"
|
||||||
#include "scalarList.H"
|
#include "scalarList.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ private:
|
|||||||
|
|
||||||
dictionary ChomiakDict_;
|
dictionary ChomiakDict_;
|
||||||
|
|
||||||
autoPtr<pdfs::pdf> dropletPDF_;
|
autoPtr<distributionModels::distributionModel> dropletDistributionModel_;
|
||||||
scalarList maxSprayAngle_;
|
scalarList maxSprayAngle_;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -52,11 +52,11 @@ Foam::definedHollowConeInjector::definedHollowConeInjector
|
|||||||
:
|
:
|
||||||
injectorModel(dict, sm),
|
injectorModel(dict, sm),
|
||||||
definedHollowConeDict_(dict.subDict(typeName + "Coeffs")),
|
definedHollowConeDict_(dict.subDict(typeName + "Coeffs")),
|
||||||
dropletPDF_
|
dropletDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New
|
distributionModels::distributionModel::New
|
||||||
(
|
(
|
||||||
definedHollowConeDict_.subDict("dropletPDF"),
|
definedHollowConeDict_.subDict("dropletDistributionModel"),
|
||||||
sm.rndGen()
|
sm.rndGen()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@ -137,8 +137,8 @@ Foam::scalar Foam::definedHollowConeInjector::d0
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// swallow function arguments - not used
|
// swallow function arguments - not used
|
||||||
// return value sampled from PDF
|
// return value sampled from distribution model
|
||||||
return dropletPDF_->sample();
|
return dropletDistributionModel_->sample();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,7 +29,7 @@ Description
|
|||||||
|
|
||||||
- user defined:
|
- user defined:
|
||||||
- inner/outer cone angle vs. time
|
- inner/outer cone angle vs. time
|
||||||
- droplet PDF
|
- droplet distribution model
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ Description
|
|||||||
|
|
||||||
#include "injectorModel.H"
|
#include "injectorModel.H"
|
||||||
#include "vector.H"
|
#include "vector.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ private:
|
|||||||
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
|
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
|
||||||
|
|
||||||
dictionary definedHollowConeDict_;
|
dictionary definedHollowConeDict_;
|
||||||
autoPtr<pdfs::pdf> dropletPDF_;
|
autoPtr<distributionModels::distributionModel> dropletDistributionModel_;
|
||||||
|
|
||||||
// inner and outer cone angle time histories
|
// inner and outer cone angle time histories
|
||||||
// 2 column vectors = (time, coneAngle)
|
// 2 column vectors = (time, coneAngle)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -52,11 +52,11 @@ Foam::hollowConeInjector::hollowConeInjector
|
|||||||
:
|
:
|
||||||
injectorModel(dict, sm),
|
injectorModel(dict, sm),
|
||||||
hollowConeDict_(dict.subDict(typeName + "Coeffs")),
|
hollowConeDict_(dict.subDict(typeName + "Coeffs")),
|
||||||
dropletPDF_
|
dropletDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New
|
distributionModels::distributionModel::New
|
||||||
(
|
(
|
||||||
hollowConeDict_.subDict("dropletPDF"),
|
hollowConeDict_.subDict("dropletDistributionModel"),
|
||||||
sm.rndGen()
|
sm.rndGen()
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@ -112,7 +112,7 @@ Foam::scalar Foam::hollowConeInjector::d0
|
|||||||
const scalar
|
const scalar
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return dropletPDF_->sample();
|
return dropletDistributionModel_->sample();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -37,7 +37,7 @@ Description
|
|||||||
|
|
||||||
#include "injectorModel.H"
|
#include "injectorModel.H"
|
||||||
#include "scalarList.H"
|
#include "scalarList.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ private:
|
|||||||
|
|
||||||
dictionary hollowConeDict_;
|
dictionary hollowConeDict_;
|
||||||
|
|
||||||
autoPtr<pdfs::pdf> dropletPDF_;
|
autoPtr<distributionModels::distributionModel> dropletDistributionModel_;
|
||||||
scalarList innerAngle_;
|
scalarList innerAngle_;
|
||||||
scalarList outerAngle_;
|
scalarList outerAngle_;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
pdf/pdf.C
|
distributionModel/distributionModel.C
|
||||||
pdf/pdfNew.C
|
distributionModel/distributionModelNew.C
|
||||||
|
|
||||||
exponential/exponential.C
|
exponential/exponential.C
|
||||||
fixedValue/fixedValue.C
|
fixedValue/fixedValue.C
|
||||||
@ -9,4 +9,4 @@ normal/normal.C
|
|||||||
RosinRammler/RosinRammler.C
|
RosinRammler/RosinRammler.C
|
||||||
uniform/uniform.C
|
uniform/uniform.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libpdf
|
LIB = $(FOAM_LIBBIN)/libdistributionModels
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,34 +30,34 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(RosinRammler, 0);
|
defineTypeNameAndDebug(RosinRammler, 0);
|
||||||
addToRunTimeSelectionTable(pdf, RosinRammler, dictionary);
|
addToRunTimeSelectionTable(distributionModel, RosinRammler, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::RosinRammler::RosinRammler
|
Foam::distributionModels::RosinRammler::RosinRammler
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
cachedRandom& rndGen
|
cachedRandom& rndGen
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
pdf(typeName, dict, rndGen),
|
distributionModel(typeName, dict, rndGen),
|
||||||
minValue_(readScalar(pdfDict_.lookup("minValue"))),
|
minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
|
||||||
maxValue_(readScalar(pdfDict_.lookup("maxValue"))),
|
maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
|
||||||
d_(readScalar(pdfDict_.lookup("d"))),
|
d_(readScalar(distributionModelDict_.lookup("d"))),
|
||||||
n_(readScalar(pdfDict_.lookup("n")))
|
n_(readScalar(distributionModelDict_.lookup("n")))
|
||||||
{
|
{
|
||||||
check();
|
check();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::pdfs::RosinRammler::RosinRammler(const RosinRammler& p)
|
Foam::distributionModels::RosinRammler::RosinRammler(const RosinRammler& p)
|
||||||
:
|
:
|
||||||
pdf(p),
|
distributionModel(p),
|
||||||
minValue_(p.minValue_),
|
minValue_(p.minValue_),
|
||||||
maxValue_(p.maxValue_),
|
maxValue_(p.maxValue_),
|
||||||
d_(p.d_),
|
d_(p.d_),
|
||||||
@ -67,13 +67,13 @@ Foam::pdfs::RosinRammler::RosinRammler(const RosinRammler& p)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::RosinRammler::~RosinRammler()
|
Foam::distributionModels::RosinRammler::~RosinRammler()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::RosinRammler::sample() const
|
Foam::scalar Foam::distributionModels::RosinRammler::sample() const
|
||||||
{
|
{
|
||||||
scalar K = 1.0 - exp(-pow((maxValue_ - minValue_)/d_, n_));
|
scalar K = 1.0 - exp(-pow((maxValue_ - minValue_)/d_, n_));
|
||||||
scalar y = rndGen_.sample01<scalar>();
|
scalar y = rndGen_.sample01<scalar>();
|
||||||
@ -82,13 +82,13 @@ Foam::scalar Foam::pdfs::RosinRammler::sample() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::RosinRammler::minValue() const
|
Foam::scalar Foam::distributionModels::RosinRammler::minValue() const
|
||||||
{
|
{
|
||||||
return minValue_;
|
return minValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::RosinRammler::maxValue() const
|
Foam::scalar Foam::distributionModels::RosinRammler::maxValue() const
|
||||||
{
|
{
|
||||||
return maxValue_;
|
return maxValue_;
|
||||||
}
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,10 +25,10 @@ Class
|
|||||||
Foam::RosinRammler
|
Foam::RosinRammler
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Rosin-Rammler pdf
|
Rosin-Rammler distributionModel
|
||||||
|
|
||||||
@f[
|
@f[
|
||||||
cumulative pdf =
|
cumulative model =
|
||||||
(1.0 - exp( -(( x - d0)/d)^n )
|
(1.0 - exp( -(( x - d0)/d)^n )
|
||||||
/ (1.0 - exp( -((d1 - d0)/d)^n )
|
/ (1.0 - exp( -((d1 - d0)/d)^n )
|
||||||
@f]
|
@f]
|
||||||
@ -42,13 +42,13 @@ SourceFiles
|
|||||||
#ifndef RosinRammler_H
|
#ifndef RosinRammler_H
|
||||||
#define RosinRammler_H
|
#define RosinRammler_H
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -57,7 +57,7 @@ namespace pdfs
|
|||||||
|
|
||||||
class RosinRammler
|
class RosinRammler
|
||||||
:
|
:
|
||||||
public pdf
|
public distributionModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -88,9 +88,9 @@ public:
|
|||||||
RosinRammler(const RosinRammler& p);
|
RosinRammler(const RosinRammler& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<pdf> clone() const
|
virtual autoPtr<distributionModel> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<pdf>(new RosinRammler(*this));
|
return autoPtr<distributionModel>(new RosinRammler(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Sample the pdf
|
//- Sample the distributionModel
|
||||||
virtual scalar sample() const;
|
virtual scalar sample() const;
|
||||||
|
|
||||||
//- Return the minimum value
|
//- Return the minimum value
|
||||||
@ -113,7 +113,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace pdfs
|
} // End namespace distributionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,36 +23,36 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(pdf, 0);
|
defineTypeNameAndDebug(distributionModel, 0);
|
||||||
defineRunTimeSelectionTable(pdf, dictionary);
|
defineRunTimeSelectionTable(distributionModel, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::pdfs::pdf::check() const
|
void Foam::distributionModels::distributionModel::check() const
|
||||||
{
|
{
|
||||||
if (minValue() < 0)
|
if (minValue() < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn("pdfs::pdf::check() const")
|
FatalErrorIn("distributionModels::distributionModel::check() const")
|
||||||
<< type() << "PDF: Minimum value must be greater than zero." << nl
|
<< type() << "distribution: Minimum value must be greater than "
|
||||||
<< "Supplied minValue = " << minValue()
|
<< "zero." << nl << "Supplied minValue = " << minValue()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxValue() < minValue())
|
if (maxValue() < minValue())
|
||||||
{
|
{
|
||||||
FatalErrorIn("pdfs::pdf::check() const")
|
FatalErrorIn("distributionModels::distributionModel::check() const")
|
||||||
<< type() << "PDF: Maximum value is smaller than the minimum value:"
|
<< type() << "distribution: Maximum value is smaller than the "
|
||||||
<< nl << " maxValue = " << maxValue()
|
<< "minimum value:" << nl << " maxValue = " << maxValue()
|
||||||
<< ", minValue = " << minValue()
|
<< ", minValue = " << minValue()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -61,50 +61,65 @@ void Foam::pdfs::pdf::check() const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::pdf::pdf
|
Foam::distributionModels::distributionModel::distributionModel
|
||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
cachedRandom& rndGen
|
cachedRandom& rndGen
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
pdfDict_(dict.subDict(name + "PDF")),
|
distributionModelDict_(dict.subDict(name + "Distribution")),
|
||||||
rndGen_(rndGen)
|
rndGen_(rndGen)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::pdfs::pdf::pdf(const pdf& p)
|
Foam::distributionModels::distributionModel::distributionModel
|
||||||
|
(
|
||||||
|
const distributionModel& p
|
||||||
|
)
|
||||||
:
|
:
|
||||||
pdfDict_(p.pdfDict_),
|
distributionModelDict_(p.distributionModelDict_),
|
||||||
rndGen_(p.rndGen_)
|
rndGen_(p.rndGen_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::pdf::~pdf()
|
Foam::distributionModels::distributionModel::~distributionModel()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::pdf::sample() const
|
Foam::scalar Foam::distributionModels::distributionModel::sample() const
|
||||||
{
|
{
|
||||||
notImplemented("Foam::scalar Foam::pdfs::pdf::sample() const");
|
notImplemented
|
||||||
|
(
|
||||||
|
"Foam::scalar "
|
||||||
|
"Foam::distributionModels::distributionModel::sample() const"
|
||||||
|
);
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::pdf::minValue() const
|
Foam::scalar Foam::distributionModels::distributionModel::minValue() const
|
||||||
{
|
{
|
||||||
notImplemented("Foam::scalar Foam::pdfs::pdf::minValue() const");
|
notImplemented
|
||||||
|
(
|
||||||
|
"Foam::scalar "
|
||||||
|
"Foam::distributionModels::distributionModel::minValue() const"
|
||||||
|
);
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::pdf::maxValue() const
|
Foam::scalar Foam::distributionModels::distributionModel::maxValue() const
|
||||||
{
|
{
|
||||||
notImplemented("Foam::scalar Foam::pdfs::pdf::maxValue() const");
|
notImplemented
|
||||||
|
(
|
||||||
|
"Foam::scalar "
|
||||||
|
"Foam::distributionModels::distributionModel::maxValue() const"
|
||||||
|
);
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,14 +22,14 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::pdf
|
Foam::distributionModel
|
||||||
|
|
||||||
Description
|
Description
|
||||||
A library of runtime-selectable PDF's.
|
A library of runtime-selectable distribution models.
|
||||||
|
|
||||||
Returns a sampled value given the expectation (nu) and variance (sigma^2)
|
Returns a sampled value given the expectation (nu) and variance (sigma^2)
|
||||||
|
|
||||||
Current PDF's include:
|
Current distribution models include:
|
||||||
- exponential
|
- exponential
|
||||||
- fixedValue
|
- fixedValue
|
||||||
- general
|
- general
|
||||||
@ -38,19 +38,19 @@ Description
|
|||||||
- Rosin-Rammler
|
- Rosin-Rammler
|
||||||
- uniform
|
- uniform
|
||||||
|
|
||||||
The pdf is tabulated in equidistant nPoints, in an interval.
|
The distributionModel is tabulated in equidistant nPoints, in an interval.
|
||||||
These values are integrated to obtain the cumulated PDF,
|
These values are integrated to obtain the cumulated distribution model,
|
||||||
which is then used to change the distribution from unifrom to
|
which is then used to change the distribution from unifrom to
|
||||||
the actual pdf.
|
the actual distributionModel.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
pdf.C
|
distributionModel.C
|
||||||
pdfNew.C
|
distributionModelNew.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef pdf_H
|
#ifndef distributionModel_H
|
||||||
#define pdf_H
|
#define distributionModel_H
|
||||||
|
|
||||||
#include "IOdictionary.H"
|
#include "IOdictionary.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
@ -60,14 +60,14 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class pdf Declaration
|
Class distributionModel Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class pdf
|
class distributionModel
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -75,7 +75,7 @@ protected:
|
|||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Coefficients dictionary
|
//- Coefficients dictionary
|
||||||
const dictionary pdfDict_;
|
const dictionary distributionModelDict_;
|
||||||
|
|
||||||
//- Reference to the random number generator
|
//- Reference to the random number generator
|
||||||
cachedRandom& rndGen_;
|
cachedRandom& rndGen_;
|
||||||
@ -83,21 +83,21 @@ protected:
|
|||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Check that the PDF is valid
|
//- Check that the distribution model is valid
|
||||||
virtual void check() const;
|
virtual void check() const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//-Runtime type information
|
//-Runtime type information
|
||||||
TypeName("pdf");
|
TypeName("distributionModel");
|
||||||
|
|
||||||
|
|
||||||
//- Declare runtime constructor selection table
|
//- Declare runtime constructor selection table
|
||||||
declareRunTimeSelectionTable
|
declareRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
autoPtr,
|
autoPtr,
|
||||||
pdf,
|
distributionModel,
|
||||||
dictionary,
|
dictionary,
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
@ -110,29 +110,38 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
pdf(const word& name, const dictionary& dict, cachedRandom& rndGen);
|
distributionModel
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const dictionary& dict,
|
||||||
|
cachedRandom& rndGen
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
pdf(const pdf& p);
|
distributionModel(const distributionModel& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<pdf> clone() const
|
virtual autoPtr<distributionModel> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<pdf>(new pdf(*this));
|
return autoPtr<distributionModel>(new distributionModel(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Selector
|
//- Selector
|
||||||
static autoPtr<pdf> New(const dictionary& dict, cachedRandom& rndGen);
|
static autoPtr<distributionModel> New
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
cachedRandom& rndGen
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~pdf();
|
virtual ~distributionModel();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Sample the pdf
|
//- Sample the distributionModel
|
||||||
virtual scalar sample() const;
|
virtual scalar sample() const;
|
||||||
|
|
||||||
//- Return the minimum value
|
//- Return the minimum value
|
||||||
@ -145,7 +154,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace pdfs
|
} // End namespace distributionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,33 +23,41 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::autoPtr<Foam::pdfs::pdf> Foam::pdfs::pdf::New
|
Foam::autoPtr<Foam::distributionModels::distributionModel>
|
||||||
|
Foam::distributionModels::distributionModel::New
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
cachedRandom& rndGen
|
cachedRandom& rndGen
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word modelType(dict.lookup("pdfType"));
|
const word modelType(dict.lookup("distributionModelType"));
|
||||||
|
|
||||||
Info<< "Selecting pdfType " << modelType << endl;
|
Info<< "Selecting distributionModelType " << modelType << endl;
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
dictionaryConstructorTable::iterator cstrIter =
|
||||||
dictionaryConstructorTablePtr_->find(modelType);
|
dictionaryConstructorTablePtr_->find(modelType);
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
{
|
{
|
||||||
FatalErrorIn("pdfs::pdf::New(const dictionary&, cachedRandom&)")
|
FatalErrorIn
|
||||||
<< "Unknown pdf type " << modelType << nl << nl
|
(
|
||||||
<< "Valid pdf types are:" << nl
|
"distributionModels::distributionModel::New"
|
||||||
|
"("
|
||||||
|
"const dictionary&, "
|
||||||
|
"cachedRandom&"
|
||||||
|
")"
|
||||||
|
)
|
||||||
|
<< "Unknown distributionModel type " << modelType << nl << nl
|
||||||
|
<< "Valid distributionModel types are:" << nl
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<pdf>(cstrIter()(dict, rndGen));
|
return autoPtr<distributionModel>(cstrIter()(dict, rndGen));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,33 +30,33 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(exponential, 0);
|
defineTypeNameAndDebug(exponential, 0);
|
||||||
addToRunTimeSelectionTable(pdf, exponential, dictionary);
|
addToRunTimeSelectionTable(distributionModel, exponential, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::exponential::exponential
|
Foam::distributionModels::exponential::exponential
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
cachedRandom& rndGen
|
cachedRandom& rndGen
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
pdf(typeName, dict, rndGen),
|
distributionModel(typeName, dict, rndGen),
|
||||||
minValue_(readScalar(pdfDict_.lookup("minValue"))),
|
minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
|
||||||
maxValue_(readScalar(pdfDict_.lookup("maxValue"))),
|
maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
|
||||||
lambda_(readScalar(pdfDict_.lookup("lambda")))
|
lambda_(readScalar(distributionModelDict_.lookup("lambda")))
|
||||||
{
|
{
|
||||||
check();
|
check();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::pdfs::exponential::exponential(const exponential& p)
|
Foam::distributionModels::exponential::exponential(const exponential& p)
|
||||||
:
|
:
|
||||||
pdf(p),
|
distributionModel(p),
|
||||||
minValue_(p.minValue_),
|
minValue_(p.minValue_),
|
||||||
maxValue_(p.maxValue_),
|
maxValue_(p.maxValue_),
|
||||||
lambda_(p.lambda_)
|
lambda_(p.lambda_)
|
||||||
@ -65,13 +65,13 @@ Foam::pdfs::exponential::exponential(const exponential& p)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::exponential::~exponential()
|
Foam::distributionModels::exponential::~exponential()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::exponential::sample() const
|
Foam::scalar Foam::distributionModels::exponential::sample() const
|
||||||
{
|
{
|
||||||
scalar y = rndGen_.sample01<scalar>();
|
scalar y = rndGen_.sample01<scalar>();
|
||||||
scalar K = exp(-lambda_*maxValue_) - exp(-lambda_*minValue_);
|
scalar K = exp(-lambda_*maxValue_) - exp(-lambda_*minValue_);
|
||||||
@ -79,13 +79,13 @@ Foam::scalar Foam::pdfs::exponential::sample() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::exponential::minValue() const
|
Foam::scalar Foam::distributionModels::exponential::minValue() const
|
||||||
{
|
{
|
||||||
return minValue_;
|
return minValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::exponential::maxValue() const
|
Foam::scalar Foam::distributionModels::exponential::maxValue() const
|
||||||
{
|
{
|
||||||
return maxValue_;
|
return maxValue_;
|
||||||
}
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,7 +25,7 @@ Class
|
|||||||
Foam::exponential
|
Foam::exponential
|
||||||
|
|
||||||
Description
|
Description
|
||||||
exponential pdf
|
exponential distribution model
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
exponential.C
|
exponential.C
|
||||||
@ -35,13 +35,13 @@ SourceFiles
|
|||||||
#ifndef exponential_H
|
#ifndef exponential_H
|
||||||
#define exponential_H
|
#define exponential_H
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -50,7 +50,7 @@ namespace pdfs
|
|||||||
|
|
||||||
class exponential
|
class exponential
|
||||||
:
|
:
|
||||||
public pdf
|
public distributionModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -81,9 +81,9 @@ public:
|
|||||||
exponential(const exponential& p);
|
exponential(const exponential& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<pdf> clone() const
|
virtual autoPtr<distributionModel> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<pdf>(new exponential(*this));
|
return autoPtr<distributionModel>(new exponential(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Sample the pdf
|
//- Sample the distributionModel
|
||||||
virtual scalar sample() const;
|
virtual scalar sample() const;
|
||||||
|
|
||||||
//- Return the minimum value
|
//- Return the minimum value
|
||||||
@ -106,7 +106,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace pdfs
|
} // End namespace distributionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,50 +30,54 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(fixedValue, 0);
|
defineTypeNameAndDebug(fixedValue, 0);
|
||||||
addToRunTimeSelectionTable(pdf, fixedValue, dictionary);
|
addToRunTimeSelectionTable(distributionModel, fixedValue, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::fixedValue::fixedValue(const dictionary& dict, cachedRandom& rndGen)
|
Foam::distributionModels::fixedValue::fixedValue
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
cachedRandom& rndGen
|
||||||
|
)
|
||||||
:
|
:
|
||||||
pdf(typeName, dict, rndGen),
|
distributionModel(typeName, dict, rndGen),
|
||||||
value_(readScalar(pdfDict_.lookup("value")))
|
value_(readScalar(distributionModelDict_.lookup("value")))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::pdfs::fixedValue::fixedValue(const fixedValue& p)
|
Foam::distributionModels::fixedValue::fixedValue(const fixedValue& p)
|
||||||
:
|
:
|
||||||
pdf(p),
|
distributionModel(p),
|
||||||
value_(p.value_)
|
value_(p.value_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::fixedValue::~fixedValue()
|
Foam::distributionModels::fixedValue::~fixedValue()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::fixedValue::fixedValue::sample() const
|
Foam::scalar Foam::distributionModels::fixedValue::fixedValue::sample() const
|
||||||
{
|
{
|
||||||
return value_;
|
return value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::fixedValue::fixedValue::minValue() const
|
Foam::scalar Foam::distributionModels::fixedValue::fixedValue::minValue() const
|
||||||
{
|
{
|
||||||
return value_;
|
return value_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::fixedValue::fixedValue::maxValue() const
|
Foam::scalar Foam::distributionModels::fixedValue::fixedValue::maxValue() const
|
||||||
{
|
{
|
||||||
return value_;
|
return value_;
|
||||||
}
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,16 +32,16 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef pdfFixedValue_H
|
#ifndef distributionModelFixedValue_H
|
||||||
#define pdfFixedValue_H
|
#define distributionModelFixedValue_H
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class fixedValue Declaration
|
Class fixedValue Declaration
|
||||||
@ -49,7 +49,7 @@ namespace pdfs
|
|||||||
|
|
||||||
class fixedValue
|
class fixedValue
|
||||||
:
|
:
|
||||||
public pdf
|
public distributionModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -72,9 +72,9 @@ public:
|
|||||||
fixedValue(const fixedValue& p);
|
fixedValue(const fixedValue& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<pdf> clone() const
|
virtual autoPtr<distributionModel> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<pdf>(new fixedValue(*this));
|
return autoPtr<distributionModel>(new fixedValue(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Sample the pdf
|
//- Sample the distributionModel
|
||||||
virtual scalar sample() const;
|
virtual scalar sample() const;
|
||||||
|
|
||||||
//- Return the minimum value
|
//- Return the minimum value
|
||||||
@ -97,7 +97,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace pdfs
|
} // End namespace distributionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,19 +30,23 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(general, 0);
|
defineTypeNameAndDebug(general, 0);
|
||||||
addToRunTimeSelectionTable(pdf, general, dictionary);
|
addToRunTimeSelectionTable(distributionModel, general, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen)
|
Foam::distributionModels::general::general
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
cachedRandom& rndGen
|
||||||
|
)
|
||||||
:
|
:
|
||||||
pdf(typeName, dict, rndGen),
|
distributionModel(typeName, dict, rndGen),
|
||||||
xy_(pdfDict_.lookup("distribution")),
|
xy_(distributionModelDict_.lookup("distribution")),
|
||||||
nEntries_(xy_.size()),
|
nEntries_(xy_.size()),
|
||||||
minValue_(xy_[0][0]),
|
minValue_(xy_[0][0]),
|
||||||
maxValue_(xy_[nEntries_-1][0]),
|
maxValue_(xy_[nEntries_-1][0]),
|
||||||
@ -50,7 +54,7 @@ Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen)
|
|||||||
{
|
{
|
||||||
check();
|
check();
|
||||||
|
|
||||||
// normalize the cumulative pdf
|
// normalize the cumulative distributionModel
|
||||||
|
|
||||||
integral_[0] = 0.0;
|
integral_[0] = 0.0;
|
||||||
for (label i=1; i<nEntries_; i++)
|
for (label i=1; i<nEntries_; i++)
|
||||||
@ -74,9 +78,9 @@ Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::pdfs::general::general(const general& p)
|
Foam::distributionModels::general::general(const general& p)
|
||||||
:
|
:
|
||||||
pdf(p),
|
distributionModel(p),
|
||||||
xy_(p.xy_),
|
xy_(p.xy_),
|
||||||
nEntries_(p.nEntries_),
|
nEntries_(p.nEntries_),
|
||||||
minValue_(p.minValue_),
|
minValue_(p.minValue_),
|
||||||
@ -87,13 +91,13 @@ Foam::pdfs::general::general(const general& p)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::general::~general()
|
Foam::distributionModels::general::~general()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::general::sample() const
|
Foam::scalar Foam::distributionModels::general::sample() const
|
||||||
{
|
{
|
||||||
scalar y = rndGen_.sample01<scalar>();
|
scalar y = rndGen_.sample01<scalar>();
|
||||||
|
|
||||||
@ -137,13 +141,13 @@ Foam::scalar Foam::pdfs::general::sample() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::general::minValue() const
|
Foam::scalar Foam::distributionModels::general::minValue() const
|
||||||
{
|
{
|
||||||
return minValue_;
|
return minValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::general::maxValue() const
|
Foam::scalar Foam::distributionModels::general::maxValue() const
|
||||||
{
|
{
|
||||||
return maxValue_;
|
return maxValue_;
|
||||||
}
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,7 +25,7 @@ Class
|
|||||||
Foam::general
|
Foam::general
|
||||||
|
|
||||||
Description
|
Description
|
||||||
general pdf
|
general distribution model
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
general.C
|
general.C
|
||||||
@ -35,7 +35,7 @@ SourceFiles
|
|||||||
#ifndef general_H
|
#ifndef general_H
|
||||||
#define general_H
|
#define general_H
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
#include "Vector.H"
|
#include "Vector.H"
|
||||||
#include "VectorSpace.H"
|
#include "VectorSpace.H"
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ SourceFiles
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -52,7 +52,7 @@ namespace pdfs
|
|||||||
|
|
||||||
class general
|
class general
|
||||||
:
|
:
|
||||||
public pdf
|
public distributionModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -84,9 +84,9 @@ public:
|
|||||||
general(const general& p);
|
general(const general& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<pdf> clone() const
|
virtual autoPtr<distributionModel> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<pdf>(new general(*this));
|
return autoPtr<distributionModel>(new general(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Sample the pdf
|
//- Sample the distributionModel
|
||||||
virtual scalar sample() const;
|
virtual scalar sample() const;
|
||||||
|
|
||||||
//- Return the minimum value
|
//- Return the minimum value
|
||||||
@ -109,7 +109,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace pdfs
|
} // End namespace distributionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,28 +30,28 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(multiNormal, 0);
|
defineTypeNameAndDebug(multiNormal, 0);
|
||||||
addToRunTimeSelectionTable(pdf, multiNormal, dictionary);
|
addToRunTimeSelectionTable(distributionModel, multiNormal, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::multiNormal::multiNormal
|
Foam::distributionModels::multiNormal::multiNormal
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
cachedRandom& rndGen
|
cachedRandom& rndGen
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
pdf(typeName, dict, rndGen),
|
distributionModel(typeName, dict, rndGen),
|
||||||
minValue_(readScalar(pdfDict_.lookup("minValue"))),
|
minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
|
||||||
maxValue_(readScalar(pdfDict_.lookup("maxValue"))),
|
maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
|
||||||
range_(maxValue_ - minValue_),
|
range_(maxValue_ - minValue_),
|
||||||
expectation_(pdfDict_.lookup("expectation")),
|
expectation_(distributionModelDict_.lookup("expectation")),
|
||||||
variance_(pdfDict_.lookup("variance")),
|
variance_(distributionModelDict_.lookup("variance")),
|
||||||
strength_(pdfDict_.lookup("strength"))
|
strength_(distributionModelDict_.lookup("strength"))
|
||||||
{
|
{
|
||||||
check();
|
check();
|
||||||
|
|
||||||
@ -81,9 +81,9 @@ Foam::pdfs::multiNormal::multiNormal
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::pdfs::multiNormal::multiNormal(const multiNormal& p)
|
Foam::distributionModels::multiNormal::multiNormal(const multiNormal& p)
|
||||||
:
|
:
|
||||||
pdf(p),
|
distributionModel(p),
|
||||||
minValue_(p.minValue_),
|
minValue_(p.minValue_),
|
||||||
maxValue_(p.maxValue_),
|
maxValue_(p.maxValue_),
|
||||||
range_(p.range_),
|
range_(p.range_),
|
||||||
@ -95,13 +95,13 @@ Foam::pdfs::multiNormal::multiNormal(const multiNormal& p)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::multiNormal::~multiNormal()
|
Foam::distributionModels::multiNormal::~multiNormal()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::multiNormal::sample() const
|
Foam::scalar Foam::distributionModels::multiNormal::sample() const
|
||||||
{
|
{
|
||||||
scalar y = 0;
|
scalar y = 0;
|
||||||
scalar x = 0;
|
scalar x = 0;
|
||||||
@ -133,13 +133,13 @@ Foam::scalar Foam::pdfs::multiNormal::sample() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::multiNormal::minValue() const
|
Foam::scalar Foam::distributionModels::multiNormal::minValue() const
|
||||||
{
|
{
|
||||||
return minValue_;
|
return minValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::multiNormal::maxValue() const
|
Foam::scalar Foam::distributionModels::multiNormal::maxValue() const
|
||||||
{
|
{
|
||||||
return maxValue_;
|
return maxValue_;
|
||||||
}
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,10 +25,10 @@ Class
|
|||||||
Foam::multiNormal
|
Foam::multiNormal
|
||||||
|
|
||||||
Description
|
Description
|
||||||
A multiNormal pdf
|
A multiNormal distribution model
|
||||||
|
|
||||||
@verbatim
|
@verbatim
|
||||||
pdf = sum_i strength_i * exp(-0.5*((x - expectation_i)/variance_i)^2 )
|
model = sum_i strength_i * exp(-0.5*((x - expectation_i)/variance_i)^2 )
|
||||||
@endverbatim
|
@endverbatim
|
||||||
|
|
||||||
|
|
||||||
@ -40,13 +40,13 @@ SourceFiles
|
|||||||
#ifndef multiNormal_H
|
#ifndef multiNormal_H
|
||||||
#define multiNormal_H
|
#define multiNormal_H
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -55,7 +55,7 @@ namespace pdfs
|
|||||||
|
|
||||||
class multiNormal
|
class multiNormal
|
||||||
:
|
:
|
||||||
public pdf
|
public distributionModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -91,9 +91,9 @@ public:
|
|||||||
multiNormal(const multiNormal& p);
|
multiNormal(const multiNormal& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<pdf> clone() const
|
virtual autoPtr<distributionModel> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<pdf>(new multiNormal(*this));
|
return autoPtr<distributionModel>(new multiNormal(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Sample the pdf
|
//- Sample the distributionModel
|
||||||
virtual scalar sample() const;
|
virtual scalar sample() const;
|
||||||
|
|
||||||
//- Return the minimum value
|
//- Return the minimum value
|
||||||
@ -116,7 +116,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace pdfs
|
} // End namespace distributionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -31,22 +31,26 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(normal, 0);
|
defineTypeNameAndDebug(normal, 0);
|
||||||
addToRunTimeSelectionTable(pdf, normal, dictionary);
|
addToRunTimeSelectionTable(distributionModel, normal, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::normal::normal(const dictionary& dict, cachedRandom& rndGen)
|
Foam::distributionModels::normal::normal
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
cachedRandom& rndGen
|
||||||
|
)
|
||||||
:
|
:
|
||||||
pdf(typeName, dict, rndGen),
|
distributionModel(typeName, dict, rndGen),
|
||||||
minValue_(readScalar(pdfDict_.lookup("minValue"))),
|
minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
|
||||||
maxValue_(readScalar(pdfDict_.lookup("maxValue"))),
|
maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
|
||||||
expectation_(readScalar(pdfDict_.lookup("expectation"))),
|
expectation_(readScalar(distributionModelDict_.lookup("expectation"))),
|
||||||
variance_(readScalar(pdfDict_.lookup("variance"))),
|
variance_(readScalar(distributionModelDict_.lookup("variance"))),
|
||||||
a_(0.147)
|
a_(0.147)
|
||||||
{
|
{
|
||||||
if (minValue_ < 0)
|
if (minValue_ < 0)
|
||||||
@ -67,9 +71,9 @@ Foam::pdfs::normal::normal(const dictionary& dict, cachedRandom& rndGen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::pdfs::normal::normal(const normal& p)
|
Foam::distributionModels::normal::normal(const normal& p)
|
||||||
:
|
:
|
||||||
pdf(p),
|
distributionModel(p),
|
||||||
minValue_(p.minValue_),
|
minValue_(p.minValue_),
|
||||||
maxValue_(p.maxValue_),
|
maxValue_(p.maxValue_),
|
||||||
expectation_(p.expectation_),
|
expectation_(p.expectation_),
|
||||||
@ -80,13 +84,13 @@ Foam::pdfs::normal::normal(const normal& p)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::normal::~normal()
|
Foam::distributionModels::normal::~normal()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::normal::sample() const
|
Foam::scalar Foam::distributionModels::normal::sample() const
|
||||||
{
|
{
|
||||||
|
|
||||||
scalar a = erf((minValue_ - expectation_)/variance_);
|
scalar a = erf((minValue_ - expectation_)/variance_);
|
||||||
@ -104,19 +108,19 @@ Foam::scalar Foam::pdfs::normal::sample() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::normal::minValue() const
|
Foam::scalar Foam::distributionModels::normal::minValue() const
|
||||||
{
|
{
|
||||||
return minValue_;
|
return minValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::normal::maxValue() const
|
Foam::scalar Foam::distributionModels::normal::maxValue() const
|
||||||
{
|
{
|
||||||
return maxValue_;
|
return maxValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::normal::erfInv(const scalar y) const
|
Foam::scalar Foam::distributionModels::normal::erfInv(const scalar y) const
|
||||||
{
|
{
|
||||||
scalar k = 2.0/(constant::mathematical::pi*a_) + 0.5*log(1.0 - y*y);
|
scalar k = 2.0/(constant::mathematical::pi*a_) + 0.5*log(1.0 - y*y);
|
||||||
scalar h = log(1.0 - y*y)/a_;
|
scalar h = log(1.0 - y*y)/a_;
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,13 +25,13 @@ Class
|
|||||||
Foam::normal
|
Foam::normal
|
||||||
|
|
||||||
Description
|
Description
|
||||||
A normal pdf
|
A normal distribution model
|
||||||
|
|
||||||
@verbatim
|
@verbatim
|
||||||
pdf = strength * exp(-0.5*((x - expectation)/variance)^2 )
|
model = strength * exp(-0.5*((x - expectation)/variance)^2 )
|
||||||
@endverbatim
|
@endverbatim
|
||||||
|
|
||||||
strength only has meaning if there's more than one pdf
|
strength only has meaning if there's more than one distribution model
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
normal.C
|
normal.C
|
||||||
@ -41,13 +41,13 @@ SourceFiles
|
|||||||
#ifndef normal_H
|
#ifndef normal_H
|
||||||
#define normal_H
|
#define normal_H
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -56,7 +56,7 @@ namespace pdfs
|
|||||||
|
|
||||||
class normal
|
class normal
|
||||||
:
|
:
|
||||||
public pdf
|
public distributionModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -91,9 +91,9 @@ public:
|
|||||||
normal(const normal& p);
|
normal(const normal& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<pdf> clone() const
|
virtual autoPtr<distributionModel> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<pdf>(new normal(*this));
|
return autoPtr<distributionModel>(new normal(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Sample the pdf
|
//- Sample the distributionModel
|
||||||
virtual scalar sample() const;
|
virtual scalar sample() const;
|
||||||
|
|
||||||
//- Return the minimum value
|
//- Return the minimum value
|
||||||
@ -118,7 +118,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace pdfs
|
} // End namespace distributionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,29 +30,33 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(uniform, 0);
|
defineTypeNameAndDebug(uniform, 0);
|
||||||
addToRunTimeSelectionTable(pdf, uniform, dictionary);
|
addToRunTimeSelectionTable(distributionModel, uniform, dictionary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::uniform::uniform(const dictionary& dict, cachedRandom& rndGen)
|
Foam::distributionModels::uniform::uniform
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
cachedRandom& rndGen
|
||||||
|
)
|
||||||
:
|
:
|
||||||
pdf(typeName, dict, rndGen),
|
distributionModel(typeName, dict, rndGen),
|
||||||
minValue_(readScalar(pdfDict_.lookup("minValue"))),
|
minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
|
||||||
maxValue_(readScalar(pdfDict_.lookup("maxValue"))),
|
maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
|
||||||
range_(maxValue_ - minValue_)
|
range_(maxValue_ - minValue_)
|
||||||
{
|
{
|
||||||
check();
|
check();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::pdfs::uniform::uniform(const uniform& p)
|
Foam::distributionModels::uniform::uniform(const uniform& p)
|
||||||
:
|
:
|
||||||
pdf(p),
|
distributionModel(p),
|
||||||
minValue_(p.minValue_),
|
minValue_(p.minValue_),
|
||||||
maxValue_(p.maxValue_)
|
maxValue_(p.maxValue_)
|
||||||
{}
|
{}
|
||||||
@ -60,25 +64,25 @@ Foam::pdfs::uniform::uniform(const uniform& p)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::pdfs::uniform::~uniform()
|
Foam::distributionModels::uniform::~uniform()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::uniform::sample() const
|
Foam::scalar Foam::distributionModels::uniform::sample() const
|
||||||
{
|
{
|
||||||
return rndGen_.position<scalar>(minValue_, maxValue_);
|
return rndGen_.position<scalar>(minValue_, maxValue_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::uniform::minValue() const
|
Foam::scalar Foam::distributionModels::uniform::minValue() const
|
||||||
{
|
{
|
||||||
return minValue_;
|
return minValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::pdfs::uniform::maxValue() const
|
Foam::scalar Foam::distributionModels::uniform::maxValue() const
|
||||||
{
|
{
|
||||||
return maxValue_;
|
return maxValue_;
|
||||||
}
|
}
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,7 +25,7 @@ Class
|
|||||||
Foam::uniform
|
Foam::uniform
|
||||||
|
|
||||||
Description
|
Description
|
||||||
uniform pdf
|
Uniform/equally-weighted distribution model
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
uniform.C
|
uniform.C
|
||||||
@ -35,13 +35,13 @@ SourceFiles
|
|||||||
#ifndef uniform_H
|
#ifndef uniform_H
|
||||||
#define uniform_H
|
#define uniform_H
|
||||||
|
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace pdfs
|
namespace distributionModels
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -50,7 +50,7 @@ namespace pdfs
|
|||||||
|
|
||||||
class uniform
|
class uniform
|
||||||
:
|
:
|
||||||
public pdf
|
public distributionModel
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -79,9 +79,9 @@ public:
|
|||||||
uniform(const uniform& p);
|
uniform(const uniform& p);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<pdf> clone() const
|
virtual autoPtr<distributionModel> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<pdf>(new uniform(*this));
|
return autoPtr<distributionModel>(new uniform(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Sample the pdf
|
//- Sample the distributionModel
|
||||||
virtual scalar sample() const;
|
virtual scalar sample() const;
|
||||||
|
|
||||||
//- Return the minimum value
|
//- Return the minimum value
|
||||||
@ -104,7 +104,7 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace pdfs
|
} // End namespace distributionModels
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
@ -24,7 +24,7 @@ LIB_LIBS = \
|
|||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lliquidProperties \
|
-lliquidProperties \
|
||||||
-lliquidMixtureProperties \
|
-lliquidMixtureProperties \
|
||||||
-lsolidProperties \
|
-lsolidProperties \
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -95,9 +95,9 @@ Foam::ConeInjection<CloudType>::ConeInjection
|
|||||||
Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())),
|
Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())),
|
||||||
thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())),
|
thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())),
|
||||||
thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())),
|
thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())),
|
||||||
parcelPDF_
|
parcelDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen())
|
distributionModels::distributionModel::New(this->coeffDict().subDict("parcelDistributionModel"), owner.rndGen())
|
||||||
),
|
),
|
||||||
tanVec1_(vector::zero),
|
tanVec1_(vector::zero),
|
||||||
tanVec2_(vector::zero)
|
tanVec2_(vector::zero)
|
||||||
@ -153,7 +153,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
|
|||||||
Umag_(im.Umag_().clone().ptr()),
|
Umag_(im.Umag_().clone().ptr()),
|
||||||
thetaInner_(im.thetaInner_().clone().ptr()),
|
thetaInner_(im.thetaInner_().clone().ptr()),
|
||||||
thetaOuter_(im.thetaOuter_().clone().ptr()),
|
thetaOuter_(im.thetaOuter_().clone().ptr()),
|
||||||
parcelPDF_(im.parcelPDF_().clone().ptr()),
|
parcelDistributionModel_(im.parcelDistributionModel_().clone().ptr()),
|
||||||
tanVec1_(im.tanVec1_),
|
tanVec1_(im.tanVec1_),
|
||||||
tanVec2_(im.tanVec2_)
|
tanVec2_(im.tanVec2_)
|
||||||
{}
|
{}
|
||||||
@ -222,7 +222,7 @@ void Foam::ConeInjection<CloudType>::setProperties
|
|||||||
parcel.U() = Umag_().value(t)*dirVec;
|
parcel.U() = Umag_().value(t)*dirVec;
|
||||||
|
|
||||||
// set particle diameter
|
// set particle diameter
|
||||||
parcel.d() = parcelPDF_().sample();
|
parcel.d() = parcelDistributionModel_().sample();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -34,7 +34,7 @@ Description
|
|||||||
- parcel flow rate
|
- parcel flow rate
|
||||||
- parcel velocity
|
- parcel velocity
|
||||||
- inner and outer cone angles
|
- inner and outer cone angles
|
||||||
- Parcel diameters obtained by PDF model
|
- Parcel diameters obtained by distribution model model
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
ConeInjection.C
|
ConeInjection.C
|
||||||
@ -45,7 +45,7 @@ SourceFiles
|
|||||||
#define ConeInjection_H
|
#define ConeInjection_H
|
||||||
|
|
||||||
#include "InjectionModel.H"
|
#include "InjectionModel.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -101,8 +101,8 @@ class ConeInjection
|
|||||||
//- Outer cone angle relative to SOI [deg]
|
//- Outer cone angle relative to SOI [deg]
|
||||||
const autoPtr<DataEntry<scalar> > thetaOuter_;
|
const autoPtr<DataEntry<scalar> > thetaOuter_;
|
||||||
|
|
||||||
//- Parcel size PDF model
|
//- Parcel size distribution model model
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
const autoPtr<distributionModels::distributionModel> parcelDistributionModel_;
|
||||||
|
|
||||||
|
|
||||||
// Tangential vectors to the direction vector
|
// Tangential vectors to the direction vector
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -126,9 +126,9 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP
|
|||||||
Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())),
|
Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())),
|
||||||
thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())),
|
thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())),
|
||||||
thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())),
|
thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())),
|
||||||
parcelPDF_
|
parcelDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen())
|
distributionModels::distributionModel::New(this->coeffDict().subDict("parcelDistributionModel"), owner.rndGen())
|
||||||
),
|
),
|
||||||
nInjected_(this->parcelsAddedTotal()),
|
nInjected_(this->parcelsAddedTotal()),
|
||||||
tanVec1_(positions_.size()),
|
tanVec1_(positions_.size()),
|
||||||
@ -193,7 +193,7 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP
|
|||||||
Umag_(im.Umag_().clone().ptr()),
|
Umag_(im.Umag_().clone().ptr()),
|
||||||
thetaInner_(im.thetaInner_().clone().ptr()),
|
thetaInner_(im.thetaInner_().clone().ptr()),
|
||||||
thetaOuter_(im.thetaOuter_().clone().ptr()),
|
thetaOuter_(im.thetaOuter_().clone().ptr()),
|
||||||
parcelPDF_(im.parcelPDF_().clone().ptr()),
|
parcelDistributionModel_(im.parcelDistributionModel_().clone().ptr()),
|
||||||
nInjected_(im.nInjected_),
|
nInjected_(im.nInjected_),
|
||||||
tanVec1_(im.tanVec1_),
|
tanVec1_(im.tanVec1_),
|
||||||
tanVec2_(im.tanVec2_)
|
tanVec2_(im.tanVec2_)
|
||||||
@ -268,7 +268,7 @@ void Foam::ConeInjectionMP<CloudType>::setProperties
|
|||||||
parcel.U() = Umag_().value(t)*dirVec;
|
parcel.U() = Umag_().value(t)*dirVec;
|
||||||
|
|
||||||
// set particle diameter
|
// set particle diameter
|
||||||
parcel.d() = parcelPDF_().sample();
|
parcel.d() = parcelDistributionModel_().sample();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -34,7 +34,7 @@ Description
|
|||||||
- parcel flow rate
|
- parcel flow rate
|
||||||
- parcel velocities
|
- parcel velocities
|
||||||
- inner and outer cone angles
|
- inner and outer cone angles
|
||||||
- Parcel diameters obtained by PDF model
|
- Parcel diameters obtained by distribution model model
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
ConeInjectionMP.C
|
ConeInjectionMP.C
|
||||||
@ -45,7 +45,7 @@ SourceFiles
|
|||||||
#define ConeInjectionMP_H
|
#define ConeInjectionMP_H
|
||||||
|
|
||||||
#include "InjectionModel.H"
|
#include "InjectionModel.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
#include "vectorList.H"
|
#include "vectorList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -108,8 +108,8 @@ class ConeInjectionMP
|
|||||||
//- Outer cone angle relative to SOI [deg]
|
//- Outer cone angle relative to SOI [deg]
|
||||||
const autoPtr<DataEntry<scalar> > thetaOuter_;
|
const autoPtr<DataEntry<scalar> > thetaOuter_;
|
||||||
|
|
||||||
//- Parcel size PDF model
|
//- Parcel size distribution model model
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
const autoPtr<distributionModels::distributionModel> parcelDistributionModel_;
|
||||||
|
|
||||||
//- Number of parcels per injector already injected
|
//- Number of parcels per injector already injected
|
||||||
mutable label nInjected_;
|
mutable label nInjected_;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -114,11 +114,11 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
|
|||||||
nParcelsInjected_(positions_.size(), 0),
|
nParcelsInjected_(positions_.size(), 0),
|
||||||
U0_(this->coeffDict().lookup("U0")),
|
U0_(this->coeffDict().lookup("U0")),
|
||||||
diameters_(positions_.size()),
|
diameters_(positions_.size()),
|
||||||
parcelPDF_
|
parcelDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New
|
distributionModels::distributionModel::New
|
||||||
(
|
(
|
||||||
this->coeffDict().subDict("parcelPDF"),
|
this->coeffDict().subDict("parcelDistributionModel"),
|
||||||
owner.rndGen()
|
owner.rndGen()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -126,7 +126,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
|
|||||||
// Construct parcel diameters - one per injector cell
|
// Construct parcel diameters - one per injector cell
|
||||||
forAll(diameters_, i)
|
forAll(diameters_, i)
|
||||||
{
|
{
|
||||||
diameters_[i] = parcelPDF_->sample();
|
diameters_[i] = parcelDistributionModel_->sample();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine total volume of particles to inject
|
// Determine total volume of particles to inject
|
||||||
@ -166,7 +166,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
|
|||||||
nParcelsInjected_(im.nParcelsInjected_),
|
nParcelsInjected_(im.nParcelsInjected_),
|
||||||
U0_(im.U0_),
|
U0_(im.U0_),
|
||||||
diameters_(im.diameters_),
|
diameters_(im.diameters_),
|
||||||
parcelPDF_(im.parcelPDF_().clone().ptr())
|
parcelDistributionModel_(im.parcelDistributionModel_().clone().ptr())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -47,7 +47,7 @@ SourceFiles
|
|||||||
#define FieldActivatedInjection_H
|
#define FieldActivatedInjection_H
|
||||||
|
|
||||||
#include "InjectionModel.H"
|
#include "InjectionModel.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -110,8 +110,8 @@ class FieldActivatedInjection
|
|||||||
//- List of parcel diameters
|
//- List of parcel diameters
|
||||||
scalarList diameters_;
|
scalarList diameters_;
|
||||||
|
|
||||||
//- Parcel size PDF model
|
//- Parcel size distribution model model
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
const autoPtr<distributionModels::distributionModel> parcelDistributionModel_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -90,7 +90,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
|||||||
(
|
(
|
||||||
1,
|
1,
|
||||||
(10*volumeAccumulator_)
|
(10*volumeAccumulator_)
|
||||||
/CloudType::parcelType::volume(parcelPDF_().minValue())
|
/CloudType::parcelType::volume(parcelDistributionModel_().minValue())
|
||||||
);
|
);
|
||||||
|
|
||||||
label iterationNo = 0;
|
label iterationNo = 0;
|
||||||
@ -128,7 +128,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
|||||||
{
|
{
|
||||||
if (selfSeed_ && !cellCentresUsed.found(cI))
|
if (selfSeed_ && !cellCentresUsed.found(cI))
|
||||||
{
|
{
|
||||||
scalar dNew = parcelPDF_().sample();
|
scalar dNew = parcelDistributionModel_().sample();
|
||||||
|
|
||||||
newParticles_.append
|
newParticles_.append
|
||||||
(
|
(
|
||||||
@ -191,7 +191,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
|||||||
scalar R = sqrt(3.0)*a/(2.0*sqrt(2.0));
|
scalar R = sqrt(3.0)*a/(2.0*sqrt(2.0));
|
||||||
scalar d = a/(2.0*sqrt(3.0));
|
scalar d = a/(2.0*sqrt(3.0));
|
||||||
|
|
||||||
scalar dNew = parcelPDF_().sample();
|
scalar dNew = parcelDistributionModel_().sample();
|
||||||
scalar volNew = CloudType::parcelType::volume(dNew);
|
scalar volNew = CloudType::parcelType::volume(dNew);
|
||||||
|
|
||||||
newParticles_.append
|
newParticles_.append
|
||||||
@ -204,7 +204,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
|||||||
);
|
);
|
||||||
volumeAccumulator_ -= volNew;
|
volumeAccumulator_ -= volNew;
|
||||||
|
|
||||||
dNew = parcelPDF_().sample();
|
dNew = parcelDistributionModel_().sample();
|
||||||
newParticles_.append
|
newParticles_.append
|
||||||
(
|
(
|
||||||
vectorPairScalarPair
|
vectorPairScalarPair
|
||||||
@ -215,7 +215,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
|||||||
);
|
);
|
||||||
volumeAccumulator_ -= volNew;
|
volumeAccumulator_ -= volNew;
|
||||||
|
|
||||||
dNew = parcelPDF_().sample();
|
dNew = parcelDistributionModel_().sample();
|
||||||
newParticles_.append
|
newParticles_.append
|
||||||
(
|
(
|
||||||
vectorPairScalarPair
|
vectorPairScalarPair
|
||||||
@ -226,7 +226,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
|
|||||||
);
|
);
|
||||||
volumeAccumulator_ -= volNew;
|
volumeAccumulator_ -= volNew;
|
||||||
|
|
||||||
dNew = parcelPDF_().sample();
|
dNew = parcelDistributionModel_().sample();
|
||||||
newParticles_.append
|
newParticles_.append
|
||||||
(
|
(
|
||||||
vectorPairScalarPair
|
vectorPairScalarPair
|
||||||
@ -341,11 +341,11 @@ Foam::InflationInjection<CloudType>::InflationInjection
|
|||||||
fraction_(1.0),
|
fraction_(1.0),
|
||||||
selfSeed_(this->coeffDict().lookupOrDefault("selfSeed", false)),
|
selfSeed_(this->coeffDict().lookupOrDefault("selfSeed", false)),
|
||||||
dSeed_(SMALL),
|
dSeed_(SMALL),
|
||||||
parcelPDF_
|
parcelDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New
|
distributionModels::distributionModel::New
|
||||||
(
|
(
|
||||||
this->coeffDict().subDict("parcelPDF"),
|
this->coeffDict().subDict("parcelDistributionModel"),
|
||||||
owner.rndGen()
|
owner.rndGen()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -409,7 +409,7 @@ Foam::InflationInjection<CloudType>::InflationInjection
|
|||||||
fraction_(im.fraction_),
|
fraction_(im.fraction_),
|
||||||
selfSeed_(im.selfSeed_),
|
selfSeed_(im.selfSeed_),
|
||||||
dSeed_(im.dSeed_),
|
dSeed_(im.dSeed_),
|
||||||
parcelPDF_(im.parcelPDF_().clone().ptr())
|
parcelDistributionModel_(im.parcelDistributionModel_().clone().ptr())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -39,7 +39,7 @@ SourceFiles
|
|||||||
#define InflationInjection_H
|
#define InflationInjection_H
|
||||||
|
|
||||||
#include "InjectionModel.H"
|
#include "InjectionModel.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -107,8 +107,8 @@ class InflationInjection
|
|||||||
//- Diameter with which to create new seed particles
|
//- Diameter with which to create new seed particles
|
||||||
scalar dSeed_;
|
scalar dSeed_;
|
||||||
|
|
||||||
//- Parcel size PDF model
|
//- Parcel size distribution model model
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
const autoPtr<distributionModels::distributionModel> parcelDistributionModel_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -96,11 +96,11 @@ Foam::ManualInjection<CloudType>::ManualInjection
|
|||||||
injectorTetFaces_(positions_.size(), -1),
|
injectorTetFaces_(positions_.size(), -1),
|
||||||
injectorTetPts_(positions_.size(), -1),
|
injectorTetPts_(positions_.size(), -1),
|
||||||
U0_(this->coeffDict().lookup("U0")),
|
U0_(this->coeffDict().lookup("U0")),
|
||||||
parcelPDF_
|
parcelDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New
|
distributionModels::distributionModel::New
|
||||||
(
|
(
|
||||||
this->coeffDict().subDict("parcelPDF"),
|
this->coeffDict().subDict("parcelDistributionModel"),
|
||||||
owner.rndGen()
|
owner.rndGen()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -149,7 +149,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
|
|||||||
// Construct parcel diameters
|
// Construct parcel diameters
|
||||||
forAll(diameters_, i)
|
forAll(diameters_, i)
|
||||||
{
|
{
|
||||||
diameters_[i] = parcelPDF_->sample();
|
diameters_[i] = parcelDistributionModel_->sample();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine volume of particles to inject
|
// Determine volume of particles to inject
|
||||||
@ -171,7 +171,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
|
|||||||
injectorTetFaces_(im.injectorTetFaces_),
|
injectorTetFaces_(im.injectorTetFaces_),
|
||||||
injectorTetPts_(im.injectorTetPts_),
|
injectorTetPts_(im.injectorTetPts_),
|
||||||
U0_(im.U0_),
|
U0_(im.U0_),
|
||||||
parcelPDF_(im.parcelPDF_().clone().ptr())
|
parcelDistributionModel_(im.parcelDistributionModel_().clone().ptr())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -31,7 +31,7 @@ Description
|
|||||||
- Total mass to inject
|
- Total mass to inject
|
||||||
- Parcel positions in file @c positionsFile
|
- Parcel positions in file @c positionsFile
|
||||||
- Initial parcel velocity
|
- Initial parcel velocity
|
||||||
- Parcel diameters obtained by PDF model
|
- Parcel diameters obtained by distribution model model
|
||||||
- All parcels introduced at SOI
|
- All parcels introduced at SOI
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
@ -43,7 +43,7 @@ SourceFiles
|
|||||||
#define ManualInjection_H
|
#define ManualInjection_H
|
||||||
|
|
||||||
#include "InjectionModel.H"
|
#include "InjectionModel.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -82,8 +82,8 @@ class ManualInjection
|
|||||||
//- Initial parcel velocity
|
//- Initial parcel velocity
|
||||||
const vector U0_;
|
const vector U0_;
|
||||||
|
|
||||||
//- Parcel size PDF model
|
//- Parcel size distribution model model
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
const autoPtr<distributionModels::distributionModel> parcelDistributionModel_;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,7 +25,7 @@ License
|
|||||||
|
|
||||||
#include "PatchInjection.H"
|
#include "PatchInjection.H"
|
||||||
#include "DataEntry.H"
|
#include "DataEntry.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -104,9 +104,13 @@ Foam::PatchInjection<CloudType>::PatchInjection
|
|||||||
(
|
(
|
||||||
DataEntry<scalar>::New("flowRateProfile", this->coeffDict())
|
DataEntry<scalar>::New("flowRateProfile", this->coeffDict())
|
||||||
),
|
),
|
||||||
parcelPDF_
|
parcelDistributionModel_
|
||||||
(
|
(
|
||||||
pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen())
|
distributionModels::distributionModel::New
|
||||||
|
(
|
||||||
|
this->coeffDict().subDict("parcelDistributionModel"),
|
||||||
|
owner.rndGen()
|
||||||
|
)
|
||||||
),
|
),
|
||||||
cellOwners_(),
|
cellOwners_(),
|
||||||
fraction_(1.0)
|
fraction_(1.0)
|
||||||
@ -153,7 +157,7 @@ Foam::PatchInjection<CloudType>::PatchInjection
|
|||||||
parcelsPerSecond_(im.parcelsPerSecond_),
|
parcelsPerSecond_(im.parcelsPerSecond_),
|
||||||
U0_(im.U0_),
|
U0_(im.U0_),
|
||||||
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
|
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
|
||||||
parcelPDF_(im.parcelPDF_().clone().ptr()),
|
parcelDistributionModel_(im.parcelDistributionModel_().clone().ptr()),
|
||||||
cellOwners_(im.cellOwners_),
|
cellOwners_(im.cellOwners_),
|
||||||
fraction_(im.fraction_)
|
fraction_(im.fraction_)
|
||||||
{}
|
{}
|
||||||
@ -236,7 +240,7 @@ void Foam::PatchInjection<CloudType>::setProperties
|
|||||||
parcel.U() = U0_;
|
parcel.U() = U0_;
|
||||||
|
|
||||||
// set particle diameter
|
// set particle diameter
|
||||||
parcel.d() = parcelPDF_->sample();
|
parcel.d() = parcelDistributionModel_->sample();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -33,7 +33,7 @@ Description
|
|||||||
- Injection duration
|
- Injection duration
|
||||||
- Initial parcel velocity
|
- Initial parcel velocity
|
||||||
- Injection volume flow rate
|
- Injection volume flow rate
|
||||||
- Parcel diameters obtained by PDF model
|
- Parcel diameters obtained by distribution model model
|
||||||
- Parcels injected at cell centres adjacent to patch
|
- Parcels injected at cell centres adjacent to patch
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
@ -54,7 +54,7 @@ namespace Foam
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
class DataEntry;
|
class DataEntry;
|
||||||
|
|
||||||
class pdf;
|
class distributionModel;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class PatchInjection Declaration
|
Class PatchInjection Declaration
|
||||||
@ -85,8 +85,8 @@ class PatchInjection
|
|||||||
//- Flow rate profile relative to SOI []
|
//- Flow rate profile relative to SOI []
|
||||||
const autoPtr<DataEntry<scalar> > flowRateProfile_;
|
const autoPtr<DataEntry<scalar> > flowRateProfile_;
|
||||||
|
|
||||||
//- Parcel size PDF model
|
//- Parcel size distribution model model
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
const autoPtr<distributionModels::distributionModel> parcelDistributionModel_;
|
||||||
|
|
||||||
//- List of cell labels corresponding to injector positions
|
//- List of cell labels corresponding to injector positions
|
||||||
labelList cellOwners_;
|
labelList cellOwners_;
|
||||||
|
|||||||
@ -9,7 +9,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
|
||||||
@ -18,6 +18,6 @@ EXE_LIBS = \
|
|||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lpdf \
|
-ldistributionModels \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lcompressibleLESModels
|
-lcompressibleLESModels
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -53,12 +53,19 @@ Foam::surfaceFilmModels::cloudInjection::cloudInjection
|
|||||||
injectionModel(type(), owner, dict),
|
injectionModel(type(), owner, dict),
|
||||||
particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))),
|
particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))),
|
||||||
rndGen_(label(0), -1),
|
rndGen_(label(0), -1),
|
||||||
parcelPDF_(pdfs::pdf::New(coeffs_.subDict("parcelPDF"), rndGen_)),
|
parcelDistribution_
|
||||||
|
(
|
||||||
|
distributionModels::distributionModel::New
|
||||||
|
(
|
||||||
|
coeffs_.subDict("parcelDistribution"),
|
||||||
|
rndGen_
|
||||||
|
)
|
||||||
|
),
|
||||||
diameter_(owner.film().nCells(), 0.0)
|
diameter_(owner.film().nCells(), 0.0)
|
||||||
{
|
{
|
||||||
forAll(diameter_, faceI)
|
forAll(diameter_, faceI)
|
||||||
{
|
{
|
||||||
diameter_[faceI] = parcelPDF_->sample();
|
diameter_[faceI] = parcelDistribution_->sample();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +102,7 @@ void Foam::surfaceFilmModels::cloudInjection::inject
|
|||||||
diameterToInject[cellI] = diameter_[cellI];
|
diameterToInject[cellI] = diameter_[cellI];
|
||||||
|
|
||||||
// Retrieve new particle diameter sample
|
// Retrieve new particle diameter sample
|
||||||
diameter_[cellI] = parcelPDF_->sample();
|
diameter_[cellI] = parcelDistribution_->sample();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#define cloudInjection_H
|
#define cloudInjection_H
|
||||||
|
|
||||||
#include "injectionModel.H"
|
#include "injectionModel.H"
|
||||||
#include "pdf.H"
|
#include "distributionModel.H"
|
||||||
#include "cachedRandom.H"
|
#include "cachedRandom.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -76,7 +76,8 @@ protected:
|
|||||||
cachedRandom rndGen_;
|
cachedRandom rndGen_;
|
||||||
|
|
||||||
//- Parcel size PDF model
|
//- Parcel size PDF model
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
const autoPtr<distributionModels::distributionModel>
|
||||||
|
parcelDistribution_;
|
||||||
|
|
||||||
//- Diameters of particles to inject into the cloud
|
//- Diameters of particles to inject into the cloud
|
||||||
scalarList diameter_;
|
scalarList diameter_;
|
||||||
|
|||||||
@ -120,10 +120,10 @@ RanzMarshallCoeffs
|
|||||||
|
|
||||||
hollowConeInjectorCoeffs
|
hollowConeInjectorCoeffs
|
||||||
{
|
{
|
||||||
dropletPDF
|
dropletDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 1e-06;
|
minValue 1e-06;
|
||||||
maxValue 0.00015;
|
maxValue 0.00015;
|
||||||
@ -131,7 +131,7 @@ hollowConeInjectorCoeffs
|
|||||||
n 3;
|
n 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
exponentialPDF
|
exponentialDistribution
|
||||||
{
|
{
|
||||||
minValue 0.0001;
|
minValue 0.0001;
|
||||||
maxValue 0.001;
|
maxValue 0.001;
|
||||||
|
|||||||
@ -131,10 +131,10 @@ subModels
|
|||||||
SOI 0;
|
SOI 0;
|
||||||
positionsFile "coalCloud1Positions";
|
positionsFile "coalCloud1Positions";
|
||||||
U0 ( 0 -10 0 );
|
U0 ( 0 -10 0 );
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 5e-06;
|
minValue 5e-06;
|
||||||
maxValue 0.0005;
|
maxValue 0.0005;
|
||||||
|
|||||||
@ -107,10 +107,10 @@ subModels
|
|||||||
SOI 0;
|
SOI 0;
|
||||||
positionsFile "limestonePositions";
|
positionsFile "limestonePositions";
|
||||||
U0 ( 0 0 0 );
|
U0 ( 0 0 0 );
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 5e-06;
|
minValue 5e-06;
|
||||||
maxValue 0.000565;
|
maxValue 0.000565;
|
||||||
|
|||||||
@ -130,10 +130,10 @@ subModels
|
|||||||
SOI 0;
|
SOI 0;
|
||||||
positionsFile "reactingCloud1Positions";
|
positionsFile "reactingCloud1Positions";
|
||||||
U0 (0 0 0);
|
U0 (0 0 0);
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType uniform;
|
pdfType uniform;
|
||||||
uniformPDF
|
uniformDistribution
|
||||||
{
|
{
|
||||||
minValue 100e-06;
|
minValue 100e-06;
|
||||||
maxValue 100e-06;
|
maxValue 100e-06;
|
||||||
|
|||||||
@ -133,10 +133,10 @@ subModels
|
|||||||
parcelsPerSecond 1e5;
|
parcelsPerSecond 1e5;
|
||||||
U0 (40 0 0);
|
U0 (40 0 0);
|
||||||
flowRateProfile constant 1;
|
flowRateProfile constant 1;
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType general;
|
pdfType general;
|
||||||
generalPDF
|
generalDistribution
|
||||||
{
|
{
|
||||||
distribution
|
distribution
|
||||||
(
|
(
|
||||||
|
|||||||
@ -131,10 +131,10 @@ subModels
|
|||||||
thetaInner constant 0;
|
thetaInner constant 0;
|
||||||
thetaOuter constant 45;
|
thetaOuter constant 45;
|
||||||
|
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 5e-04;
|
minValue 5e-04;
|
||||||
maxValue 0.0012;
|
maxValue 0.0012;
|
||||||
|
|||||||
@ -59,10 +59,10 @@ thermoSingleLayerCoeffs
|
|||||||
|
|
||||||
particlesPerParcel 100.0;
|
particlesPerParcel 100.0;
|
||||||
|
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 5e-04;
|
minValue 5e-04;
|
||||||
maxValue 0.0012;
|
maxValue 0.0012;
|
||||||
|
|||||||
@ -131,10 +131,10 @@ subModels
|
|||||||
thetaInner constant 0;
|
thetaInner constant 0;
|
||||||
thetaOuter constant 45;
|
thetaOuter constant 45;
|
||||||
|
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 5e-04;
|
minValue 5e-04;
|
||||||
maxValue 0.0012;
|
maxValue 0.0012;
|
||||||
|
|||||||
@ -61,10 +61,10 @@ thermoSingleLayerCoeffs
|
|||||||
|
|
||||||
particlesPerParcel 100.0;
|
particlesPerParcel 100.0;
|
||||||
|
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 5e-04;
|
minValue 5e-04;
|
||||||
maxValue 0.0012;
|
maxValue 0.0012;
|
||||||
|
|||||||
@ -123,10 +123,10 @@ subModels
|
|||||||
SOI 0;
|
SOI 0;
|
||||||
positionsFile "reactingCloud1Positions";
|
positionsFile "reactingCloud1Positions";
|
||||||
U0 ( 0 0 0 );
|
U0 ( 0 0 0 );
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType uniform;
|
pdfType uniform;
|
||||||
uniformPDF
|
uniformDistribution
|
||||||
{
|
{
|
||||||
minValue 1e-04;
|
minValue 1e-04;
|
||||||
maxValue 1e-04;
|
maxValue 1e-04;
|
||||||
|
|||||||
@ -87,10 +87,10 @@ subModels
|
|||||||
SOI 0;
|
SOI 0;
|
||||||
positionsFile "kinematicCloud1Positions";
|
positionsFile "kinematicCloud1Positions";
|
||||||
U0 ( 0 0 0 );
|
U0 ( 0 0 0 );
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 5e-05;
|
minValue 5e-05;
|
||||||
maxValue 0.0001;
|
maxValue 0.0001;
|
||||||
|
|||||||
@ -106,10 +106,10 @@ subModels
|
|||||||
SOI 0;
|
SOI 0;
|
||||||
positionsFile "thermoCloud1Positions";
|
positionsFile "thermoCloud1Positions";
|
||||||
U0 ( 0 0 0 );
|
U0 ( 0 0 0 );
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType RosinRammler;
|
pdfType RosinRammler;
|
||||||
RosinRammlerPDF
|
RosinRammlerDistribution
|
||||||
{
|
{
|
||||||
minValue 5e-06;
|
minValue 5e-06;
|
||||||
maxValue 0.0005;
|
maxValue 0.0005;
|
||||||
|
|||||||
@ -144,10 +144,10 @@ subModels
|
|||||||
duration 1; // NOTE: set to 1 for steady state
|
duration 1; // NOTE: set to 1 for steady state
|
||||||
U0 (0 40 0);
|
U0 (0 40 0);
|
||||||
flowRateProfile constant 1;
|
flowRateProfile constant 1;
|
||||||
parcelPDF
|
parcelDistribution
|
||||||
{
|
{
|
||||||
pdfType general;
|
pdfType general;
|
||||||
generalPDF
|
generalDistribution
|
||||||
{
|
{
|
||||||
distribution
|
distribution
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user