Commit 3213388d authored by Mark Olesen's avatar Mark Olesen
Browse files

Merge remote branch 'OpenCFD/master' into olesenm

parents d29c4386 76381a7b
......@@ -93,6 +93,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
......@@ -29,6 +29,7 @@ Description
#include "fvCFD.H"
#include "pdf.H"
#include "makeGraph.H"
#include "OFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
......@@ -39,16 +40,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++)
{
......@@ -56,6 +47,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;
......
......@@ -25,8 +25,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.
......
......@@ -54,7 +54,7 @@ Foam::ChomiakInjector::ChomiakInjector
ChomiakDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_
(
pdf::New
pdfs::pdf::New
(
ChomiakDict_.subDict("dropletPDF"),
sm.rndGen()
......
......@@ -63,7 +63,7 @@ private:
dictionary ChomiakDict_;
autoPtr<pdf> dropletPDF_;
autoPtr<pdfs::pdf> dropletPDF_;
scalarList maxSprayAngle_;
......
......@@ -54,7 +54,7 @@ Foam::definedHollowConeInjector::definedHollowConeInjector
definedHollowConeDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_
(
pdf::New
pdfs::pdf::New
(
definedHollowConeDict_.subDict("dropletPDF"),
sm.rndGen()
......
......@@ -60,7 +60,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)
......
......@@ -54,7 +54,7 @@ Foam::hollowConeInjector::hollowConeInjector
hollowConeDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_
(
pdf::New
pdfs::pdf::New
(
hollowConeDict_.subDict("dropletPDF"),
sm.rndGen()
......
......@@ -58,7 +58,7 @@ private:
dictionary hollowConeDict_;
autoPtr<pdf> dropletPDF_;
autoPtr<pdfs::pdf> dropletPDF_;
scalarList innerAngle_;
scalarList outerAngle_;
......
......@@ -119,7 +119,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
),
parcelPDF_
(
pdf::New
pdfs::pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
......
......@@ -96,7 +96,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
......
......@@ -150,7 +150,7 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP
),
parcelPDF_
(
pdf::New
pdfs::pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
......
......@@ -103,7 +103,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_;
......
......@@ -114,7 +114,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
diameters_(positions_.size()),
parcelPDF_
(
pdf::New
pdfs::pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
......
......@@ -105,7 +105,7 @@ class FieldActivatedInjection
scalarList diameters_;
//- Parcel size PDF model
const autoPtr<pdf> parcelPDF_;
const autoPtr<pdfs::pdf> parcelPDF_;
protected:
......
......@@ -93,7 +93,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
U0_(this->coeffDict().lookup("U0")),
parcelPDF_
(
pdf::New
pdfs::pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
......
......@@ -74,7 +74,7 @@ class ManualInjection
const vector U0_;
//- Parcel size PDF model
const autoPtr<pdf> parcelPDF_;
const autoPtr<pdfs::pdf> parcelPDF_;
//- Number of particles represented by each parcel
scalar nParticlesPerParcel_;
......
......@@ -92,7 +92,7 @@ Foam::PatchInjection<CloudType>::PatchInjection
),
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