Commit 9bb6e5ac authored by mattijs's avatar mattijs
Browse files

Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

parents 1a741a22 76381a7b
......@@ -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"
......
......@@ -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<pdfs::pdf> p(pdfs::pdf::New(pdfDictionary, rndGen));
const scalar xMin = p->minValue();
const scalar xMax = p->maxValue();
autoPtr<OFstream> 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);
......@@ -23,6 +23,10 @@ nSamples 10000;
// Type of pdf
pdfType RosinRammler;
// Write data flag
writeData true;
// PDF model coefficients
RosinRammlerPDF
{
minValue 1e-06;
......
......@@ -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<pdf> 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;
......
......@@ -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 <Type> 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.
......
......@@ -30,7 +30,8 @@ License
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
Foam::volScalarField&
Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
{
const scalar minVsf = min(vsf).value();
......@@ -55,6 +56,8 @@ void Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
vsf.boundaryField() = max(vsf.boundaryField(), lowerBound.value());
}
return vsf;
}
......
......@@ -50,8 +50,9 @@ namespace Foam
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
//- Bound the given scalar field if it has gone unbounded.
// Return the bounded field.
// Used extensively in RAS and LES turbulence models.
void bound(volScalarField&, const dimensionedScalar& lowerBound);
volScalarField& bound(volScalarField&, const dimensionedScalar& lowerBound);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -55,7 +55,7 @@ Foam::ChomiakInjector::ChomiakInjector
ChomiakDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_
(
pdf::New
pdfs::pdf::New
(
ChomiakDict_.subDict("dropletPDF"),
sm.rndGen()
......
......@@ -64,7 +64,7 @@ private:
dictionary ChomiakDict_;
autoPtr<pdf> dropletPDF_;
autoPtr<pdfs::pdf> dropletPDF_;
scalarList maxSprayAngle_;
......
......@@ -55,7 +55,7 @@ Foam::definedHollowConeInjector::definedHollowConeInjector
definedHollowConeDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_
(
pdf::New
pdfs::pdf::New
(
definedHollowConeDict_.subDict("dropletPDF"),
sm.rndGen()
......
......@@ -61,7 +61,7 @@ private:
typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
dictionary definedHollowConeDict_;
autoPtr<pdf> dropletPDF_;
autoPtr<pdfs::pdf> dropletPDF_;
// inner and outer cone angle time histories
// 2 column vectors = (time, coneAngle)
......
......@@ -55,7 +55,7 @@ Foam::hollowConeInjector::hollowConeInjector
hollowConeDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_
(
pdf::New
pdfs::pdf::New
(
hollowConeDict_.subDict("dropletPDF"),
sm.rndGen()
......
......@@ -59,7 +59,7 @@ private:
dictionary hollowConeDict_;
autoPtr<pdf> dropletPDF_;
autoPtr<pdfs::pdf> dropletPDF_;
scalarList innerAngle_;
scalarList outerAngle_;
......
......@@ -120,7 +120,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
),
parcelPDF_
(
pdf::New
pdfs::pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
......
......@@ -97,7 +97,7 @@ class ConeInjection
const autoPtr<DataEntry<scalar> > thetaOuter_;
//- Parcel size PDF model
const autoPtr<pdf> parcelPDF_;
const autoPtr<pdfs::pdf> parcelPDF_;
// Tangential vectors to the direction vector
......
......@@ -151,7 +151,7 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP
),
parcelPDF_
(
pdf::New
pdfs::pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
......
......@@ -104,7 +104,7 @@ class ConeInjectionMP
const autoPtr<DataEntry<scalar> > thetaOuter_;
//- Parcel size PDF model
const autoPtr<pdf> parcelPDF_;
const autoPtr<pdfs::pdf> parcelPDF_;
//- Number of parcels per injector already injected
mutable label nInjected_;
......
......@@ -115,7 +115,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
diameters_(positions_.size()),
parcelPDF_
(
pdf::New
pdfs::pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
......
......@@ -106,7 +106,7 @@ class FieldActivatedInjection
scalarList diameters_;
//- Parcel size PDF model
const autoPtr<pdf> parcelPDF_;
const autoPtr<pdfs::pdf> parcelPDF_;
protected:
......
......@@ -94,7 +94,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
U0_(this->coeffDict().lookup("U0")),
parcelPDF_
(
pdf::New
pdfs::pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment