From 5458e4b7d5ec83a243c1dc781b7002b6cee212c1 Mon Sep 17 00:00:00 2001 From: ekinaci Date: Thu, 12 May 2016 16:51:59 +0200 Subject: [PATCH 1/7] minor changes --- .../chemistryModel/species/species.C | 46 +++++-------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C index fc640a21..9d557b75 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C @@ -74,14 +74,14 @@ species::species ( IOobject ( - "changeOfGasMassField_", + "changeOfGasMassField", mesh_.time().timeName(), mesh_, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), mesh_, - dimensionedScalar("zero",dimensionSet(0,0,0,0,0,0,0),0.0) + dimensionedScalar("zero",dimMass/dimVolume,0.0) ), tempFieldName_(propsDict_.lookupOrDefault("tempFieldName","T")), tempField_(sm.mesh().lookupObject (tempFieldName_)), @@ -116,7 +116,7 @@ species::species ( IOobject ( - "New"+Y_[i].name(), + "ModSpeciesMassField_"+Y_[i].name(), mesh_.time().timeName(), mesh_, IOobject::NO_READ, @@ -170,8 +170,6 @@ void species::execute() scalar rhofluid(0); List Yfluid_; Yfluid_.setSize(speciesNames_.size()); - List changedField_; - changedField_.setSize(speciesNames_.size()); // defining interpolators for T, rho interpolationCellPoint TInterpolator_(tempField_); @@ -187,27 +185,11 @@ void species::execute() vector position = particleCloud_.position(index); Tfluid = TInterpolator_.interpolate(position,cellI); rhofluid = rhoInterpolator_.interpolate(position,cellI); - - - for (int i=0;i YInterpolator_[i](Y_[i]); - // Yfluid_[i] = YInterpolator_[i].interpolate(position,cellI); - // const volScalarField& Yfluid_ = mesh_.lookupObject(speciesNames_[i]); - // interpolationCellPoint YInterpolator_(Y_[i]); - //const volScalarField& Yfluid_ = mesh_.lookupObject(Y_[i]); - // interpolationCellPoint YInterpolator_(Y_[i].name()); - // Yfluid_ = YInterpolator_.interpolate(position,cellI); - } } else { Tfluid = tempField_[cellI]; rhofluid=rho_[cellI]; - for (int i=0; i changeOfSpeciesMass_[i]; - // sum or average??? changeOfSpeciesMassFields_[i].internalField() = 0.0; + changeOfSpeciesMassFields_[i].boundaryField() = 0.0; particleCloud_.averagingM().setScalarSum ( changeOfSpeciesMassFields_[i], changeOfSpeciesMass_[i], particleCloud_.particleWeights(), NULL - ); + ); + + // take care for implementation in LIGGGHTS: species produced from particles defined positive + changeOfSpeciesMassFields_[i].internalField() /= changeOfSpeciesMassFields_[i].mesh().V(); + changeOfSpeciesMassFields_[i].correctBoundaryConditions(); changeOfGasMassField_ += changeOfSpeciesMassFields_[i]; - // } + Info << "total conversion of species" << speciesNames_[i] << "=" << gSum(changeOfSpeciesMassFields_[i]*1.0*changeOfSpeciesMassFields_[i].mesh().V()) << endl; } } From 32331ab36650da7881c0eea656aad497448be835 Mon Sep 17 00:00:00 2001 From: ekinaci Date: Thu, 12 May 2016 16:52:35 +0200 Subject: [PATCH 2/7] partial working test case --- .../CFD/constant/couplingProperties | 2 +- .../CFD/system/fvSchemes | 2 ++ .../simplifiedSiwek_in_CFDEM/parCFDDEMrun.sh | 20 +++++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/constant/couplingProperties b/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/constant/couplingProperties index 98694a8d..ea2b4385 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/constant/couplingProperties +++ b/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/constant/couplingProperties @@ -78,7 +78,7 @@ energyModels //reactionHeat ); -thermCondModel off;//SyamlalThermCond;//thermCondModel;//off; +thermCondModel SyamlalThermCond;//thermCondModel;//off; chemistryModel species; diff --git a/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/system/fvSchemes b/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/system/fvSchemes index 94ebc29d..91bdc716 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/system/fvSchemes +++ b/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/system/fvSchemes @@ -39,6 +39,8 @@ divSchemes div((muEff*dev2(T(grad(U))))) Gauss linear; div(phi,Yi_h) Gauss upwind; div((viscousTerm*dev2(grad(U).T()))) Gauss linear; + div((thermo:mu*dev(grad(U).T()))) Gauss linear; + } laplacianSchemes diff --git a/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/parCFDDEMrun.sh b/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/parCFDDEMrun.sh index fe1d189d..f87dd161 100644 --- a/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/parCFDDEMrun.sh +++ b/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/parCFDDEMrun.sh @@ -81,14 +81,14 @@ if [ $postproc == "true" ] fi #- clean up case -echo "deleting data at: $casePath :\n" -source $WM_PROJECT_DIR/bin/tools/CleanFunctions -cd $casePath/CFD -cleanCase -rm -r $casePath/CFD/clockData -rm $casePath/DEM/post/*.* -touch $casePath/DEM/post/.gitignore +#echo "deleting data at: $casePath :\n" +#source $WM_PROJECT_DIR/bin/tools/CleanFunctions +#cd $casePath/CFD +#cleanCase +#rm -r $casePath/CFD/clockData +#rm $casePath/DEM/post/*.* +#touch $casePath/DEM/post/.gitignore #rm $casePath/DEM/post/restart/*.* -rm $casePath/DEM/post/restart/liggghts.restartCFDEM* -touch $casePath/DEM/post/restart/.gitignore -echo "done" +#rm $casePath/DEM/post/restart/liggghts.restartCFDEM* +#touch $casePath/DEM/post/restart/.gitignore +#echo "done" From 8b7e48ac3638dc1515255a0f99f6a2945795323a Mon Sep 17 00:00:00 2001 From: ekinaci Date: Fri, 13 May 2016 10:49:04 +0200 Subject: [PATCH 3/7] fixed noThermCond model --- .../thermCondModel/noTherm/noThermCond.C | 54 ++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/thermCondModel/noTherm/noThermCond.C b/src/lagrangian/cfdemParticle/subModels/thermCondModel/noTherm/noThermCond.C index ffad2d57..63d40b02 100644 --- a/src/lagrangian/cfdemParticle/subModels/thermCondModel/noTherm/noThermCond.C +++ b/src/lagrangian/cfdemParticle/subModels/thermCondModel/noTherm/noThermCond.C @@ -53,9 +53,59 @@ noThermCond::~noThermCond() // * * * * * * * * * * * * * * * * Member Fct * * * * * * * * * * * * * * * // -tmp noThermCond::thermCond() const{return volScalarField::null();} +tmp noThermCond::thermCond() const +{ + tmp tcond + ( + new volScalarField + ( + IOobject + ( + "fake1", + particleCloud_.mesh().time().timeName(), + particleCloud_.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + particleCloud_.mesh(), + dimensionedScalar + ( + "zero", + dimensionSet(0,2,-1,0,0,0,0), + 0.0 + ) + ) + ); -tmp noThermCond::thermDiff() const{return volScalarField::null();} + return tcond; +} + +tmp noThermCond::thermDiff() const +{ + tmp tdif + ( + new volScalarField + ( + IOobject + ( + "fake1", + particleCloud_.mesh().time().timeName(), + particleCloud_.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + particleCloud_.mesh(), + dimensionedScalar + ( + "zero", + dimensionSet(0,2,-1,0,0,0,0), + 0.0 + ) + ) + ); + + return tdif; +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From 920d6468d86212344034dc222728d9fd49f67371 Mon Sep 17 00:00:00 2001 From: ekinaci Date: Fri, 13 May 2016 10:50:38 +0200 Subject: [PATCH 4/7] thermal diffusivity was missing --- .../simplifiedSiwek_in_CFDEM/CFD/0/thDiff | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/0/thDiff diff --git a/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/0/thDiff b/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/0/thDiff new file mode 100644 index 00000000..b5b676d9 --- /dev/null +++ b/tutorials/cfdemSolverRhoPimpleChem/simplifiedSiwek_in_CFDEM/CFD/0/thDiff @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.3.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + top + { + type fixedValue; + value uniform 2.3e-5; + } + + bottom + { + type fixedValue; + value uniform 2.3e-5; + } + + walls + { + type fixedValue; + value uniform 2.3e-5; + + } + + symmetry + { + type symmetryPlane; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // From 6777c7b7dd7e5194f6217f0cdaa03b16689f931b Mon Sep 17 00:00:00 2001 From: ekinaci Date: Fri, 13 May 2016 10:51:45 +0200 Subject: [PATCH 5/7] dim change --- .../cfdemParticle/subModels/chemistryModel/species/species.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C index 2572f41d..f66c002b 100644 --- a/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C +++ b/src/lagrangian/cfdemParticle/subModels/chemistryModel/species/species.C @@ -81,7 +81,7 @@ species::species IOobject::AUTO_WRITE ), mesh_, - dimensionedScalar("zero",dimMass/dimVolume,0.0) + dimensionedScalar("zero",dimMass/dimTime,0.0) ), tempFieldName_(propsDict_.lookupOrDefault("tempFieldName","T")), tempField_(sm.mesh().lookupObject (tempFieldName_)), From 8cbaa515e4cd04e0fd6c1c4a67b29eb31bbbbadf Mon Sep 17 00:00:00 2001 From: Thomas Lichtenegger Date: Fri, 13 May 2016 13:59:18 +0200 Subject: [PATCH 6/7] Add functionality to average particle temperatures. --- .../heatTransferGunn/heatTransferGunn.C | 49 ++++++++++++++----- .../heatTransferGunn/heatTransferGunn.H | 6 +++ 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C index 663bea00..c9471ab3 100644 --- a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C +++ b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C @@ -63,12 +63,26 @@ heatTransferGunn::heatTransferGunn "particleTemp", sm.mesh().time().timeName(), sm.mesh(), - IOobject::READ_IF_PRESENT, + IOobject::NO_READ, IOobject::AUTO_WRITE ), sm.mesh(), dimensionedScalar("zero", dimensionSet(0,0,0,1,0,0,0), 0.0) ), + partRelTempField_ + ( IOobject + ( + "particleRelTemp", + sm.mesh().time().timeName(), + sm.mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + sm.mesh(), + dimensionedScalar("zero", dimensionSet(0,0,0,1,0,0,0), 0.0) + ), + partRefTemp_(0.0), + calcPartTempField_(propsDict_.lookupOrDefault("calcPartTempField",false)), tempFieldName_(propsDict_.lookupOrDefault("tempFieldName","T")), tempField_(sm.mesh().lookupObject (tempFieldName_)), voidfractionFieldName_(propsDict_.lookupOrDefault("voidfractionFieldName","voidfraction")), @@ -90,6 +104,11 @@ heatTransferGunn::heatTransferGunn maxSource_=readScalar(propsDict_.lookup ("maxSource")); Info << "limiting eulerian source field to: " << maxSource_ << endl; } + if (calcPartTempField_) + { + // read ref temp etc + // switch field write options if not already set + } } @@ -123,16 +142,24 @@ void heatTransferGunn::calcEnergyContribution() // get DEM data particleCloud_.dataExchangeM().getData(partTempName_,"scalar-atom",partTemp_); - double **particleWeights=particleCloud_.particleWeights(); - particleCloud_.averagingM().resetWeightFields(); - particleCloud_.averagingM().setScalarAverage - ( - partTempField_, - partTemp_, - particleWeights, - particleCloud_.averagingM().UsWeightField(), - NULL - ); + if(calcPartTempField_) + { + scalar aveTemp(0.0); + partTempField_.internalField() = 0.0; + double **particleWeights=particleCloud_.particleWeights(); + particleCloud_.averagingM().resetWeightFields(); + particleCloud_.averagingM().setScalarAverage + ( + partTempField_, + partTemp_, + particleWeights, + particleCloud_.averagingM().UsWeightField(), + NULL + ); + // check for appropriate averaging function + //aveTemp = gSum(partTempField_ + partRelTempField_ = (partTempField_ - aveTemp) / (aveTemp - partRefTemp_); + } #ifdef compre const volScalarField mufField = particleCloud_.turbulence().mu(); diff --git a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H index 0edd2d75..cf138a80 100644 --- a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H +++ b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.H @@ -52,6 +52,12 @@ private: volScalarField QPartFluid_; volScalarField partTempField_; + + volScalarField partRelTempField_; + + scalar partRefTemp_; + + bool calcPartTempField_; word tempFieldName_; From 8eb000e27b9eff183742ea5b6406b9d058456b80 Mon Sep 17 00:00:00 2001 From: Thomas Lichtenegger Date: Fri, 13 May 2016 18:55:48 +0200 Subject: [PATCH 7/7] Towards particle temp. field. --- .../heatTransferGunn/heatTransferGunn.C | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C index c9471ab3..288daa7b 100644 --- a/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C +++ b/src/lagrangian/cfdemParticle/subModels/energyModel/heatTransferGunn/heatTransferGunn.C @@ -64,7 +64,7 @@ heatTransferGunn::heatTransferGunn sm.mesh().time().timeName(), sm.mesh(), IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), sm.mesh(), dimensionedScalar("zero", dimensionSet(0,0,0,1,0,0,0), 0.0) @@ -76,7 +76,7 @@ heatTransferGunn::heatTransferGunn sm.mesh().time().timeName(), sm.mesh(), IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::NO_WRITE ), sm.mesh(), dimensionedScalar("zero", dimensionSet(0,0,0,1,0,0,0), 0.0) @@ -106,8 +106,11 @@ heatTransferGunn::heatTransferGunn } if (calcPartTempField_) { - // read ref temp etc - // switch field write options if not already set + if (propsDict_.found("partRefTemp")) + partRefTemp_=readScalar(propsDict_.lookup ("partRefTemp")); + partTempField_.writeOpt() = 0; + partRelTempField_.writeOpt() = 0; + Info << "Particle temperature field activated." << endl; } } @@ -145,6 +148,9 @@ void heatTransferGunn::calcEnergyContribution() if(calcPartTempField_) { scalar aveTemp(0.0); + for(int index = 0;index < particleCloud_.numberOfParticles(); ++index) + aveTemp += partTemp_[index][0]; + aveTemp /= particleCloud_.numberOfParticles(); partTempField_.internalField() = 0.0; double **particleWeights=particleCloud_.particleWeights(); particleCloud_.averagingM().resetWeightFields(); @@ -152,12 +158,10 @@ void heatTransferGunn::calcEnergyContribution() ( partTempField_, partTemp_, - particleWeights, + particleCloud_.particleWeights(), particleCloud_.averagingM().UsWeightField(), NULL ); - // check for appropriate averaging function - //aveTemp = gSum(partTempField_ partRelTempField_ = (partTempField_ - aveTemp) / (aveTemp - partRefTemp_); }