mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
use const word class member variables to store particle property names
internal variable naming convention for registered particle properties: * suffix 'RegName_' indicates class-internal particle property usage; these names use the typeName of the class as prefix for uniqueness * suffix 'Name_' indicates particle properties also used in give/getData; these names can potentially cause a conflict if multiple models try to communicate a property with the same name (some of them can be customized via the couplingProperties dict to resolve this situation)
This commit is contained in:
@ -77,7 +77,7 @@ diffusionCoefficient::diffusionCoefficient
|
||||
initialized_(false)
|
||||
{
|
||||
particleCloud_.checkCG(false);
|
||||
particleCloud_.registerParticleProperty<double**>("partPressure",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partPressureName_,1);
|
||||
for (int i=0; i<diffusantGasNames_.size(); i++)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>(diffusantGasNames_[i],1);
|
||||
@ -144,7 +144,7 @@ void diffusionCoefficient::execute()
|
||||
interpolationCellPoint <scalar> TInterpolator_(tempField_);
|
||||
interpolationCellPoint <scalar> PInterpolator_(P_);
|
||||
|
||||
double**& partPressure_ = particleCloud_.getParticlePropertyRef<double**>("partPressure");
|
||||
double**& partPressure_ = particleCloud_.getParticlePropertyRef<double**>(partPressureName_);
|
||||
|
||||
for (int index=0; index<particleCloud_.numberOfParticles(); ++index)
|
||||
{
|
||||
|
||||
@ -63,12 +63,12 @@ massTransferCoeff::massTransferCoeff
|
||||
densityFieldName_(propsDict_.lookupOrDefault<word>("densityFieldName","rho")),
|
||||
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
||||
partNuName_(propsDict_.lookupOrDefault<word>("partViscos","partNu")),
|
||||
partReynolds_(propsDict_.lookupOrDefault<word>("partReynolds","partRe")),
|
||||
partReName_(propsDict_.lookupOrDefault<word>("partReynolds","partRe")),
|
||||
scaleDia_(1)
|
||||
{
|
||||
particleCloud_.checkCG(true);
|
||||
particleCloud_.registerParticleProperty<double**>(partNuName_,1);
|
||||
particleCloud_.registerParticleProperty<double**>(partReynolds_,1);
|
||||
particleCloud_.registerParticleProperty<double**>(partReName_,1);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
@ -115,7 +115,7 @@ void massTransferCoeff::execute()
|
||||
interpolationCellPoint <scalar> voidfractionInterpolator_(voidfraction_);
|
||||
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>(partNuName_);
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>(partReynolds_);
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>(partReName_);
|
||||
|
||||
for (int index=0; index<particleCloud_.numberOfParticles(); ++index)
|
||||
{
|
||||
@ -173,7 +173,7 @@ void massTransferCoeff::execute()
|
||||
|
||||
// give DEM data
|
||||
particleCloud_.dataExchangeM().giveData(partNuName_, "scalar-atom", partNu_);
|
||||
particleCloud_.dataExchangeM().giveData(partReynolds_, "scalar-atom", partRe_);
|
||||
particleCloud_.dataExchangeM().giveData(partReName_, "scalar-atom", partRe_);
|
||||
|
||||
Info << "give data done" << endl;
|
||||
}
|
||||
|
||||
@ -68,9 +68,9 @@ private:
|
||||
|
||||
const volScalarField& rho_;
|
||||
|
||||
word partNuName_;
|
||||
const word partNuName_;
|
||||
|
||||
word partReynolds_;
|
||||
const word partReName_;
|
||||
|
||||
mutable scalar scaleDia_;
|
||||
|
||||
|
||||
@ -57,6 +57,7 @@ reactantPerParticle::reactantPerParticle
|
||||
propsDict_(dict.subDict(typeName + "Props")),
|
||||
mesh_(sm.mesh()),
|
||||
verbose_(propsDict_.lookupOrDefault<bool>("verbose",false)),
|
||||
partReactantName_("reactantPerParticle"),
|
||||
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
|
||||
voidfraction_(sm.mesh().lookupObject<volScalarField>(voidfractionFieldName_)),
|
||||
particlesPerCell_
|
||||
@ -75,7 +76,7 @@ reactantPerParticle::reactantPerParticle
|
||||
Nevery_(propsDict_.lookupOrDefault<label>("Nevery",1))
|
||||
{
|
||||
particleCloud_.checkCG(false);
|
||||
particleCloud_.registerParticleProperty<double**>("reactantPerParticle",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partReactantName_,1);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
@ -102,7 +103,7 @@ void reactantPerParticle::execute()
|
||||
scalar voidfraction(1);
|
||||
scalar cellvolume(0.0);
|
||||
scalar particlesPerCell(1.0);
|
||||
double**& reactantPerParticle_ = particleCloud_.getParticlePropertyRef<double**>("reactantPerParticle");
|
||||
double**& reactantPerParticle_ = particleCloud_.getParticlePropertyRef<double**>(partReactantName_);
|
||||
|
||||
// first create particles per cell field
|
||||
for (int index=0; index<particleCloud_.numberOfParticles(); ++index)
|
||||
@ -130,7 +131,7 @@ void reactantPerParticle::execute()
|
||||
}
|
||||
|
||||
// give DEM data
|
||||
particleCloud_.dataExchangeM().giveData("reactantPerParticle", "scalar-atom", reactantPerParticle_);
|
||||
particleCloud_.dataExchangeM().giveData(partReactantName_, "scalar-atom", reactantPerParticle_);
|
||||
|
||||
Info << "give data done" << endl;
|
||||
}
|
||||
|
||||
@ -56,7 +56,9 @@ private:
|
||||
|
||||
bool verbose_;
|
||||
|
||||
word voidfractionFieldName_;
|
||||
const word partReactantName_;
|
||||
|
||||
const word voidfractionFieldName_;
|
||||
|
||||
const volScalarField& voidfraction_;
|
||||
|
||||
|
||||
@ -95,10 +95,11 @@ heatTransferGranConduction::heatTransferGranConduction
|
||||
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
|
||||
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
|
||||
partHeatFluxName_(propsDict_.lookupOrDefault<word>("partHeatFluxName","conductiveHeatFlux")),
|
||||
typePartThermCond_(propsDict_.lookupOrDefault<scalarList>("thermalConductivities",scalarList(1,-1.0)))
|
||||
typePartThermCond_(propsDict_.lookupOrDefault<scalarList>("thermalConductivities",scalarList(1,-1.0))),
|
||||
partThermCondRegName_(typeName + "partThermCond")
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>(partHeatFluxName_,1);
|
||||
particleCloud_.registerParticleProperty<double**>("partThermCond",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partThermCondRegName_,1);
|
||||
|
||||
if (typePartThermCond_[0] < 0.0)
|
||||
{
|
||||
@ -188,7 +189,7 @@ void heatTransferGranConduction::calcPartThermCond()
|
||||
{
|
||||
label cellI=0;
|
||||
label partType = 1;
|
||||
double**& partThermCond_ = particleCloud_.getParticlePropertyRef<double**>("partThermCond");
|
||||
double**& partThermCond_ = particleCloud_.getParticlePropertyRef<double**>(partThermCondRegName_);
|
||||
|
||||
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
|
||||
{
|
||||
|
||||
@ -76,6 +76,8 @@ protected:
|
||||
|
||||
scalarList typePartThermCond_;
|
||||
|
||||
const word partThermCondRegName_;
|
||||
|
||||
void calcPartEffThermCond();
|
||||
|
||||
void calcPartThermCond();
|
||||
|
||||
@ -144,6 +144,9 @@ heatTransferGunn::heatTransferGunn
|
||||
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
||||
partTempName_(propsDict_.lookup("partTempName")),
|
||||
partHeatFluxName_(propsDict_.lookupOrDefault<word>("partHeatFluxName","convectiveHeatFlux")),
|
||||
partHeatFluxCoeffRegName_(typeName + "partHeatFluxCoeff"),
|
||||
partReRegName_(typeName + "partRe"),
|
||||
partNuRegName_(typeName + "partNu"),
|
||||
scaleDia_(1.),
|
||||
typeCG_(propsDict_.lookupOrDefault<scalarList>("coarseGrainingFactors",scalarList(1,1.0))),
|
||||
maxTypeCG_(typeCG_.size())
|
||||
@ -152,12 +155,12 @@ heatTransferGunn::heatTransferGunn
|
||||
particleCloud_.registerParticleProperty<double**>(partHeatFluxName_,1);
|
||||
if (implicit_)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("partHeatFluxCoeff",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partHeatFluxCoeffRegName_,1);
|
||||
}
|
||||
if(verbose_)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("partRe",1);
|
||||
particleCloud_.registerParticleProperty<double**>("partNu",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partReRegName_,1);
|
||||
particleCloud_.registerParticleProperty<double**>(partNuRegName_,1);
|
||||
}
|
||||
|
||||
if (propsDict_.found("NusseltScalingFactor"))
|
||||
@ -367,8 +370,8 @@ void heatTransferGunn::calcEnergyContribution()
|
||||
|
||||
if(verbose_)
|
||||
{
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>("partRe");
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>("partNu");
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>(partReRegName_);
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>(partNuRegName_);
|
||||
partRe_[index][0] = Rep;
|
||||
partNu_[index][0] = Nup;
|
||||
}
|
||||
@ -415,7 +418,7 @@ void heatTransferGunn::calcEnergyContribution()
|
||||
|
||||
if(implicit_)
|
||||
{
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>("partHeatFluxCoeff");
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>(partHeatFluxCoeffRegName_);
|
||||
QPartFluidCoeff_.primitiveFieldRef() = 0.0;
|
||||
|
||||
particleCloud_.averagingM().setScalarSum
|
||||
@ -431,8 +434,8 @@ void heatTransferGunn::calcEnergyContribution()
|
||||
|
||||
if(verbose_)
|
||||
{
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>("partRe");
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>("partNu");
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>(partReRegName_);
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>(partNuRegName_);
|
||||
ReField_.primitiveFieldRef() = 0.0;
|
||||
NuField_.primitiveFieldRef() = 0.0;
|
||||
particleCloud_.averagingM().resetWeightFields();
|
||||
@ -516,7 +519,7 @@ void heatTransferGunn::heatFlux(label index, scalar h, scalar As, scalar Tfluid,
|
||||
}
|
||||
else
|
||||
{
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>("partHeatFluxCoeff");
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>(partHeatFluxCoeffRegName_);
|
||||
partHeatFluxCoeff_[index][0] = hAs;
|
||||
}
|
||||
}
|
||||
@ -543,7 +546,7 @@ void heatTransferGunn::postFlow()
|
||||
interpolationCellPoint<scalar> TInterpolator_(tempField_);
|
||||
double**& partTemp_ = particleCloud_.getParticlePropertyRef<double**>(partTempName_);
|
||||
double**& partHeatFlux_ = particleCloud_.getParticlePropertyRef<double**>(partHeatFluxName_);
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>("partHeatFluxCoeff");
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>(partHeatFluxCoeffRegName_);
|
||||
|
||||
totalHeatFlux_ = 0.0;
|
||||
|
||||
|
||||
@ -112,6 +112,12 @@ protected:
|
||||
|
||||
word partHeatFluxName_;
|
||||
|
||||
const word partHeatFluxCoeffRegName_;
|
||||
|
||||
const word partReRegName_;
|
||||
|
||||
const word partNuRegName_;
|
||||
|
||||
mutable scalar scaleDia_;
|
||||
|
||||
scalarList typeCG_;
|
||||
|
||||
@ -143,6 +143,9 @@ heatTransferRanzMarshall::heatTransferRanzMarshall
|
||||
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
|
||||
partTempName_(propsDict_.lookup("partTempName")),
|
||||
partHeatFluxName_(propsDict_.lookupOrDefault<word>("partHeatFluxName","convectiveHeatFlux")),
|
||||
partHeatFluxCoeffRegName_(typeName + "partHeatFluxCoeff"),
|
||||
partReRegName_(typeName + "partRe"),
|
||||
partNuRegName_(typeName + "partNu"),
|
||||
scaleDia_(1.),
|
||||
typeCG_(propsDict_.lookupOrDefault<scalarList>("coarseGrainingFactors",scalarList(1,1.0))),
|
||||
maxTypeCG_(typeCG_.size())
|
||||
@ -151,12 +154,12 @@ heatTransferRanzMarshall::heatTransferRanzMarshall
|
||||
particleCloud_.registerParticleProperty<double**>(partHeatFluxName_,1);
|
||||
if (implicit_)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("partHeatFluxCoeff",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partHeatFluxCoeffRegName_,1);
|
||||
}
|
||||
if(verbose_)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("partRe",1);
|
||||
particleCloud_.registerParticleProperty<double**>("partNu",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partReRegName_,1);
|
||||
particleCloud_.registerParticleProperty<double**>(partNuRegName_,1);
|
||||
}
|
||||
|
||||
if (propsDict_.found("NusseltScalingFactor"))
|
||||
@ -367,8 +370,8 @@ void heatTransferRanzMarshall::calcEnergyContribution()
|
||||
|
||||
if(verbose_)
|
||||
{
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>("partRe");
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>("partNu");
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>(partReRegName_);
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>(partNuRegName_);
|
||||
partRe_[index][0] = Rep;
|
||||
partNu_[index][0] = Nup;
|
||||
}
|
||||
@ -409,7 +412,7 @@ void heatTransferRanzMarshall::calcEnergyContribution()
|
||||
|
||||
if(implicit_)
|
||||
{
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>("partHeatFluxCoeff");
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>(partHeatFluxCoeffRegName_);
|
||||
QPartFluidCoeff_.primitiveFieldRef() = 0.0;
|
||||
|
||||
particleCloud_.averagingM().setScalarSum
|
||||
@ -425,8 +428,8 @@ void heatTransferRanzMarshall::calcEnergyContribution()
|
||||
|
||||
if(verbose_)
|
||||
{
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>("partRe");
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>("partNu");
|
||||
double**& partRe_ = particleCloud_.getParticlePropertyRef<double**>(partReRegName_);
|
||||
double**& partNu_ = particleCloud_.getParticlePropertyRef<double**>(partNuRegName_);
|
||||
ReField_.primitiveFieldRef() = 0.0;
|
||||
NuField_.primitiveFieldRef() = 0.0;
|
||||
particleCloud_.averagingM().resetWeightFields();
|
||||
@ -504,7 +507,7 @@ void heatTransferRanzMarshall::heatFlux(label index, scalar h, scalar As, scalar
|
||||
}
|
||||
else
|
||||
{
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>("partHeatFluxCoeff");
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>(partHeatFluxCoeffRegName_);
|
||||
partHeatFluxCoeff_[index][0] = hAs;
|
||||
}
|
||||
}
|
||||
@ -531,7 +534,7 @@ void heatTransferRanzMarshall::postFlow()
|
||||
interpolationCellPoint<scalar> TInterpolator_(tempField_);
|
||||
double**& partTemp_ = particleCloud_.getParticlePropertyRef<double**>(partTempName_);
|
||||
double**& partHeatFlux_ = particleCloud_.getParticlePropertyRef<double**>(partHeatFluxName_);
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>("partHeatFluxCoeff");
|
||||
double**& partHeatFluxCoeff_ = particleCloud_.getParticlePropertyRef<double**>(partHeatFluxCoeffRegName_);
|
||||
|
||||
totalHeatFlux_ = 0.0;
|
||||
|
||||
|
||||
@ -111,6 +111,12 @@ protected:
|
||||
|
||||
word partHeatFluxName_;
|
||||
|
||||
const word partHeatFluxCoeffRegName_;
|
||||
|
||||
const word partReRegName_;
|
||||
|
||||
const word partNuRegName_;
|
||||
|
||||
mutable scalar scaleDia_;
|
||||
|
||||
scalarList typeCG_;
|
||||
|
||||
@ -74,6 +74,8 @@ KochHillRWDrag::KochHillRWDrag
|
||||
interpolation_(propsDict_.found("interpolation")),
|
||||
scale_(1.),
|
||||
randomTauE_(propsDict_.found("randomTauE")),
|
||||
partTimeRegName_(typeName + "partTime"),
|
||||
partUfluctRegName_(typeName + "partUfluct"),
|
||||
RanGen_(label(0))
|
||||
{
|
||||
|
||||
@ -97,8 +99,8 @@ KochHillRWDrag::KochHillRWDrag
|
||||
if (propsDict_.found("rhoP"))
|
||||
rhoP_= readScalar(propsDict_.lookup("rhoP"));
|
||||
|
||||
particleCloud_.registerParticleProperty<double**>("partTime",1,0.0,false);
|
||||
particleCloud_.registerParticleProperty<double**>("partUfluct",3,0.0,false);
|
||||
particleCloud_.registerParticleProperty<double**>(partTimeRegName_,1,0.0,false);
|
||||
particleCloud_.registerParticleProperty<double**>(partUfluctRegName_,3,0.0,false);
|
||||
}
|
||||
|
||||
|
||||
@ -173,8 +175,8 @@ void KochHillRWDrag::setForce() const
|
||||
interpolationCellPoint<scalar> voidfractionInterpolator_(voidfraction_);
|
||||
interpolationCellPoint<vector> UInterpolator_(U_);
|
||||
|
||||
double**& partTime_ = particleCloud_.getParticlePropertyRef<double**>("partTime");
|
||||
double**& partUfluct_ = particleCloud_.getParticlePropertyRef<double**>("partUfluct");
|
||||
double**& partTime_ = particleCloud_.getParticlePropertyRef<double**>(partTimeRegName_);
|
||||
double**& partUfluct_ = particleCloud_.getParticlePropertyRef<double**>(partUfluctRegName_);
|
||||
|
||||
//Info << "RW-TEST: We are in setForce() at t = " << t << endl; // TEST-Output
|
||||
|
||||
|
||||
@ -89,6 +89,10 @@ private:
|
||||
|
||||
const bool randomTauE_;
|
||||
|
||||
const word partTimeRegName_;
|
||||
|
||||
const word partUfluctRegName_;
|
||||
|
||||
mutable Random RanGen_;
|
||||
|
||||
public:
|
||||
|
||||
@ -54,6 +54,8 @@ dSauter::dSauter
|
||||
forceModel(dict,sm),
|
||||
propsDict_(dict.subDict(typeName + "Props")),
|
||||
multiTypes_(false),
|
||||
d2RegName_(typeName + "d2"),
|
||||
d3RegName_(typeName + "d3"),
|
||||
maxTypeCG_(1),
|
||||
typeCG_(propsDict_.lookupOrDefault<scalarList>("coarseGrainingFactors",scalarList(1,1.0))),
|
||||
d2Field_
|
||||
@ -100,8 +102,8 @@ dSauter::dSauter
|
||||
maxTypeCG_ = typeCG_.size();
|
||||
}
|
||||
|
||||
particleCloud_.registerParticleProperty<double**>("d2",1);
|
||||
particleCloud_.registerParticleProperty<double**>("d3",1);
|
||||
particleCloud_.registerParticleProperty<double**>(d2RegName_,1);
|
||||
particleCloud_.registerParticleProperty<double**>(d3RegName_,1);
|
||||
|
||||
dSauter_.write();
|
||||
|
||||
@ -128,8 +130,8 @@ void dSauter::setForce() const
|
||||
Info << "dSauter using CG factor(s) = " << typeCG_ << endl;
|
||||
}
|
||||
|
||||
double**& d2_ = particleCloud_.getParticlePropertyRef<double**>("d2");
|
||||
double**& d3_ = particleCloud_.getParticlePropertyRef<double**>("d3");
|
||||
double**& d2_ = particleCloud_.getParticlePropertyRef<double**>(d2RegName_);
|
||||
double**& d3_ = particleCloud_.getParticlePropertyRef<double**>(d3RegName_);
|
||||
|
||||
label cellI = 0;
|
||||
label partType = 1;
|
||||
|
||||
@ -45,6 +45,10 @@ private:
|
||||
|
||||
bool multiTypes_;
|
||||
|
||||
const word d2RegName_;
|
||||
|
||||
const word d3RegName_;
|
||||
|
||||
label maxTypeCG_;
|
||||
|
||||
scalarList typeCG_;
|
||||
|
||||
@ -53,6 +53,7 @@ granKineticEnergy::granKineticEnergy
|
||||
:
|
||||
forceModel(dict,sm),
|
||||
propsDict_(dict.subDict(typeName + "Props")),
|
||||
vflucRegName_(typeName + "vfluc_mag"),
|
||||
UsFieldName_(propsDict_.lookup("granVelFieldName")),
|
||||
UsField_(sm.mesh().lookupObject<volVectorField> (UsFieldName_)),
|
||||
granKineticEnergy_
|
||||
@ -69,7 +70,7 @@ granKineticEnergy::granKineticEnergy
|
||||
"zeroGradient"
|
||||
)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("vfluc_mag",1);
|
||||
particleCloud_.registerParticleProperty<double**>(vflucRegName_,1);
|
||||
granKineticEnergy_.write();
|
||||
|
||||
|
||||
@ -88,7 +89,7 @@ granKineticEnergy::~granKineticEnergy()
|
||||
|
||||
void granKineticEnergy::setForce() const
|
||||
{
|
||||
double**& vfluc_ = particleCloud_.getParticlePropertyRef<double**>("vfluc_mag");
|
||||
double**& vfluc_ = particleCloud_.getParticlePropertyRef<double**>(vflucRegName_);
|
||||
|
||||
label cellI = 0;
|
||||
vector velfluc(0,0,0);
|
||||
|
||||
@ -43,7 +43,9 @@ private:
|
||||
|
||||
dictionary propsDict_;
|
||||
|
||||
word UsFieldName_;
|
||||
const word vflucRegName_;
|
||||
|
||||
const word UsFieldName_;
|
||||
|
||||
const volVectorField& UsField_;
|
||||
|
||||
|
||||
@ -59,9 +59,10 @@ particleDeformation::particleDeformation
|
||||
defaultDeformation_(propsDict_.lookupOrDefault<scalar>("defaultDeformation",1.0)),
|
||||
partTypes_(propsDict_.lookupOrDefault<labelList>("partTypes",labelList(1,-1))),
|
||||
lowerBounds_(propsDict_.lookupOrDefault<scalarList>("lowerBounds",scalarList(1,-1.0))),
|
||||
upperBounds_(propsDict_.lookupOrDefault<scalarList>("upperBounds",scalarList(1,-1.0)))
|
||||
upperBounds_(propsDict_.lookupOrDefault<scalarList>("upperBounds",scalarList(1,-1.0))),
|
||||
partDeformationsName_("partDeformations")
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("partDeformations",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partDeformationsName_,1);
|
||||
|
||||
// init force sub model
|
||||
setForceSubModels(propsDict_);
|
||||
@ -138,7 +139,7 @@ void particleDeformation::setForce() const
|
||||
initialExec_ = false;
|
||||
}
|
||||
|
||||
double**& partDeformations_ = particleCloud_.getParticlePropertyRef<double**>("partDeformations");
|
||||
double**& partDeformations_ = particleCloud_.getParticlePropertyRef<double**>(partDeformationsName_);
|
||||
|
||||
label cellI = 0;
|
||||
label partType = -1;
|
||||
@ -196,7 +197,7 @@ void particleDeformation::setForce() const
|
||||
}
|
||||
|
||||
// give DEM data
|
||||
particleCloud_.dataExchangeM().giveData("partDeformations","scalar-atom", partDeformations_);
|
||||
particleCloud_.dataExchangeM().giveData(partDeformationsName_,"scalar-atom", partDeformations_);
|
||||
}
|
||||
|
||||
void particleDeformation::init() const
|
||||
|
||||
@ -74,6 +74,8 @@ private:
|
||||
|
||||
scalarList upperBounds_;
|
||||
|
||||
const word partDeformationsName_;
|
||||
|
||||
label getListIndex(label) const;
|
||||
|
||||
void init() const;
|
||||
|
||||
@ -55,6 +55,11 @@ pdCorrelation::pdCorrelation
|
||||
:
|
||||
forceModel(dict,sm),
|
||||
propsDict_(dict.subDict(typeName + "Props")),
|
||||
dRegName_(typeName + "d"),
|
||||
pRegName_(typeName + "p"),
|
||||
d2RegName_(typeName + "d2"),
|
||||
pdRegName_(typeName + "pd"),
|
||||
cg3RegName_(typeName + "cg3"),
|
||||
dField_
|
||||
( IOobject
|
||||
(
|
||||
@ -146,11 +151,11 @@ pdCorrelation::pdCorrelation
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
particleCloud_.registerParticleProperty<double**>("d",1);
|
||||
particleCloud_.registerParticleProperty<double**>("p",3);
|
||||
particleCloud_.registerParticleProperty<double**>("d2",1);
|
||||
particleCloud_.registerParticleProperty<double**>("pd",3);
|
||||
particleCloud_.registerParticleProperty<double**>("cg3",1);
|
||||
particleCloud_.registerParticleProperty<double**>(dRegName_,1);
|
||||
particleCloud_.registerParticleProperty<double**>(pRegName_,3);
|
||||
particleCloud_.registerParticleProperty<double**>(d2RegName_,1);
|
||||
particleCloud_.registerParticleProperty<double**>(pdRegName_,3);
|
||||
particleCloud_.registerParticleProperty<double**>(cg3RegName_,1);
|
||||
|
||||
dField_.write();
|
||||
pdField_.write();
|
||||
@ -175,11 +180,11 @@ void pdCorrelation::setForce() const
|
||||
|
||||
if (runOnWriteOnly_ && !mesh.write()) return; // skip if it's not write time
|
||||
|
||||
double**& d_ = particleCloud_.getParticlePropertyRef<double**>("d");
|
||||
double**& p_ = particleCloud_.getParticlePropertyRef<double**>("p");
|
||||
double**& d2_ = particleCloud_.getParticlePropertyRef<double**>("d2");
|
||||
double**& pd_ = particleCloud_.getParticlePropertyRef<double**>("pd");
|
||||
double**& cg3_ = particleCloud_.getParticlePropertyRef<double**>("cg3");
|
||||
double**& d_ = particleCloud_.getParticlePropertyRef<double**>(dRegName_);
|
||||
double**& p_ = particleCloud_.getParticlePropertyRef<double**>(pRegName_);
|
||||
double**& d2_ = particleCloud_.getParticlePropertyRef<double**>(d2RegName_);
|
||||
double**& pd_ = particleCloud_.getParticlePropertyRef<double**>(pdRegName_);
|
||||
double**& cg3_ = particleCloud_.getParticlePropertyRef<double**>(cg3RegName_);
|
||||
|
||||
const Switch densityFromList
|
||||
(
|
||||
|
||||
@ -45,6 +45,12 @@ private:
|
||||
|
||||
dictionary propsDict_;
|
||||
|
||||
const word dRegName_;
|
||||
const word pRegName_;
|
||||
const word d2RegName_;
|
||||
const word pdRegName_;
|
||||
const word cg3RegName_;
|
||||
|
||||
mutable volScalarField dField_;
|
||||
mutable volVectorField pField_;
|
||||
mutable volScalarField d2Field_;
|
||||
|
||||
@ -82,9 +82,10 @@ potentialRelaxation::potentialRelaxation
|
||||
dt_(particleCloud_.dataExchangeM().DEMts()),
|
||||
ignoreReg_(propsDict_.lookupOrDefault<bool>("ignoreRegion",false)),
|
||||
ignoreDirection_(propsDict_.lookupOrDefault<vector>("ignoreDirection",vector::zero)),
|
||||
ignorePoint_(propsDict_.lookupOrDefault<vector>("ignorePoint",vector::zero))
|
||||
ignorePoint_(propsDict_.lookupOrDefault<vector>("ignorePoint",vector::zero)),
|
||||
vflucName_("vfluc")
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("vfluc",3);
|
||||
particleCloud_.registerParticleProperty<double**>(vflucName_,3);
|
||||
|
||||
if(ignoreReg_)
|
||||
{
|
||||
@ -117,7 +118,7 @@ void potentialRelaxation::setForce() const
|
||||
|
||||
// volVectorField relaxStream = DField_ * fvc::grad(voidfraction_ - voidfractionRec_);
|
||||
|
||||
double**& vfluc_ = particleCloud_.getParticlePropertyRef<double**>("vfluc");
|
||||
double**& vfluc_ = particleCloud_.getParticlePropertyRef<double**>(vflucName_);
|
||||
|
||||
vector position(0,0,0);
|
||||
scalar voidfraction(0.0);
|
||||
@ -174,7 +175,7 @@ void potentialRelaxation::setForce() const
|
||||
}
|
||||
}
|
||||
|
||||
particleCloud_.dataExchangeM().giveData("vfluc","vector-atom", vfluc_);
|
||||
particleCloud_.dataExchangeM().giveData(vflucName_,"vector-atom", vfluc_);
|
||||
|
||||
if (measureDiff_)
|
||||
{
|
||||
|
||||
@ -78,6 +78,8 @@ private:
|
||||
|
||||
vector ignorePoint_;
|
||||
|
||||
const word vflucName_;
|
||||
|
||||
void relax(scalar, scalar) const;
|
||||
|
||||
public:
|
||||
|
||||
@ -69,10 +69,11 @@ virtualMassForce::virtualMassForce
|
||||
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
|
||||
phiFieldName_(propsDict_.lookup("phiFieldName")),
|
||||
phi_(sm.mesh().lookupObject<surfaceScalarField> (phiFieldName_)),
|
||||
UrelOldRegName_(typeName + "UrelOld"),
|
||||
splitUrelCalculation_(propsDict_.lookupOrDefault<bool>("splitUrelCalculation",false)),
|
||||
Cadd_(0.5)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("UrelOld",3,NOTONCPU,false);
|
||||
particleCloud_.registerParticleProperty<double**>(UrelOldRegName_,3,NOTONCPU,false);
|
||||
|
||||
// init force sub model
|
||||
setForceSubModels(propsDict_);
|
||||
@ -117,7 +118,7 @@ virtualMassForce::~virtualMassForce()
|
||||
|
||||
void virtualMassForce::setForce() const
|
||||
{
|
||||
double**& UrelOld_ = particleCloud_.getParticlePropertyRef<double**>("UrelOld");
|
||||
double**& UrelOld_ = particleCloud_.getParticlePropertyRef<double**>(UrelOldRegName_);
|
||||
|
||||
scalar dt = U_.mesh().time().deltaT().value();
|
||||
|
||||
|
||||
@ -71,6 +71,8 @@ private:
|
||||
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
const word UrelOldRegName_;
|
||||
|
||||
const bool splitUrelCalculation_; //indicator to split calculation of Urel between CFDEM and LIGGGHTS
|
||||
//requires the integration fix to take dv/dt into account!
|
||||
|
||||
|
||||
@ -54,7 +54,8 @@ ZehnerSchluenderThermCond::ZehnerSchluenderThermCond
|
||||
partKsField_(const_cast<volScalarField&>(sm.mesh().lookupObject<volScalarField> (partKsFieldName_))),
|
||||
voidfractionFieldName_(propsDict_.lookupOrDefault<word>("voidfractionFieldName","voidfraction")),
|
||||
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
|
||||
typeKs_(propsDict_.lookupOrDefault<scalarList>("thermalConductivities",scalarList(1,-1.0)))
|
||||
typeKs_(propsDict_.lookupOrDefault<scalarList>("thermalConductivities",scalarList(1,-1.0))),
|
||||
partKsRegName_(typeName + "partKs")
|
||||
{
|
||||
if (typeKs_[0] < 0.0)
|
||||
{
|
||||
@ -63,7 +64,7 @@ ZehnerSchluenderThermCond::ZehnerSchluenderThermCond
|
||||
|
||||
if (typeKs_.size() > 1)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("partKs",1);
|
||||
particleCloud_.registerParticleProperty<double**>(partKsRegName_,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -127,7 +128,7 @@ void ZehnerSchluenderThermCond::calcPartKsField() const
|
||||
FatalError << "ZehnerSchluenderThermCond needs data for more than one type, but types are not communicated." << abort(FatalError);
|
||||
}
|
||||
|
||||
double**& partKs_ = particleCloud_.getParticlePropertyRef<double**>("partKs");
|
||||
double**& partKs_ = particleCloud_.getParticlePropertyRef<double**>(partKsRegName_);
|
||||
label cellI=0;
|
||||
label partType = 0;
|
||||
for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
|
||||
|
||||
@ -64,6 +64,8 @@ private:
|
||||
|
||||
scalarList typeKs_;
|
||||
|
||||
const word partKsRegName_;
|
||||
|
||||
void calcPartKsField() const;
|
||||
|
||||
public:
|
||||
|
||||
@ -84,11 +84,12 @@ voidFractionModel::voidFractionModel
|
||||
/*sm.mesh(),
|
||||
dimensionedScalar("zero", dimensionSet(0,0,0,0,0), 1)*/
|
||||
),
|
||||
partCellsRegName_("cellsPerParticle"),
|
||||
maxCellsPerParticle_(1),
|
||||
weight_(1.),
|
||||
porosity_(1.)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<int**>("cellsPerParticle",1,1.0,false);
|
||||
particleCloud_.registerParticleProperty<int**>(partCellsRegName_,1,1.0,false);
|
||||
if (particleCloud_.getParticleEffVolFactors()) multiWeights_ = true;
|
||||
}
|
||||
|
||||
@ -127,11 +128,12 @@ voidFractionModel::voidFractionModel
|
||||
sm.mesh(),
|
||||
dimensionedScalar("zero", dimensionSet(0,0,0,0,0), initVoidfraction)
|
||||
),
|
||||
partCellsRegName_("cellsPerParticle"),
|
||||
maxCellsPerParticle_(1),
|
||||
weight_(1.),
|
||||
porosity_(1.)
|
||||
{
|
||||
particleCloud_.registerParticleProperty<int**>("cellsPerParticle",1,1.0,false);
|
||||
particleCloud_.registerParticleProperty<int**>(partCellsRegName_,1,1.0,false);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
@ -159,7 +161,7 @@ void voidFractionModel::resetVoidFractions()
|
||||
|
||||
int** const& voidFractionModel::cellsPerParticle() const
|
||||
{
|
||||
return particleCloud_.getParticlePropertyRef<int**>("cellsPerParticle");
|
||||
return particleCloud_.getParticlePropertyRef<int**>(partCellsRegName_);
|
||||
}
|
||||
|
||||
int voidFractionModel::maxCellsPerParticle() const
|
||||
|
||||
@ -69,6 +69,8 @@ protected:
|
||||
|
||||
volScalarField voidfractionNext_;
|
||||
|
||||
const word partCellsRegName_;
|
||||
|
||||
int maxCellsPerParticle_;
|
||||
|
||||
scalar weight_;
|
||||
|
||||
Reference in New Issue
Block a user