mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Added ranomise to lookup table injection models
This commit is contained in:
@ -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<CloudType>::KinematicLookupTableInjection
|
||||
(
|
||||
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
|
||||
),
|
||||
randomise_(readBool(this->coeffDict().lookup("randomise"))),
|
||||
injectors_
|
||||
(
|
||||
IOobject
|
||||
@ -87,6 +88,7 @@ Foam::KinematicLookupTableInjection<CloudType>::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<CloudType>::setPositionAndCell
|
||||
label& tetPtI
|
||||
)
|
||||
{
|
||||
label injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
label injectorI = 0;
|
||||
if (randomise_)
|
||||
{
|
||||
cachedRandom& rnd = this->owner().rndGen();
|
||||
injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
}
|
||||
|
||||
position = injectors_[injectorI].x();
|
||||
cellOwner = injectorCells_[injectorI];
|
||||
|
||||
@ -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
|
||||
@ -78,6 +78,9 @@ class KinematicLookupTableInjection
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const scalar parcelsPerSecond_;
|
||||
|
||||
//- Flag to indicate to randomise injection positions
|
||||
bool randomise_;
|
||||
|
||||
//- List of injectors
|
||||
kinematicParcelInjectionDataIOList injectors_;
|
||||
|
||||
|
||||
@ -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
|
||||
@ -42,6 +42,7 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection
|
||||
(
|
||||
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
|
||||
),
|
||||
randomise_(readBool(this->coeffDict().lookup("randomise"))),
|
||||
injectors_
|
||||
(
|
||||
IOobject
|
||||
@ -86,6 +87,7 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection
|
||||
inputFileName_(im.inputFileName_),
|
||||
duration_(im.duration_),
|
||||
parcelsPerSecond_(im.parcelsPerSecond_),
|
||||
randomise_(im.randomise_),
|
||||
injectors_(im.injectors_),
|
||||
injectorCells_(im.injectorCells_),
|
||||
injectorTetFaces_(im.injectorTetFaces_),
|
||||
@ -176,7 +178,16 @@ void Foam::ReactingLookupTableInjection<CloudType>::setPositionAndCell
|
||||
label& tetPtI
|
||||
)
|
||||
{
|
||||
label injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
label injectorI = 0;
|
||||
if (randomise_)
|
||||
{
|
||||
cachedRandom& rnd = this->owner().rndGen();
|
||||
injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
}
|
||||
|
||||
position = injectors_[injectorI].x();
|
||||
cellOwner = injectorCells_[injectorI];
|
||||
|
||||
@ -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
|
||||
@ -81,6 +81,9 @@ class ReactingLookupTableInjection
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const scalar parcelsPerSecond_;
|
||||
|
||||
//- Flag to indicate to randomise injection positions
|
||||
bool randomise_;
|
||||
|
||||
//- List of injectors
|
||||
reactingParcelInjectionDataIOList injectors_;
|
||||
|
||||
|
||||
@ -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 @@ ReactingMultiphaseLookupTableInjection
|
||||
(
|
||||
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
|
||||
),
|
||||
randomise_(readBool(this->coeffDict().lookup("randomise"))),
|
||||
injectors_
|
||||
(
|
||||
IOobject
|
||||
@ -88,6 +89,7 @@ ReactingMultiphaseLookupTableInjection
|
||||
inputFileName_(im.inputFileName_),
|
||||
duration_(im.duration_),
|
||||
parcelsPerSecond_(im.parcelsPerSecond_),
|
||||
randomise_(im.randomise_),
|
||||
injectors_(im.injectors_),
|
||||
injectorCells_(im.injectorCells_),
|
||||
injectorTetFaces_(im.injectorTetFaces_),
|
||||
@ -182,7 +184,16 @@ void Foam::ReactingMultiphaseLookupTableInjection<CloudType>::setPositionAndCell
|
||||
label& tetPtI
|
||||
)
|
||||
{
|
||||
label injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
label injectorI = 0;
|
||||
if (randomise_)
|
||||
{
|
||||
cachedRandom& rnd = this->owner().rndGen();
|
||||
injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
}
|
||||
|
||||
position = injectors_[injectorI].x();
|
||||
cellOwner = injectorCells_[injectorI];
|
||||
|
||||
@ -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
|
||||
@ -84,6 +84,9 @@ class ReactingMultiphaseLookupTableInjection
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const scalar parcelsPerSecond_;
|
||||
|
||||
//- Flag to indicate to randomise injection positions
|
||||
bool randomise_;
|
||||
|
||||
//- List of injectors
|
||||
reactingMultiphaseParcelInjectionDataIOList injectors_;
|
||||
|
||||
|
||||
@ -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::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection
|
||||
(
|
||||
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
|
||||
),
|
||||
randomise_(readBool(this->coeffDict().lookup("randomise"))),
|
||||
injectors_
|
||||
(
|
||||
IOobject
|
||||
@ -87,6 +88,7 @@ Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection
|
||||
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::ThermoLookupTableInjection<CloudType>::setPositionAndCell
|
||||
label& tetPtI
|
||||
)
|
||||
{
|
||||
label injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
label injectorI = 0;
|
||||
if (randomise_)
|
||||
{
|
||||
cachedRandom& rnd = this->owner().rndGen();
|
||||
injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
}
|
||||
|
||||
position = injectors_[injectorI].x();
|
||||
cellOwner = injectorCells_[injectorI];
|
||||
|
||||
@ -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
|
||||
@ -80,6 +80,9 @@ class ThermoLookupTableInjection
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const scalar parcelsPerSecond_;
|
||||
|
||||
//- Flag to indicate to randomise injection positions
|
||||
bool randomise_;
|
||||
|
||||
//- List of injectors
|
||||
kinematicParcelInjectionDataIOList injectors_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user