diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C index 67dcb4f3..dd5afa67 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C @@ -56,19 +56,11 @@ species::species interpolation_(propsDict_.lookupOrDefault("interpolation",false)), - // species names are written in the coupling Properties under "species" - speciesNames_(propsDict_.lookup("species")) -{ - Y_.setSize(speciesNames_.size()); - - for (int i=0; i(speciesNames_[i])); - } -} - concentrations_(NULL), - changeOfSpeciesMass_(NULL), + // species names are written in the coupling properties under "species" + speciesNames_(propsDict_.lookup("species")), + Y_(speciesNames_.size()), + concentrations_(), + // changeOfSpeciesMass_(), tempFieldName_(propsDict_.lookupOrDefault("tempFieldName","T")), tempField_(sm.mesh().lookupObject (tempFieldName_)), @@ -79,13 +71,42 @@ species::species rho_(sm.mesh().lookupObject (densityFieldName_)), partRhoName_(propsDict_.lookup("partRhoName")), partRho_(NULL) -{ - allocateMyArrays(); +{ + + //Y_.setSize(speciesNames_.size()); + + for (int i=0; i(speciesNames_[i]); + /*word fieldName = "Y_" + speciesNames_[i]; + + Y_.set + ( + i, + new volVectorField + ( + IOobject + ( + fieldName, + sm.mesh().time().timeName(), + sm.mesh(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ), + sm.mesh(), + dimensionedScalar("zero",sm.mesh().lookupObject(speciesNames_[i]).dimensions(), 0) + ) + );*/ + } + + + allocateMyArrays(); } - /*// define a file name in the coupling properties that contains the species + /* define a file name in the coupling properties that contains the species speciesNames_ ( IFstream @@ -94,11 +115,8 @@ species::species )() ),*/ - //changeOfSpeciesMass_(), - //changeOfSpeciesMassFields_(sm.mesh().lookup (changeOfSpeciesMassFields)), - //changeOfGasMassFields_(sm.mesh().lookup (changeOfGasMassField_)), - // voidfraction and velocity fields can be included by wish +// voidfraction and velocity fields can be included by wish /* voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")), voidfraction_(sm.mesh().lookupObject (voidfractionFieldName_)), velFieldName_(propsDict_.lookup("velFieldName")), @@ -112,7 +130,7 @@ species::~species() { delete partTemp_; delete partRho_; - delete concentrations_; + } // * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * // @@ -124,9 +142,9 @@ void species::allocateMyArrays() const double initVal=0.0; particleCloud_.dataExchangeM().allocateArray(partRho_,initVal,1); particleCloud_.dataExchangeM().allocateArray(partTemp_,initVal,1); - particleCloud_.dataExchangeM().allocateArray(concentrations_,initVal,1); - //particleCloud_.dataExchangeM().allocateArray(Y_,initVal,1); + //particleCloud_.dataExchangeM().allocateArray(concentrations_,initVal,1,numberOfParticles_); + } @@ -142,15 +160,11 @@ void species::execute() label cellI=0; scalar Tfluid(0); scalar rhofluid(0); - scalar Yfluid_[i](0); - interpolationCellPoint TInterpolator_(tempField_); - interpolationCellPoint rhoInterpolator_(rho_); - for (int i=0; i YInterpolator_[i](Y_[i]); - } + + interpolationCellPoint TInterpolator_(tempField_); + interpolationCellPoint rhoInterpolator_(rho_); for (int index=0; index YInterpolator_[i](Y_[i]); + + scalar Yfluid_i = YInterpolator_[i].interpolate(position,cellI); + }*/ } else { Tfluid = tempField_[cellI]; - rho=rho_[cellI]; - for (int i=0; i YInterpolator_[i](Y_[i]); + //} + + // give DEM data - particleCloud_.dataExchangeM().giveData(partTempName_,'scalar-atom',partTemp_); - particleCloud_.dataExchangeM().giveData(partRhoName_,'scalar-atom', partRho_); + particleCloud_.dataExchangeM().giveData(partTempName_, "scalar-atom", partTemp_); + particleCloud_.dataExchangeM().giveData(partRhoName_, "scalar-atom", partRho_); diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.H b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.H index 97eb847f..d16ca5f1 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.H +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.H @@ -49,39 +49,41 @@ private: bool interpolation_; - // const wordList speciesNames_; + const wordList speciesNames_; - // List concentrations_; + PtrList Y_; + + List concentrations_; // List changeOfSpeciesMass_; - - // List changeOfSpeciesMassFields_; - - // volScalarField changeOfGasMassField_; - - // word tempFieldName_; - // const volScalarField& tempField_; // ref to gas temperature field + //List changeOfSpeciesMassFields_; - // word partTempName_; - - // mutable double **partTemp_; // gas temperature at particle positions - - // word densityFieldName_; + //volScalarField changeOfGasMassField_; - // const volScalarField& rho_; + word tempFieldName_; - // word partRhoName_; + const volScalarField& tempField_; // ref to gas temperature field + + word partTempName_; + + mutable double **partTemp_; // gas temperature at particle positions + + word densityFieldName_; + + const volScalarField& rho_; + + word partRhoName_; - // mutable double **partRho_; // gas density at particle positions + mutable double **partRho_; // gas density at particle positions - // word velFieldName_; // Can be uncommented when velocity is to be calculated in the species source code + //word velFieldName_; // Can be uncommented when velocity is to be calculated in the species source code - // const volVectorField& U_; + //const volVectorField& U_; - // word voidfractionFieldName_; // Can be uncommented when voidfraction is to be calculated in the species source code + //word voidfractionFieldName_; // Can be uncommented when voidfraction is to be calculated in the species source code - // const volScalarField& voidfraction_; + //const volScalarField& voidfraction_; void allocateMyArrays() const;