From e4545b8be90cf42862fd0c118b11b23d5052f1b9 Mon Sep 17 00:00:00 2001 From: tlichtenegger Date: Mon, 4 Sep 2017 15:16:20 +0200 Subject: [PATCH 1/3] More info for debugging YEqn. --- applications/solvers/cfdemSolverRhoPimpleChem/debugYEqn.H | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } } From be5b056d708d659e84463d629956cb60931b14fe Mon Sep 17 00:00:00 2001 From: tlichtenegger Date: Tue, 31 Oct 2017 13:32:42 +0100 Subject: [PATCH 2/3] Added functionality to communicate available gas volume per particle. --- .../solvers/cfdemSolverRhoPimpleChem/YEqn.H | 2 +- src/lagrangian/cfdemParticle/Make/files | 1 + .../reactantPerParticle/reactantPerParticle.C | 162 ++++++++++++++++++ .../reactantPerParticle/reactantPerParticle.H | 105 ++++++++++++ src/lagrangian/cfdemParticleComp/Make/files | 1 + 5 files changed, 270 insertions(+), 1 deletion(-) create mode 100644 src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.C create mode 100644 src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.H 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/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/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