Commit ba087008 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Overhaul of look-up table injection models + added new model

- Added helper classes to simplify the handling of the injector properties
- Added new reacting multiphase injection model variant
parent 9efcf216
......@@ -45,10 +45,32 @@ $(REACTINGMPPARCEL)/makeBasicReactingMultiphaseParcelSubmodels.C
/* bolt-on models */
submodels/addOns/radiation/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C
submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C
RADIATION=submodels/addOns/radiation
$(RADIATION)/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C
$(RADIATION)/scatter/cloudScatter/cloudScatter.C
submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionData.C
KINEMATICINJECTION=submodels/Kinematic/InjectionModel
$(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionData.C
$(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionDataIO.C
$(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.C
THERMOINJECTION=submodels/Thermodynamic/InjectionModel
$(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionData.C
$(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionDataIO.C
$(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.C
REACTINGINJECTION=submodels/Reacting/InjectionModel
$(REACTINGINJECTION)/ReactingLookupTableInjection/reactingParcelInjectionData.C
$(REACTINGINJECTION)/ReactingLookupTableInjection/reactingParcelInjectionDataIO.C
$(REACTINGINJECTION)/ReactingLookupTableInjection/reactingParcelInjectionDataIOList.C
REACTINGMPINJECTION=submodels/ReactingMultiphase/InjectionModel
$(REACTINGMPINJECTION)/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionData.C
$(REACTINGMPINJECTION)/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIO.C
$(REACTINGMPINJECTION)/ReactingMultiphaseLookupTableInjection/reactingMultiphaseParcelInjectionDataIOList.C
/* data entries */
submodels/IO/DataEntry/makeDataEntries.C
......
......@@ -38,6 +38,7 @@ License
#include "ManualInjection.H"
#include "NoInjection.H"
#include "PatchInjection.H"
#include "ReactingMultiphaseLookupTableInjection.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -108,6 +109,13 @@ License
ParcelType, \
ThermoType \
); \
makeInjectionModelThermoType \
( \
ReactingMultiphaseLookupTableInjection, \
KinematicCloud, \
ParcelType, \
ThermoType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -27,11 +27,6 @@ License
#include "KinematicLookupTableInjection.H"
#include "scalarIOList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class CloudType>
Foam::label Foam::KinematicLookupTableInjection<CloudType>::INPUT_FILE_COLS = 9;
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class CloudType>
......@@ -62,9 +57,9 @@ Foam::scalar Foam::KinematicLookupTableInjection<CloudType>::volumeToInject
scalar volume = 0.0;
if ((time0 >= 0.0) && (time0 < duration_))
{
forAll(mDot_, injectorI)
forAll(injectors_, i)
{
volume += mDot_[injectorI]/rho_[injectorI]*(time1 - time0);
volume += injectors_[i].mDot()/injectors_[i].rho()*(time1 - time0);
}
}
......@@ -88,14 +83,7 @@ Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection
(
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
),
x_(0),
U_(0),
d_(0),
rho_(0),
mDot_(0),
injectorCells_(0)
{
scalarListIOList injectorData
injectors_
(
IOobject
(
......@@ -105,55 +93,21 @@ Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
x_.setSize(injectorData.size());
U_.setSize(injectorData.size());
d_.setSize(injectorData.size());
rho_.setSize(injectorData.size());
mDot_.setSize(injectorData.size());
// Populate lists
forAll(injectorData, injectorI)
{
if (injectorData[injectorI].size() != INPUT_FILE_COLS)
{
FatalErrorIn
(
"KinematicLookupTableInjection"
"("
"const dictionary&,"
"CloudType& owner"
")"
) << "Incorrect number of entries in injector specification "
<< "- found " << injectorData[injectorI].size()
<< ", expected " << INPUT_FILE_COLS << ":" << nl
<< " x0 x1 x2 u0 u1 u2 d rho mDot " << nl
<< exit(FatalError);
}
x_[injectorI].component(0) = injectorData[injectorI][0];
x_[injectorI].component(1) = injectorData[injectorI][1];
x_[injectorI].component(2) = injectorData[injectorI][2];
U_[injectorI].component(0) = injectorData[injectorI][3];
U_[injectorI].component(1) = injectorData[injectorI][4];
U_[injectorI].component(2) = injectorData[injectorI][5];
d_[injectorI] = injectorData[injectorI][6];
rho_[injectorI] = injectorData[injectorI][7];
mDot_[injectorI] = injectorData[injectorI][8];
}
),
injectorCells_(0)
{
// Set/cache the injector cells
injectorCells_.setSize(injectorData.size());
forAll(x_, injectorI)
injectorCells_.setSize(injectors_.size());
forAll(injectors_, i)
{
this->findCellAtPosition(injectorCells_[injectorI], x_[injectorI]);
this->findCellAtPosition(injectorCells_[i], injectors_[i].x());
}
// Determine volume of particles to inject
this->volumeTotal_ = 0.0;
forAll(mDot_, injectorI)
forAll(injectors_, i)
{
this->volumeTotal_ += mDot_[injectorI]/rho_[injectorI];
this->volumeTotal_ += injectors_[i].mDot()/injectors_[i].rho();
}
this->volumeTotal_ *= duration_;
}
......@@ -194,7 +148,7 @@ void Foam::KinematicLookupTableInjection<CloudType>::setPositionAndCell
{
label injectorI = parcelI*injectorCells_.size()/nParcels;
position = x_[injectorI];
position = injectors_[injectorI].x();
cellOwner = injectorCells_[injectorI];
}
......@@ -211,13 +165,13 @@ void Foam::KinematicLookupTableInjection<CloudType>::setProperties
label injectorI = parcelI*injectorCells_.size()/nParcels;
// set particle velocity
parcel.U() = U_[injectorI];
parcel.U() = injectors_[injectorI].U();
// set particle diameter
parcel.d() = d_[injectorI];
parcel.d() = injectors_[injectorI].d();
// set particle density
parcel.rho() = rho_[injectorI];
parcel.rho() = injectors_[injectorI].rho();
}
......
......@@ -30,7 +30,10 @@ Description
an injection site.
(
(x y z u v w d rho mDot)
(x y z) (u v w) d rho mDot // injector 1
(x y z) (u v w) d rho mDot // injector 2
...
(x y z) (u v w) d rho mDot // injector N
);
where:
......@@ -49,7 +52,7 @@ SourceFiles
#define KinematicLookupTableInjection_H
#include "InjectionModel.H"
#include "pdf.H"
#include "kinematicParcelInjectionDataIOList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -76,27 +79,12 @@ class KinematicLookupTableInjection
//- Number of parcels per injector - common to all injection sources
const label nParcelsPerSecond_;
//- List of parcel position per injector / [m]
List<point> x_;
//- List of parcel velocity per injector / [m]
List<vector> U_;
//- List of parcel diameter per injector / [m]
List<scalar> d_;
//- List of parcel fluid density pre injector / [kg/m3]
List<scalar> rho_;
//- List of parcel injection mass flow per injector / [kg/s]
List<scalar> mDot_;
//- List of injectors
kinematicParcelInjectionDataIOList injectors_;
//- List of injector cells per injector
List<label> injectorCells_;
//- Number of columns expected in input file
static label INPUT_FILE_COLS;
protected:
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "kinematicParcelInjectionData.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(kinematicParcelInjectionData, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kinematicParcelInjectionData::kinematicParcelInjectionData()
:
x_(point::zero),
U_(vector::zero),
d_(0.0),
rho_(0.0),
mDot_(0.0)
{}
Foam::kinematicParcelInjectionData::kinematicParcelInjectionData
(
const dictionary& dict
)
:
x_(dict.lookup("x")),
U_(dict.lookup("U")),
d_(readScalar(dict.lookup("d"))),
rho_(readScalar(dict.lookup("rho"))),
mDot_(readScalar(dict.lookup("mDot")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kinematicParcelInjectionData::~kinematicParcelInjectionData()
{}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::kinematicParcelInjectionData
Description
Container class to provide injection data for kinematic parcels
SourceFiles
kinematicParcelInjectionData.C
\*---------------------------------------------------------------------------*/
#ifndef kinematicParcelInjectionData_H
#define kinematicParcelInjectionData_H
#include "dictionary.H"
#include "vector.H"
#include "point.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class kinematicParcelInjectionData;
// Forward declaration of friend functions
Ostream& operator<<
(
Ostream&,
const kinematicParcelInjectionData&
);
Istream& operator>>
(
Istream&,
kinematicParcelInjectionData&
);
/*---------------------------------------------------------------------------*\
Class kinematicParcelInjectionData Declaration
\*---------------------------------------------------------------------------*/
class kinematicParcelInjectionData
{
protected:
// Parcel properties
//- Position [m]
point x_;
//- Velocity [m/s]
vector U_;
//- Diameter [m]
scalar d_;
//- Density [kg/m3]
scalar rho_;
//- Mass flow rate [kg/s]
scalar mDot_;
public:
//- Runtime type information
TypeName("kinematicParcelInjectionData");
// Constructors
//- Null constructor
kinematicParcelInjectionData();
//- Construct from dictionary
kinematicParcelInjectionData(const dictionary& dict);
//- Construct from Istream
kinematicParcelInjectionData(Istream& is);
//-Destructor
virtual ~kinematicParcelInjectionData();
// Access
//- Return const access to the position
inline const point& x() const;
//- Return const access to the velocity
inline const vector& U() const;
//- Return const access to the diameter
inline scalar d() const;
//- Return const access to the density
inline scalar rho() const;
//- Return const access to the mass flow rate
inline scalar mDot() const;
// Edit
//- Return access to the position
inline point& x();
//- Return access to the velocity
inline vector& U();
//- Return access to the diameter
inline scalar& d();
//- Return access to the density
inline scalar& rho();
//- Return access to the mass flow rate
inline scalar& mDot();
// I-O
// Friend Operators
friend bool operator==
(
const kinematicParcelInjectionData& a,
const kinematicParcelInjectionData& b
)
{
notImplemented
(
"operator=="
"("
"const kinematicParcelInjectionData&, "
"const kinematicParcelInjectionData&"
")"
);
return false;
}
friend bool operator!=
(
const kinematicParcelInjectionData& a,
const kinematicParcelInjectionData& b
)
{
notImplemented
(
"operator=="
"("
"const kinematicParcelInjectionData&, "
"const kinematicParcelInjectionData&"
")"
);
return false;
}
//- Ostream operator
friend Ostream& operator<<
(
Ostream& os,
const kinematicParcelInjectionData& data
);
//- Istream operator
friend Istream& operator>>
(
Istream& is,
kinematicParcelInjectionData& data
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "kinematicParcelInjectionDataI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "kinematicParcelInjectionData.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::point& Foam::kinematicParcelInjectionData::x() const
{
return x_;
}
inline const Foam::vector& Foam::kinematicParcelInjectionData::U() const
{
return U_;
}