add scale factor for coarse graining

This commit is contained in:
ekinaci
2018-11-27 10:09:07 +01:00
parent eab214a0c4
commit 66e0fc59e8
2 changed files with 39 additions and 17 deletions

View File

@ -141,7 +141,8 @@ heatTransferGunn::heatTransferGunn
partHeatFlux_(NULL),
partHeatFluxCoeff_(NULL),
partRe_(NULL),
partNu_(NULL)
partNu_(NULL),
scaleDia_(1.)
{
allocateMyArrays();
@ -181,6 +182,8 @@ heatTransferGunn::heatTransferGunn
FatalError <<"Cannot read and create NuField at the same time!\n" << abort(FatalError);
}
}
particleCloud_.checkCG(true);
}
@ -230,6 +233,12 @@ void heatTransferGunn::calcEnergyContribution()
// get DEM data
particleCloud_.dataExchangeM().getData(partTempName_,"scalar-atom",partTemp_);
if(particleCloud_.cg() > 1.)
{
scaleDia_ = particleCloud_.cg();
Info << "Heat Transfer Gunn is using scale from liggghts cg = " << scaleDia_ << endl;
}
if(calcPartTempField_)
{
partTempField_.primitiveFieldRef() = 0.0;
@ -269,7 +278,7 @@ void heatTransferGunn::calcEnergyContribution()
scalar Pr(0);
scalar Nup(0);
scalar Tsum(0.0);
scalar ds_scaled(0.);
interpolationCellPoint<scalar> voidfractionInterpolator_(voidfraction_);
interpolationCellPoint<vector> UInterpolator_(U_);
@ -301,15 +310,19 @@ void heatTransferGunn::calcEnergyContribution()
Us = particleCloud_.velocity(index);
magUr = mag(Ufluid - Us);
ds = 2.*particleCloud_.radius(index);
ds_scaled = ds/scaleDia_;
muf = mufField[cellI];
Rep = ds * magUr * voidfraction * rho_[cellI]/ muf;
//Rep = ds * magUr * voidfraction * rho_[cellI]/ muf;
Rep = ds_scaled*magUr*voidfraction*rho_[cellI]/ muf;
Pr = max(SMALL, Cp_ * muf / kf0_);
Nup = Nusselt(voidfraction, Rep, Pr);
Tsum += partTemp_[index][0];
scalar h = kf0_ * Nup / ds;
scalar As = ds * ds * M_PI; // surface area of sphere
//scalar h = kf0_ * Nup / ds;
scalar h = kf0_ * Nup / ds_scaled;
//scalar As = ds * ds * M_PI; // surface area of sphere
scalar As = ds_scaled * ds_scaled * M_PI; // surface area of sphere
// calc convective heat flux [W]
heatFlux(index, h, As, Tfluid);
@ -320,18 +333,25 @@ void heatTransferGunn::calcEnergyContribution()
partNu_[index][0] = Nup;
}
if(particleCloud_.verbose() && index >=0 && index <2)
{
Info << "partHeatFlux = " << partHeatFlux_[index][0] << endl;
Info << "magUr = " << magUr << endl;
Info << "As = " << As << endl;
Info << "muf = " << muf << endl;
Info << "Rep = " << Rep << endl;
Info << "Pr = " << Pr << endl;
Info << "Nup = " << Nup << endl;
Info << "voidfraction = " << voidfraction << endl;
Info << "partTemp_[index][0] = " << partTemp_[index][0] << endl;
Info << "Tfluid = " << Tfluid << endl ;
//if(particleCloud_.verbose() && index >=0 && index <2)
if(verbose_ && index >=0 && index <2)
{
Pout << "partHeatFlux = " << partHeatFlux_[index][0] << endl;
Pout << "magUr = " << magUr << endl;
Pout << "kf0 = " << kf0_ << endl;
Pout << "Cp = " << Cp_ << endl;
Pout << "rho = " << rho_[cellI] << endl;
Pout << "h = " << h << endl;
Pout << "ds = " << ds << endl;
Pout << "ds_scaled = " << ds_scaled << endl;
Pout << "As = " << As << endl;
Pout << "muf = " << muf << endl;
Pout << "Rep = " << Rep << endl;
Pout << "Pr = " << Pr << endl;
Pout << "Nup = " << Nup << endl;
Pout << "voidfraction = " << voidfraction << endl;
Pout << "partTemp_[index][0] = " << partTemp_[index][0] << endl;
Pout << "Tfluid = " << Tfluid << endl ;
}
}
}

View File

@ -109,6 +109,8 @@ protected:
mutable double **partNu_;
mutable scalar scaleDia_;
void allocateMyArrays() const;
void partTempField();