diff --git a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H index 9cfdb66e25..a9b1686d58 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntry.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -142,62 +142,60 @@ public: virtual void convertTimeBase(const Time& t); -public: + // Evaluation + + //- Return value as a function of (scalar) independent variable + virtual Type value(const scalar x) const; + + //- Return value as a function of (scalar) independent variable + virtual tmp > value(const scalarField& x) const; + + //- Integrate between two (scalar) values + virtual Type integrate(const scalar x1, const scalar x2) const; + + //- Integrate between two (scalar) values + virtual tmp > integrate + ( + const scalarField& x1, + const scalarField& x2 + ) const; + + //- Return dimensioned type + virtual dimensioned dimValue(const scalar x) const; + + //- Return dimensioned type as a function of (scalar) + virtual tmp > > dimValue + ( + const scalarField& x + ) const; + + //- Integrate between two scalars and return a dimensioned type + virtual dimensioned dimIntegrate + ( + const scalar x1, + const scalar x2 + ) const; + + //- Integrate between two scalar fields and return a field of + // dimensioned type + virtual tmp > > dimIntegrate + ( + const scalarField& x1, + const scalarField& x2 + ) const; - // Evaluation + // I/O - //- Return value as a function of (scalar) independent variable - virtual Type value(const scalar x) const; + //- Ostream Operator + friend Ostream& operator<< + ( + Ostream& os, + const DataEntry& de + ); - //- Return value as a function of (scalar) independent variable - virtual tmp > value(const scalarField& x) const; - - //- Integrate between two (scalar) values - virtual Type integrate(const scalar x1, const scalar x2) const; - - //- Integrate between two (scalar) values - virtual tmp > integrate - ( - const scalarField& x1, - const scalarField& x2 - ) const; - - //- Return dimensioned type - virtual dimensioned dimValue(const scalar x) const; - - //- Return dimensioned type as a function of (scalar) - virtual tmp > > dimValue - ( - const scalarField& x - ) const; - - //- Integrate between two scalars and returns a dimensioned type - virtual dimensioned dimIntegrate - ( - const scalar x1, - const scalar x2 - ) const; - - //- Integrate between two scalars and returns list of dimensioned type - virtual tmp > > dimIntegrate - ( - const scalarField& x1, - const scalarField& x2 - ) const; - - - // I/O - - //- Ostream Operator - friend Ostream& operator<< - ( - Ostream& os, - const DataEntry& de - ); - - //- Write in dictionary format - virtual void writeData(Ostream& os) const; + //- Write in dictionary format + virtual void writeData(Ostream& os) const; }; diff --git a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C index 206e7c4e95..27622aeeb7 100644 --- a/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C +++ b/src/finiteVolume/cfdTools/general/adjustPhi/adjustPhi.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,11 +56,7 @@ bool Foam::adjustPhi if (!isA(phip)) { - if - ( - Up.fixesValue() - && !isA(Up) - ) + if (Up.fixesValue() && !isA(Up)) { forAll(phip, i) { @@ -113,8 +109,12 @@ bool Foam::adjustPhi { FatalErrorIn ( - "adjustPhi(surfaceScalarField& phi, const volVectorField& U," - "const volScalarField& p" + "adjustPhi" + "(" + "surfaceScalarField&, " + "const volVectorField&," + "volScalarField&" + ")" ) << "Continuity error cannot be removed by adjusting the" " outflow.\nPlease check the velocity boundary conditions" " and/or run potentialFoam to initialise the outflow." << nl diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C index cebed76580..97c3c819a0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -167,7 +167,8 @@ Foam::ConeNozzleInjection::ConeNozzleInjection "Foam::ConeNozzleInjection::ConeNozzleInjection" "(" "const dictionary&, " - "CloudType&" + "CloudType&, " + "const word&" ")" )<< "innerNozzleDiameter >= outerNozzleDiameter" << nl << exit(FatalError); @@ -369,6 +370,7 @@ void Foam::ConeNozzleInjection::setPositionAndCell "const scalar, " "vector&, " "label&, " + "label&, " "label&" ")" )<< "Unknown injectionMethod type" << nl diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C index c40a95fbac..293fd7d740 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,6 +43,7 @@ Foam::KinematicLookupTableInjection::KinematicLookupTableInjection ( readScalar(this->coeffDict().lookup("parcelsPerSecond")) ), + randomise_(readBool(this->coeffDict().lookup("randomise"))), injectors_ ( IOobject @@ -87,6 +88,7 @@ Foam::KinematicLookupTableInjection::KinematicLookupTableInjection inputFileName_(im.inputFileName_), duration_(im.duration_), parcelsPerSecond_(im.parcelsPerSecond_), + randomise_(im.randomise_), injectors_(im.injectors_), injectorCells_(im.injectorCells_), injectorTetFaces_(im.injectorTetFaces_), @@ -177,7 +179,16 @@ void Foam::KinematicLookupTableInjection::setPositionAndCell label& tetPtI ) { - label injectorI = parcelI*injectorCells_.size()/nParcels; + label injectorI = 0; + if (randomise_) + { + cachedRandom& rnd = this->owner().rndGen(); + injectorI = rnd.position