diff --git a/.gitignore b/.gitignore index 1d1ae5ca..b4b35554 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,6 @@ log.* *~ **/linux*Gcc*/ +**/.vscode lnInclude diff --git a/applications/solvers/cfdemSolverMultiphase/Make/options b/applications/solvers/cfdemSolverMultiphase/Make/options index 78dc7582..0cfccaff 100644 --- a/applications/solvers/cfdemSolverMultiphase/Make/options +++ b/applications/solvers/cfdemSolverMultiphase/Make/options @@ -1,7 +1,7 @@ include $(CFDEM_ADD_LIBS_DIR)/additionalLibs EXE_INC = \ - -I$(CFDEM_OFVERSION_DIR) \ + -I$(CFDEM_OFVERSION_DIR) \ -ImultiphaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ diff --git a/applications/solvers/cfdemSolverMultiphase/UEqn.H b/applications/solvers/cfdemSolverMultiphase/UEqn.H index 86d12e50..ace635f5 100644 --- a/applications/solvers/cfdemSolverMultiphase/UEqn.H +++ b/applications/solvers/cfdemSolverMultiphase/UEqn.H @@ -37,9 +37,9 @@ if (pimple.momentumPredictor() && (modelType=="B" || modelType=="Bfull")) ) * voidfraction + Ksl*Us ); - + fvOptions.correct(U); -} +} else if (pimple.momentumPredictor()) { solve diff --git a/applications/solvers/cfdemSolverMultiphase/cfdemSolverMultiphase.C b/applications/solvers/cfdemSolverMultiphase/cfdemSolverMultiphase.C index c37c3fcb..42e514da 100644 --- a/applications/solvers/cfdemSolverMultiphase/cfdemSolverMultiphase.C +++ b/applications/solvers/cfdemSolverMultiphase/cfdemSolverMultiphase.C @@ -41,6 +41,7 @@ Description #include "clockModel.H" #include "smoothingModel.H" #include "forceModel.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) @@ -71,11 +72,11 @@ int main(int argc, char *argv[]) { #include "CourantNo.H" #include "alphaCourantNo.H" - + particleCloud.clockM().start(1,"Global"); Info<< "Time = " << runTime.timeName() << nl << endl; - + particleCloud.clockM().start(2,"Coupling"); bool hasEvolved = particleCloud.evolve(voidfraction,Us,U); @@ -88,12 +89,12 @@ int main(int argc, char *argv[]) Ksl = particleCloud.momCoupleM(0).impMomSource(); Ksl.correctBoundaryConditions(); - //Force Checks - vector fTotal(0,0,0); - vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value(); - reduce(fImpTotal, sumOp()); - Info << "TotalForceExp: " << fTotal << endl; - Info << "TotalForceImp: " << fImpTotal << endl; + //Force Checks + vector fTotal(0,0,0); + vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value(); + reduce(fImpTotal, sumOp()); + Info << "TotalForceExp: " << fTotal << endl; + Info << "TotalForceImp: " << fImpTotal << endl; #include "solverDebugInfo.H" particleCloud.clockM().stop("Coupling"); @@ -101,22 +102,22 @@ int main(int argc, char *argv[]) particleCloud.clockM().start(26,"Flow"); if(particleCloud.solveFlow()) - { + { mixture.solve(); rho = mixture.rho(); rhoEps = rho * voidfraction; - + // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { #include "UEqn.H" - + // --- Pressure corrector loop while (pimple.correct()) { #include "pEqn.H" } - + if (pimple.turbCorr()) { turbulence->correct(); @@ -133,7 +134,7 @@ int main(int argc, char *argv[]) Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; - + particleCloud.clockM().stop("Flow"); particleCloud.clockM().stop("Global"); } diff --git a/applications/solvers/cfdemSolverMultiphase/createFields.H b/applications/solvers/cfdemSolverMultiphase/createFields.H index c56fafb9..3b4194c5 100644 --- a/applications/solvers/cfdemSolverMultiphase/createFields.H +++ b/applications/solvers/cfdemSolverMultiphase/createFields.H @@ -76,17 +76,17 @@ volVectorField U Info<< "Reading/calculating face flux field phi\n" << endl; surfaceScalarField phi - ( - IOobject - ( +( + IOobject + ( "phi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE - ), - linearInterpolate(U*voidfraction) & mesh.Sf() - ); + ), + linearInterpolate(U*voidfraction) & mesh.Sf() +); multiphaseMixture mixture(U, phi, voidfraction); diff --git a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C index 49cee681..a1ea1537 100644 --- a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.C @@ -57,12 +57,12 @@ Foam::multiphaseMixture::calcNu() const tmp tnu = iter()*iter().nu(); volScalarField& nu = tnu.ref(); - + for (++iter; iter != phases_.end(); ++iter) { nu += iter()*iter().nu(); } - + return tnu; } @@ -216,7 +216,7 @@ Foam::multiphaseMixture::multiphaseMixture calcAlphas(); alphas_.write(); surfaceTensionForce_ = calcStf(); - + } @@ -300,20 +300,20 @@ Foam::multiphaseMixture::mu(const label patchi) const Foam::tmp Foam::multiphaseMixture::muf() const { - + return nuf()*fvc::interpolate(rho()); // PtrDictionary::const_iterator iter = phases_.begin(); - + // tmp tmuf = // fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu()); // surfaceScalarField& muf = tmuf.ref(); - + // for (++iter; iter != phases_.end(); ++iter) // { // muf += // fvc::interpolate(iter())*iter().rho()*fvc::interpolate(iter().nu()); // } - + // return tmuf; } @@ -400,7 +400,7 @@ void Foam::multiphaseMixture::solve() !(++alphaSubCycle).end(); ) { - FatalError << "Sub-cycling of the alpha equation not yet implemented!!" << abort(FatalError); + FatalError << "Sub-cycling of the alpha equation not yet implemented!!" << abort(FatalError); solveAlphas(cAlpha); rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi_; } diff --git a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.H b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.H index 2ae6d903..9a34c4ee 100644 --- a/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/cfdemSolverMultiphase/multiphaseMixture/multiphaseMixture.H @@ -159,8 +159,8 @@ private: // Private member functions void calcAlphas(); - - tmp calcNu() const; + + tmp calcNu() const; void solveAlphas(const scalar cAlpha); @@ -257,7 +257,7 @@ public: { return surfaceTensionForce_; } - + //- Indicator of the proximity of the interface // Field values are 1 near and 0 away for the interface. tmp nearInterface() const; diff --git a/applications/solvers/cfdemSolverPiso/UEqn.H b/applications/solvers/cfdemSolverPiso/UEqn.H index bfc3121d..2f26ac91 100644 --- a/applications/solvers/cfdemSolverPiso/UEqn.H +++ b/applications/solvers/cfdemSolverPiso/UEqn.H @@ -15,10 +15,10 @@ fvOptions.constrain(UEqn); if (piso.momentumPredictor() && (modelType=="B" || modelType=="Bfull")) { solve(UEqn == - fvc::grad(p) + Ksl/rho*Us); - fvOptions.correct(U); + fvOptions.correct(U); } else if (piso.momentumPredictor()) { solve(UEqn == - voidfraction*fvc::grad(p) + Ksl/rho*Us); fvOptions.correct(U); -} \ No newline at end of file +} diff --git a/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C b/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C index 8f1a8534..78c425c7 100644 --- a/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C +++ b/applications/solvers/cfdemSolverPiso/cfdemSolverPiso.C @@ -86,12 +86,12 @@ int main(int argc, char *argv[]) Ksl = particleCloud.momCoupleM(0).impMomSource(); Ksl.correctBoundaryConditions(); - //Force Checks - vector fTotal(0,0,0); - vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value(); - reduce(fImpTotal, sumOp()); - Info << "TotalForceExp: " << fTotal << endl; - Info << "TotalForceImp: " << fImpTotal << endl; + //Force Checks + vector fTotal(0,0,0); + vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value(); + reduce(fImpTotal, sumOp()); + Info << "TotalForceExp: " << fTotal << endl; + Info << "TotalForceImp: " << fImpTotal << endl; #include "solverDebugInfo.H" particleCloud.clockM().stop("Coupling"); diff --git a/applications/solvers/cfdemSolverPiso/createFields.H b/applications/solvers/cfdemSolverPiso/createFields.H index 8f0b5584..36246301 100644 --- a/applications/solvers/cfdemSolverPiso/createFields.H +++ b/applications/solvers/cfdemSolverPiso/createFields.H @@ -96,17 +96,17 @@ #define createPhi_H Info<< "Reading/calculating face flux field phi\n" << endl; surfaceScalarField phi - ( - IOobject - ( +( + IOobject + ( "phi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE - ), - linearInterpolate(U*voidfraction) & mesh.Sf() - ); + ), + linearInterpolate(U*voidfraction) & mesh.Sf() +); #endif @@ -123,4 +123,4 @@ surfaceScalarField phi incompressible::turbulenceModel::New(U, phi, laminarTransport) ); -#include "createMRF.H" \ No newline at end of file +#include "createMRF.H" diff --git a/applications/solvers/cfdemSolverPiso/pEqn.H b/applications/solvers/cfdemSolverPiso/pEqn.H index 96ca1d77..c50eb9e3 100644 --- a/applications/solvers/cfdemSolverPiso/pEqn.H +++ b/applications/solvers/cfdemSolverPiso/pEqn.H @@ -31,12 +31,12 @@ constrainPressure(p, Uvoidfraction, phiHbyA, rAUvoidfraction, MRF); while (piso.correctNonOrthogonal()) { // Pressure corrector - + fvScalarMatrix pEqn ( fvm::laplacian(rAUvoidfraction, p) == fvc::div(phi) + particleCloud.ddtVoidfraction() ); - + pEqn.setReference(pRefCell, pRefValue); pEqn.solve(mesh.solver(p.select(piso.finalInnerIter()))); @@ -55,4 +55,4 @@ else U = HbyA - voidfraction*rAU*fvc::grad(p) + Ksl/rho*Us*rAU; U.correctBoundaryConditions(); -fvOptions.correct(U); \ No newline at end of file +fvOptions.correct(U); diff --git a/applications/solvers/cfdemSolverPisoScalar/TEqn.H b/applications/solvers/cfdemSolverPisoScalar/TEqn.H index 6513b654..772b7838 100644 --- a/applications/solvers/cfdemSolverPisoScalar/TEqn.H +++ b/applications/solvers/cfdemSolverPisoScalar/TEqn.H @@ -1,4 +1,4 @@ - // get scalar source from DEM + // get scalar source from DEM particleCloud.forceM(1).manipulateScalarField(Tsource); Tsource.correctBoundaryConditions(); @@ -12,4 +12,4 @@ Tsource ); TEqn.relax(); - TEqn.solve(); \ No newline at end of file + TEqn.solve(); diff --git a/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C b/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C index 9fc59b59..5f511cdf 100644 --- a/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C +++ b/applications/solvers/cfdemSolverPisoScalar/cfdemSolverPisoScalar.C @@ -81,23 +81,23 @@ int main(int argc, char *argv[]) { particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces()); } - + Info << "update Ksl.internalField()" << endl; Ksl = particleCloud.momCoupleM(0).impMomSource(); Ksl.correctBoundaryConditions(); - //Force Checks - vector fTotal(0,0,0); - vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value(); - reduce(fImpTotal, sumOp()); - Info << "TotalForceExp: " << fTotal << endl; - Info << "TotalForceImp: " << fImpTotal << endl; + //Force Checks + vector fTotal(0,0,0); + vector fImpTotal = sum(mesh.V()*Ksl.internalField()*(Us.internalField()-U.internalField())).value(); + reduce(fImpTotal, sumOp()); + Info << "TotalForceExp: " << fTotal << endl; + Info << "TotalForceImp: " << fImpTotal << endl; #include "solverDebugInfo.H" particleCloud.clockM().stop("Coupling"); particleCloud.clockM().start(26,"Flow"); - + #include "TEqn.H" if(particleCloud.solveFlow()) diff --git a/applications/solvers/cfdemSolverPisoScalar/createFields.H b/applications/solvers/cfdemSolverPisoScalar/createFields.H index fe5dd29a..f7779bec 100644 --- a/applications/solvers/cfdemSolverPisoScalar/createFields.H +++ b/applications/solvers/cfdemSolverPisoScalar/createFields.H @@ -146,17 +146,17 @@ #define createPhi_H Info<< "Reading/calculating face flux field phi\n" << endl; surfaceScalarField phi - ( - IOobject - ( +( + IOobject + ( "phi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE - ), - linearInterpolate(U*voidfraction) & mesh.Sf() - ); + ), + linearInterpolate(U*voidfraction) & mesh.Sf() +); #endif @@ -173,4 +173,4 @@ surfaceScalarField phi incompressible::turbulenceModel::New(U, phi, laminarTransport) ); -#include "createMRF.H" \ No newline at end of file +#include "createMRF.H" diff --git a/applications/solvers/cfdemSolverRhoPimple/EEqn.H b/applications/solvers/cfdemSolverRhoPimple/EEqn.H index a83de685..022e933d 100644 --- a/applications/solvers/cfdemSolverRhoPimple/EEqn.H +++ b/applications/solvers/cfdemSolverRhoPimple/EEqn.H @@ -20,6 +20,9 @@ Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp(); + // correct source for the thermodynamic reference temperature + dimensionedScalar Tref("Tref", dimTemperature, T[0]-he[0]/(Cpv[0]+SMALL)); + Qsource += QCoeff*Tref; fvScalarMatrix EEqn ( diff --git a/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C b/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C index 39fa85cc..eb4d2c47 100644 --- a/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C +++ b/applications/solvers/cfdemSolverRhoPimple/cfdemSolverRhoPimple.C @@ -69,8 +69,8 @@ int main(int argc, char *argv[]) #include "checkModelType.H" turbulence->validate(); - // #include "compressibleCourantNo.H" - // #include "setInitialDeltaT.H" + //#include "compressibleCourantNo.H" + //#include "setInitialDeltaT.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/cfdemSolverRhoPimple/pEqn.H b/applications/solvers/cfdemSolverRhoPimple/pEqn.H index 40c68619..e107c5a4 100644 --- a/applications/solvers/cfdemSolverRhoPimple/pEqn.H +++ b/applications/solvers/cfdemSolverRhoPimple/pEqn.H @@ -32,7 +32,7 @@ else // + rhorAUf*fvc::ddtCorr(rho, U, phi) ) ); - + // flux without pressure gradient contribution phi = phiHbyA + phiUs; diff --git a/applications/solvers/cfdemSolverRhoPimple/rhoEqn.H b/applications/solvers/cfdemSolverRhoPimple/rhoEqn.H index 3be6fb2b..620e16c2 100644 --- a/applications/solvers/cfdemSolverRhoPimple/rhoEqn.H +++ b/applications/solvers/cfdemSolverRhoPimple/rhoEqn.H @@ -14,4 +14,4 @@ fvOptions.correct(rho); } -// ************************************************************************* // \ No newline at end of file +// ************************************************************************* // diff --git a/applications/solvers/cfdemSolverRhoPimpleChem/EEqn.H b/applications/solvers/cfdemSolverRhoPimpleChem/EEqn.H index dfe1e4eb..8b685990 100644 --- a/applications/solvers/cfdemSolverRhoPimpleChem/EEqn.H +++ b/applications/solvers/cfdemSolverRhoPimpleChem/EEqn.H @@ -8,6 +8,10 @@ particleCloud.energyCoefficients(QCoeff); Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp(); +// correct source for the thermodynamic reference temperature +dimensionedScalar Tref("Tref", dimTemperature, T[0]-he[0]/(Cpv[0]+SMALL)); +Qsource += QCoeff*Tref; + fvScalarMatrix EEqn ( fvm::ddt(rhoeps, he) + fvm::div(phi, he) diff --git a/applications/solvers/cfdemSolverRhoSimple/EEqn.H b/applications/solvers/cfdemSolverRhoSimple/EEqn.H new file mode 100644 index 00000000..a30bbdd0 --- /dev/null +++ b/applications/solvers/cfdemSolverRhoSimple/EEqn.H @@ -0,0 +1,57 @@ +// contributions to internal energy equation can be found in +// Crowe et al.: "Multiphase flows with droplets and particles", CRC Press 1998 +{ + // dim he = J / kg + volScalarField& he = thermo.he(); + particleCloud.energyContributions(Qsource); + particleCloud.energyCoefficients(QCoeff); + + addSource = + ( + he.name() == "e" + ? + fvc::div(phi, K) + + fvc::div + ( + fvc::absolute(phi/fvc::interpolate(rho), voidfraction*U), + p, + "div(phiv,p)" + ) + : fvc::div(phi, K) + ); + + Cpv = he.name() == "e" ? thermo.Cv() : thermo.Cp(); + + // correct source for the thermodynamic reference temperature + dimensionedScalar Tref("Tref", dimTemperature, T[0]-he[0]/(Cpv[0]+SMALL)); + Qsource += QCoeff*Tref; + + fvScalarMatrix EEqn + ( + fvm::div(phi, he) + + addSource + - Qsource + - fvm::Sp(QCoeff/Cpv, he) + - fvm::laplacian(voidfraction*thCond/Cpv,he) + == + fvOptions(rho, he) + ); + + + EEqn.relax(); + + fvOptions.constrain(EEqn); + + EEqn.solve(); + + fvOptions.correct(he); + + thermo.correct(); + + Info<< "T max/min : " << max(T).value() << " " << min(T).value() << endl; + + + particleCloud.clockM().start(31,"energySolve"); + particleCloud.solve(); + particleCloud.clockM().stop("energySolve"); +} diff --git a/applications/solvers/cfdemSolverRhoSimple/Make/files b/applications/solvers/cfdemSolverRhoSimple/Make/files new file mode 100644 index 00000000..d9db0744 --- /dev/null +++ b/applications/solvers/cfdemSolverRhoSimple/Make/files @@ -0,0 +1,3 @@ +cfdemSolverRhoSimple.C + +EXE=$(CFDEM_APP_DIR)/cfdemSolverRhoSimple diff --git a/applications/solvers/cfdemSolverRhoSimple/Make/options b/applications/solvers/cfdemSolverRhoSimple/Make/options new file mode 100644 index 00000000..0377ece5 --- /dev/null +++ b/applications/solvers/cfdemSolverRhoSimple/Make/options @@ -0,0 +1,32 @@ +include $(CFDEM_ADD_LIBS_DIR)/additionalLibs + +PFLAGS+= -Dcompre + +EXE_INC = \ + $(PFLAGS) \ + -I$(CFDEM_OFVERSION_DIR) \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/finiteVolume/cfdTools \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/lnInclude \ + -I$(CFDEM_SRC_DIR)/lagrangian/cfdemParticle/cfdTools \ + +EXE_LIBS = \ + -L$(CFDEM_LIB_DIR)\ + -lcompressibleTransportModels \ + -lfluidThermophysicalModels \ + -lspecie \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lfiniteVolume \ + -lmeshTools \ + -lsampling \ + -lfvOptions \ + -l$(CFDEM_LIB_COMP_NAME) \ + $(CFDEM_ADD_LIB_PATHS) \ + $(CFDEM_ADD_LIBS) diff --git a/applications/solvers/cfdemSolverRhoSimple/UEqn.H b/applications/solvers/cfdemSolverRhoSimple/UEqn.H new file mode 100644 index 00000000..8fbd30f2 --- /dev/null +++ b/applications/solvers/cfdemSolverRhoSimple/UEqn.H @@ -0,0 +1,30 @@ +// Solve the Momentum equation +particleCloud.otherForces(fOther); + +tmp tUEqn +( + fvm::div(phi, U) + + particleCloud.divVoidfractionTau(U, voidfraction) + + fvm::Sp(Ksl,U) + - fOther + == + fvOptions(rho, U) +); +fvVectorMatrix& UEqn = tUEqn.ref(); + +UEqn.relax(); + +fvOptions.constrain(UEqn); + +if (modelType=="B" || modelType=="Bfull") +{ + solve(UEqn == -fvc::grad(p)+ Ksl*Us); +} +else +{ + solve(UEqn == -voidfraction*fvc::grad(p)+ Ksl*Us); +} + +fvOptions.correct(U); + +K = 0.5*magSqr(U); diff --git a/applications/solvers/cfdemSolverRhoSimple/cfdemSolverRhoSimple.C b/applications/solvers/cfdemSolverRhoSimple/cfdemSolverRhoSimple.C new file mode 100644 index 00000000..3af7f1f6 --- /dev/null +++ b/applications/solvers/cfdemSolverRhoSimple/cfdemSolverRhoSimple.C @@ -0,0 +1,140 @@ +/*---------------------------------------------------------------------------*\ +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 + +Application + cfdemSolverRhoSimple + +Description + Steady-state solver for turbulent flow of compressible fluids based on + rhoSimpleFoam where functionality for CFD-DEM coupling has been added. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "psiThermo.H" +#include "turbulentFluidThermoModel.H" +#include "bound.H" +#include "simpleControl.H" +#include "fvOptions.H" +#include "localEulerDdtScheme.H" +#include "fvcSmooth.H" + +#include "cfdemCloudEnergy.H" +#include "implicitCouple.H" +#include "clockModel.H" +#include "smoothingModel.H" +#include "forceModel.H" +#include "thermCondModel.H" +#include "energyModel.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "postProcess.H" + + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createControl.H" + #include "createTimeControls.H" + #include "createRDeltaT.H" + #include "initContinuityErrs.H" + #include "createFields.H" + #include "createFieldRefs.H" + #include "createFvOptions.H" + + // create cfdemCloud + #include "readGravitationalAcceleration.H" + cfdemCloudEnergy particleCloud(mesh); + #include "checkModelType.H" + + turbulence->validate(); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (simple.loop()) + { + particleCloud.clockM().start(1,"Global"); + + Info<< "Time = " << runTime.timeName() << nl << endl; + + // do particle stuff + particleCloud.clockM().start(2,"Coupling"); + bool hasEvolved = particleCloud.evolve(voidfraction,Us,U); + + if(hasEvolved) + { + particleCloud.smoothingM().smoothen(particleCloud.forceM(0).impParticleForces()); + } + + Info << "update Ksl.internalField()" << endl; + Ksl = particleCloud.momCoupleM(0).impMomSource(); + Ksl.correctBoundaryConditions(); + + //Force Checks + vector fTotal(0,0,0); + vector fImpTotal = sum(mesh.V()*Ksl.primitiveFieldRef()*(Us.primitiveFieldRef()-U.primitiveFieldRef())); + reduce(fImpTotal, sumOp()); + Info << "TotalForceExp: " << fTotal << endl; + Info << "TotalForceImp: " << fImpTotal << endl; + + #include "solverDebugInfo.H" + particleCloud.clockM().stop("Coupling"); + + particleCloud.clockM().start(26,"Flow"); + + volScalarField rhoeps("rhoeps",rho*voidfraction); + // Pressure-velocity SIMPLE corrector + + #include "UEqn.H" + + + // besides this pEqn, OF offers a "simple consistent"-option + #include "pEqn.H" + rhoeps=rho*voidfraction; + + #include "EEqn.H" + + turbulence->correct(); + + particleCloud.clockM().start(32,"postFlow"); + if(hasEvolved) particleCloud.postFlow(); + particleCloud.clockM().stop("postFlow"); + + runTime.write(); + + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + particleCloud.clockM().stop("Flow"); + particleCloud.clockM().stop("Global"); + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/cfdemSolverRhoSimple/createFieldRefs.H b/applications/solvers/cfdemSolverRhoSimple/createFieldRefs.H new file mode 100644 index 00000000..5842906a --- /dev/null +++ b/applications/solvers/cfdemSolverRhoSimple/createFieldRefs.H @@ -0,0 +1,2 @@ +const volScalarField& T = thermo.T(); +const volScalarField& psi = thermo.psi(); diff --git a/applications/solvers/cfdemSolverRhoSimple/createFields.H b/applications/solvers/cfdemSolverRhoSimple/createFields.H new file mode 100644 index 00000000..ab79229b --- /dev/null +++ b/applications/solvers/cfdemSolverRhoSimple/createFields.H @@ -0,0 +1,243 @@ +Info<< "Reading thermophysical properties\n" << endl; + + autoPtr pThermo + ( + psiThermo::New(mesh) + ); + psiThermo& thermo = pThermo(); + thermo.validate(args.executable(), "h", "e"); + volScalarField& p = thermo.p(); + + Info<< "Reading field rho\n" << endl; + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + thermo.rho() + ); + + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "\nReading voidfraction field voidfraction = (Vgas/Vparticle)\n" << endl; + volScalarField voidfraction + ( + IOobject + ( + "voidfraction", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + volScalarField addSource + ( + IOobject + ( + "addSource", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "\nCreating fluid-particle heat flux field\n" << endl; + volScalarField Qsource + ( + IOobject + ( + "Qsource", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimensionSet(1,-1,-3,0,0,0,0), 0.0) + ); + + Info<< "\nCreating fluid-particle heat flux coefficient field\n" << endl; + volScalarField QCoeff + ( + IOobject + ( + "QCoeff", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimensionSet(1,-1,-3,-1,0,0,0), 0.0) + ); + + Info<< "\nCreating thermal conductivity field\n" << endl; + volScalarField thCond + ( + IOobject + ( + "thCond", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimensionSet(1,1,-3,-1,0,0,0), 0.0), + "zeroGradient" + ); + + Info<< "\nCreating heat capacity field\n" << endl; + volScalarField Cpv + ( + IOobject + ( + "Cpv", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimensionSet(0,2,-2,-1,0,0,0), 0.0) + ); + + Info<< "\nCreating body force field\n" << endl; + volVectorField fOther + ( + IOobject + ( + "fOther", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedVector("zero", dimensionSet(1,-2,-2,0,0,0,0), vector::zero) + ); + + Info<< "Reading/calculating face flux field phi\n" << endl; + surfaceScalarField phi + ( + IOobject + ( + "phi", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(rho*U*voidfraction) & mesh.Sf() + ); + + dimensionedScalar rhoMax + ( + dimensionedScalar::lookupOrDefault + ( + "rhoMax", + simple.dict(), + dimDensity, + GREAT + ) + ); + + dimensionedScalar rhoMin + ( + dimensionedScalar::lookupOrDefault + ( + "rhoMin", + simple.dict(), + dimDensity, + 0 + ) + ); + + Info<< "Creating turbulence model\n" << endl; + autoPtr turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, simple.dict(), pRefCell, pRefValue); + + mesh.setFluxRequired(p.name()); + + Info<< "Creating field dpdt\n" << endl; + volScalarField dpdt + ( + IOobject + ( + "dpdt", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) + ); + + Info<< "Creating field kinetic energy K\n" << endl; + volScalarField K("K", 0.5*magSqr(U)); + + Info<< "\nReading momentum exchange field Ksl\n" << endl; + volScalarField Ksl + ( + IOobject + ( + "Ksl", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + //dimensionedScalar("0", dimensionSet(1, -3, -1, 0, 0), 1.0) + ); + + + Info<< "Reading particle velocity field Us\n" << endl; + volVectorField Us + ( + IOobject + ( + "Us", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +//=============================== diff --git a/applications/solvers/cfdemSolverRhoSimple/pEqn.H b/applications/solvers/cfdemSolverRhoSimple/pEqn.H new file mode 100644 index 00000000..ed546344 --- /dev/null +++ b/applications/solvers/cfdemSolverRhoSimple/pEqn.H @@ -0,0 +1,81 @@ +rho = thermo.rho(); +rho = max(rho, rhoMin); +rho = min(rho, rhoMax); +rho.relax(); + +volScalarField rAU(1.0/UEqn.A()); +surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rhoeps*rAU)); +if (modelType=="A") +{ + rhorAUf *= fvc::interpolate(voidfraction); +} +volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); + +surfaceScalarField phiUs("phiUs", fvc::interpolate(rhoeps*rAU*Ksl*Us)& mesh.Sf()); + + +if (simple.transonic()) +{ +// transonic version not implemented yet +} +else +{ + surfaceScalarField phiHbyA + ( + "phiHbyA", + ( + fvc::flux(rhoeps*HbyA) + ) + ); + + // flux without pressure gradient contribution + phi = phiHbyA + phiUs; + + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, rhoeps, U, phi, rhorAUf); + + while (simple.correctNonOrthogonal()) + { + // Pressure corrector + fvScalarMatrix pEqn + ( + fvc::div(phi) + - fvm::laplacian(rhorAUf, p) + == + fvOptions(psi, p, rho.name()) + ); + + pEqn.setReference(pRefCell, pRefValue); + + pEqn.solve(); + + if (simple.finalNonOrthogonalIter()) + { + phi += pEqn.flux(); + } + } +} + +// Explicitly relax pressure for momentum corrector +p.relax(); + +// Recalculate density from the relaxed pressure +rho = thermo.rho(); +rho = max(rho, rhoMin); +rho = min(rho, rhoMax); +rho.relax(); +Info<< "rho max/min : " << max(rho).value() + << " " << min(rho).value() << endl; + +if (modelType=="A") +{ + U = HbyA - rAU*(voidfraction*fvc::grad(p)-Ksl*Us); +} +else +{ + U = HbyA - rAU*(fvc::grad(p)-Ksl*Us); +} + +U.correctBoundaryConditions(); +fvOptions.correct(U); +K = 0.5*magSqr(U); diff --git a/applications/solvers/rcfdemSolverRhoSteadyPimple/EEqn.H b/applications/solvers/rcfdemSolverRhoSteadyPimple/EEqn.H index 8d11ed27..d9b32f48 100644 --- a/applications/solvers/rcfdemSolverRhoSteadyPimple/EEqn.H +++ b/applications/solvers/rcfdemSolverRhoSteadyPimple/EEqn.H @@ -5,11 +5,11 @@ volScalarField& he = thermo.he(); particleCloud.energyContributions(Qsource); particleCloud.energyCoefficients(QCoeff); - - addSource = + + addSource = ( he.name() == "e" - ? + ? fvc::div(phi, K) + fvc::div ( diff --git a/applications/solvers/rcfdemSolverRhoSteadyPimple/pEqn.H b/applications/solvers/rcfdemSolverRhoSteadyPimple/pEqn.H index 13323354..f40c57a8 100644 --- a/applications/solvers/rcfdemSolverRhoSteadyPimple/pEqn.H +++ b/applications/solvers/rcfdemSolverRhoSteadyPimple/pEqn.H @@ -28,7 +28,7 @@ else fvc::flux(rhoeps*HbyA) ) ); - + // flux without pressure gradient contribution phi = phiHbyA + phiUs; diff --git a/applications/utilities/cfdemPostproc/cfdemPostproc.C b/applications/utilities/cfdemPostproc/cfdemPostproc.C index a832bacc..1f46b1de 100644 --- a/applications/utilities/cfdemPostproc/cfdemPostproc.C +++ b/applications/utilities/cfdemPostproc/cfdemPostproc.C @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) particleCloud.dataExchangeM().allocateArray(particleV_,0.,1); particleCloud.get_cellIDs(cellIDs_); // get ref to cellIDs //particleCloud.dataExchangeM().allocateArray(cellIDs_,0.,1); - + while (runTime.loop()) { diff --git a/applications/utilities/writeUfluid/writeUfluid.C b/applications/utilities/writeUfluid/writeUfluid.C index cde6c88f..a6a84121 100644 --- a/applications/utilities/writeUfluid/writeUfluid.C +++ b/applications/utilities/writeUfluid/writeUfluid.C @@ -28,7 +28,7 @@ Application writeUfluidwriteUfluid Description - Writes the the cell center fluid velocity to particles in the lagrangian + Writes the the cell center fluid velocity to particles in the lagrangian time directory. \*---------------------------------------------------------------------------*/ @@ -76,13 +76,13 @@ int nParticle=0; { volVectorField U(UHeader,mesh); passiveParticleCloud myCloud(mesh, cloudName); - myCloud.write(); + myCloud.write(); nParticle = myCloud.size(); - IOField Ufluid(myCloud.fieldIOobject("Ufluid",IOobject::NO_READ),nParticle); + IOField Ufluid(myCloud.fieldIOobject("Ufluid",IOobject::NO_READ),nParticle); label i = 0; forAllConstIter(passiveParticleCloud, myCloud, iter) { - Ufluid[i]=U[iter().cell()]; + Ufluid[i]=U[iter().cell()]; i++; } Ufluid.write(); diff --git a/doc/CFDEMcoupling_Manual.txt b/doc/CFDEMcoupling_Manual.txt index 06ca9074..a48f1708 100644 --- a/doc/CFDEMcoupling_Manual.txt +++ b/doc/CFDEMcoupling_Manual.txt @@ -89,3 +89,5 @@ END_RST --> :link(of,http://www.openfoam.org) :link(lig,http://www.cfdem.com) + + diff --git a/doc/CFDEMcoupling_install.txt b/doc/CFDEMcoupling_install.txt index 7878649b..b4634e3e 100644 --- a/doc/CFDEMcoupling_install.txt +++ b/doc/CFDEMcoupling_install.txt @@ -189,7 +189,7 @@ cfdemCompLIG :pre If the compilation fails with a message like -No rule to make target `/usr/lib/libpython2.7.so' :pre +No rule to make target '/usr/lib/libpython2.7.so' :pre you probably need to create a symbolic link to the library in question. diff --git a/doc/CFDEMcoupling_models.txt b/doc/CFDEMcoupling_models.txt index 6da09c76..800e9eb4 100644 --- a/doc/CFDEMcoupling_models.txt +++ b/doc/CFDEMcoupling_models.txt @@ -38,7 +38,7 @@ models used for chemical reaction calculations. "diffusionCoefficients"_chemistryModel_diffusionCoefficients.html, "massTransferCoeff"_chemistryModel_massTransferCoeff.html, "off"_chemistryModel_noChemistry.html, -reactantPerParticle, +"reactantPerParticle"_chemistryModel_reactantPerParticle.html, "species"_chemistryModel_species.html :tb(c=2,ea=c) @@ -60,7 +60,8 @@ that performs the data exchange between the DEM code and the CFD code. "oneWayVTK"_dataExchangeModel_oneWayVTK.html, "twoWayFiles"_dataExchangeModel_twoWayFiles.html, "twoWayMPI"_dataExchangeModel_twoWayMPI.html, -"twoWayMany2Many"_dataExchangeModel_twoWayMany2Many.html :tb(c=2,ea=c) +"twoWayMany2Many"_dataExchangeModel_twoWayMany2Many.html, +"twoWayOne2One"_dataExchangeModel_twoWayOne2One.html :tb(c=2,ea=c) 6.6 Energy models :h4 diff --git a/doc/CFDEMcoupling_solvers.txt b/doc/CFDEMcoupling_solvers.txt index 323e566e..acbca05a 100644 --- a/doc/CFDEMcoupling_solvers.txt +++ b/doc/CFDEMcoupling_solvers.txt @@ -13,7 +13,7 @@ This section lists all CFDEMcoupling solvers alphabetically. "cfdemSolverMultiphase"_cfdemSolverMultiphase.html, "cfdemSolverPiso"_cfdemSolverPiso.html, "cfdemSolverPisoScalar"_cfdemSolverPisoScalar.html, -cfdemSolverRhoPimple, -cfdemSolverRhoPimpleChem, -cfdemSolverRhoSimple :tb(c=2,ea=c) +"cfdemSolverRhoPimple"_cfdemSolverRhoPimple.html, +"cfdemSolverRhoPimpleChem"_cfdemSolverRhoPimpleChem.html, +"cfdemSolverRhoSimple"_cfdemSolverRhoSimple.html :tb(c=2,ea=c) diff --git a/doc/cfdemSolverMultiphase.txt b/doc/cfdemSolverMultiphase.txt index d655bc97..6f7a08a3 100644 --- a/doc/cfdemSolverMultiphase.txt +++ b/doc/cfdemSolverMultiphase.txt @@ -33,7 +33,7 @@ For more details, see "Vångö et al. (2018)"_#Vångö2018. :link(Vångö2018) [(Vångö2018)] M. Vångö, S. Pirker, T. Lichtenegger. (2018): -"Unresolved CFD–DEM modeling of multiphase flow in densely packed particle beds", +"Unresolved CFD-DEM modeling of multiphase flow in densely packed particle beds", Applied Mathematical Modelling :line diff --git a/doc/cfdemSolverRhoPimple.txt b/doc/cfdemSolverRhoPimple.txt new file mode 100644 index 00000000..432581aa --- /dev/null +++ b/doc/cfdemSolverRhoPimple.txt @@ -0,0 +1,59 @@ + + + + + +"CFDEMproject Website"_lws - "Main Page"_main :c + +:link(lws,http://www.cfdem.com) +:link(main,CFDEMcoupling_Manual.html) + +:line + +cfdemSolverRhoPimple command :h3 + +[Description:] + + +"cfdemSolverRhoPimple" is a coupled CFD-DEM solver using the CFDEMcoupling +framework. Based on the OpenFOAM®(*) solver rhoPimpleFoam, this is a +transient solver for compressible flow using the flexible PIMPLE (PISO-SIMPLE) +algorithm, coupled with the DEM code LIGGGHTS for solid particles. + + + + + +:line + + +NOTE: +(*) This offering is not approved or endorsed by OpenCFD Limited, producer and +distributor of the OpenFOAM software via www.openfoam.com, and owner of the +OPENFOAM® and OpenCFD® trade marks. +OPENFOAM® is a registered trade mark of OpenCFD Limited, producer and +distributor of the OpenFOAM software via www.openfoam.com. + + + diff --git a/doc/cfdemSolverRhoPimpleChem.txt b/doc/cfdemSolverRhoPimpleChem.txt new file mode 100644 index 00000000..d3f64ddb --- /dev/null +++ b/doc/cfdemSolverRhoPimpleChem.txt @@ -0,0 +1,63 @@ + + + + + +"CFDEMproject Website"_lws - "Main Page"_main :c + +:link(lws,http://www.cfdem.com) +:link(main,CFDEMcoupling_Manual.html) + +:line + +cfdemSolverRhoPimpleChem command :h3 + +[Description:] + + +"cfdemSolverRhoPimpleChem" is a coupled CFD-DEM solver using the CFDEMcoupling +framework. Based on the OpenFOAM®(*) solver rhoPimpleFoam, this is a +transient solver for compressible flow using the flexible PIMPLE (PISO-SIMPLE) +algorithm, coupled with the DEM code LIGGGHTS for solid particles. +Compared to cfdemSolverRhoPimple this solver adds functionality for chemical +reactions. + + + + + +:line + + +NOTE: +(*) This offering is not approved or endorsed by OpenCFD Limited, producer and +distributor of the OpenFOAM software via www.openfoam.com, and owner of the +OPENFOAM® and OpenCFD® trade marks. +OPENFOAM® is a registered trade mark of OpenCFD Limited, producer and +distributor of the OpenFOAM software via www.openfoam.com. + + + diff --git a/doc/cfdemSolverRhoSimple.txt b/doc/cfdemSolverRhoSimple.txt new file mode 100644 index 00000000..d0ac3e00 --- /dev/null +++ b/doc/cfdemSolverRhoSimple.txt @@ -0,0 +1,59 @@ + + + + + +"CFDEMproject Website"_lws - "Main Page"_main :c + +:link(lws,http://www.cfdem.com) +:link(main,CFDEMcoupling_Manual.html) + +:line + +cfdemSolverRhoSimple command :h3 + +[Description:] + + +"cfdemSolverRhoSimple" is a coupled CFD-DEM solver using the CFDEMcoupling +framework. Based on the OpenFOAM®(*) solver rhoSimpleFoam, this is a +steady-state solver for turbulent flow of compressible fluids coupled with the +DEM code LIGGGHTS for solid particles. + + + + + +:line + + +NOTE: +(*) This offering is not approved or endorsed by OpenCFD Limited, producer and +distributor of the OpenFOAM software via www.openfoam.com, and owner of the +OPENFOAM® and OpenCFD® trade marks. +OPENFOAM® is a registered trade mark of OpenCFD Limited, producer and +distributor of the OpenFOAM software via www.openfoam.com. + + + diff --git a/doc/chemistryModel_diffusionCoefficients.txt b/doc/chemistryModel_diffusionCoefficients.txt index df64243b..125a5584 100644 --- a/doc/chemistryModel_diffusionCoefficients.txt +++ b/doc/chemistryModel_diffusionCoefficients.txt @@ -23,7 +23,7 @@ diffusionCoefficientsProps diffusantGasNames ( speciesNames ); \} :pre -{switch1} = (optional, normally off) flag to give information :ulb,l +{switch1} = (optional, default false) flag to output verbose information :ulb,l {ChemistryFile} = path to file, where the reacting species are listed :l {diffusantGasNames} = list of gas field names that are the reactant gases :l :ule diff --git a/doc/chemistryModel_massTransferCoeff.txt b/doc/chemistryModel_massTransferCoeff.txt index 39573ac4..56534c52 100644 --- a/doc/chemistryModel_massTransferCoeff.txt +++ b/doc/chemistryModel_massTransferCoeff.txt @@ -21,7 +21,7 @@ massTransferCoeffProps verbose switch1; \} :pre -{switch1} = (optional, normally off) flag to give information :l +{switch1} = (optional, default false) flag to output verbose information :l :ule [Examples:] diff --git a/doc/chemistryModel_reactantPerParticle.txt b/doc/chemistryModel_reactantPerParticle.txt new file mode 100644 index 00000000..6f5069c3 --- /dev/null +++ b/doc/chemistryModel_reactantPerParticle.txt @@ -0,0 +1,54 @@ +"CFDEMproject Website"_lws - "Main Page"_main :c + +:link(lws,http://www.cfdem.com) +:link(main,CFDEMcoupling_Manual.html) + +:line + +chemistryModel reactantPerParticle command :h3 + +[Syntax:] + +Defined in "couplingProperties"_CFDEMcoupling_dicts.html#couplingProperties +dictionary. + +chemistryModels +( + reactantPerParticle +); +reactantPerParticleProps +\{ + voidfractionFieldName "voidfraction"; + Nevery number1; +\} :pre + +{voidfraction} = (optional, default "voidfraction") name of the finite volume void fraction field :l +{number1} = (optional, default 1) number to adjust execution interval :l +:ule + +[Examples:] + +chemistryModels +( + reactantPerParticle +); +reactantPerParticleProps +\{ + voidfractionFieldName "voidfraction"; + Nevery 1; +\} :pre + +[Description:] + +The chemistry model performs the calculation of chemical reactional effects +acting on each DEM particle. The reactantPerParticle model is the model to +communicate the available reactant per particle. + +[Restrictions:] + +none + +[Related commands:] + +"chemistryModel"_chemistryModel.html + diff --git a/doc/chemistryModel_species.txt b/doc/chemistryModel_species.txt index ad4891bf..b5071e59 100644 --- a/doc/chemistryModel_species.txt +++ b/doc/chemistryModel_species.txt @@ -26,16 +26,18 @@ speciesProps partTempName "partTemp"; partRhoName "partRho"; verbose switch1; + Nevery number1; \} :pre {ChemistryFile} = path to file, where the reacting species are listed :ulb,l -{T} = name of the finite volume temperature field, it is already added in default and doesn't need to be specified if name is the same :l -{rho} = name of the finite volume density field, it is already added in default and doesn't need to be specified if name is the same :l -{voidfraction} = name of the finite volume void fraction field, it is already added in default and doesn't need to be specified if name is the same :l -{molarConc} = name of the finite volume molar concentration field, it is already added in default and doesn't need to be specified if name is the same :l -{partTemp} = name of the finite volume cell averaged particle temperature field, it is already added in default and doesn't need to be specified if name is the same :l -{partRho} = name of the finite volume cell averaged density temperature field, it is already added in default and doesn't need to be specified if name is the same :l -{switch1} = (optional, normally off) flag to give information :l +{T} = (optional, default "T") name of the finite volume temperature field :l +{rho} = (optional, default "rho") name of the finite volume density field :l +{voidfraction} = (optional, default "voidfraction") name of the finite volume void fraction field :l +{molarConc} = (optional, default "molarConc") name of the finite volume molar concentration field :l +{partTemp} = (optional, default "partTemp") name of the finite volume cell averaged particle temperature field :l +{partRho} = (optional, default "partRho") name of the finite volume cell averaged density temperature field :l +{switch1} = (optional, default false) flag to output verbose information :l +{number1} = (optional, default 1) number to adjust execution interval :l :ule [Examples:] diff --git a/doc/dataExchangeModel_twoWayOne2One.html b/doc/dataExchangeModel_twoWayOne2One.html deleted file mode 100644 index df4a4ada..00000000 --- a/doc/dataExchangeModel_twoWayOne2One.html +++ /dev/null @@ -1,46 +0,0 @@ - -
CFDEMproject WWW Site - CFDEM Commands -
- - - - -
- -

dataExchangeModel_twoWayOne2One command -

-

Syntax: -

-

Defined in couplingProperties dictionary. -

-
dataExchangeModel twoWayOne2One;
-twoWayOne2OneProps
-{
-    liggghtsPath "path";
-}; 
-
-
  • path = path to the DEM simulation input file - - -
-

Examples: -

-
dataExchangeModel twoWayOne2One;
-twoWayOne2OneProps
-{
-    liggghtsPath "../DEM/in.liggghts_init";
-} 
-
-

Description: -

-

The data exchange model performs the data exchange between the DEM code and the CFD code. The twoWayOne2One model is a model that can exchange particle properties from DEM to CFD and from CFD to DEM. Data is exchanged via MPI technique using a more sophisticated mapping scheme than twoWayMPI / all2all and scales much better for large systems and many cores. The DEM run is executed by the coupling model, via a liggghtsCommandModel object. -

-

Restrictions: -

-

Must be used in combination with the engineSearchMany2Many locate model! Use the "one2one" cfd datacoupling option in fix couple/cfd in LIGGGHTS! -

-

Related commands: -

-

dataExchangeModel -

- diff --git a/doc/dataExchangeModel_twoWayOne2One.txt b/doc/dataExchangeModel_twoWayOne2One.txt index 995535af..f415ebd5 100644 --- a/doc/dataExchangeModel_twoWayOne2One.txt +++ b/doc/dataExchangeModel_twoWayOne2One.txt @@ -14,10 +14,12 @@ Defined in couplingProperties dictionary. dataExchangeModel twoWayOne2One; twoWayOne2OneProps \{ - liggghtsPath "path"; + liggghtsPath "path"; + useStaticProcMap switch1; \}; :pre -{path} = path to the DEM simulation input file :ulb,l +{path} = path to the DEM simulation input file :ulb,l +{switch1} = (optional, default no) switch to determine if the map is built once (yes) or every coupling step (no) :l :ule [Examples:] @@ -25,17 +27,20 @@ twoWayOne2OneProps dataExchangeModel twoWayOne2One; twoWayOne2OneProps \{ - liggghtsPath "../DEM/in.liggghts_init"; + liggghtsPath "../DEM/in.liggghts_init"; + useStaticProcMap yes; \} :pre [Description:] -The data exchange model performs the data exchange between the DEM code and the CFD code. The twoWayOne2One model is a model that can exchange particle properties from DEM to CFD and from CFD to DEM. Data is exchanged via MPI technique using a more sophisticated mapping scheme than twoWayMPI / all2all and scales much better for large systems and many cores. The DEM run is executed by the coupling model, via a liggghtsCommandModel object. +The data exchange model performs the data exchange between the DEM code and the CFD code. The twoWayOne2One model is a model that can exchange particle properties from DEM to CFD and from CFD to DEM. Data is exchanged via MPI technique using a more sophisticated mapping scheme than twoWayMPI / all2all and scales much better for large systems and many cores. The DEM run is executed by the coupling model, via a liggghtsCommandModel object. Only use staticProcMap yes if no load balancing is employed. [Restrictions:] Must be used in combination with the engineSearchMany2Many locate model! Use the "one2one" cfd datacoupling option in fix couple/cfd in LIGGGHTS! +Some warnings may be given for particles that have not been located - this is due to LIGGGHTS' treatment of domain crossers. + [Related commands:] "dataExchangeModel"_dataExchangeModel.html diff --git a/doc/smoothingModel_temporalSmoothing.txt b/doc/smoothingModel_temporalSmoothing.txt index 7be01983..eb6136e5 100644 --- a/doc/smoothingModel_temporalSmoothing.txt +++ b/doc/smoothingModel_temporalSmoothing.txt @@ -47,7 +47,7 @@ performed on a separate (smooth) field which uses the calculated (un-smooth) field as a reference. Thus its usage is limited and CANNOT be used to smooth the exchange fields similar to other smoothing models. -For further information see Vångö et al., "Unresolved CFD–DEM modeling of +For further information see Vångö et al., "Unresolved CFD-DEM modeling of multiphase flow in densely packed particle beds", Appl. Math. Model. (2018). [Restrictions:] diff --git a/etc/bashrc b/etc/bashrc index e069a93e..c7224a0b 100755 --- a/etc/bashrc +++ b/etc/bashrc @@ -17,7 +17,7 @@ #------------------------------------------------------------------------------ export CFDEM_PROJECT=CFDEM -export CFDEM_VERSION=18.10 +export CFDEM_VERSION=19.02 ################################################################################ # USER EDITABLE PART: Changes made here may be lost with the next upgrade diff --git a/etc/cshrc b/etc/cshrc index b56a1c47..5ce854ac 100755 --- a/etc/cshrc +++ b/etc/cshrc @@ -15,7 +15,7 @@ #------------------------------------------------------------------------------ setenv CFDEM_PROJECT CFDEM -setenv CFDEM_VERSION 18.10 +setenv CFDEM_VERSION 19.02 ################################################################################ # USER EDITABLE PART: Changes made here may be lost with the next upgrade diff --git a/etc/solver-list.txt b/etc/solver-list.txt index 82d25b08..8391f45e 100644 --- a/etc/solver-list.txt +++ b/etc/solver-list.txt @@ -4,10 +4,10 @@ rcfdemSolverCoupledHeattransfer/dir rStatAnalysis/dir rcfdemSolverBase/dir rtfmSolverSpecies/dir -cfdemSolverRhoPimple/dir cfdemSolverPisoMS/dir cfdemSolverPiso/dir cfdemSolverRhoPimple/dir +cfdemSolverRhoSimple/dir cfdemSolverIB/dir cfdemSolverPisoScalar/dir cfdemSolverRhoPimpleChem/dir diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files index 286b53f3..d49f0b23 100644 --- a/src/lagrangian/cfdemParticle/Make/files +++ b/src/lagrangian/cfdemParticle/Make/files @@ -159,6 +159,8 @@ $(dataExchangeModels)/oneWayVTK/oneWayVTK.C $(dataExchangeModels)/twoWayFiles/twoWayFiles.C $(dataExchangeModels)/noDataExchange/noDataExchange.C $(dataExchangeModels)/twoWayMPI/twoWayMPI.C +$(dataExchangeModels)/twoWayOne2One/twoWayOne2One.C +$(dataExchangeModels)/twoWayOne2One/one2one.C $(averagingModels)/averagingModel/averagingModel.C $(averagingModels)/averagingModel/newAveragingModel.C diff --git a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H index 637262b3..7297ac62 100755 --- a/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H +++ b/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H @@ -34,8 +34,8 @@ Description #ifndef versionInfo_H #define versionInfo_H -word CFDEMversion="PFM 18.10"; -word compatibleLIGGGHTSversion="PFM 18.10"; +word CFDEMversion="PFM 19.02"; +word compatibleLIGGGHTSversion="PFM 19.02"; word OFversion="4.x"; Info << "\nCFDEMcoupling version: " << CFDEMversion << endl; diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.C index f9a2eb9d..62695fd1 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.C @@ -312,7 +312,7 @@ void diffusionCoefficient::execute() TotalFraction_[i] += Xfluid_[j]/dBinary_; // dCoeff -- diffusion component of diffusant gas - MixtureBinaryDiffusion_[i] = (1.0-XfluidDiffusant_[i])/TotalFraction_[i]; + MixtureBinaryDiffusion_[i] = (1.0-XfluidDiffusant_[i])/TotalFraction_[i]; if(verbose_) { diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.H b/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.H index fb96c5f8..ab360a67 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.H +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.H @@ -72,7 +72,7 @@ private: // gas pressure at particle location word pressureFieldName_; - const volScalarField& P_; + const volScalarField& P_; word partPressureName_; diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.C index 57a58f44..1573c68a 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/reactantPerParticle/reactantPerParticle.C @@ -109,8 +109,6 @@ void reactantPerParticle::reAllocMyArrays() const void reactantPerParticle::execute() { - - loopCounter_++; if (loopCounter_ % Nevery_ != 0) { @@ -121,7 +119,7 @@ void reactantPerParticle::execute() particlesPerCell_ *= 0.0; - label cellI=0; + label cellI=0; scalar voidfraction(1); scalar cellvolume(0.0); scalar particlesPerCell(1.0); @@ -133,7 +131,7 @@ void reactantPerParticle::execute() if (cellI >= 0) { particlesPerCell_[cellI] += 1.0; - } + } } // no fill array and communicate it @@ -151,7 +149,7 @@ void reactantPerParticle::execute() // give DEM data particleCloud_.dataExchangeM().giveData("reactantPerParticle", "scalar-atom", reactantPerParticle_); - + Info << "give data done" << endl; } diff --git a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H index 10f9b360..7e8a117a 100755 --- a/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H +++ b/src/lagrangian/cfdemParticle/subModels/dataExchangeModel/dataExchangeModel/dataExchangeModel.H @@ -245,20 +245,20 @@ public: virtual int getNumberOfTypes() const; virtual double* getTypeVol() const; - inline void setPositions(label n,double* pos) const + inline void setPositions(label n,double* pos) { for (int i=0;i const& ids) const + inline void setCellIDs(DynamicList