diff --git a/src/lagrangian/coalCombustion/Make/files b/src/lagrangian/coalCombustion/Make/files index 019781420d..f3d07eaa1f 100644 --- a/src/lagrangian/coalCombustion/Make/files +++ b/src/lagrangian/coalCombustion/Make/files @@ -1,4 +1,5 @@ /* Coal parcel and sub-models */ coalParcel/makeCoalParcelSubmodels.C +coalCloudList/coalCloudList.C LIB = $(FOAM_LIBBIN)/libcoalCombustion diff --git a/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.C b/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.C new file mode 100644 index 0000000000..548e81d216 --- /dev/null +++ b/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.C @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#include "coalCloudList.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::coalCloudList::coalCloudList +( + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + const SLGThermo& slgThermo +) +: + PtrList(), + mesh_(rho.mesh()) +{ + IOdictionary props + ( + IOobject + ( + "coalCloudList", + mesh_.time().constant(), + mesh_, + IOobject::MUST_READ + ) + ); + + const wordHashSet cloudNames(wordList(props.lookup("clouds"))); + + setSize(cloudNames.size()); + + label i = 0; + forAllConstIter(wordHashSet, cloudNames, iter) + { + const word& name = iter.key(); + + Info<< "creating cloud: " << name << endl; + + set + ( + i++, + new coalCloud + ( + name, + rho, + U, + g, + slgThermo + ) + ); + + Info<< endl; + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::coalCloudList::evolve() +{ + forAll(*this, i) + { + operator[](i).evolve(); + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.H b/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.H new file mode 100644 index 0000000000..1a023e27ba --- /dev/null +++ b/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.H @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef coalCloudList_H +#define coalCloudList_H + +#include "coalCloud.H" +#include "volFieldsFwd.H" +#include "fvMatricesFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class coalCloudList Declaration +\*---------------------------------------------------------------------------*/ + +class coalCloudList +: + public PtrList +{ +private: + + //- Reference to the mesh + const fvMesh& mesh_; + + +public: + + // Constructor + + coalCloudList + ( + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + const SLGThermo& slgThermo + ); + + + // Member Functions + + // Evolution + + //- Evolve the cloud collection + void evolve(); + + + // Source terms + + //- Return const reference to momentum source + inline tmp > UTrans() const; + + //- Return tmp momentum source term + inline tmp SU(volVectorField& U) const; + + //- Sensible enthalpy transfer [J/kg] + inline tmp > hsTrans() const; + + //- Return sensible enthalpy source term [J/kg/m3/s] + inline tmp Sh(volScalarField& hs) const; + + + //- Return mass source term for specie i - specie eqn + inline tmp SYi + ( + const label i, + volScalarField& Yi + ) const; + + //- Return total mass transfer [kg/m3] + inline tmp > rhoTrans() const; + + //- Return tmp total mass source for carrier phase + // - fully explicit + inline tmp > Srho() const; + + //- Return tmp total mass source for carrier phase specie i + // - fully explicit + inline tmp > Srho + ( + const label i + ) const; + + //- Return total mass source term [kg/m3/s] + inline tmp Srho(volScalarField& rho) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "coalCloudListI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalCloudList/coalCloudListI.H b/src/lagrangian/coalCombustion/coalCloudList/coalCloudListI.H new file mode 100644 index 0000000000..005d9ef604 --- /dev/null +++ b/src/lagrangian/coalCombustion/coalCloudList/coalCloudListI.H @@ -0,0 +1,262 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#include "fvMatrices.H" +#include "volFields.H" +#include "DimensionedField.H" + +Foam::tmp > +Foam::coalCloudList::UTrans() const +{ + tmp > tfld + ( + new DimensionedField + ( + IOobject + ( + "UTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedVector("zero", dimMass*dimVelocity, vector::zero) + ) + ); + + DimensionedField& fld = tfld(); + + forAll(*this, i) + { + fld += operator[](i).UTrans(); + } + + return tfld; +} + + +Foam::tmp Foam::coalCloudList::SU +( + volVectorField& U +) const +{ + tmp tfvm(new fvVectorMatrix(U, dimForce)); + fvVectorMatrix& fvm = tfvm(); + + forAll(*this, i) + { + fvm += operator[](i).SU(U); + } + + return tfvm; +} + + +Foam::tmp > +Foam::coalCloudList::hsTrans() const +{ + tmp > tfld + ( + new DimensionedField + ( + IOobject + ( + "hsTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimEnergy, 0.0) + ) + ); + + DimensionedField& fld = tfld(); + + forAll(*this, i) + { + fld += operator[](i).hsTrans(); + } + + return tfld; +} + + +Foam::tmp Foam::coalCloudList::Sh +( + volScalarField& hs +) const +{ + tmp tfvm(new fvScalarMatrix(hs, dimEnergy/dimTime)); + fvScalarMatrix& fvm = tfvm(); + + forAll(*this, i) + { + fvm += operator[](i).Sh(hs); + } + + return tfvm; +} + + +Foam::tmp Foam::coalCloudList::SYi +( + const label ii, + volScalarField& Yi +) const +{ + tmp tfvm(new fvScalarMatrix(Yi, dimMass/dimTime)); + fvScalarMatrix& fvm = tfvm(); + + forAll(*this, i) + { + fvm += operator[](i).SYi(ii, Yi); + } + + return tfvm; +} + + +Foam::tmp > +Foam::coalCloudList::rhoTrans() const +{ + tmp > tfld + ( + new DimensionedField + ( + IOobject + ( + "rhoTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimMass, 0.0) + ) + ); + + DimensionedField& fld = tfld(); + + forAll(*this, i) + { + forAll(operator[](i).rhoTrans(), j) + { + fld += operator[](i).rhoTrans()[j]; + } + } + + return tfld; +} + + + + +Foam::tmp > +Foam::coalCloudList::Srho() const +{ + tmp > tfld + ( + new DimensionedField + ( + IOobject + ( + "rhoTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimDensity/dimTime, 0.0) + ) + ); + + DimensionedField& fld = tfld(); + + forAll(*this, i) + { + fld += operator[](i).Srho(); + } + + return tfld; +} + + +Foam::tmp > +Foam::coalCloudList::Srho +( + const label i +) const +{ + tmp > tfld + ( + new DimensionedField + ( + IOobject + ( + "rhoTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimDensity/dimTime, 0.0) + ) + ); + + DimensionedField& fld = tfld(); + + forAll(*this, j) + { + fld += operator[](j).Srho(i); + } + + return tfld; +} + + +Foam::tmp Foam::coalCloudList::Srho +( + volScalarField& rho +) const +{ + tmp tfvm(new fvScalarMatrix(rho, dimMass/dimTime)); + fvScalarMatrix& fvm = tfvm(); + + forAll(*this, i) + { + fvm += operator[](i).Srho(rho); + } + + return tfvm; +} + + +// ************************************************************************* //