diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C index 8499589784..da721e70b2 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -160,7 +160,7 @@ Foam::label Foam::PatchFlowRateInjection::parcelsToInject scalar c = concentration_.value(0.5*(time0 + time1)); - scalar nParcels = fraction_*parcelConcentration_*c*flowRate()*dt; + scalar nParcels = parcelConcentration_*c*flowRate()*dt; label nParcelsToInject = floor(nParcels); // Inject an additional parcel with a probability based on the @@ -205,7 +205,7 @@ Foam::scalar Foam::PatchFlowRateInjection::volumeToInject this->volumeTotal_ = volume; this->massTotal_ = volume*this->owner().constProps().rho0(); - return fraction_*volume; + return volume; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C index 184c026b92..05cce02811 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,8 +68,7 @@ Foam::PatchInjection::PatchInjection patchInjectionBase::updateMesh(owner.mesh()); // Set total volume/mass to inject - this->volumeTotal_ = fraction_*flowRateProfile_.integrate(0.0, duration_); - this->massTotal_ *= fraction_; + this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_); } @@ -121,7 +120,7 @@ Foam::label Foam::PatchInjection::parcelsToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - scalar nParcels = this->fraction_*(time1 - time0)*parcelsPerSecond_; + scalar nParcels = (time1 - time0)*parcelsPerSecond_; cachedRandom& rnd = this->owner().rndGen(); @@ -159,7 +158,7 @@ Foam::scalar Foam::PatchInjection::volumeToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - return this->fraction_*flowRateProfile_.integrate(time0, time1); + return flowRateProfile_.integrate(time0, time1); } else { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C index 15543f1851..0d1700b5d0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,6 @@ Foam::patchInjectionBase::patchInjectionBase patchArea_(0.0), patchNormal_(), cellOwners_(), - fraction_(1.0), triFace_(), triToFace_(), triCumulativeMagSf_(), @@ -73,7 +72,6 @@ Foam::patchInjectionBase::patchInjectionBase(const patchInjectionBase& pib) patchArea_(pib.patchArea_), patchNormal_(pib.patchNormal_), cellOwners_(pib.cellOwners_), - fraction_(pib.fraction_), triFace_(pib.triFace_), triToFace_(pib.triToFace_), triCumulativeMagSf_(pib.triCumulativeMagSf_), @@ -103,6 +101,9 @@ void Foam::patchInjectionBase::updateMesh(const polyMesh& mesh) DynamicList triFace(2*patch.size()); DynamicList tris(5); + // set zero value at the start of the tri area list + triMagSf.append(0.0); + forAll(patch, faceI) { const face& f = patch[faceI]; @@ -138,13 +139,10 @@ void Foam::patchInjectionBase::updateMesh(const polyMesh& mesh) triToFace_.transfer(triToFace); triCumulativeMagSf_.transfer(triMagSf); - // fraction of injection volume to be injected by this patch - fraction_ = sumTriMagSf_[Pstream::myProcNo() + 1]/sum(sumTriMagSf_); - // convert sumTriMagSf_ into cumulative sum of areas per proc for (label i = 1; i < sumTriMagSf_.size(); i++) { - sumTriMagSf_[i] += sumTriMagSf_[i - 1]; + sumTriMagSf_[i] += sumTriMagSf_[i-1]; } const scalarField magSf(mag(patch.faceAreas())); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H index f318531614..b11f2790b0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,9 +80,6 @@ protected: //- List of cell labels corresponding to injector positions labelList cellOwners_; - //- Fraction of injection controlled by this processor - scalar fraction_; - //- Decomposed patch faces as a list of triangles faceList triFace_;