diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H index b7fc9f09..172edbdb 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/YEqn.H @@ -17,10 +17,10 @@ tmp > mvConvection forAll(Y, i) { - if (Y[i].name() != inertSpecie) + if (Y[i].name() != inertSpecie || ignoreInertSpecie) { volScalarField& Yi = Y[i]; - + fvScalarMatrix YiEqn ( fvm::ddt(rhoeps, Yi) @@ -52,6 +52,17 @@ tmp > mvConvection // calculate total mole in Volume N = rho/W; - Y[inertIndex] = scalar(1) - Yt; - Y[inertIndex].max(0.0); + if (ignoreInertSpecie) + { + forAll(Y,i) + { + volScalarField& Yi = Y[i]; + Yi = Yi/Yt; + } + } + else + { + Y[inertIndex] = scalar(1) - Yt; + Y[inertIndex].max(0.0); + } } diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C b/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C index 1ae2610a..99276071 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C +++ b/applications/solvers/cfdemSolverRhoPimpleChem/cfdemSolverRhoPimpleChem.C @@ -119,7 +119,8 @@ int main(int argc, char *argv[]) { #include "rhoEqn.H" } - volScalarField rhoeps("rhoeps",rho*voidfraction); + + rhoeps = rho * voidfraction; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { @@ -133,7 +134,7 @@ int main(int argc, char *argv[]) #include "pEqn.H" rhoeps=rho*voidfraction; } - + if (pimple.turbCorr()) { turbulence->correct(); diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H b/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H index 159ec480..c96573bf 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/createFields.H @@ -20,6 +20,8 @@ // read molecular weight volScalarField W(composition.W()); + bool ignoreInertSpecie = true; + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) @@ -98,6 +100,19 @@ ), mesh ); + + volScalarField rhoeps + ( + IOobject + ( + "rhoeps", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + rho*voidfraction + ); Info<< "\nCreating fluid-particle heat flux field\n" << endl; volScalarField Qsource diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/pEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/pEqn.H index 38e5473d..49f2e399 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/pEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/pEqn.H @@ -48,8 +48,8 @@ else + fvc::div(phi) - fvm::laplacian(rhorAUf, p) == - // particleCloud.chemistryM(0).Sm() - fvOptions(psi, p, rho.name()) + particleCloud.chemistryM(0).Sm() + + fvOptions(psi, p, rho.name()) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/rhoEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/rhoEqn.H index 52663636..7e2fc356 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/rhoEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/rhoEqn.H @@ -4,8 +4,8 @@ fvm::ddt(voidfraction,rho) + fvc::div(phi) == -// particleCloud.chemistryM(0).Sm() - fvOptions(rho) + particleCloud.chemistryM(0).Sm() + + fvOptions(rho) ); fvOptions.constrain(rhoEqn); diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/noChemistry/noChemistry.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/noChemistry/noChemistry.C index 5580e3c4..72ebcb35 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/noChemistry/noChemistry.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/noChemistry/noChemistry.C @@ -59,84 +59,50 @@ noChemistry::~noChemistry() void noChemistry::execute() {} -void noChemistry::tryout(const label i) -{ - mi_.set - ( - i, - new volScalarField - ( - IOobject - ( - "empty1", - particleCloud_.mesh().time().timeName(), - particleCloud_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - particleCloud_.mesh(), - dimensionedScalar("zero",dimless,0.0) - ) - ); -} tmp noChemistry ::Smi(const label i) const { - return tmp (mi_[i]); -} - - /* tmp mi_[i] + tmp smi ( new volScalarField ( IOobject ( - "empty1", + "dummy", particleCloud_.mesh().time().timeName(), particleCloud_.mesh(), IOobject::NO_READ, IOobject::NO_WRITE - ), - particleCloud_.mesh(), - dimensionedScalar - ( - "zero", - dimMass/dimTime,//dimensionSet(0,2,-1,0,0,0,0), - 0.0 - ) - ) + ), + particleCloud_.mesh(), + dimensionedScalar("zero",dimMass/(dimVol*dimTime),0.0) + ) ); - return mi_[i]; -}*/ + return smi; +} tmp noChemistry::Sm() const { - tmp sm_ + tmp sm ( new volScalarField ( IOobject ( - "empty2", + "dummy", particleCloud_.mesh().time().timeName(), particleCloud_.mesh(), IOobject::NO_READ, IOobject::NO_WRITE - ), - particleCloud_.mesh(), - dimensionedScalar("zero",dimless,0.0) + ), + particleCloud_.mesh(), + dimensionedScalar("zero",dimMass/(dimVol*dimTime), 0.0) ) ); - return sm_; + return sm; } - - -/*tmp noChemistry::Smi(const label i) const -tmp noChemistry::Sm() const*/ - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/noChemistry/noChemistry.H b/src/lagrangian/cfdemParticle/subModels/chemistryModel/noChemistry/noChemistry.H index 6a98eaa5..861ad90e 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/noChemistry/noChemistry.H +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/noChemistry/noChemistry.H @@ -41,9 +41,6 @@ class noChemistry : public chemistryModel { -private: - PtrList mi_; - public: //- Runtime type information @@ -68,12 +65,6 @@ public: void execute(); -// tmp Smi(const label i) const; - -// tmp Sm() const; - - virtual void tryout(const label i); - tmp Smi(const label i) const; tmp Sm() const; diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C index 905f95dd..58e0b8a3 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C @@ -101,7 +101,7 @@ species::species N_(sm.mesh().lookupObject(totalMoleFieldName_)), partMoleName_(propsDict_.lookup("partMoleName")), partN_(NULL), - loopCounter_(0), + loopCounter_(-1), Nevery_(propsDict_.lookupOrDefault