From 11e53185e789f26a07968dc4b730c4f2d646fee6 Mon Sep 17 00:00:00 2001 From: tlichtenegger Date: Thu, 28 Mar 2019 15:28:33 +0100 Subject: [PATCH] Tutorial case for rCFD. Minor bug fixes. Some code cleaning. --- .../updateFields.H | 2 - src/lagrangian/cfdemParticle/Make/files | 1 + .../cfdemParticle/cfdemCloud/cfdemCloudI.H | 2 +- .../heatTransferGranConduction.C | 13 +- .../heatTransferGranConduction.H | 4 + .../heatTransferGunn/heatTransferGunn.C | 126 +- .../heatTransferGunn/heatTransferGunn.H | 12 +- .../directedDiffusiveRelaxation.C | 7 +- .../forceModel/freeStreaming/freeStreaming.C | 36 +- .../forceModel/freeStreaming/freeStreaming.H | 10 + src/lagrangian/cfdemParticleComp/Make/files | 1 + src/recurrence/recNorm/diffNorm/diffNorm.C | 13 +- .../recPath/MarkovPath/MarkovPath.C | 5 + .../recPath/MarkovPath/MarkovPath.H | 2 + .../FluidizedBed_HeatSources/README | 4 +- .../FluidizedBed_HeatSources/db1/CFD/-5/U | 2 +- .../FluidizedBed_HeatSources/db1/run.sh | 40 +- .../FluidizedBed_HeatSources/db2/run.sh | 40 +- .../FluidizedBed_HeatSources/rCFD/CFD/0/T | 20488 +---- .../FluidizedBed_HeatSources/rCFD/CFD/0/UsRec | 39 + .../FluidizedBed_HeatSources/rCFD/CFD/0/pRec | 43 + .../rCFD/CFD/0/phiRec | 67386 ++++++++++++++++ .../rCFD/CFD/0/rhoRec | 40 + .../rCFD/CFD/0/voidfractionRec | 41 + .../rCFD/CFD/constant/couplingProperties | 13 +- .../rCFD/CFD/constant/recProperties | 3 - .../rCFD/CFD/system/controlDict | 2 +- .../rCFD/DEM/in.liggghts_run | 14 +- .../FluidizedBed_HeatSources/rCFD/prerun.sh | 4 - .../FluidizedBed_HeatSources/rCFD/run.sh | 3 +- 30 files changed, 67730 insertions(+), 20666 deletions(-) create mode 100644 tutorials/rcfdemSolverCoupledHeatTransfer/FluidizedBed_HeatSources/rCFD/CFD/0/UsRec create mode 100644 tutorials/rcfdemSolverCoupledHeatTransfer/FluidizedBed_HeatSources/rCFD/CFD/0/pRec create mode 100644 tutorials/rcfdemSolverCoupledHeatTransfer/FluidizedBed_HeatSources/rCFD/CFD/0/phiRec create mode 100644 tutorials/rcfdemSolverCoupledHeatTransfer/FluidizedBed_HeatSources/rCFD/CFD/0/rhoRec create mode 100644 tutorials/rcfdemSolverCoupledHeatTransfer/FluidizedBed_HeatSources/rCFD/CFD/0/voidfractionRec diff --git a/applications/solvers/rcfdemSolverCoupledHeattransfer/updateFields.H b/applications/solvers/rcfdemSolverCoupledHeattransfer/updateFields.H index 4c6a8964..8f21eaef 100644 --- a/applications/solvers/rcfdemSolverCoupledHeattransfer/updateFields.H +++ b/applications/solvers/rcfdemSolverCoupledHeattransfer/updateFields.H @@ -18,10 +18,8 @@ if(recurrenceBase.recM().endOfPath()) } recurrenceBase.recM().exportVolScalarField("voidfraction",voidfractionRec); -//recurrenceBase.recM().exportVolScalarFieldAve("rho",rhoRec); recurrenceBase.recM().exportVolScalarField("p",pRec); recurrenceBase.recM().exportVolVectorField("Us",UsRec); -//recurrenceBase.recM().exportVolVectorField("U",URec); recurrenceBase.recM().exportSurfaceScalarField("phi",phiRec); Info << "current database weights: = " << wList << endl; diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files index 22cad185..286b53f3 100644 --- a/src/lagrangian/cfdemParticle/Make/files +++ b/src/lagrangian/cfdemParticle/Make/files @@ -41,6 +41,7 @@ $(chemistryModels)/reactantPerParticle/reactantPerParticle.C $(energyModels)/energyModel/energyModel.C $(energyModels)/energyModel/newEnergyModel.C $(energyModels)/heatTransferGunn/heatTransferGunn.C +$(energyModels)/heatTransferRanzMarshall/heatTransferRanzMarshall.C $(energyModels)/heatTransferGranConduction/heatTransferGranConduction.C $(energyModels)/reactionHeat/reactionHeat.C diff --git a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H index 63e31651..0a21702e 100644 --- a/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H +++ b/src/lagrangian/cfdemParticle/cfdemCloud/cfdemCloudI.H @@ -271,7 +271,7 @@ inline int ** cfdemCloud::particleTypes() const inline label cfdemCloud::particleType(label index) const { - if(!getParticleDensities_) return -1; + if(!getParticleTypes_) return -1; else { return particleTypes_[index][0]; diff --git a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGranConduction/heatTransferGranConduction.C b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGranConduction/heatTransferGranConduction.C index fd6cb794..135850f7 100644 --- a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGranConduction/heatTransferGranConduction.C +++ b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGranConduction/heatTransferGranConduction.C @@ -45,6 +45,8 @@ heatTransferGranConduction::heatTransferGranConduction propsDict_(dict.subDict(typeName + "Props")), multiTypes_(false), verbose_(propsDict_.lookupOrDefault("verbose",false)), + calcTotalHeatFlux_(propsDict_.lookupOrDefault("calcTotalHeatFlux",false)), + totalHeatFlux_(0.0), QPartPartName_(propsDict_.lookupOrDefault("QPartPartName","QPartPart")), QPartPart_ ( IOobject @@ -108,7 +110,7 @@ heatTransferGranConduction::heatTransferGranConduction multiTypes_ = true; } - if (multiTypes_ = true && !particleCloud_.getParticleTypes()) + if (multiTypes_ && !particleCloud_.getParticleTypes()) { FatalError << "heatTransferGranConduction needs data for more than one type, but types are not communicated." << abort(FatalError); } @@ -153,6 +155,8 @@ void heatTransferGranConduction::calcEnergyContribution() scalar QPartPart(0); scalar voidfraction(1); + totalHeatFlux_ = 0.0; + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; @@ -166,6 +170,7 @@ void heatTransferGranConduction::calcEnergyContribution() QPartPart = QPartPart_[cellI]; heatFlux(index, partVolume, voidfraction, QPartPart); + if (calcTotalHeatFlux_) totalHeatFlux_ += partHeatFlux_[index][0]; } } } @@ -227,7 +232,11 @@ void heatTransferGranConduction::heatFlux(label index, scalar vol, scalar voidfr void heatTransferGranConduction::giveData() { - Info << "total conductive particle-particle heat flux [W] (Eulerian) = " << gSum(QPartPart_*1.0*QPartPart_.mesh().V()) << endl; + if (calcTotalHeatFlux_) + { + reduce(totalHeatFlux_, sumOp()); + Info << "total conductive particle-particle heat flux [W] (Eulerian) = " << totalHeatFlux_ << endl; + } particleCloud_.dataExchangeM().giveData(partHeatFluxName_,"scalar-atom", partHeatFlux_); } diff --git a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGranConduction/heatTransferGranConduction.H b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGranConduction/heatTransferGranConduction.H index 1320e9b1..3bb8d425 100644 --- a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGranConduction/heatTransferGranConduction.H +++ b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGranConduction/heatTransferGranConduction.H @@ -50,6 +50,10 @@ protected: bool verbose_; + bool calcTotalHeatFlux_; + + scalar totalHeatFlux_; + word QPartPartName_; volScalarField QPartPart_; diff --git a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C index 2760792e..c73627ba 100644 --- a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C +++ b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C @@ -47,6 +47,9 @@ heatTransferGunn::heatTransferGunn expNusselt_(propsDict_.lookupOrDefault("expNusselt",false)), interpolation_(propsDict_.lookupOrDefault("interpolation",false)), verbose_(propsDict_.lookupOrDefault("verbose",false)), + calcTotalHeatFlux_(propsDict_.lookupOrDefault("calcTotalHeatFlux",true)), + totalHeatFlux_(0.0), + NusseltScalingFactor_(1.0), implicit_(propsDict_.lookupOrDefault("implicit",true)), QPartFluidName_(propsDict_.lookupOrDefault("QPartFluidName","QPartFluid")), QPartFluid_ @@ -125,8 +128,7 @@ heatTransferGunn::heatTransferGunn ), partRefTemp_("partRefTemp", dimensionSet(0,0,0,1,0,0,0), 0.0), calcPartTempField_(propsDict_.lookupOrDefault("calcPartTempField",false)), - calcPartTempAve_(propsDict_.lookupOrDefault("calcPartTempAve",false)), - partTempAve_(0.0), + partTempAve_("partTempAve", dimensionSet(0,0,0,1,0,0,0), 0.0), tempFieldName_(propsDict_.lookupOrDefault("tempFieldName","T")), tempField_(sm.mesh().lookupObject (tempFieldName_)), voidfractionFieldName_(propsDict_.lookupOrDefault("voidfractionFieldName","voidfraction")), @@ -148,6 +150,12 @@ heatTransferGunn::heatTransferGunn { allocateMyArrays(); + if (propsDict_.found("NusseltScalingFactor")) + { + NusseltScalingFactor_=readScalar(propsDict_.lookup ("NusseltScalingFactor")); + Info << "NusseltScalingFactor set to: " << NusseltScalingFactor_ << endl; + } + if (propsDict_.found("maxSource")) { maxSource_=readScalar(propsDict_.lookup ("maxSource")); @@ -156,7 +164,6 @@ heatTransferGunn::heatTransferGunn if (calcPartTempField_) { - calcPartTempAve_ = true; if (propsDict_.found("partRefTemp")) { partRefTemp_.value()=readScalar(propsDict_.lookup ("partRefTemp")); @@ -185,6 +192,13 @@ heatTransferGunn::heatTransferGunn } } + if (expNusselt_) + { + NuField_.writeOpt() = IOobject::AUTO_WRITE; + NuField_.write(); + Info << "Using predefined Nusselt number field." << endl; + } + if (propsDict_.found("scale") && typeCG_.size()==1) { // if "scale" is specified and there's only one single type, use "scale" @@ -241,25 +255,6 @@ void heatTransferGunn::calcEnergyContribution() // get DEM data particleCloud_.dataExchangeM().getData(partTempName_,"scalar-atom",partTemp_); - if(calcPartTempField_) - { - partTempField_.primitiveFieldRef() = 0.0; - particleCloud_.averagingM().resetWeightFields(); - particleCloud_.averagingM().setScalarAverage - ( - partTempField_, - partTemp_, - particleCloud_.particleWeights(), - particleCloud_.averagingM().UsWeightField(), - NULL - ); - - volScalarField sumTp (particleCloud_.averagingM().UsWeightField() * partTempField_); - dimensionedScalar aveTemp("aveTemp",dimensionSet(0,0,0,1,0,0,0), gSum(sumTp) / particleCloud_.numberOfParticles()); - partRelTempField_ = (partTempField_ - aveTemp) / (aveTemp - partRefTemp_); - Info << "heatTransferGunn: average part. temp = " << aveTemp.value() << endl; - } - #ifdef compre const volScalarField mufField = particleCloud_.turbulence().mu(); #else @@ -291,6 +286,7 @@ void heatTransferGunn::calcEnergyContribution() scalar Pr(0); scalar Nup(0); scalar Tsum(0.0); + scalar Nsum(0.0); scalar cg = typeCG_[0]; label partType = 1; @@ -299,6 +295,8 @@ void heatTransferGunn::calcEnergyContribution() interpolationCellPoint UInterpolator_(U_); interpolationCellPoint TInterpolator_(tempField_); + totalHeatFlux_ = 0.0; + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; @@ -328,23 +326,38 @@ void heatTransferGunn::calcEnergyContribution() scaleDia3 = cg*cg*cg; } - // calc relative velocity - Us = particleCloud_.velocity(index); - magUr = mag(Ufluid - Us); ds = 2.*particleCloud_.radius(index); ds_scaled = ds/cg; - muf = mufField[cellI]; - Rep = ds_scaled * magUr * voidfraction * rho_[cellI]/ muf; - Pr = max(SMALL, Cp_ * muf / kf0_); - Nup = Nusselt(voidfraction, Rep, Pr); + if (expNusselt_) + { + Nup = NuField_[cellI]; + if (Nup < 2.0) + Nup = 2.0; + } + else + { + Us = particleCloud_.velocity(index); + magUr = mag(Ufluid - Us); + muf = mufField[cellI]; + Rep = ds_scaled * magUr * voidfraction * rho_[cellI]/ muf; + Pr = max(SMALL, Cp_ * muf / kf0_); + Nup = Nusselt(voidfraction, Rep, Pr); + } + Nup *= NusseltScalingFactor_; Tsum += partTemp_[index][0]; + Nsum += 1.0; + scalar h = kf0_ * Nup / ds_scaled; scalar As = ds_scaled * ds_scaled * M_PI; // surface area of sphere // calc convective heat flux [W] heatFlux(index, h, As, Tfluid, scaleDia3); + if (calcTotalHeatFlux_ & !implicit_) + { + totalHeatFlux_ += partHeatFlux_[index][0]; + } if(verbose_) { @@ -368,16 +381,14 @@ void heatTransferGunn::calcEnergyContribution() } } - // gather particle temperature sums and obtain average - if(calcPartTempAve_) + if(calcPartTempField_) { reduce(Tsum, sumOp()); - partTempAve_ = Tsum / particleCloud_.numberOfParticles(); - Info << "mean particle temperature = " << partTempAve_ << endl; + reduce(Nsum, sumOp()); + partTempAve_.value() = Tsum / Nsum; + partTempField(); } - if(calcPartTempField_) partTempField(); - particleCloud_.averagingM().setScalarSum ( QPartFluid_, @@ -489,8 +500,12 @@ void heatTransferGunn::heatFlux(label index, scalar h, scalar As, scalar Tfluid, void heatTransferGunn::giveData() { - Info << "total convective particle-fluid heat flux [W] (Eulerian) = " << gSum(QPartFluid_*1.0*QPartFluid_.mesh().V()) << endl; - + // Info << "total convective particle-fluid heat flux [W] (Eulerian) = " << gSum(QPartFluid_*1.0*QPartFluid_.mesh().V()) << endl; + if (calcTotalHeatFlux_) + { + reduce(totalHeatFlux_, sumOp()); + Info << "total convective particle-fluid heat flux [W] = " << totalHeatFlux_ << endl; + } particleCloud_.dataExchangeM().giveData(partHeatFluxName_,"scalar-atom", partHeatFlux_); } @@ -503,6 +518,8 @@ void heatTransferGunn::postFlow() scalar Tpart(0.0); interpolationCellPoint TInterpolator_(tempField_); + totalHeatFlux_ = 0.0; + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; @@ -520,32 +537,35 @@ void heatTransferGunn::postFlow() Tpart = partTemp_[index][0]; partHeatFlux_[index][0] = (Tfluid - Tpart) * partHeatFluxCoeff_[index][0]; + if (calcTotalHeatFlux_) + { + totalHeatFlux_ += partHeatFlux_[index][0]; + } } } } giveData(); } -scalar heatTransferGunn::aveTpart() const -{ - return partTempAve_; -} void heatTransferGunn::partTempField() { - partTempField_.primitiveFieldRef() = 0.0; - particleCloud_.averagingM().resetWeightFields(); - particleCloud_.averagingM().setScalarAverage - ( - partTempField_, - partTemp_, - particleCloud_.particleWeights(), - particleCloud_.averagingM().UsWeightField(), - NULL - ); + partTempField_.primitiveFieldRef() = 0.0; + particleCloud_.averagingM().resetWeightFields(); + particleCloud_.averagingM().setScalarAverage + ( + partTempField_, + partTemp_, + particleCloud_.particleWeights(), + particleCloud_.averagingM().UsWeightField(), + NULL + ); - dimensionedScalar aveTemp("aveTemp",dimensionSet(0,0,0,1,0,0,0), partTempAve_); - partRelTempField_ = (partTempField_ - aveTemp) / (aveTemp - partRefTemp_); + dimensionedScalar denom = partTempAve_ - partRefTemp_; + if (denom.value() < SMALL && denom.value() > -SMALL) denom.value() = SMALL; + partRelTempField_ = (partTempField_ - partTempAve_) / denom; + + Info << "heatTransferGunn: average part. temp = " << partTempAve_.value() << endl; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H index 6139d3c6..f34a9ec2 100644 --- a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H +++ b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H @@ -55,6 +55,12 @@ protected: bool implicit_; + bool calcTotalHeatFlux_; + + scalar totalHeatFlux_; + + scalar NusseltScalingFactor_; + word QPartFluidName_; volScalarField QPartFluid_; @@ -75,9 +81,7 @@ protected: bool calcPartTempField_; - bool calcPartTempAve_; - - scalar partTempAve_; + dimensionedScalar partTempAve_; word tempFieldName_; @@ -154,8 +158,6 @@ public: void calcEnergyContribution(); void postFlow(); - - scalar aveTpart() const; }; diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/directedDiffusiveRelaxation/directedDiffusiveRelaxation.C b/src/lagrangian/cfdemParticle/subModels/forceModel/directedDiffusiveRelaxation/directedDiffusiveRelaxation.C index 37e2bcb6..8f10efe4 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/directedDiffusiveRelaxation/directedDiffusiveRelaxation.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/directedDiffusiveRelaxation/directedDiffusiveRelaxation.C @@ -153,9 +153,6 @@ void directedDiffusiveRelaxation::setForce() const relaxStream_ = DField_ * fvc::grad(correctedField_ - voidfractionRec_); - // explicit evaluation? - // relaxStream_ = DField_ * fvc::grad(voidfraction_ - voidfractionRec_); - vector position(0,0,0); scalar voidfraction(0.0); vector flucU(0,0,0); @@ -169,10 +166,10 @@ void directedDiffusiveRelaxation::setForce() const for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) { cellI = particleCloud_.cellIDs()[index][0]; - if (cellI > -1 && !ignoreCell(cellI)) // particle found + if (cellI > -1 && !ignoreCell(cellI)) { { - if( interpolate_ ) + if (interpolate_) { position = particleCloud_.position(index); voidfraction = voidfractionInterpolator_.interpolate(position,cellI); diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/freeStreaming/freeStreaming.C b/src/lagrangian/cfdemParticle/subModels/forceModel/freeStreaming/freeStreaming.C index c7dd572c..8b786de0 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/freeStreaming/freeStreaming.C +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/freeStreaming/freeStreaming.C @@ -56,6 +56,9 @@ freeStreaming::freeStreaming forceModel(dict,sm), propsDict_(dict.subDict(typeName + "Props")), interpolate_(propsDict_.lookupOrDefault("interpolation", false)), + ignoreCellsName_(propsDict_.lookupOrDefault("ignoreCellsName","none")), + ignoreCells_(), + existIgnoreCells_(true), UsRecFieldName_(propsDict_.lookupOrDefault("granVelRecFieldName","UsRec")), UsRec_(sm.mesh().lookupObject (UsRecFieldName_)), voidfractionRecFieldName_(propsDict_.lookupOrDefault("voidfractionRecFieldName","voidfractionRec")), @@ -65,21 +68,13 @@ freeStreaming::freeStreaming particleDensity_(propsDict_.lookupOrDefault("particleDensity",0.0)), gravAcc_(propsDict_.lookupOrDefault("g",vector(0.0,0.0,-9.81))) { -// forceSubModels_.setSize(1, "recU"); -// forceSubModels_.append("recF"); -// delete[] forceSubModel_; -// forceSubModel_ = new autoPtr[nrForceSubModels()]; -// Info << "nrForceSubModels()=" << nrForceSubModels() << endl; -// for (int i=0;i -1) // particle found + if (cellI > -1 && !ignoreCell(cellI)) // particle found { // let particles in empty regions follow trajectories subject to gravity, otherwise stream if(voidfractionRec_[cellI] < critVoidfraction_) @@ -129,7 +131,6 @@ void freeStreaming::setForce() const radius = particleCloud_.radius(index); mass = 4.188790205*radius*radius*radius * particleDensity_; grav = mass*gravAcc_; - // forceSubM(1).partToArray(index,grav,vector::zero); for(int j=0;j<3;j++) { particleCloud_.DEMForces()[index][j] += grav[j]; @@ -141,7 +142,6 @@ void freeStreaming::setForce() const { particleCloud_.particleConvVels()[index][j] += UNew[j]; } - // forceSubM(0).partToArray(index,UNew,vector::zero); } } diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/freeStreaming/freeStreaming.H b/src/lagrangian/cfdemParticle/subModels/forceModel/freeStreaming/freeStreaming.H index 05c3fc51..d2a1a2a4 100644 --- a/src/lagrangian/cfdemParticle/subModels/forceModel/freeStreaming/freeStreaming.H +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/freeStreaming/freeStreaming.H @@ -27,6 +27,7 @@ License #include "forceModel.H" #include "interpolationCellPoint.H" +#include "cellSet.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,6 +46,13 @@ private: dictionary propsDict_; bool interpolate_; + + // ignore streaming velocity in region + word ignoreCellsName_; + + autoPtr ignoreCells_; + + bool existIgnoreCells_; word UsRecFieldName_; @@ -63,6 +71,8 @@ private: const vector gravAcc_; + bool ignoreCell(label) const; + public: //- Runtime type information diff --git a/src/lagrangian/cfdemParticleComp/Make/files b/src/lagrangian/cfdemParticleComp/Make/files index 008b2935..af8b8d34 100644 --- a/src/lagrangian/cfdemParticleComp/Make/files +++ b/src/lagrangian/cfdemParticleComp/Make/files @@ -39,6 +39,7 @@ $(chemistryModels)/reactantPerParticle/reactantPerParticle.C $(energyModels)/energyModel/energyModel.C $(energyModels)/energyModel/newEnergyModel.C $(energyModels)/heatTransferGunn/heatTransferGunn.C +$(energyModels)/heatTransferRanzMarshall/heatTransferRanzMarshall.C $(energyModels)/heatTransferGranConduction/heatTransferGranConduction.C $(energyModels)/reactionHeat/reactionHeat.C diff --git a/src/recurrence/recNorm/diffNorm/diffNorm.C b/src/recurrence/recNorm/diffNorm/diffNorm.C index a28f4ce1..ccb46360 100644 --- a/src/recurrence/recNorm/diffNorm/diffNorm.C +++ b/src/recurrence/recNorm/diffNorm/diffNorm.C @@ -85,6 +85,12 @@ void diffNorm::computeRecMatrix() label totNumRecSteps = base_.recM().numRecFields(); SymmetricSquareMatrix& recurrenceMatrix( base_.recM().recurrenceMatrix() ); + if (totNumRecSteps == 1) + { + recurrenceMatrix[0][0]=0.0; + return; + } + scalar normIJ(0.0); scalar maxNormIJ(0.0); @@ -192,7 +198,12 @@ void diffNorm::computeRecMatrix() // normalize matrix and copy lower to upper half - if(normConstant_ > 0.0) maxNormIJ = normConstant_; + if (normConstant_ > 0.0) maxNormIJ = normConstant_; + if (maxNormIJ < SMALL) + { + Info << "Small normalization constant detected. Setting maxNormIJ = 1.0." << endl; + maxNormIJ = 1.0; + } for(label ti=0;ti("minIntervalSteps",0)), numIntervals_(base.recM().numIntervals()), recSteps_(0), + startIndex_(propsDict_.lookupOrDefault