mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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
This commit is contained in:
@ -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:
|
||||
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,216 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,91 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::kinematicParcelInjectionData::d() const
|
||||
{
|
||||
return d_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::kinematicParcelInjectionData::rho() const
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::kinematicParcelInjectionData::mDot() const
|
||||
{
|
||||
return mDot_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::point& Foam::kinematicParcelInjectionData::x()
|
||||
{
|
||||
return x_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::vector& Foam::kinematicParcelInjectionData::U()
|
||||
{
|
||||
return U_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::kinematicParcelInjectionData::d()
|
||||
{
|
||||
return d_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::kinematicParcelInjectionData::rho()
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::kinematicParcelInjectionData::mDot()
|
||||
{
|
||||
return mDot_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,89 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::kinematicParcelInjectionData::kinematicParcelInjectionData(Istream& is)
|
||||
{
|
||||
is.check("reading (Px Py Pz)");
|
||||
is >> x_;
|
||||
|
||||
is.check("reading (Ux Uy Uz)");
|
||||
is >> U_;
|
||||
|
||||
is.check("reading d");
|
||||
is >> d_;
|
||||
|
||||
is.check("reading rho");
|
||||
is >> rho_;
|
||||
|
||||
is.check("reading mDot");
|
||||
is >> mDot_;
|
||||
|
||||
is.check("kinematicParcelInjectionData(Istream& is)");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const kinematicParcelInjectionData& data
|
||||
)
|
||||
{
|
||||
os << data.x_ << data.U_ << data.d_ << data.rho_ << data.mDot_;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
Foam::Istream& Foam::operator>>(Istream& is, kinematicParcelInjectionData& data)
|
||||
{
|
||||
is.check("reading (Px Py Pz)");
|
||||
is >> data.x_;
|
||||
|
||||
is.check("reading (Ux Uy Uz)");
|
||||
is >> data.U_;
|
||||
|
||||
is.check("reading d");
|
||||
is >> data.d_;
|
||||
|
||||
is.check("reading rho");
|
||||
is >> data.rho_;
|
||||
|
||||
is.check("reading mDot");
|
||||
is >> data.mDot_;
|
||||
|
||||
is.check("operator(Istream&, kinematicParcelInjectionData&)");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "kinematicParcelInjectionDataIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTemplateTypeNameAndDebug(IOList<kinematicParcelInjectionData>, 0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
kinematicParcelInjectionDataIOList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef kinematicParcelInjectionDataIOList_H
|
||||
#define kinematicParcelInjectionDataIOList_H
|
||||
|
||||
#include "IOList.H"
|
||||
#include "kinematicParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef IOList<kinematicParcelInjectionData>
|
||||
kinematicParcelInjectionDataIOList;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -25,12 +25,6 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "ReactingLookupTableInjection.H"
|
||||
#include "scalarIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::label Foam::ReactingLookupTableInjection<CloudType>::INPUT_FILE_COLS = 12;
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -62,9 +56,9 @@ Foam::scalar Foam::ReactingLookupTableInjection<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,17 +82,7 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection
|
||||
(
|
||||
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
|
||||
),
|
||||
x_(0),
|
||||
U_(0),
|
||||
d_(0),
|
||||
rho_(0),
|
||||
mDot_(0),
|
||||
T_(0),
|
||||
cp_(0),
|
||||
Y_(0),
|
||||
injectorCells_(0)
|
||||
{
|
||||
scalarListIOList injectorData
|
||||
injectors_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -108,75 +92,21 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection
|
||||
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());
|
||||
T_.setSize(injectorData.size());
|
||||
cp_.setSize(injectorData.size());
|
||||
Y_.setSize(injectorData.size());
|
||||
|
||||
// Populate lists
|
||||
forAll(injectorData, injectorI)
|
||||
{
|
||||
if (injectorData[injectorI].size() != INPUT_FILE_COLS)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"ReactingLookupTableInjection"
|
||||
"("
|
||||
"const dictionary&,"
|
||||
"CloudType& owner"
|
||||
")"
|
||||
) << "Incorrect number of entries in injector specification "
|
||||
<< "- found " << injectorData[injectorI].size()
|
||||
<< ", expected a minimum of " << INPUT_FILE_COLS << ":" << nl
|
||||
<< " x0 x1 x2 u0 u1 u2 d rho mDot T cp Y0..YN"
|
||||
<< 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];
|
||||
T_[injectorI] = injectorData[injectorI][9];
|
||||
cp_[injectorI] = injectorData[injectorI][10];
|
||||
|
||||
Y_[injectorI].setSize
|
||||
(
|
||||
injectorData[injectorI].size() - INPUT_FILE_COLS + 1
|
||||
);
|
||||
label Yi = 0;
|
||||
for
|
||||
(
|
||||
label i = INPUT_FILE_COLS-1;
|
||||
i < injectorData[injectorI].size();
|
||||
i++
|
||||
)
|
||||
{
|
||||
Y_[injectorI][Yi++] = injectorData[injectorI][i];
|
||||
}
|
||||
}
|
||||
|
||||
),
|
||||
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_;
|
||||
}
|
||||
@ -217,7 +147,7 @@ void Foam::ReactingLookupTableInjection<CloudType>::setPositionAndCell
|
||||
{
|
||||
label injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
|
||||
position = x_[injectorI];
|
||||
position = injectors_[injectorI].x();
|
||||
cellOwner = injectorCells_[injectorI];
|
||||
}
|
||||
|
||||
@ -234,22 +164,22 @@ void Foam::ReactingLookupTableInjection<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();
|
||||
|
||||
// set particle temperature
|
||||
parcel.T() = T_[injectorI];
|
||||
parcel.T() = injectors_[injectorI].T();
|
||||
|
||||
// set particle specific heat capacity
|
||||
parcel.cp() = cp_[injectorI];
|
||||
parcel.cp() = injectors_[injectorI].cp();
|
||||
|
||||
// set particle component mass fractions
|
||||
parcel.Y() = Y_[injectorI];
|
||||
parcel.Y() = injectors_[injectorI].Y();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,10 @@ Description
|
||||
an injection site.
|
||||
|
||||
(
|
||||
(x y z u v w d rho mDot T cp Y0..YN)
|
||||
(x y z) (u v w) d rho mDot T cp (Y0..YN) // injector 1
|
||||
(x y z) (u v w) d rho mDot T cp (Y0..YN) // injector 2
|
||||
...
|
||||
(x y z) (u v w) d rho mDot T cp (Y0..YN) // injector N
|
||||
);
|
||||
|
||||
where:
|
||||
@ -41,6 +44,7 @@ Description
|
||||
mDot = mass flow rate [kg/m3]
|
||||
T = temperature [K]
|
||||
cp = specific heat capacity [J/kg/K]
|
||||
Y = list of mass fractions
|
||||
|
||||
SourceFiles
|
||||
ReactingLookupTableInjection.C
|
||||
@ -51,7 +55,7 @@ SourceFiles
|
||||
#define ReactingLookupTableInjection_H
|
||||
|
||||
#include "InjectionModel.H"
|
||||
#include "pdf.H"
|
||||
#include "reactingParcelInjectionDataIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -78,36 +82,12 @@ class ReactingLookupTableInjection
|
||||
//- 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 parcel temperature flow per injector / [K]
|
||||
List<scalar> T_;
|
||||
|
||||
//- List of parcel specific heat capacity per injector / [J/kg/K]
|
||||
List<scalar> cp_;
|
||||
|
||||
//- List of parcel specie mass fractions per injector / []
|
||||
List<scalarList> Y_;
|
||||
//- List of injectors
|
||||
reactingParcelInjectionDataIOList injectors_;
|
||||
|
||||
//- List of injector cells per injector
|
||||
List<label> injectorCells_;
|
||||
|
||||
//- Number of columns expected in input file
|
||||
static label INPUT_FILE_COLS;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "reactingParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(reactingParcelInjectionData, 0);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::reactingParcelInjectionData::reactingParcelInjectionData()
|
||||
:
|
||||
thermoParcelInjectionData(),
|
||||
Y_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::reactingParcelInjectionData::reactingParcelInjectionData
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
thermoParcelInjectionData(dict),
|
||||
Y_(dict.lookup("Y"))
|
||||
{}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::reactingParcelInjectionData::~reactingParcelInjectionData()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,181 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::reactingParcelInjectionData
|
||||
|
||||
Description
|
||||
Container class to provide injection data for reacting parcels
|
||||
|
||||
SourceFiles
|
||||
reactingParcelInjectionData.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef reactingParcelInjectionData_H
|
||||
#define reactingParcelInjectionData_H
|
||||
|
||||
#include "thermoParcelInjectionData.H"
|
||||
#include "scalarList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class reactingParcelInjectionData;
|
||||
|
||||
// Forward declaration of friend functions
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const reactingParcelInjectionData&
|
||||
);
|
||||
|
||||
Istream& operator>>
|
||||
(
|
||||
Istream&,
|
||||
reactingParcelInjectionData&
|
||||
);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class reactingParcelInjectionData Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class reactingParcelInjectionData
|
||||
:
|
||||
public thermoParcelInjectionData
|
||||
{
|
||||
protected:
|
||||
|
||||
// Parcel properties
|
||||
|
||||
//- List of mass fractions
|
||||
scalarList Y_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("reactingParcelInjectionData");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Null constructor
|
||||
reactingParcelInjectionData();
|
||||
|
||||
//- Construct from dictionary
|
||||
reactingParcelInjectionData(const dictionary& dict);
|
||||
|
||||
//- Construct from Istream
|
||||
reactingParcelInjectionData(Istream& is);
|
||||
|
||||
|
||||
//-Destructor
|
||||
virtual ~reactingParcelInjectionData();
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the list of mass fractions
|
||||
inline const scalarList& Y() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
//- Return access to the mass fractions
|
||||
inline scalarList& Y();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
// Friend Operators
|
||||
|
||||
friend bool operator==
|
||||
(
|
||||
const reactingParcelInjectionData& a,
|
||||
const reactingParcelInjectionData& b
|
||||
)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"operator=="
|
||||
"("
|
||||
"const reactingParcelInjectionData&, "
|
||||
"const reactingParcelInjectionData&"
|
||||
")"
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
friend bool operator!=
|
||||
(
|
||||
const reactingParcelInjectionData& a,
|
||||
const reactingParcelInjectionData& b
|
||||
)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"operator=="
|
||||
"("
|
||||
"const reactingParcelInjectionData&, "
|
||||
"const reactingParcelInjectionData&"
|
||||
")"
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Ostream operator
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const reactingParcelInjectionData& data
|
||||
);
|
||||
|
||||
//- Istream operator
|
||||
friend Istream& operator>>
|
||||
(
|
||||
Istream& is,
|
||||
reactingParcelInjectionData& data
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "reactingParcelInjectionDataI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "reactingParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::scalarList& Foam::reactingParcelInjectionData::Y() const
|
||||
{
|
||||
return Y_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalarList& Foam::reactingParcelInjectionData::Y()
|
||||
{
|
||||
return Y_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,71 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "reactingParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::reactingParcelInjectionData::reactingParcelInjectionData(Istream& is)
|
||||
:
|
||||
thermoParcelInjectionData(is)
|
||||
{
|
||||
is.check("reading Y's");
|
||||
is >> Y_;
|
||||
|
||||
is.check("reactingParcelInjectionData(Istream& is)");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const reactingParcelInjectionData& data
|
||||
)
|
||||
{
|
||||
os << static_cast<const thermoParcelInjectionData&>(data);
|
||||
|
||||
os << data.Y_;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
Foam::Istream& Foam::operator>>(Istream& is, reactingParcelInjectionData& data)
|
||||
{
|
||||
is >> static_cast<thermoParcelInjectionData&>(data);
|
||||
|
||||
is.check("reading Y's");
|
||||
is >> data.Y_;
|
||||
|
||||
is.check("operator(Istream&, reactingParcelInjectionData&)");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "reactingParcelInjectionDataIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTemplateTypeNameAndDebug(IOList<reactingParcelInjectionData>, 0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
reactingParcelInjectionDataIOList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef reactingParcelInjectionDataIOList_H
|
||||
#define reactingParcelInjectionDataIOList_H
|
||||
|
||||
#include "IOList.H"
|
||||
#include "reactingParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef IOList<reactingParcelInjectionData>
|
||||
reactingParcelInjectionDataIOList;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,218 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 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 "ReactingMultiphaseLookupTableInjection.H"
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::label
|
||||
Foam::ReactingMultiphaseLookupTableInjection<CloudType>::parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
{
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
return round(injectorCells_.size()*(time1 - time0)*nParcelsPerSecond_);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar
|
||||
Foam::ReactingMultiphaseLookupTableInjection<CloudType>::volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const
|
||||
{
|
||||
scalar volume = 0.0;
|
||||
if ((time0 >= 0.0) && (time0 < duration_))
|
||||
{
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
volume += injectors_[i].mDot()/injectors_[i].rho()*(time1 - time0);
|
||||
}
|
||||
}
|
||||
|
||||
return volume;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ReactingMultiphaseLookupTableInjection<CloudType>::
|
||||
ReactingMultiphaseLookupTableInjection
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
)
|
||||
:
|
||||
InjectionModel<CloudType>(dict, owner, typeName),
|
||||
inputFileName_(this->coeffDict().lookup("inputFile")),
|
||||
duration_(readScalar(this->coeffDict().lookup("duration"))),
|
||||
nParcelsPerSecond_
|
||||
(
|
||||
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
|
||||
),
|
||||
injectors_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
inputFileName_,
|
||||
owner.db().time().constant(),
|
||||
owner.db(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
injectorCells_(0)
|
||||
{
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], injectors_[i].x());
|
||||
}
|
||||
|
||||
// Determine volume of particles to inject
|
||||
this->volumeTotal_ = 0.0;
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->volumeTotal_ += injectors_[i].mDot()/injectors_[i].rho();
|
||||
}
|
||||
this->volumeTotal_ *= duration_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::ReactingMultiphaseLookupTableInjection<CloudType>::
|
||||
~ReactingMultiphaseLookupTableInjection()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::ReactingMultiphaseLookupTableInjection<CloudType>::active() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar
|
||||
Foam::ReactingMultiphaseLookupTableInjection<CloudType>::timeEnd() const
|
||||
{
|
||||
return this->SOI_ + duration_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingMultiphaseLookupTableInjection<CloudType>::setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
)
|
||||
{
|
||||
label injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
|
||||
position = injectors_[injectorI].x();
|
||||
cellOwner = injectorCells_[injectorI];
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingMultiphaseLookupTableInjection<CloudType>::setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar,
|
||||
typename CloudType::parcelType& parcel
|
||||
)
|
||||
{
|
||||
label injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
|
||||
// set particle velocity
|
||||
parcel.U() = injectors_[injectorI].U();
|
||||
|
||||
// set particle diameter
|
||||
parcel.d() = injectors_[injectorI].d();
|
||||
|
||||
// set particle density
|
||||
parcel.rho() = injectors_[injectorI].rho();
|
||||
|
||||
// set particle temperature
|
||||
parcel.T() = injectors_[injectorI].T();
|
||||
|
||||
// set particle specific heat capacity
|
||||
parcel.cp() = injectors_[injectorI].cp();
|
||||
|
||||
// set particle component mass fractions
|
||||
parcel.Y() = injectors_[injectorI].Y();
|
||||
|
||||
// set particle gaseous component mass fractions
|
||||
parcel.YGas() = injectors_[injectorI].YGas();
|
||||
|
||||
// set particle liquid component mass fractions
|
||||
parcel.YLiquid() = injectors_[injectorI].YLiquid();
|
||||
|
||||
// set particle solid component mass fractions
|
||||
parcel.YSolid() = injectors_[injectorI].YSolid();
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool
|
||||
Foam::ReactingMultiphaseLookupTableInjection<CloudType>::fullyDescribed() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::ReactingMultiphaseLookupTableInjection<CloudType>::validInjection
|
||||
(
|
||||
const label
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,187 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2008-2009 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::ReactingMultiphaseLookupTableInjection
|
||||
|
||||
Description
|
||||
Particle injection sources read from look-up table. Each row corresponds to
|
||||
an injection site.
|
||||
|
||||
(
|
||||
(x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
|
||||
(x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
|
||||
...
|
||||
(x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
|
||||
);
|
||||
|
||||
where:
|
||||
x, y, z = global cartesian co-ordinates [m]
|
||||
u, v, w = global cartesian velocity components [m/s]
|
||||
d = diameter [m]
|
||||
rho = density [kg/m3]
|
||||
mDot = mass flow rate [kg/m3]
|
||||
T = temperature [K]
|
||||
cp = specific heat capacity [J/kg/K]
|
||||
Y(3) = total mass fraction of gas (Y0), liquid (Y1), solid (Y3)
|
||||
Yg(Ngas) = mass fractions of gaseous components
|
||||
Yl(Nliq) = mass fractions of liquid components
|
||||
Ys(Nsld) = mass fractions of solid components
|
||||
|
||||
SourceFiles
|
||||
ReactingMultiphaseLookupTableInjection.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef ReactingMultiphaseLookupTableInjection_H
|
||||
#define ReactingMultiphaseLookupTableInjection_H
|
||||
|
||||
#include "InjectionModel.H"
|
||||
#include "reactingMultiphaseParcelInjectionDataIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ReactingMultiphaseLookupTableInjection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class ReactingMultiphaseLookupTableInjection
|
||||
:
|
||||
public InjectionModel<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of file containing injector/parcel data
|
||||
const word inputFileName_;
|
||||
|
||||
//- Injection duration - common to all injection sources
|
||||
const scalar duration_;
|
||||
|
||||
//- Number of parcels per injector - common to all injection sources
|
||||
const label nParcelsPerSecond_;
|
||||
|
||||
//- List of injectors
|
||||
reactingMultiphaseParcelInjectionDataIOList injectors_;
|
||||
|
||||
//- List of injector cells per injector
|
||||
List<label> injectorCells_;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Protected member functions
|
||||
|
||||
//- Number of parcels to introduce over the time step relative to SOI
|
||||
label parcelsToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
|
||||
//- Volume of parcels to introduce over the time step relative to SOI
|
||||
scalar volumeToInject
|
||||
(
|
||||
const scalar time0,
|
||||
const scalar time1
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("ReactingMultiphaseLookupTableInjection");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
ReactingMultiphaseLookupTableInjection
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ReactingMultiphaseLookupTableInjection();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
||||
// Injection geometry
|
||||
|
||||
//- Set the injection position and owner cell
|
||||
virtual void setPositionAndCell
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
vector& position,
|
||||
label& cellOwner
|
||||
);
|
||||
|
||||
//- Set the parcel properties
|
||||
virtual void setProperties
|
||||
(
|
||||
const label parcelI,
|
||||
const label nParcels,
|
||||
const scalar time,
|
||||
typename CloudType::parcelType& parcel
|
||||
);
|
||||
|
||||
//- Flag to identify whether model fully describes the parcel
|
||||
virtual bool fullyDescribed() const;
|
||||
|
||||
//- Return flag to identify whether or not injection of parcelI is
|
||||
// permitted
|
||||
virtual bool validInjection(const label parcelI);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "ReactingMultiphaseLookupTableInjection.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "reactingMultiphaseParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(reactingMultiphaseParcelInjectionData, 0);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::reactingMultiphaseParcelInjectionData::
|
||||
reactingMultiphaseParcelInjectionData()
|
||||
:
|
||||
reactingParcelInjectionData(),
|
||||
YGas_(),
|
||||
YLiquid_(),
|
||||
YSolid_()
|
||||
{}
|
||||
|
||||
|
||||
Foam::reactingMultiphaseParcelInjectionData::
|
||||
reactingMultiphaseParcelInjectionData
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
reactingParcelInjectionData(dict),
|
||||
YGas_(dict.lookup("YGas")),
|
||||
YLiquid_(dict.lookup("YLiquid")),
|
||||
YSolid_(dict.lookup("YSolid"))
|
||||
{}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::reactingMultiphaseParcelInjectionData::
|
||||
~reactingMultiphaseParcelInjectionData()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,198 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::reactingMultiphaseParcelInjectionData
|
||||
|
||||
Description
|
||||
Container class to provide injection data for reacting multiphase parcels
|
||||
|
||||
SourceFiles
|
||||
reactingMultiphaseParcelInjectionData.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef reactingMultiphaseParcelInjectionData_H
|
||||
#define reactingMultiphaseParcelInjectionData_H
|
||||
|
||||
#include "reactingParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class reactingMultiphaseParcelInjectionData;
|
||||
|
||||
// Forward declaration of friend functions
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const reactingMultiphaseParcelInjectionData&
|
||||
);
|
||||
|
||||
Istream& operator>>
|
||||
(
|
||||
Istream&,
|
||||
reactingMultiphaseParcelInjectionData&
|
||||
);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class reactingMultiphaseParcelInjectionData Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class reactingMultiphaseParcelInjectionData
|
||||
:
|
||||
public reactingParcelInjectionData
|
||||
{
|
||||
protected:
|
||||
|
||||
// Parcel properties
|
||||
|
||||
//- List of gaseous mass fractions
|
||||
scalarList YGas_;
|
||||
|
||||
//- List of liquid mass fractions
|
||||
scalarList YLiquid_;
|
||||
|
||||
//- List of solid mass fractions
|
||||
scalarList YSolid_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("reactingMultiphaseParcelInjectionData");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Null constructor
|
||||
reactingMultiphaseParcelInjectionData();
|
||||
|
||||
//- Construct from dictionary
|
||||
reactingMultiphaseParcelInjectionData(const dictionary& dict);
|
||||
|
||||
//- Construct from Istream
|
||||
reactingMultiphaseParcelInjectionData(Istream& is);
|
||||
|
||||
|
||||
//-Destructor
|
||||
virtual ~reactingMultiphaseParcelInjectionData();
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the list of gaseous mass fractions
|
||||
inline const scalarList& YGas() const;
|
||||
|
||||
//- Return const access to the list of liquid mass fractions
|
||||
inline const scalarList& YLiquid() const;
|
||||
|
||||
//- Return const access to the list of solid mass fractions
|
||||
inline const scalarList& YSolid() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
//- Return access to the gaseous mass fractions
|
||||
inline scalarList& YGas();
|
||||
|
||||
//- Return access to the liquid mass fractions
|
||||
inline scalarList& YLiquid();
|
||||
|
||||
//- Return access to the solid mass fractions
|
||||
inline scalarList& YSolid();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
// Friend Operators
|
||||
|
||||
friend bool operator==
|
||||
(
|
||||
const reactingMultiphaseParcelInjectionData& a,
|
||||
const reactingMultiphaseParcelInjectionData& b
|
||||
)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"operator=="
|
||||
"("
|
||||
"const reactingMultiphaseParcelInjectionData&, "
|
||||
"const reactingMultiphaseParcelInjectionData&"
|
||||
")"
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
friend bool operator!=
|
||||
(
|
||||
const reactingMultiphaseParcelInjectionData& a,
|
||||
const reactingMultiphaseParcelInjectionData& b
|
||||
)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"operator=="
|
||||
"("
|
||||
"const reactingMultiphaseParcelInjectionData&, "
|
||||
"const reactingMultiphaseParcelInjectionData&"
|
||||
")"
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Ostream operator
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const reactingMultiphaseParcelInjectionData& data
|
||||
);
|
||||
|
||||
//- Istream operator
|
||||
friend Istream& operator>>
|
||||
(
|
||||
Istream& is,
|
||||
reactingMultiphaseParcelInjectionData& data
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "reactingMultiphaseParcelInjectionDataI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,70 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "reactingMultiphaseParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::scalarList&
|
||||
Foam::reactingMultiphaseParcelInjectionData::YGas() const
|
||||
{
|
||||
return YGas_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::scalarList&
|
||||
Foam::reactingMultiphaseParcelInjectionData::YLiquid() const
|
||||
{
|
||||
return YLiquid_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::scalarList&
|
||||
Foam::reactingMultiphaseParcelInjectionData::YSolid() const
|
||||
{
|
||||
return YSolid_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalarList& Foam::reactingMultiphaseParcelInjectionData::YGas()
|
||||
{
|
||||
return YGas_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalarList& Foam::reactingMultiphaseParcelInjectionData::YLiquid()
|
||||
{
|
||||
return YLiquid_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalarList& Foam::reactingMultiphaseParcelInjectionData::YSolid()
|
||||
{
|
||||
return YSolid_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,88 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "reactingMultiphaseParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::reactingMultiphaseParcelInjectionData::
|
||||
reactingMultiphaseParcelInjectionData(Istream& is)
|
||||
:
|
||||
reactingParcelInjectionData(is)
|
||||
{
|
||||
is.check("reading YGas's");
|
||||
is >> YGas_;
|
||||
|
||||
is.check("reading YLiquid's");
|
||||
is >> YLiquid_;
|
||||
|
||||
is.check("reading YSolid's");
|
||||
is >> YSolid_;
|
||||
|
||||
is.check("reactingMultiphaseParcelInjectionData(Istream& is)");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const reactingMultiphaseParcelInjectionData& data
|
||||
)
|
||||
{
|
||||
os << static_cast<const reactingParcelInjectionData&>(data);
|
||||
|
||||
os << data.YGas_ << data.YLiquid_ << data.YSolid_;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
Foam::Istream& Foam::operator>>
|
||||
(
|
||||
Istream& is,
|
||||
reactingMultiphaseParcelInjectionData& data
|
||||
)
|
||||
{
|
||||
is >> static_cast<reactingParcelInjectionData&>(data);
|
||||
|
||||
is.check("reading YGas's");
|
||||
is >> data.YGas_;
|
||||
|
||||
is.check("reading YLiquid's");
|
||||
is >> data.YLiquid_;
|
||||
|
||||
is.check("reading YSolid's");
|
||||
is >> data.YSolid_;
|
||||
|
||||
is.check("operator(Istream&, reactingMultiphaseParcelInjectionData&)");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "reactingMultiphaseParcelInjectionDataIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTemplateTypeNameAndDebug(IOList<reactingMultiphaseParcelInjectionData>, 0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
reactingMultiphaseParcelInjectionDataIOList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef reactingMultiphaseParcelInjectionDataIOList_H
|
||||
#define reactingMultiphaseParcelInjectionDataIOList_H
|
||||
|
||||
#include "IOList.H"
|
||||
#include "reactingMultiphaseParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef IOList<reactingMultiphaseParcelInjectionData>
|
||||
reactingMultiphaseParcelInjectionDataIOList;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -27,11 +27,6 @@ License
|
||||
#include "ThermoLookupTableInjection.H"
|
||||
#include "scalarIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::label Foam::ThermoLookupTableInjection<CloudType>::INPUT_FILE_COLS = 11;
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
@ -62,9 +57,9 @@ Foam::scalar Foam::ThermoLookupTableInjection<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,16 +83,7 @@ Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection
|
||||
(
|
||||
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
|
||||
),
|
||||
x_(0),
|
||||
U_(0),
|
||||
d_(0),
|
||||
rho_(0),
|
||||
mDot_(0),
|
||||
T_(0),
|
||||
cp_(0),
|
||||
injectorCells_(0)
|
||||
{
|
||||
scalarListIOList injectorData
|
||||
injectors_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -107,59 +93,21 @@ Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection
|
||||
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());
|
||||
T_.setSize(injectorData.size());
|
||||
cp_.setSize(injectorData.size());
|
||||
|
||||
// Populate lists
|
||||
forAll(injectorData, injectorI)
|
||||
{
|
||||
if (injectorData[injectorI].size() != INPUT_FILE_COLS)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"ThermoLookupTableInjection"
|
||||
"("
|
||||
"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 T cp"
|
||||
<< 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];
|
||||
T_[injectorI] = injectorData[injectorI][9];
|
||||
cp_[injectorI] = injectorData[injectorI][10];
|
||||
}
|
||||
|
||||
),
|
||||
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_[injectorI], 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_;
|
||||
}
|
||||
@ -200,7 +148,7 @@ void Foam::ThermoLookupTableInjection<CloudType>::setPositionAndCell
|
||||
{
|
||||
label injectorI = parcelI*injectorCells_.size()/nParcels;
|
||||
|
||||
position = x_[injectorI];
|
||||
position = injectors_[injectorI].x();
|
||||
cellOwner = injectorCells_[injectorI];
|
||||
}
|
||||
|
||||
@ -217,19 +165,19 @@ void Foam::ThermoLookupTableInjection<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();
|
||||
|
||||
// set particle temperature
|
||||
parcel.T() = T_[injectorI];
|
||||
parcel.T() = injectors_[injectorI].T();
|
||||
|
||||
// set particle specific heat capacity
|
||||
parcel.cp() = cp_[injectorI];
|
||||
parcel.cp() = injectors_[injectorI].cp();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,10 @@ Description
|
||||
an injection site.
|
||||
|
||||
(
|
||||
(x y z u v w d rho mDot T cp)
|
||||
(x y z) (u v w) d rho mDot T cp // injector 1
|
||||
(x y z) (u v w) d rho mDot T cp // injector 2
|
||||
...
|
||||
(x y z) (u v w) d rho mDot T cp // injector N
|
||||
);
|
||||
|
||||
where:
|
||||
@ -51,7 +54,7 @@ SourceFiles
|
||||
#define ThermoLookupTableInjection_H
|
||||
|
||||
#include "InjectionModel.H"
|
||||
#include "pdf.H"
|
||||
#include "kinematicParcelInjectionDataIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -78,33 +81,12 @@ class ThermoLookupTableInjection
|
||||
//- 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 parcel temperature flow per injector / [K]
|
||||
List<scalar> T_;
|
||||
|
||||
//- List of parcel specific heat capacity per injector / [J/kg/K]
|
||||
List<scalar> cp_;
|
||||
//- 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:
|
||||
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "thermoParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(thermoParcelInjectionData, 0);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::thermoParcelInjectionData::thermoParcelInjectionData()
|
||||
:
|
||||
kinematicParcelInjectionData(),
|
||||
T_(0.0),
|
||||
cp_(0.0)
|
||||
{}
|
||||
|
||||
|
||||
Foam::thermoParcelInjectionData::thermoParcelInjectionData
|
||||
(
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
kinematicParcelInjectionData(dict),
|
||||
T_(readScalar(dict.lookup("T"))),
|
||||
cp_(readScalar(dict.lookup("cp")))
|
||||
{}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::thermoParcelInjectionData::~thermoParcelInjectionData()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,189 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::thermoParcelInjectionData
|
||||
|
||||
Description
|
||||
Container class to provide injection data for thermodynamic parcels
|
||||
|
||||
SourceFiles
|
||||
thermoParcelInjectionData.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef thermoParcelInjectionData_H
|
||||
#define thermoParcelInjectionData_H
|
||||
|
||||
#include "kinematicParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of classes
|
||||
class thermoParcelInjectionData;
|
||||
|
||||
// Forward declaration of friend functions
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const thermoParcelInjectionData&
|
||||
);
|
||||
|
||||
Istream& operator>>
|
||||
(
|
||||
Istream&,
|
||||
thermoParcelInjectionData&
|
||||
);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class thermoParcelInjectionData Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class thermoParcelInjectionData
|
||||
:
|
||||
public kinematicParcelInjectionData
|
||||
{
|
||||
protected:
|
||||
|
||||
// Parcel properties
|
||||
|
||||
//- Temperature [K]
|
||||
scalar T_;
|
||||
|
||||
//- Specific heat capacity [J/kg/K]
|
||||
scalar cp_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("thermoParcelInjectionData");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Null constructor
|
||||
thermoParcelInjectionData();
|
||||
|
||||
//- Construct from dictionary
|
||||
thermoParcelInjectionData(const dictionary& dict);
|
||||
|
||||
//- Construct from Istream
|
||||
thermoParcelInjectionData(Istream& is);
|
||||
|
||||
|
||||
//-Destructor
|
||||
virtual ~thermoParcelInjectionData();
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the temperature
|
||||
inline scalar T() const;
|
||||
|
||||
//- Return const access to the specific heat capacity
|
||||
inline scalar cp() const;
|
||||
|
||||
|
||||
// Edit
|
||||
|
||||
//- Return access to the temperature
|
||||
inline scalar& T();
|
||||
|
||||
//- Return access to the specific heat capacity
|
||||
inline scalar& cp();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
// Friend Operators
|
||||
|
||||
friend bool operator==
|
||||
(
|
||||
const thermoParcelInjectionData& a,
|
||||
const thermoParcelInjectionData& b
|
||||
)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"operator=="
|
||||
"("
|
||||
"const thermoParcelInjectionData&, "
|
||||
"const thermoParcelInjectionData&"
|
||||
")"
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
friend bool operator!=
|
||||
(
|
||||
const thermoParcelInjectionData& a,
|
||||
const thermoParcelInjectionData& b
|
||||
)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"operator=="
|
||||
"("
|
||||
"const thermoParcelInjectionData&, "
|
||||
"const thermoParcelInjectionData&"
|
||||
")"
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Ostream operator
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const thermoParcelInjectionData& data
|
||||
);
|
||||
|
||||
//- Istream operator
|
||||
friend Istream& operator>>
|
||||
(
|
||||
Istream& is,
|
||||
thermoParcelInjectionData& data
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "thermoParcelInjectionDataI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,55 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "thermoParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::scalar Foam::thermoParcelInjectionData::T() const
|
||||
{
|
||||
return T_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::thermoParcelInjectionData::cp() const
|
||||
{
|
||||
return cp_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::thermoParcelInjectionData::T()
|
||||
{
|
||||
return T_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar& Foam::thermoParcelInjectionData::cp()
|
||||
{
|
||||
return cp_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,77 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "thermoParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::thermoParcelInjectionData::thermoParcelInjectionData(Istream& is)
|
||||
:
|
||||
kinematicParcelInjectionData(is)
|
||||
{
|
||||
is.check("reading T");
|
||||
is >> T_;
|
||||
|
||||
is.check("reading cp");
|
||||
is >> cp_;
|
||||
|
||||
is.check("thermoParcelInjectionData(Istream& is)");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const thermoParcelInjectionData& data
|
||||
)
|
||||
{
|
||||
os << static_cast<const kinematicParcelInjectionData&>(data);
|
||||
|
||||
os << data.T_ << data.cp_;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
Foam::Istream& Foam::operator>>(Istream& is, thermoParcelInjectionData& data)
|
||||
{
|
||||
is >> static_cast<kinematicParcelInjectionData&>(data);
|
||||
|
||||
is.check("reading T");
|
||||
is >> data.T_;
|
||||
|
||||
is.check("reading cp");
|
||||
is >> data.cp_;
|
||||
|
||||
is.check("operator(Istream&, thermoParcelInjectionData&)");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "thermoParcelInjectionDataIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTemplateTypeNameAndDebug(IOList<thermoParcelInjectionData>, 0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
thermoParcelInjectionDataIOList.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef thermoParcelInjectionDataIOList_H
|
||||
#define thermoParcelInjectionDataIOList_H
|
||||
|
||||
#include "IOList.H"
|
||||
#include "thermoParcelInjectionData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
typedef IOList<thermoParcelInjectionData>
|
||||
thermoParcelInjectionDataIOList;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user