diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C index be2dfea3..ae876b65 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C @@ -21,6 +21,8 @@ License #include "error.H" #include "species.H" #include "addToRunTimeSelectionTable.H" + +#include "dataExchangeModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -30,7 +32,12 @@ namespace Foam defineTypeNameAndDebug(species, 0); -addToRunTimeSelectionTable(chemistryModel, species, dictionary); +addToRunTimeSelectionTable +( + chemistryModel, + species, + dictionary +); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -43,11 +50,36 @@ species::species : chemistryModel(dict,sm), propsDict_(dict.subDict(typeName + "Props")), - interpolation_(propsDict_.lookupOrDefault("interpolation",false)) + interpolation_(propsDict_.lookupOrDefault("interpolation",false)), + //speciesNames_(propsDict_.lookup("speciesNames")); + //Y_(sm.mesh().lookup (speciesNames_)), + + + //concentrations_(), + //changeOfSpeciesMass_(), + + //changeOfSpeciesMassFields_(sm.mesh().lookup (changeOfSpeciesMassFields)), + //changeOfGasMassFields_(sm.mesh().lookup (changeOfGasMassField_)), + + tempFieldName_(propsDict_.lookupOrDefault("tempFieldName","T")), + tempField_(sm.mesh().lookupObject (tempFieldName_)), + partTempName_(propsDict_.lookup("partTempName")), + partTemp_(NULL), + + densityFieldName_(propsDict_.lookupOrDefault("densityFieldName","rho")), + rho_(sm.mesh().lookupObject (densityFieldName_)), + partRhoName_(propsDict_.lookup("partRhoName")), + partRho_(NULL), + + + /* voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")), + voidfraction_(sm.mesh().lookupObject (voidfractionFieldName_)), + velFieldName_(propsDict_.lookup("velFieldName")), + U_(sm.mesh().lookup (velFieldName_)),*/ + { allocateMyArrays(); - } @@ -55,22 +87,78 @@ species::species species::~species() { - + delete partTemp_; + delete partRho_; } // * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * // void species::allocateMyArrays() const { // could be implemented similarly as forcemodel LaEuScalarTemp + + // get memory for 2d arrays + double initVal=0.0; + particleCloud_.dataExchangeM().allocateArray(partRho_,initVal,1); + particleCloud_.dataExchangeM().allocateArray(partTemp_,initVal,1); + //particleCloud_.dataExchangeM().allocateArray(Y_,initVal,1); + } // * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * // void species::execute() { - + // realloc the arrays + allocateMyArrays(); + + // get DEM data + particleCloud_.dataExchangeM().getData(partTempName_,'scalar-atom',partTemp_); + //particleCloud_.dataExchangeM().getData(partRhoName_,'scalar-atom',partRho_); + // get Y_i, T, rho at particle positions, fill arrays with them and push to LIGGGHTS - + + scalar Tfluid(0); + label cellI=0; + scalar rho(0); + scalar Yfluid(0); + + interpolationCellPoint TInterpolator_(tempField_); + interpolationCellPoint rhoInterpolator_(rho_); + itnerpolationCellPoint YInterpolator_(Y_); + + for (int index=0; index=0) + { + if(interpolation_) + //if(chemistryM(0).interpolation()) + { + vector position = particleCloud_.position(index); + Tfluid = TInterpolator_.interpolate(poistion,cellI); + rho=rhoInterpolator_.interpolate(position,cellI); + Yfluid=YInterpolator_.interpolate(position,cellI); + } + else + { + Tfluid = tempField_[cellI]; + rho=rho_[cellI]; + Yfluid=Y_[cellI]; + } + + // calculate T, rho, Y_i + + //fill arrays + partTemp_[index][0]=; + partRho_[index][0]=; + + + } + } + + + + // pull changeOfSpeciesMass_, transform onto fields changeOfSpeciesMassFields_, add them up on changeOfGasMassField_ } diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.H b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.H index e414be2c..a34e1738 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.H +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.H @@ -63,11 +63,15 @@ private: // 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