From 772e1d1b4fb28a3d786c83303fbafebfabf3e2e9 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Mar 2010 16:26:53 +0000 Subject: [PATCH 1/6] BUG: enthalpy source term for dieselFoam solver corrected --- applications/solvers/combustion/dieselFoam/dieselFoam.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 1e6ddfe0c1..6cd29ccca8 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -94,6 +94,8 @@ int main(int argc, char *argv[]) kappa = (runTime.deltaT() + tc)/(runTime.deltaT()+tc+tk); } + chemistrySh = kappa*chemistry.Sh()(); + #include "rhoEqn.H" #include "UEqn.H" From b3bf8309490e3ec0d4ac7c2fe7a606ff7e4d4b78 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 29 Mar 2010 17:32:31 +0100 Subject: [PATCH 2/6] ENH: Updates to thermo/pdfs library - added Niklas' update to Rosin-Rammler - new fixedValue type - code clean-up --- src/thermophysicalModels/pdfs/Make/files | 23 ++- .../pdfs/RosinRammler/RosinRammler.C | 90 +++--------- .../pdfs/RosinRammler/RosinRammler.H | 24 ++-- .../pdfs/exponential/exponential.C | 78 +++------- .../pdfs/exponential/exponential.H | 24 ++-- .../pdfs/fixedValue/fixedValue.C | 76 ++++++++++ .../pdfs/fixedValue/fixedValue.H | 103 ++++++++++++++ .../pdfs/general/general.C | 97 ++++++++----- .../pdfs/general/general.H | 11 +- .../pdfs/multiNormal/multiNormal.C | 133 ++++++++++++++++++ .../pdfs/multiNormal/multiNormal.H | 122 ++++++++++++++++ src/thermophysicalModels/pdfs/normal/normal.C | 97 +++++++------ src/thermophysicalModels/pdfs/normal/normal.H | 24 ++-- src/thermophysicalModels/pdfs/pdf/newPdf.C | 6 +- src/thermophysicalModels/pdfs/pdf/pdf.C | 38 ++++- src/thermophysicalModels/pdfs/pdf/pdf.H | 45 +++--- .../pdfs/uniform/uniform.C | 26 ++-- .../pdfs/uniform/uniform.H | 15 +- 18 files changed, 711 insertions(+), 321 deletions(-) create mode 100644 src/thermophysicalModels/pdfs/fixedValue/fixedValue.C create mode 100644 src/thermophysicalModels/pdfs/fixedValue/fixedValue.H create mode 100644 src/thermophysicalModels/pdfs/multiNormal/multiNormal.C create mode 100644 src/thermophysicalModels/pdfs/multiNormal/multiNormal.H diff --git a/src/thermophysicalModels/pdfs/Make/files b/src/thermophysicalModels/pdfs/Make/files index e5d66e3aea..7b0c50a956 100644 --- a/src/thermophysicalModels/pdfs/Make/files +++ b/src/thermophysicalModels/pdfs/Make/files @@ -1,17 +1,12 @@ -pdf = pdf -uniform = uniform -normal = normal -general = general -exponential = exponential -RosinRammler = RosinRammler +pdf/pdf.C +pdf/newPdf.C -$(pdf)/pdf.C -$(pdf)/newPdf.C - -$(uniform)/uniform.C -$(normal)/normal.C -$(general)/general.C -$(exponential)/exponential.C -$(RosinRammler)/RosinRammler.C +exponential/exponential.C +fixedValue/fixedValue.C +general/general.C +multiNormal/multiNormal.C +normal/normal.C +RosinRammler/RosinRammler.C +uniform/uniform.C LIB = $(FOAM_LIBBIN)/libpdf diff --git a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C b/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C index becfd94db2..efa7a21750 100644 --- a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C +++ b/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,106 +31,52 @@ License namespace Foam { - defineTypeNameAndDebug(RosinRammler, 0); - - addToRunTimeSelectionTable(pdf, RosinRammler, dictionary); + namespace pdfs + { + defineTypeNameAndDebug(RosinRammler, 0); + addToRunTimeSelectionTable(pdf, RosinRammler, dictionary); + } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::RosinRammler::RosinRammler(const dictionary& dict, Random& rndGen) +Foam::pdfs::RosinRammler::RosinRammler(const dictionary& dict, Random& rndGen) : - pdf(dict, rndGen), - pdfDict_(dict.subDict(typeName + "PDF")), + pdf(typeName, dict, rndGen), minValue_(readScalar(pdfDict_.lookup("minValue"))), maxValue_(readScalar(pdfDict_.lookup("maxValue"))), - d_(pdfDict_.lookup("d")), - n_(pdfDict_.lookup("n")), - ls_(d_), - range_(maxValue_ - minValue_) + d_(readScalar(pdfDict_.lookup("d"))), + n_(readScalar(pdfDict_.lookup("n"))) { - if (minValue_<0) - { - FatalErrorIn - ( - "RosinRammler::RosinRammler(const dictionary& dict)" - ) << " minValue = " << minValue_ << ", it must be >0." << nl - << abort(FatalError); - } - - if (maxValue_p); + scalar K = 1.0 - exp(-pow((maxValue_ - minValue_)/d_, n_)); + scalar y = rndGen_.scalar01(); + scalar x = minValue_ + d_*::pow(-log(1.0 - y*K), 1.0/n_); return x; } -Foam::scalar Foam::RosinRammler::minValue() const +Foam::scalar Foam::pdfs::RosinRammler::minValue() const { return minValue_; } -Foam::scalar Foam::RosinRammler::maxValue() const +Foam::scalar Foam::pdfs::RosinRammler::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.H b/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.H index 6b04f3dfbb..370f0d2ad2 100644 --- a/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.H +++ b/src/thermophysicalModels/pdfs/RosinRammler/RosinRammler.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,14 +29,12 @@ Description Rosin-Rammler pdf @f[ - pdf = ( x/d )^n \exp ( -( x/d )^n ) + cumulative pdf = (1.0 - exp( -((x - d0)/d)^n ) / (1.0 - exp( -((d1 - d0)/d)^n ) @f] SourceFiles - RosinRammlerI.H RosinRammler.C - RosinRammlerIO.C \*---------------------------------------------------------------------------*/ @@ -49,9 +47,11 @@ SourceFiles namespace Foam { +namespace pdfs +{ /*---------------------------------------------------------------------------*\ - Class RosinRammler Declaration + Class RosinRammler Declaration \*---------------------------------------------------------------------------*/ class RosinRammler @@ -60,17 +60,16 @@ class RosinRammler { // Private data - dictionary pdfDict_; - - //- min and max values of the distribution + //- Distribution minimum scalar minValue_; + + //- Distribution maximum scalar maxValue_; - List d_; - List n_; - List ls_; + // Model coefficients - scalar range_; + scalar d_; + scalar n_; public: @@ -108,6 +107,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace pdfs } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/exponential/exponential.C b/src/thermophysicalModels/pdfs/exponential/exponential.C index 8498c2c9e2..7e97f4ae20 100644 --- a/src/thermophysicalModels/pdfs/exponential/exponential.C +++ b/src/thermophysicalModels/pdfs/exponential/exponential.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ - #include "exponential.H" #include "addToRunTimeSelectionTable.H" @@ -32,92 +31,49 @@ License namespace Foam { - defineTypeNameAndDebug(exponential, 0); - addToRunTimeSelectionTable(pdf, exponential, dictionary); + namespace pdfs + { + defineTypeNameAndDebug(exponential, 0); + addToRunTimeSelectionTable(pdf, exponential, dictionary); + } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::exponential::exponential(const dictionary& dict, Random& rndGen) +Foam::pdfs::exponential::exponential(const dictionary& dict, Random& rndGen) : - pdf(dict, rndGen), - pdfDict_(dict.subDict(typeName + "PDF")), + pdf(typeName, dict, rndGen), minValue_(readScalar(pdfDict_.lookup("minValue"))), maxValue_(readScalar(pdfDict_.lookup("maxValue"))), - lambda_(pdfDict_.lookup("lambda")), - ls_(lambda_), - range_(maxValue_ - minValue_) + lambda_(readScalar(pdfDict_.lookup("lambda"))) { - if (minValue_<0) - { - FatalErrorIn - ( - "exponential::exponential(const dictionary& dict)" - ) << " minValue = " << minValue_ << ", it must be >0." << nl - << abort(FatalError); - } - - scalar sMax = 0; - label n = lambda_.size(); - for (label i=0; iy); - - return x; + scalar y = rndGen_.scalar01(); + scalar K = exp(-lambda_*maxValue_) - exp(-lambda_*minValue_); + return -(1.0/lambda_)*log(exp(-lambda_*minValue_) + y*K); } -Foam::scalar Foam::exponential::minValue() const +Foam::scalar Foam::pdfs::exponential::minValue() const { return minValue_; } -Foam::scalar Foam::exponential::maxValue() const +Foam::scalar Foam::pdfs::exponential::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/exponential/exponential.H b/src/thermophysicalModels/pdfs/exponential/exponential.H index 4ef19b75a3..eb452a6dd5 100644 --- a/src/thermophysicalModels/pdfs/exponential/exponential.H +++ b/src/thermophysicalModels/pdfs/exponential/exponential.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,9 +29,7 @@ Description exponential pdf SourceFiles - exponentialI.H exponential.C - exponentialIO.C \*---------------------------------------------------------------------------*/ @@ -44,6 +42,8 @@ SourceFiles namespace Foam { +namespace pdfs +{ /*---------------------------------------------------------------------------*\ Class exponential Declaration @@ -55,16 +55,17 @@ class exponential { // Private data - dictionary pdfDict_; - - //- min and max values of the distribution + //- Distribution minimum scalar minValue_; + + //- Distribution maximum scalar maxValue_; - List lambda_; - List ls_; - scalar range_; + // Model coefficients + + scalar lambda_; + public: @@ -101,14 +102,11 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace pdfs } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -//#include "exponentialI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/pdfs/fixedValue/fixedValue.C b/src/thermophysicalModels/pdfs/fixedValue/fixedValue.C new file mode 100644 index 0000000000..a160803549 --- /dev/null +++ b/src/thermophysicalModels/pdfs/fixedValue/fixedValue.C @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "fixedValue.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace pdfs + { + defineTypeNameAndDebug(fixedValue, 0); + addToRunTimeSelectionTable(pdf, fixedValue, dictionary); + } +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::pdfs::fixedValue::fixedValue(const dictionary& dict, Random& rndGen) +: + pdf(typeName, dict, rndGen), + value_(readScalar(pdfDict_.lookup("value"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::pdfs::fixedValue::~fixedValue() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::scalar Foam::pdfs::fixedValue::fixedValue::sample() const +{ + return value_; +} + + +Foam::scalar Foam::pdfs::fixedValue::fixedValue::minValue() const +{ + return -VGREAT; +} + + +Foam::scalar Foam::pdfs::fixedValue::fixedValue::maxValue() const +{ + return VGREAT; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/pdfs/fixedValue/fixedValue.H b/src/thermophysicalModels/pdfs/fixedValue/fixedValue.H new file mode 100644 index 0000000000..e64b1c2a13 --- /dev/null +++ b/src/thermophysicalModels/pdfs/fixedValue/fixedValue.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::fixedValue + +Description + Returns a fixed value + +SourceFiles + fixedValue.C + +\*---------------------------------------------------------------------------*/ + +#ifndef pdfFixedValue_H +#define pdfFixedValue_H + +#include "pdf.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace pdfs +{ +/*---------------------------------------------------------------------------*\ + Class fixedValue Declaration +\*---------------------------------------------------------------------------*/ + +class fixedValue +: + public pdf +{ + // Private data + + //- Fixed value + scalar value_; + + +public: + + //- Runtime type information + TypeName("fixedValue"); + + + // Constructors + + //- Construct from components + fixedValue + ( + const dictionary& dict, + Random& rndGen + ); + + + //- Destructor + virtual ~fixedValue(); + + + // Member Functions + + //- Sample the pdf + virtual scalar sample() const; + + //- Return the minimum value + virtual scalar minValue() const; + + //- Return the maximum value + virtual scalar maxValue() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace pdfs +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/pdfs/general/general.C b/src/thermophysicalModels/pdfs/general/general.C index 33d3e3f57d..844e712683 100644 --- a/src/thermophysicalModels/pdfs/general/general.C +++ b/src/thermophysicalModels/pdfs/general/general.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,84 +31,109 @@ License namespace Foam { - defineTypeNameAndDebug(general, 0); - addToRunTimeSelectionTable(pdf, general, dictionary); + namespace pdfs + { + defineTypeNameAndDebug(general, 0); + addToRunTimeSelectionTable(pdf, general, dictionary); + } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::general::general(const dictionary& dict, Random& rndGen) +Foam::pdfs::general::general(const dictionary& dict, Random& rndGen) : - pdf(dict, rndGen), - pdfDict_(dict.subDict(typeName + "PDF")), + pdf(typeName, dict, rndGen), xy_(pdfDict_.lookup("distribution")), nEntries_(xy_.size()), minValue_(xy_[0][0]), maxValue_(xy_[nEntries_-1][0]), - range_(maxValue_ - minValue_) + integral_(nEntries_) { - // normalize the pdf - scalar yMax = 0; + check(); - for (label i=0; i SMALL) + { + scalar p = 2.0*d/k; + scalar q = -2.0*alpha/k; + scalar sqrtEr = sqrt(0.25*p*p - q); + + scalar x1 = -0.5*p + sqrtEr; + scalar x2 = -0.5*p - sqrtEr; + if ((x1 >= xy_[n-1][0]) && (x1 <= xy_[n][0])) { - i++; - if ((x>xy_[i][0]) && (xy); + else + { + x = x2; + } + } + else + { + x = alpha/d; + } return x; } -Foam::scalar Foam::general::minValue() const +Foam::scalar Foam::pdfs::general::minValue() const { return minValue_; } -Foam::scalar Foam::general::maxValue() const +Foam::scalar Foam::pdfs::general::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/general/general.H b/src/thermophysicalModels/pdfs/general/general.H index 06c48feb18..609c0e6c4b 100644 --- a/src/thermophysicalModels/pdfs/general/general.H +++ b/src/thermophysicalModels/pdfs/general/general.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,9 +29,7 @@ Description general pdf SourceFiles - generalI.H general.C - generalIO.C \*---------------------------------------------------------------------------*/ @@ -44,6 +42,8 @@ SourceFiles namespace Foam { +namespace pdfs +{ /*---------------------------------------------------------------------------*\ Class general Declaration @@ -55,8 +55,6 @@ class general { // Private data - dictionary pdfDict_; - typedef VectorSpace, scalar, 2> pair; List xy_; @@ -67,7 +65,7 @@ class general scalar minValue_; scalar maxValue_; - scalar range_; + List integral_; public: @@ -105,6 +103,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace pdfs } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/multiNormal/multiNormal.C b/src/thermophysicalModels/pdfs/multiNormal/multiNormal.C new file mode 100644 index 0000000000..2ce3942b6c --- /dev/null +++ b/src/thermophysicalModels/pdfs/multiNormal/multiNormal.C @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "multiNormal.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace pdfs + { + defineTypeNameAndDebug(multiNormal, 0); + addToRunTimeSelectionTable(pdf, multiNormal, dictionary); + } +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::pdfs::multiNormal::multiNormal(const dictionary& dict, Random& rndGen) +: + pdf(typeName, dict, rndGen), + minValue_(readScalar(pdfDict_.lookup("minValue"))), + maxValue_(readScalar(pdfDict_.lookup("maxValue"))), + range_(maxValue_ - minValue_), + expectation_(pdfDict_.lookup("expectation")), + variance_(pdfDict_.lookup("variance")), + strength_(pdfDict_.lookup("strength")) +{ + check(); + + scalar sMax = 0; + label n = strength_.size(); + for (label i=0; i expectation_; + List variance_; + List strength_; + + +public: + + //- Runtime type information + TypeName("multiNormal"); + + + // Constructors + + //- Construct from components + multiNormal + ( + const dictionary& dict, + Random& rndGen + ); + + + //- Destructor + virtual ~multiNormal(); + + + // Member Functions + + //- Sample the pdf + virtual scalar sample() const; + + //- Return the minimum value + virtual scalar minValue() const; + + //- Return the maximum value + virtual scalar maxValue() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace pdfs +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/pdfs/normal/normal.C b/src/thermophysicalModels/pdfs/normal/normal.C index 4a66fc9883..c105372cef 100644 --- a/src/thermophysicalModels/pdfs/normal/normal.C +++ b/src/thermophysicalModels/pdfs/normal/normal.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,98 +26,97 @@ License #include "normal.H" #include "addToRunTimeSelectionTable.H" +#include "mathematicalConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(normal, 0); - addToRunTimeSelectionTable(pdf, normal, dictionary); + namespace pdfs + { + defineTypeNameAndDebug(normal, 0); + addToRunTimeSelectionTable(pdf, normal, dictionary); + } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::normal::normal(const dictionary& dict, Random& rndGen) +Foam::pdfs::normal::normal(const dictionary& dict, Random& rndGen) : - pdf(dict, rndGen), - pdfDict_(dict.subDict(typeName + "PDF")), + pdf(typeName, dict, rndGen), minValue_(readScalar(pdfDict_.lookup("minValue"))), maxValue_(readScalar(pdfDict_.lookup("maxValue"))), - expectation_(pdfDict_.lookup("expectation")), - variance_(pdfDict_.lookup("variance")), - strength_(pdfDict_.lookup("strength")), - range_(maxValue_ - minValue_) + expectation_(readScalar(pdfDict_.lookup("expectation"))), + variance_(readScalar(pdfDict_.lookup("variance"))), + a_(0.147) { - scalar sMax = 0; - label n = strength_.size(); - for (label i=0; isortedToc() diff --git a/src/thermophysicalModels/pdfs/pdf/pdf.C b/src/thermophysicalModels/pdfs/pdf/pdf.C index 21945ca786..0f323dd56e 100644 --- a/src/thermophysicalModels/pdfs/pdf/pdf.C +++ b/src/thermophysicalModels/pdfs/pdf/pdf.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,22 +30,48 @@ License namespace Foam { - defineTypeNameAndDebug(pdf, 0); - defineRunTimeSelectionTable(pdf, dictionary); + namespace pdfs + { + defineTypeNameAndDebug(pdf, 0); + defineRunTimeSelectionTable(pdf, dictionary); + } } +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +void Foam::pdfs::pdf::check() const +{ + if (minValue() < 0) + { + FatalErrorIn("pdfs::pdf::check() const") + << type() << "PDF: Minimum value must be greater than zero." << nl + << "Supplied minValue = " << minValue() + << abort(FatalError); + } + + if (maxValue() < minValue()) + { + FatalErrorIn("pdfs::pdf::check() const") + << type() << "PDF: Maximum value is smaller than the minimum value:" + << nl << " maxValue = " << maxValue() + << ", minValue = " << minValue() + << abort(FatalError); + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pdf::pdf(const dictionary& dict, Random& rndGen) +Foam::pdfs::pdf::pdf(const word& name, const dictionary& dict, Random& rndGen) : - dict_(dict), + pdfDict_(dict.subDict(name + "PDF")), rndGen_(rndGen) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pdf::~pdf() +Foam::pdfs::pdf::~pdf() {} diff --git a/src/thermophysicalModels/pdfs/pdf/pdf.H b/src/thermophysicalModels/pdfs/pdf/pdf.H index ef1fa11b92..a3077ce9eb 100644 --- a/src/thermophysicalModels/pdfs/pdf/pdf.H +++ b/src/thermophysicalModels/pdfs/pdf/pdf.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,37 +26,27 @@ Class Foam::pdf Description - A library of runtime-selectable pdf's. + A library of runtime-selectable PDF's. Returns a sampled value given the expectation (nu) and variance (sigma^2) - Sample of planned pdfs (beta p. 374-375): - - binomial - - geometric - - Poisson - - hypergeometric - - Pascal - - uniform + Current PDF's include: - exponential + - fixedValue + - general + - multi-normal - normal - - Gamma - - chi - - t? - - F? - - beta - - Weibull - - Rayleigh - - Cauchy? + - Rosin-Rammler + - uniform The pdf 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 PDF, which is then used to change the distribution from unifrom to the actual pdf. SourceFiles - pdfI.H pdf.C - pdfIO.C + newPdf.C \*---------------------------------------------------------------------------*/ @@ -71,6 +61,8 @@ SourceFiles namespace Foam { +namespace pdfs +{ /*---------------------------------------------------------------------------*\ Class pdf Declaration @@ -83,11 +75,19 @@ protected: // Protected data - const dictionary& dict_; + //- Coefficients dictionary + const dictionary pdfDict_; + //- Reference to the randmo number generator Random& rndGen_; + // Protected member functions + + //- Check that the PDF is valid + virtual void check() const; + + public: //-Runtime type information @@ -111,7 +111,7 @@ public: // Constructors //- Construct from dictionary - pdf(const dictionary& dict, Random& rndGen); + pdf(const word& name, const dictionary& dict, Random& rndGen); //- Selector @@ -137,6 +137,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace pdfs } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/pdfs/uniform/uniform.C b/src/thermophysicalModels/pdfs/uniform/uniform.C index 09c2c4b05a..817558fa88 100644 --- a/src/thermophysicalModels/pdfs/uniform/uniform.C +++ b/src/thermophysicalModels/pdfs/uniform/uniform.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,43 +31,47 @@ License namespace Foam { - defineTypeNameAndDebug(uniform, 0); - addToRunTimeSelectionTable(pdf, uniform, dictionary); + namespace pdfs + { + defineTypeNameAndDebug(uniform, 0); + addToRunTimeSelectionTable(pdf, uniform, dictionary); + } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::uniform::uniform(const dictionary& dict, Random& rndGen) +Foam::pdfs::uniform::uniform(const dictionary& dict, Random& rndGen) : - pdf(dict, rndGen), - pdfDict_(dict.subDict(typeName + "PDF")), + pdf(typeName, dict, rndGen), minValue_(readScalar(pdfDict_.lookup("minValue"))), maxValue_(readScalar(pdfDict_.lookup("maxValue"))), range_(maxValue_ - minValue_) -{} +{ + check(); +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::uniform::~uniform() +Foam::pdfs::uniform::~uniform() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::uniform::sample() const +Foam::scalar Foam::pdfs::uniform::sample() const { return (minValue_ + rndGen_.scalar01()*range_); } -Foam::scalar Foam::uniform::minValue() const +Foam::scalar Foam::pdfs::uniform::minValue() const { return minValue_; } -Foam::scalar Foam::uniform::maxValue() const +Foam::scalar Foam::pdfs::uniform::maxValue() const { return maxValue_; } diff --git a/src/thermophysicalModels/pdfs/uniform/uniform.H b/src/thermophysicalModels/pdfs/uniform/uniform.H index 86b7542f34..f1d0de3688 100644 --- a/src/thermophysicalModels/pdfs/uniform/uniform.H +++ b/src/thermophysicalModels/pdfs/uniform/uniform.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,9 +29,7 @@ Description uniform pdf SourceFiles - uniformI.H uniform.C - uniformIO.C \*---------------------------------------------------------------------------*/ @@ -44,6 +42,8 @@ SourceFiles namespace Foam { +namespace pdfs +{ /*---------------------------------------------------------------------------*\ Class uniform Declaration @@ -55,13 +55,13 @@ class uniform { // Private data - dictionary pdfDict_; - - //- min and max values of the distribution + //- Distribution minimum scalar minValue_; + + //- Distribution maximum scalar maxValue_; - // help-variable to avoid always having to calculate max-min + //- Distribution range scalar range_; @@ -100,6 +100,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace pdfs } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From 6f78c8a949998005172569e823c146263296f8b6 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 29 Mar 2010 17:34:18 +0100 Subject: [PATCH 3/6] STYLE: Updated header comment/description --- .../interpolations/interpolationTable/interpolationTable.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.H b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.H index 884c3cabd7..8f70d6989d 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.H +++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.H @@ -26,8 +26,8 @@ Class Foam::interpolationTable Description - A list of times and values. - The time values must be positive and monotonically increasing. + An interpolation/look-up table of scalar vs values. + The reference scalar values must be positive and monotonically increasing. The handling of out-of-bounds values depends on the current setting of @a outOfBounds. From 4ba2681dd63525c977f2a8aa6611b1fcf5f7ad0e Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 29 Mar 2010 17:34:50 +0100 Subject: [PATCH 4/6] ENH: Updated pdfPlot utility - pdf updated - needs to be inside pdfs namespace - added writeData option - write individual data/samples to file --- .../miscellaneous/pdfPlot/createFields.H | 27 +++++++++++++++++-- .../miscellaneous/pdfPlot/pdfDict | 4 +++ .../miscellaneous/pdfPlot/pdfPlot.C | 18 +++++-------- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H index 2dc6e7af70..ddb1f663ad 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H @@ -10,9 +10,32 @@ ) ); - label nIntervals(readLabel(pdfDictionary.lookup("nIntervals"))); + const label nIntervals(readLabel(pdfDictionary.lookup("nIntervals"))); - label nSamples(readLabel(pdfDictionary.lookup("nSamples"))); + const label nSamples(readLabel(pdfDictionary.lookup("nSamples"))); + + const bool writeData(readBool(pdfDictionary.lookup("writeData"))); + + + const fileName pdfPath = runTime.path()/"pdf"; + mkDir(pdfPath); + + Random rndGen(label(0)); + + autoPtr p(pdfs::pdf::New(pdfDictionary, rndGen)); + + const scalar xMin = p->minValue(); + const scalar xMax = p->maxValue(); + + autoPtr filePtr(NULL); + if (writeData) + { + fileName fName = pdfPath/(p->type() + ".data"); + Info<< "Writing " << p->type() << " data samples to file:" << nl + << fName << nl << endl; + + filePtr.reset(new OFstream(fName)); + } scalarField samples(nIntervals, 0); diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfDict b/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfDict index 2a48115bea..d236d5ea8b 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfDict +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfDict @@ -23,6 +23,10 @@ nSamples 10000; // Type of pdf pdfType RosinRammler; +// Write data flag +writeData true; + +// PDF model coefficients RosinRammlerPDF { minValue 1e-06; diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfPlot.C b/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfPlot.C index 3347e4dcdb..b88f0ca1cf 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfPlot.C +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/pdfPlot.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,6 +30,7 @@ Description #include "fvCFD.H" #include "pdf.H" #include "makeGraph.H" +#include "OFstream.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Main program: @@ -40,16 +41,6 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createFields.H" - fileName pdfPath = runTime.path()/"pdf"; - mkDir(pdfPath); - - Random rndGen(label(0)); - - autoPtr p(pdf::New(pdfDictionary, rndGen)); - - scalar xMin = p->minValue(); - scalar xMax = p->maxValue(); - label iCheck = 100; for (label i=1; i<=nSamples; i++) { @@ -57,6 +48,11 @@ int main(int argc, char *argv[]) label n = label((ps - xMin)*nIntervals/(xMax - xMin)); samples[n]++; + if (writeData) + { + filePtr() << ps << nl; + } + if (i % iCheck == 0) { Info<< " processed " << i << " samples" << endl; From 1ac64420550613e27d6c014ff40ac279bd6c8096 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 29 Mar 2010 17:36:47 +0100 Subject: [PATCH 5/6] ENH: Updated dieselSpray lib to use updated pdfs library --- .../dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C | 2 +- .../dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H | 2 +- .../injectorModel/definedHollowCone/definedHollowCone.C | 2 +- .../injectorModel/definedHollowCone/definedHollowCone.H | 2 +- .../spraySubModels/injectorModel/hollowCone/hollowCone.C | 2 +- .../spraySubModels/injectorModel/hollowCone/hollowCone.H | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C index 661a2ea7b2..bf1a792c6f 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C @@ -55,7 +55,7 @@ Foam::ChomiakInjector::ChomiakInjector ChomiakDict_(dict.subDict(typeName + "Coeffs")), dropletPDF_ ( - pdf::New + pdfs::pdf::New ( ChomiakDict_.subDict("dropletPDF"), sm.rndGen() diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H index 50de0a31dc..87c2d1d816 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H @@ -64,7 +64,7 @@ private: dictionary ChomiakDict_; - autoPtr dropletPDF_; + autoPtr dropletPDF_; scalarList maxSprayAngle_; diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C index 883dc9c431..e266181c9c 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C @@ -55,7 +55,7 @@ Foam::definedHollowConeInjector::definedHollowConeInjector definedHollowConeDict_(dict.subDict(typeName + "Coeffs")), dropletPDF_ ( - pdf::New + pdfs::pdf::New ( definedHollowConeDict_.subDict("dropletPDF"), sm.rndGen() diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H index 56d6241892..d5318120ec 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H @@ -61,7 +61,7 @@ private: typedef VectorSpace, scalar, 2> pair; dictionary definedHollowConeDict_; - autoPtr dropletPDF_; + autoPtr dropletPDF_; // inner and outer cone angle time histories // 2 column vectors = (time, coneAngle) diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C index 40508fda7e..28bed642e0 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C @@ -55,7 +55,7 @@ Foam::hollowConeInjector::hollowConeInjector hollowConeDict_(dict.subDict(typeName + "Coeffs")), dropletPDF_ ( - pdf::New + pdfs::pdf::New ( hollowConeDict_.subDict("dropletPDF"), sm.rndGen() diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H index 985d7c6073..6df6552174 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H +++ b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H @@ -59,7 +59,7 @@ private: dictionary hollowConeDict_; - autoPtr dropletPDF_; + autoPtr dropletPDF_; scalarList innerAngle_; scalarList outerAngle_; From e2f2bd1ff19108736c61e9f7152e18a7c2481c8e Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 29 Mar 2010 17:37:10 +0100 Subject: [PATCH 6/6] ENH: Updated lagrangian/intermediate lib to use updated pdfs library --- .../Kinematic/InjectionModel/ConeInjection/ConeInjection.C | 2 +- .../Kinematic/InjectionModel/ConeInjection/ConeInjection.H | 2 +- .../Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C | 2 +- .../Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H | 2 +- .../FieldActivatedInjection/FieldActivatedInjection.C | 2 +- .../FieldActivatedInjection/FieldActivatedInjection.H | 2 +- .../Kinematic/InjectionModel/ManualInjection/ManualInjection.C | 2 +- .../Kinematic/InjectionModel/ManualInjection/ManualInjection.H | 2 +- .../Kinematic/InjectionModel/PatchInjection/PatchInjection.C | 2 +- .../Kinematic/InjectionModel/PatchInjection/PatchInjection.H | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C index b9cbf0f921..6d38ad3ba8 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C @@ -120,7 +120,7 @@ Foam::ConeInjection::ConeInjection ), parcelPDF_ ( - pdf::New + pdfs::pdf::New ( this->coeffDict().subDict("parcelPDF"), owner.rndGen() diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H index 5e6498e3d4..41c299b027 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H @@ -97,7 +97,7 @@ class ConeInjection const autoPtr > thetaOuter_; //- Parcel size PDF model - const autoPtr parcelPDF_; + const autoPtr parcelPDF_; // Tangential vectors to the direction vector diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C index e59eba322e..8b02e7057a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C @@ -151,7 +151,7 @@ Foam::ConeInjectionMP::ConeInjectionMP ), parcelPDF_ ( - pdf::New + pdfs::pdf::New ( this->coeffDict().subDict("parcelPDF"), owner.rndGen() diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H index 238d0463ef..a517866689 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H @@ -104,7 +104,7 @@ class ConeInjectionMP const autoPtr > thetaOuter_; //- Parcel size PDF model - const autoPtr parcelPDF_; + const autoPtr parcelPDF_; //- Number of parcels per injector already injected mutable label nInjected_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C index a1353be80c..f8599dcceb 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C @@ -115,7 +115,7 @@ Foam::FieldActivatedInjection::FieldActivatedInjection diameters_(positions_.size()), parcelPDF_ ( - pdf::New + pdfs::pdf::New ( this->coeffDict().subDict("parcelPDF"), owner.rndGen() diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H index c2f1e3cef4..e58df9c379 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H @@ -106,7 +106,7 @@ class FieldActivatedInjection scalarList diameters_; //- Parcel size PDF model - const autoPtr parcelPDF_; + const autoPtr parcelPDF_; protected: diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C index ad829f3978..0bf8e62e4d 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C @@ -94,7 +94,7 @@ Foam::ManualInjection::ManualInjection U0_(this->coeffDict().lookup("U0")), parcelPDF_ ( - pdf::New + pdfs::pdf::New ( this->coeffDict().subDict("parcelPDF"), owner.rndGen() diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H index b04fee48b5..e4642f6124 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H @@ -75,7 +75,7 @@ class ManualInjection const vector U0_; //- Parcel size PDF model - const autoPtr parcelPDF_; + const autoPtr parcelPDF_; //- Number of particles represented by each parcel scalar nParticlesPerParcel_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C index 4e88b90bfe..198ba8e13d 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C @@ -93,7 +93,7 @@ Foam::PatchInjection::PatchInjection ), parcelPDF_ ( - pdf::New + pdfs::pdf::New ( this->coeffDict().subDict("parcelPDF"), owner.rndGen() diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H index 05117ce3be..1338d5bbda 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H @@ -84,7 +84,7 @@ class PatchInjection const autoPtr > volumeFlowRate_; //- Parcel size PDF model - const autoPtr parcelPDF_; + const autoPtr parcelPDF_; //- Cell owners labelList cellOwners_;