mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
Add functionality to average particle temperatures.
This commit is contained in:
@ -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<bool>("calcPartTempField",false)),
|
||||
tempFieldName_(propsDict_.lookupOrDefault<word>("tempFieldName","T")),
|
||||
tempField_(sm.mesh().lookupObject<volScalarField> (tempFieldName_)),
|
||||
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("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();
|
||||
|
||||
@ -52,6 +52,12 @@ private:
|
||||
volScalarField QPartFluid_;
|
||||
|
||||
volScalarField partTempField_;
|
||||
|
||||
volScalarField partRelTempField_;
|
||||
|
||||
scalar partRefTemp_;
|
||||
|
||||
bool calcPartTempField_;
|
||||
|
||||
word tempFieldName_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user