diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H index e892eb48..b8af296d 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H @@ -42,7 +42,7 @@ tmp > mvConvection fvOptions.correct(Yi); - // #include "debugYEqn.H" + #include "debugYEqn.H" Yi.max(0.0); Yt += Yi; diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/debugYEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/debugYEqn.H index ea2c268c..2a475fd7 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/debugYEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/debugYEqn.H @@ -18,10 +18,10 @@ artMass[cellI] *=0.0; } } - Info << "\nartificial mass of " << Y[i].name() << " per time step: "<< fvc::domainIntegrate(artMass) << endl; + Info << "\nartificial mass of species " << Y[i].name() << " per time step: "<< fvc::domainIntegrate(artMass) << endl; if(lVCell > -1) { - Info << "lowest value of " << lowestValue << " at cell " << lVCell << "with coordinates" << endl; - Info << "\t" << mesh.C()[lVCell].component(0) << "\t" << mesh.C()[lVCell].component(1) << "\t" << mesh.C()[lVCell].component(2) << endl; + Pout << "lowest value of " << lowestValue << " at cell " << lVCell << " with coordinates" << endl; + Pout << "\t" << mesh.C()[lVCell].component(0) << "\t" << mesh.C()[lVCell].component(1) << "\t" << mesh.C()[lVCell].component(2) << endl; } } diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files index 48f76d0d..afe6512c 100644 --- a/src/lagrangian/cfdemParticle/Make/files +++ b/src/lagrangian/cfdemParticle/Make/files @@ -35,6 +35,7 @@ $(chemistryModels)/species/species.C $(chemistryModels)/noChemistry/noChemistry.C $(chemistryModels)/diffusionCoefficients/diffusionCoefficients.C $(chemistryModels)/massTransferCoeff/massTransferCoeff.C +$(chemistryModels)/reactantPerParticle/reactantPerParticle.C $(energyModels)/energyModel/energyModel.C $(energyModels)/energyModel/newEnergyModel.C diff --git a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C index 1f159643..d9201fcc 100644 --- a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C +++ b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.C @@ -229,6 +229,31 @@ void averagingModel::setScalarSum field.correctBoundaryConditions(); } +void averagingModel::setScalarSumCentre +( + volScalarField& field, + double**& value, + double**const& weight, + double**const& mask +) const +{ + label cellI; + scalar valueScal; + + for(int index=0; index< particleCloud_.numberOfParticles(); index++) + { + cellI = particleCloud_.cellIDs()[index][0]; + if (cellI >= 0) + { + valueScal = value[index][0]; + field[cellI] += valueScal; + } + } + + // correct cell values to patches + field.correctBoundaryConditions(); +} + void averagingModel::setDSauter ( volScalarField& dSauter, diff --git a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.H b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.H index df1e2c58..1f46300e 100644 --- a/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.H +++ b/src/lagrangian/cfdemParticle/subModels/averagingModel/averagingModel/averagingModel.H @@ -175,6 +175,14 @@ public: double**const& weight, double**const& mask ) const; + + void setScalarSumCentre + ( + volScalarField& field, + double**& value, + double**const& weight, + double**const& mask + ) const; void setDSauter ( diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.C new file mode 100644 index 00000000..57a58f44 --- /dev/null +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.C @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------*\ +License + + This 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. + + This code 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 this code. If not, see . + + Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria + M.Efe Kinaci, JKU Linz, Austria + +\*---------------------------------------------------------------------------*/ + +#include "error.H" +#include "reactantPerParticle.H" +#include "addToRunTimeSelectionTable.H" + +#include "dataExchangeModel.H" +#include "IFstream.H" + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(reactantPerParticle, 0); + +addToRunTimeSelectionTable +( + chemistryModel, + reactantPerParticle, + dictionary +); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// Construct from components +reactantPerParticle::reactantPerParticle +( + const dictionary& dict, + cfdemCloudEnergy& sm +) +: + chemistryModel(dict,sm), + propsDict_(dict.subDict(typeName + "Props")), + mesh_(sm.mesh()), + reactantPerParticle_(NULL), + voidfractionFieldName_(propsDict_.lookupOrDefault("voidfractionFieldName","voidfraction")), + voidfraction_(sm.mesh().lookupObject(voidfractionFieldName_)), + particlesPerCell_ + ( IOobject + ( + "particlesPerCell", + sm.mesh().time().timeName(), + sm.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + sm.mesh(), + dimensionedScalar("zero", dimensionSet(0,0,0,0,0), 0) + ), + loopCounter_(-1), + Nevery_(propsDict_.lookupOrDefault