From b8c987ae941d775e1567ac452c2b9012d877f30b Mon Sep 17 00:00:00 2001 From: danielque Date: Tue, 22 Sep 2020 11:20:12 +0200 Subject: [PATCH] use const word class member variables to store particle property names internal variable naming convention for registered particle properties: * suffix 'RegName_' indicates class-internal particle property usage; these names use the typeName of the class as prefix for uniqueness * suffix 'Name_' indicates particle properties also used in give/getData; these names can potentially cause a conflict if multiple models try to communicate a property with the same name (some of them can be customized via the couplingProperties dict to resolve this situation) --- .../diffusionCoefficients.C | 4 +-- .../massTransferCoeff/massTransferCoeff.C | 8 +++--- .../massTransferCoeff/massTransferCoeff.H | 4 +-- .../reactantPerParticle/reactantPerParticle.C | 7 +++--- .../reactantPerParticle/reactantPerParticle.H | 4 ++- .../heatTransferGranConduction.C | 7 +++--- .../heatTransferGranConduction.H | 2 ++ .../heatTransferGunn/heatTransferGunn.C | 23 +++++++++-------- .../heatTransferGunn/heatTransferGunn.H | 6 +++++ .../heatTransferRanzMarshall.C | 23 +++++++++-------- .../heatTransferRanzMarshall.H | 6 +++++ .../KochHillRWDrag/KochHillRWDrag.C | 10 +++++--- .../KochHillRWDrag/KochHillRWDrag.H | 4 +++ .../subModels/forceModel/dSauter/dSauter.C | 10 +++++--- .../subModels/forceModel/dSauter/dSauter.H | 4 +++ .../granKineticEnergy/granKineticEnergy.C | 5 ++-- .../granKineticEnergy/granKineticEnergy.H | 4 ++- .../particleDeformation/particleDeformation.C | 9 ++++--- .../particleDeformation/particleDeformation.H | 2 ++ .../forceModel/pdCorrelation/pdCorrelation.C | 25 +++++++++++-------- .../forceModel/pdCorrelation/pdCorrelation.H | 6 +++++ .../potentialRelaxation/potentialRelaxation.C | 9 ++++--- .../potentialRelaxation/potentialRelaxation.H | 2 ++ .../virtualMassForce/virtualMassForce.C | 5 ++-- .../virtualMassForce/virtualMassForce.H | 2 ++ .../ZehnerSchluenderThermCond.C | 7 +++--- .../ZehnerSchluenderThermCond.H | 2 ++ .../voidFractionModel/voidFractionModel.C | 8 +++--- .../voidFractionModel/voidFractionModel.H | 2 ++ 29 files changed, 138 insertions(+), 72 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.C index c824f43c..3ad1a38b 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/diffusionCoefficients/diffusionCoefficients.C @@ -77,7 +77,7 @@ diffusionCoefficient::diffusionCoefficient initialized_(false) { particleCloud_.checkCG(false); - particleCloud_.registerParticleProperty("partPressure",1); + particleCloud_.registerParticleProperty(partPressureName_,1); for (int i=0; i(diffusantGasNames_[i],1); @@ -144,7 +144,7 @@ void diffusionCoefficient::execute() interpolationCellPoint TInterpolator_(tempField_); interpolationCellPoint PInterpolator_(P_); - double**& partPressure_ = particleCloud_.getParticlePropertyRef("partPressure"); + double**& partPressure_ = particleCloud_.getParticlePropertyRef(partPressureName_); for (int index=0; index("densityFieldName","rho")), rho_(sm.mesh().lookupObject (densityFieldName_)), partNuName_(propsDict_.lookupOrDefault("partViscos","partNu")), - partReynolds_(propsDict_.lookupOrDefault("partReynolds","partRe")), + partReName_(propsDict_.lookupOrDefault("partReynolds","partRe")), scaleDia_(1) { particleCloud_.checkCG(true); particleCloud_.registerParticleProperty(partNuName_,1); - particleCloud_.registerParticleProperty(partReynolds_,1); + particleCloud_.registerParticleProperty(partReName_,1); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -115,7 +115,7 @@ void massTransferCoeff::execute() interpolationCellPoint voidfractionInterpolator_(voidfraction_); double**& partNu_ = particleCloud_.getParticlePropertyRef(partNuName_); - double**& partRe_ = particleCloud_.getParticlePropertyRef(partReynolds_); + double**& partRe_ = particleCloud_.getParticlePropertyRef(partReName_); for (int index=0; index("verbose",false)), + partReactantName_("reactantPerParticle"), voidfractionFieldName_(propsDict_.lookupOrDefault("voidfractionFieldName","voidfraction")), voidfraction_(sm.mesh().lookupObject(voidfractionFieldName_)), particlesPerCell_ @@ -75,7 +76,7 @@ reactantPerParticle::reactantPerParticle Nevery_(propsDict_.lookupOrDefault