Commit 25575df6 authored by sergio's avatar sergio Committed by Andrew Heather
Browse files

ENH: new ReactingHeterogeneousCloud

- number of particles per parcel info to kinematic cloud

- added turbulent dispersion to basicHeterogeneousReactingParcel

- corrected dhsTrans in MUCSheterogeneousRate::calculate

- added cloud macro system to reactingParcelFoam and fixed calculation
  of average particles per parcel

- added progress variable dimension to reacting model (nF)

- added ReactingHeterogeneous tutorial
parent 912009c4
Info<< "\nConstructing reacting cloud" << endl;
basicReactingMultiphaseCloud parcels
basicReactingTypeCloud parcels
(
"reactingCloud1",
rho,
......
reactingHeterogenousParcelFoam.C
EXE = $(FOAM_APPBIN)/reactingHeterogenousParcelFoam
EXE_INC = \
-I. \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I${LIB_SRC}/sampling/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(FOAM_SOLVERS)/combustion/reactingFoam
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lsampling \
-lmeshTools \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lregionModels \
-lradiationModels \
-lsurfaceFilmModels \
-lsurfaceFilmDerivedFvPatchFields \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lODE \
-lcombustionModels
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018-2019 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/>.
Application
reactingHeterogenousParcelFoam
Group
grpLagrangianSolvers
Description
Transient solver for the coupled transport of a single kinematic particle
cloud including the effect of the volume fraction of particles on the
continuous phase. Multi-Phase Particle In Cell (MPPIC) modeling is used to
represent collisions without resolving particle-particle interactions.
\*---------------------------------------------------------------------------*/
#define CLOUD_BASE_TYPE HeterogeneousReacting
#define CLOUD_BASE_TYPE_NAME "HeterogeneousReacting"
#include "reactingParcelFoam.C"
// ************************************************************************* //
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
......@@ -37,7 +37,7 @@ Description
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "basicReactingMultiphaseCloud.H"
#include "surfaceFilmModel.H"
#include "rhoReactionThermo.H"
#include "CombustionModel.H"
......@@ -48,6 +48,15 @@ Description
#include "pressureControl.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
#include "cloudMacros.H"
#ifndef CLOUD_BASE_TYPE
#define CLOUD_BASE_TYPE ReactingMultiphase
#define CLOUD_BASE_TYPE_NAME "reacting"
#endif
#include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
#define basicReactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
......@@ -91,20 +91,14 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::COxidationDiffusionLimitedRate<CloudType>::
~COxidationDiffusionLimitedRate()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
......@@ -50,7 +50,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Forward class declarations
// Forward declarations
template<class CloudType>
class COxidationDiffusionLimitedRate;
......@@ -130,7 +130,7 @@ public:
//- Destructor
virtual ~COxidationDiffusionLimitedRate();
virtual ~COxidationDiffusionLimitedRate() = default;
// Member Functions
......@@ -139,6 +139,8 @@ public:
virtual scalar calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2016 OpenFOAM Foundation
......@@ -91,19 +91,14 @@ Foam::COxidationHurtMitchell<CloudType>::COxidationHurtMitchell
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::COxidationHurtMitchell<CloudType>::~COxidationHurtMitchell()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
Foam::scalar Foam::COxidationHurtMitchell<CloudType>::calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2012-2016 OpenFOAM Foundation
......@@ -73,9 +73,9 @@ class COxidationHurtMitchell
:
public SurfaceReactionModel<CloudType>
{
// Private data
// Private Data
// Model constants
// Model Constants
//- Stoichiometry of reaction
const scalar Sb_;
......@@ -143,7 +143,7 @@ public:
//- Destructor
virtual ~COxidationHurtMitchell();
virtual ~COxidationHurtMitchell() = default;
// Member Functions
......@@ -152,6 +152,8 @@ public:
virtual scalar calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2016 OpenFOAM Foundation
......@@ -103,20 +103,14 @@ Foam::COxidationIntrinsicRate<CloudType>::COxidationIntrinsicRate
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::COxidationIntrinsicRate<CloudType>::
~COxidationIntrinsicRate()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
Foam::scalar Foam::COxidationIntrinsicRate<CloudType>::calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2014-2016 OpenFOAM Foundation
......@@ -63,9 +63,9 @@ class COxidationIntrinsicRate
:
public SurfaceReactionModel<CloudType>
{
// Private data
// Private Data
// Model constants
// Model Constants
//- Stoichiometry of reaction []
const scalar Sb_;
......@@ -148,7 +148,7 @@ public:
//- Destructor
virtual ~COxidationIntrinsicRate();
virtual ~COxidationIntrinsicRate() = default;
// Member Functions
......@@ -157,6 +157,8 @@ public:
virtual scalar calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
......@@ -88,20 +88,14 @@ COxidationKineticDiffusionLimitedRate
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::COxidationKineticDiffusionLimitedRate<CloudType>::
~COxidationKineticDiffusionLimitedRate()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
......@@ -135,7 +135,7 @@ public:
//- Destructor
virtual ~COxidationKineticDiffusionLimitedRate();
virtual ~COxidationKineticDiffusionLimitedRate() = default;
// Member Functions
......@@ -144,6 +144,8 @@ public:
virtual scalar calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
......@@ -103,19 +103,14 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::COxidationMurphyShaddix<CloudType>::~COxidationMurphyShaddix()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
......@@ -156,7 +156,7 @@ public:
//- Destructor
virtual ~COxidationMurphyShaddix();
virtual ~COxidationMurphyShaddix() = default;
// Member Functions
......@@ -165,6 +165,8 @@ public:
virtual scalar calculate
(
const scalar dt,
const scalar Re,
const scalar nu,
const label celli,
const scalar d,
const scalar T,
......
......@@ -12,6 +12,7 @@ $(BASECLOUDS)/kinematicCloud/kinematicCloud.C
$(BASECLOUDS)/thermoCloud/thermoCloud.C
$(BASECLOUDS)/reactingCloud/reactingCloud.C
$(BASECLOUDS)/reactingMultiphaseCloud/reactingMultiphaseCloud.C
$(BASECLOUDS)/reactingHeterogeneousCloud/reactingHeterogeneousCloud.C
/* kinematic parcel sub-models */
......@@ -44,6 +45,12 @@ $(REACTINGMPPARCEL)/defineBasicReactingMultiphaseParcel.C
$(REACTINGMPPARCEL)/makeBasicReactingMultiphaseParcelSubmodels.C
/* heterogeous reacting parcel sub-models */
REACTINGHETERMPPARCEL=$(DERIVEDPARCELS)/basicHeterogeneousReactingParcel
$(REACTINGHETERMPPARCEL)/defineBasicHeterogeneousReactingParcel.C
$(REACTINGHETERMPPARCEL)/makeBasicHeterogeneousReactingParcelSubmodels.C
/* kinematic MPPIC parcel sub-models */
KINEMATICMPPICPARCEL=$(DERIVEDPARCELS)/basicKinematicMPPICParcel
$(KINEMATICMPPICPARCEL)/defineBasicKinematicMPPICParcel.C
......
......@@ -757,23 +757,29 @@ void Foam::KinematicCloud<CloudType>::autoMap(const mapPolyMesh& mapper)
template<class CloudType>
void Foam::KinematicCloud<CloudType>::info()
{
vector linearMomentum = linearMomentumOfSystem();
reduce(linearMomentum, sumOp<vector>());
const vector linearMomentum =
returnReduce(linearMomentumOfSystem(), sumOp<vector>());
scalar linearKineticEnergy = linearKineticEnergyOfSystem();
reduce(linearKineticEnergy, sumOp<scalar>());
const scalar linearKineticEnergy =
returnReduce(linearKineticEnergyOfSystem(), sumOp<scalar>());
const label nTotParcel = returnReduce(this->size(), sumOp<label>());
const scalar particlePerParcel =
(
nTotParcel
? (returnReduce(totalParticlePerParcel(), sumOp<scalar>()) / nTotParcel)
: 0
);
Info<< "Cloud: " << this->name() << nl
<< " Current number of parcels = "
<< returnReduce(this->size(), sumOp<label>()) << nl
<< " Current number of parcels = " << nTotParcel << nl
<< " Current mass in system = "
<< returnReduce(massInSystem(), sumOp<scalar>()) << nl
<< " Linear momentum = "
<< linearMomentum << nl
<< " |Linear momentum| = "
<< mag(linearMomentum) << nl
<< " Linear kinetic energy = "
<< linearKineticEnergy << nl;
<< " Linear momentum = " << linearMomentum << nl
<< " |Linear momentum| = " << mag(linearMomentum) << nl
<< " Linear kinetic energy = " << linearKineticEnergy << nl
<< " Average particle per parcel = " << particlePerParcel << nl;
injectors_.info(Info);
this->surfaceFilm().info(Info);
......
......@@ -502,6 +502,9 @@ public:
//- Total linear momentum of the system
inline vector linearMomentumOfSystem() const;
//- Average particle per parcel
inline scalar totalParticlePerParcel() const;
//- Total linear kinetic energy in the system
inline scalar linearKineticEnergyOfSystem() const;
......
......@@ -297,11 +297,26 @@ Foam::KinematicCloud<CloudType>::linearMomentumOfSystem() const
}
template<class CloudType>
inline Foam::scalar
Foam::KinematicCloud<CloudType>::totalParticlePerParcel() const
{
scalar parPerParcel = 0;
for (const parcelType& p : *this)
{
parPerParcel += p.nParticle();
}
return parPerParcel;
}
template<class CloudType>
inline Foam::scalar
Foam::KinematicCloud<CloudType>::linearKineticEnergyOfSystem() const
{
scalar linearKineticEnergy = 0.0;
scalar linearKineticEnergy = 0;
for (const parcelType& p : *this)
{
......