ENH: Updated lagrangian/coalCombustion library re: local developments

This commit is contained in:
andy
2010-09-07 10:51:08 +01:00
parent 973be0cf7a
commit 0940cb6fb7
13 changed files with 97 additions and 244 deletions

View File

@ -1,5 +1,6 @@
/* Coal parcel and sub-models */
CoalParcel/defineCoalParcel.C
CoalParcel/makeCoalParcelSubmodels.C
coalParcel/coalParcel.C
coalParcel/defineCoalParcel.C
coalParcel/makeCoalParcelSubmodels.C
LIB = $(FOAM_LIBBIN)/libcoalCombustion

View File

@ -11,6 +11,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
@ -32,6 +33,7 @@ LIB_LIBS = \
-lsolids \
-lsolidMixture \
-lreactionThermophysicalModels \
-lSLGThermo \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lsurfaceFilmModels

View File

@ -25,29 +25,21 @@ Class
CoalCloud
Description
Coal cloud templated on the type of carrier phase thermodynamics
Coal cloud
\*---------------------------------------------------------------------------*/
#ifndef CoalCloud_H
#define CoalCloud_H
#ifndef coalCloud_H
#define coalCloud_H
#include "ReactingMultiphaseCloud.H"
#include "CoalParcel.H"
#include "thermoPhysicsTypes.H"
#include "coalParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef ReactingMultiphaseCloud<CoalParcel<constGasThermoPhysics> >
constThermoCoalCloud;
typedef ReactingMultiphaseCloud<CoalParcel<gasThermoPhysics> >
thermoCoalCloud;
typedef ReactingMultiphaseCloud<CoalParcel<icoPoly8ThermoPhysics> >
icoPoly8ThermoCoalCloud;
typedef ReactingMultiphaseCloud<coalParcel> coalCloud;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,26 +23,24 @@ License
\*---------------------------------------------------------------------------*/
#include "CoalParcel.H"
#include "coalParcel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::CoalParcel<ThermoType>::CoalParcel
Foam::coalParcel::coalParcel
(
ReactingMultiphaseCloud<CoalParcel<ThermoType> >& owner,
ReactingMultiphaseCloud<coalParcel>& owner,
const vector& position,
const label cellI
)
:
ReactingMultiphaseParcel<CoalParcel<ThermoType> >(owner, position, cellI)
ReactingMultiphaseParcel<coalParcel>(owner, position, cellI)
{}
template<class ThermoType>
Foam::CoalParcel<ThermoType>::CoalParcel
Foam::coalParcel::coalParcel
(
ReactingMultiphaseCloud<CoalParcel<ThermoType> >& owner,
ReactingMultiphaseCloud<coalParcel>& owner,
const vector& position,
const label cellI,
const label typeId,
@ -56,12 +54,10 @@ Foam::CoalParcel<ThermoType>::CoalParcel
const scalarField& YGas0,
const scalarField& YLiquid0,
const scalarField& YSolid0,
const typename
ReactingMultiphaseParcel<CoalParcel<ThermoType> >::
constantProperties& constProps
const ReactingMultiphaseParcel<coalParcel>::constantProperties& constProps
)
:
ReactingMultiphaseParcel<CoalParcel<ThermoType> >
ReactingMultiphaseParcel<coalParcel>
(
owner,
position,
@ -82,22 +78,27 @@ Foam::CoalParcel<ThermoType>::CoalParcel
{}
template<class ThermoType>
Foam::CoalParcel<ThermoType>::CoalParcel
Foam::coalParcel::coalParcel
(
const Cloud<CoalParcel<ThermoType> >& cloud,
const Cloud<coalParcel>& cloud,
Istream& is,
bool readFields
)
:
ReactingMultiphaseParcel<CoalParcel<ThermoType> >(cloud, is, readFields)
ReactingMultiphaseParcel<coalParcel>(cloud, is, readFields)
{}
Foam::coalParcel::coalParcel(const coalParcel& p)
:
ReactingMultiphaseParcel<coalParcel>(p)
{
}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //
template<class ThermoType>
Foam::CoalParcel<ThermoType>::~CoalParcel()
Foam::coalParcel::~coalParcel()
{}

View File

@ -22,19 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
CoalParcel
coalParcel
Description
Coal parcel class
SourceFiles
CoalParcel.C
CoalParcelIO.C
\*---------------------------------------------------------------------------*/
#ifndef CoalParcel_H
#define CoalParcel_H
#ifndef coalParcel_H
#define coalParcel_H
#include "ReactingMultiphaseParcel.H"
@ -43,42 +42,34 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
template<class ThermoType>
class CoalParcel;
/*---------------------------------------------------------------------------*\
Class CoalParcel Declaration
Class coalParcel Declaration
\*---------------------------------------------------------------------------*/
template<class ThermoType>
class CoalParcel
class coalParcel
:
public ReactingMultiphaseParcel<CoalParcel<ThermoType> >
public ReactingMultiphaseParcel<coalParcel>
{
public:
//- The type of thermodynamics this parcel was instantiated for
typedef ThermoType thermoType;
// Run-time type information
TypeName("CoalParcel");
TypeName("coalParcel");
// Constructors
//- Construct from owner, position, and cloud owner
// Other properties initialised as null
CoalParcel
coalParcel
(
ReactingMultiphaseCloud<CoalParcel>& owner,
ReactingMultiphaseCloud<coalParcel>& owner,
const vector& position,
const label cellI
);
//- Construct from components
CoalParcel
coalParcel
(
ReactingMultiphaseCloud<CoalParcel>& owner,
ReactingMultiphaseCloud<coalParcel>& owner,
const vector& position,
const label cellI,
const label typeId,
@ -92,28 +83,30 @@ public:
const scalarField& YGas0,
const scalarField& YLiquid0,
const scalarField& YSolid0,
const typename
ReactingMultiphaseParcel<CoalParcel>::
constantProperties& constProps
const ReactingMultiphaseParcel<coalParcel>::constantProperties&
constProps
);
//- Construct from Istream
CoalParcel
coalParcel
(
const Cloud<CoalParcel>& c,
const Cloud<coalParcel>& c,
Istream& is,
bool readFields = true
);
//- Construct as a copy
coalParcel(const coalParcel& p);
//- Construct and return a clone
autoPtr<CoalParcel> clone() const
autoPtr<coalParcel> clone() const
{
return autoPtr<CoalParcel>(new CoalParcel(*this));
return autoPtr<coalParcel>(new coalParcel(*this));
}
//- Destructor
virtual ~CoalParcel();
virtual ~coalParcel();
};
@ -123,12 +116,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "CoalParcel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -23,14 +23,14 @@ License
\*---------------------------------------------------------------------------*/
#include "createCoalParcelTypes.H"
#include "CoalParcel.H"
#include "createReactingMultiphaseParcelTypes.H"
#include "coalParcel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
createCoalParcelType(CoalParcel);
createReactingMultiphaseParcelTypes(coalParcel);
};

View File

@ -23,26 +23,26 @@ License
\*---------------------------------------------------------------------------*/
#include "CoalParcel.H"
#include "coalParcel.H"
// Kinematic
#include "makeReactingParcelDispersionModels.H"
#include "makeReactingParcelDragModels.H"
#include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeReactingParcelCollisionModels.H"
#include "makeReactingParcelPatchInteractionModels.H"
#include "makeReactingParcelPostProcessingModels.H"
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H"
// Thermodynamic
#include "makeReactingParcelHeatTransferModels.H"
#include "makeParcelHeatTransferModels.H"
// Reacting
#include "makeReactingMultiphaseParcelCompositionModels.H" // MP variant
#include "makeReactingParcelPhaseChangeModels.H"
#include "makeReactingParcelSurfaceFilmModels.H"
// Reacting multiphase
#include "makeReactingMultiphaseParcelDevolatilisationModels.H"
#include "makeReactingMultiphaseParcelSurfaceFilmModels.H"
// Coal specific
#include "makeCoalParcelSurfaceReactionModels.H"
@ -52,24 +52,24 @@ License
namespace Foam
{
// Kinematic sub-models
makeReactingDispersionModels(CoalParcel);
makeReactingDragModels(CoalParcel);
makeReactingMultiphaseInjectionModels(CoalParcel);
makeReactingCollisionModels(CoalParcel);
makeReactingPatchInteractionModels(CoalParcel);
makeReactingPostProcessingModels(CoalParcel);
makeParcelDispersionModels(coalParcel);
makeParcelDragModels(coalParcel);
makeReactingMultiphaseParcelInjectionModels(coalParcel);
makeParcelCollisionModels(coalParcel);
makeParcelPatchInteractionModels(coalParcel);
makeParcelPostProcessingModels(coalParcel);
// Thermo sub-models
makeReactingHeatTransferModels(CoalParcel);
makeParcelHeatTransferModels(coalParcel);
// Reacting sub-models
makeReactingMultiphaseCompositionModels(CoalParcel);
makeReactingPhaseChangeModels(CoalParcel);
makeReactingMultiphaseParcelCompositionModels(coalParcel);
makeReactingParcelPhaseChangeModels(coalParcel);
// Reacting multiphase sub-models
makeReactingMultiphaseDevolatilisationModels(CoalParcel);
makeReactingMultiphaseSurfaceFilmModels(CoalParcel);
makeCoalSurfaceReactionModels(CoalParcel);
makeReactingMultiphaseParcelDevolatilisationModels(coalParcel);
makeReactingParcelSurfaceFilmModels(coalParcel);
makeCoalParcelSurfaceReactionModels(coalParcel);
};

View File

@ -1,98 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef createCoalParcelTypes_H
#define createCoalParcelTypes_H
#include "thermoPhysicsTypes.H"
#include "CoalCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define createCoalParcelType(ParcelType) \
\
createCoalParcelThermoType \
( \
ParcelType, \
constGasThermoPhysics \
); \
createCoalParcelThermoType \
( \
ParcelType, \
gasThermoPhysics \
); \
createCoalParcelThermoType \
( \
ParcelType, \
icoPoly8ThermoPhysics \
);
#define createCoalParcelThermoType(ParcelType, ThermoType) \
\
typedef ParcelType<ThermoType> ParcelType##ThermoType; \
\
defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \
defineTemplateTypeNameAndDebug(Particle<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug(Cloud<ParcelType##ThermoType>, 0); \
\
defineParcelTypeNameAndDebug(KinematicParcel<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug \
( \
KinematicParcel<ParcelType##ThermoType>, \
0 \
); \
defineParcelTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \
defineParcelTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0);\
defineParcelTypeNameAndDebug \
( \
ReactingMultiphaseParcel<ParcelType##ThermoType>, \
0 \
); \
defineTemplateTypeNameAndDebug \
( \
ReactingMultiphaseParcel<ParcelType##ThermoType>, \
0 \
); \
defineParcelTypeNameAndDebug(CoalParcel<ParcelType##ThermoType>, 0); \
defineTemplateTypeNameAndDebug(CoalParcel<ParcelType##ThermoType>, 0); \
\
defineParcelTypeNameAndDebug(KinematicCloud<ParcelType##ThermoType>, 0); \
defineParcelTypeNameAndDebug(ThermoCloud<ParcelType##ThermoType>, 0); \
defineParcelTypeNameAndDebug(ReactingCloud<ParcelType##ThermoType>, 0); \
defineParcelTypeNameAndDebug \
( \
ReactingMultiphaseCloud<ParcelType##ThermoType>, \
0 \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -28,7 +28,6 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "thermoPhysicsTypes.H"
#include "ReactingMultiphaseCloud.H"
#include "NoSurfaceReaction.H"
@ -38,59 +37,33 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeCoalSurfaceReactionModels(ParcelType) \
#define makeCoalParcelSurfaceReactionModels(ParcelType) \
\
makeCoalSurfaceReactionModelThermoType \
( \
ParcelType, \
constGasThermoPhysics \
); \
makeCoalSurfaceReactionModelThermoType \
( \
ParcelType, \
gasThermoPhysics \
); \
makeCoalSurfaceReactionModelThermoType \
( \
ParcelType, \
icoPoly8ThermoPhysics \
);
#define makeCoalSurfaceReactionModelThermoType(ParcelType, ThermoType) \
makeSurfaceReactionModel(ReactingMultiphaseCloud<ParcelType>); \
\
makeSurfaceReactionModel \
( \
ReactingMultiphaseCloud<ParcelType<ThermoType> > \
); \
\
makeSurfaceReactionModelThermoType \
makeSurfaceReactionModelType \
( \
NoSurfaceReaction, \
ReactingMultiphaseCloud, \
ParcelType, \
ThermoType \
ParcelType \
); \
makeSurfaceReactionModelThermoType \
makeSurfaceReactionModelType \
( \
COxidationDiffusionLimitedRate, \
ReactingMultiphaseCloud, \
ParcelType, \
ThermoType \
ParcelType \
); \
makeSurfaceReactionModelThermoType \
makeSurfaceReactionModelType \
( \
COxidationKineticDiffusionLimitedRate, \
ReactingMultiphaseCloud, \
ParcelType, \
ThermoType \
ParcelType \
); \
makeSurfaceReactionModelThermoType \
makeSurfaceReactionModelType \
( \
COxidationMurphyShaddix, \
ReactingMultiphaseCloud, \
ParcelType, \
ThermoType \
ParcelType \
);

View File

@ -50,10 +50,10 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
CsLocalId_ = owner.composition().localId(idSolid, "C");
// Set local copies of thermo properties
WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_;
HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc();
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
if (Sb_ < 0)
{
@ -120,7 +120,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
}
// Local mass fraction of O2 in the carrier phase
const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
const scalar YO2 = this->owner().thermo().carrier().Y(O2GlobalId_)[cellI];
// Change in C mass [kg]
scalar dmC =

View File

@ -58,10 +58,10 @@ COxidationKineticDiffusionLimitedRate
CsLocalId_ = owner.composition().localId(idSolid, "C");
// Set local copies of thermo properties
WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_;
HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc();
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
if (Sb_ < 0)
{
@ -128,7 +128,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
}
// Local mass fraction of O2 in the carrier phase
const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
const scalar YO2 = this->owner().thermo().carrier().Y(O2GlobalId_)[cellI];
// Diffusion rate coefficient
const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);

View File

@ -69,8 +69,8 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
CsLocalId_ = owner.composition().localId(idSolid, "C");
// Set local copies of thermo properties
WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_;
}
@ -125,7 +125,7 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
// Cell carrier phase O2 species density [kg/m^3]
const scalar rhoO2 =
rhoc*this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
rhoc*this->owner().thermo().carrier().Y(O2GlobalId_)[cellI];
if (rhoO2 < SMALL)
{
@ -207,10 +207,8 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
const scalar HC =
this->owner().composition().solids().properties()[CsLocalId_].Hf()
+ this->owner().composition().solids().properties()[CsLocalId_].cp()*T;
const scalar HCO2 =
this->owner().mcCarrierThermo().speciesData()[CO2GlobalId_].H(T);
const scalar HO2 =
this->owner().mcCarrierThermo().speciesData()[O2GlobalId_].H(T);
const scalar HCO2 = this->owner().thermo().carrier().H(CO2GlobalId_, T);
const scalar HO2 = this->owner().thermo().carrier().H(O2GlobalId_, T);
// Heat of reaction
return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);

View File

@ -51,9 +51,6 @@ RADIATION=submodels/addOns/radiation
$(RADIATION)/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C
$(RADIATION)/scatter/cloudScatter/cloudScatter.C
SURFACEFILM=submodels/addOns/surfaceFilmModel
$(SURFACEFILM)/injection/cloudInjection/cloudInjection.C
submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionData.C
KINEMATICINJECTION=submodels/Kinematic/InjectionModel