本文整理汇总了C++中cfdemCloud类的典型用法代码示例。如果您正苦于以下问题:C++ cfdemCloud类的具体用法?C++ cfdemCloud怎么用?C++ cfdemCloud使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cfdemCloud类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: forceModel
// Construct from components
virtualMassForce::virtualMassForce
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
UrelOld_(NULL)
{
if (propsDict_.found("verbose")) verbose_=true;
if (particleCloud_.dataExchangeM().maxNumberOfParticles() > 0)
{
// get memory for 2d array
particleCloud_.dataExchangeM().allocateArray(UrelOld_,0.,3);
}
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
particleCloud_.checkCG(true);
}
示例2: forceModel
// Construct from components
brownianForce::brownianForce
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
lambda_(readScalar(propsDict_.lookup("lambda"))),
temperature_(readScalar(propsDict_.lookup("temperature")))
//rndGen_(label(0), -1)
//rndGen_(time(NULL), -1)
{
if (propsDict_.found("verbose")) verbose_=true;
Info << "brownianForce is applied only to DEM side" << endl;
seed_=(scalar)(time(NULL));
save_ = 0;
dt_ = U_.mesh().time().deltaT().value();
}
示例3: forceModel
// Construct from components
SchillerNaumannDrag::SchillerNaumannDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_))
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "schillerNaumannDrag.logDat");
particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force
particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug
particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug
particleCloud_.probeM().scalarFields_.append("Cd"); //other are debug
particleCloud_.probeM().writeHeader();
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
particleCloud_.checkCG(false);
if(particleCloud_.dispersionM().isActive())
{
Info << "Turbulent dispersion enabled."<< endl;
}
}
示例4: forceModel
// Construct from components
viscForce::viscForce
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velocityFieldName_(propsDict_.lookup("velocityFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velocityFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
interpolation_(false)
{
if (modelType_ == "B")
{
FatalError <<"using model viscForce with model type B is not valid\n" << abort(FatalError);
} else
{
treatDEM_=true;
Info << "viscForce is applied only to DEM side" << endl;
}
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("interpolation"))
{
Info << "using interpolated value of pressure gradient." << endl;
interpolation_=true;
}
particleCloud_.checkCG(true);
}
示例5: forceModel
// Construct from components
DiFeliceDrag::DiFeliceDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
interpolation_(false)
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "diFeliceDrag.logDat");
particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force
particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug
particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug
particleCloud_.probeM().scalarFields_.append("Cd"); //other are debug
particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug
particleCloud_.probeM().writeHeader();
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("interpolation"))
{
Info << "using interpolated value of U." << endl;
interpolation_=true;
}
particleCloud_.checkCG(false);
}
示例6: forceModel
// Construct from components
DiFeliceDrag::DiFeliceDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
interpolation_(false)
{
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("interpolation"))
{
Info << "using interpolated value of U." << endl;
interpolation_=true;
}
particleCloud_.checkCG(false);
}
示例7: forceModel
// Construct from components
virtualMassForce::virtualMassForce
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
phiFieldName_(propsDict_.lookup("phiFieldName")),
phi_(sm.mesh().lookupObject<surfaceScalarField> (phiFieldName_)),
UrelOld_(NULL),
splitUrelCalculation_(false),
Cadd_(0.5)
{
if (particleCloud_.dataExchangeM().maxNumberOfParticles() > 0)
{
// get memory for 2d array
particleCloud_.dataExchangeM().allocateArray(UrelOld_,NOTONCPU,3);
}
// init force sub model
setForceSubModels(propsDict_);
// define switches which can be read from dict
forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
forceSubM(0).readSwitches();
//Extra switches/settings
if(propsDict_.found("splitUrelCalculation"))
{
splitUrelCalculation_ = readBool(propsDict_.lookup("splitUrelCalculation"));
if(splitUrelCalculation_)
Info << "Virtual mass model: will split the Urel calculation\n";
Info << "WARNING: be sure that LIGGGHTS integration takes ddtv_p implicitly into account! \n";
}
if(propsDict_.found("Cadd"))
{
Cadd_ = readScalar(propsDict_.lookup("Cadd"));
Info << "Virtual mass model: using non-standard Cadd = " << Cadd_ << endl;
}
particleCloud_.checkCG(true);
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "virtualMass.logDat");
particleCloud_.probeM().vectorFields_.append("virtualMassForce"); //first entry must the be the force
particleCloud_.probeM().vectorFields_.append("Urel");
particleCloud_.probeM().vectorFields_.append("UrelOld");
particleCloud_.probeM().vectorFields_.append("ddtUrel");
particleCloud_.probeM().scalarFields_.append("Vs");
particleCloud_.probeM().scalarFields_.append("rho");
particleCloud_.probeM().writeHeader();
}
示例8: forceModel
// Construct from components
gradPForce::gradPForce
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
pFieldName_(propsDict_.lookup("pFieldName")),
p_(sm.mesh().lookupObject<volScalarField> (pFieldName_)),
velocityFieldName_(propsDict_.lookup("velocityFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velocityFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
useRho_(false),
useU_(false),
addedMassCoeff_(0.0),
interpolation_(false)
{
if (modelType_ == "B")
{
FatalError <<"using model gradPForce with model type B is not valid\n" << abort(FatalError);
}else
{
treatDEM_=true;
Info << "gradPForce is applied only to DEM side" << endl;
}
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("useU")) useU_=true;
if (propsDict_.found("useAddedMass"))
{
addedMassCoeff_ = readScalar(propsDict_.lookup("useAddedMass"));
Info << "gradP will also include added mass with coefficient: " << addedMassCoeff_ << endl;
Info << "WARNING: use fix nve/sphere/addedMass in LIGGGHTS input script to correctly account for added mass effects!" << endl;
}
if (propsDict_.found("interpolation"))
{
Info << "using interpolated value of pressure gradient." << endl;
interpolation_=true;
}
if(p_.dimensions()==dimensionSet(0,2,-2,0,0))
useRho_ = true;
particleCloud_.checkCG(true);
particleCloud_.probeM().initialize(typeName, "gradP.logDat");
particleCloud_.probeM().vectorFields_.append("gradPForce"); //first entry must the be the force
particleCloud_.probeM().scalarFields_.append("Vs");
particleCloud_.probeM().scalarFields_.append("rho");
particleCloud_.probeM().writeHeader();
}
示例9: forceModel
// Construct from components
GidaspowDrag::GidaspowDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
phi_(readScalar(propsDict_.lookup("phi"))),
interpolation_(false),
scaleDia_(1.),
scaleDrag_(1.)
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "gidaspowDrag.logDat");
particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must be the force
particleCloud_.probeM().vectorFields_.append("Urel");
particleCloud_.probeM().scalarFields_.append("Rep");
particleCloud_.probeM().scalarFields_.append("betaP");
particleCloud_.probeM().scalarFields_.append("voidfraction");
particleCloud_.probeM().writeHeader();
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("interpolation")) interpolation_=true;
if (propsDict_.found("implDEM"))
{
treatExplicit_=false;
implDEM_=true;
setImpDEMdrag();
Info << "Using implicit DEM drag formulation." << endl;
}
particleCloud_.checkCG(true);
if (propsDict_.found("scale"))
scaleDia_=scalar(readScalar(propsDict_.lookup("scale")));
if (propsDict_.found("scaleDrag"))
scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag")));
Info << "Gidaspow - interpolation switch: " << interpolation_ << endl;
if(particleCloud_.dispersionM().isActive())
{
Info << "Turbulent dispersion enabled."<< endl;
}
}
示例10: forceModel
// Construct from components
DiFeliceDrag::DiFeliceDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
interpolation_(false),
splitImplicitExplicit_(false),
UsFieldName_(propsDict_.lookup("granVelFieldName")),
UsField_(sm.mesh().lookupObject<volVectorField> (UsFieldName_)),
scaleDia_(1.),
scaleDrag_(1.)
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "diFeliceDrag.logDat");
particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force
particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug
particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug
particleCloud_.probeM().scalarFields_.append("Cd"); //other are debug
particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug
particleCloud_.probeM().writeHeader();
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("interpolation"))
{
Info << "using interpolated value of U." << endl;
interpolation_=true;
}
if (propsDict_.found("splitImplicitExplicit"))
{
Info << "will split implicit / explicit force contributions." << endl;
splitImplicitExplicit_ = true;
if(!interpolation_)
Info << "WARNING: will only consider fluctuating particle velocity in implicit / explicit force split!" << endl;
}
particleCloud_.checkCG(true);
if (propsDict_.found("scale"))
scaleDia_=scalar(readScalar(propsDict_.lookup("scale")));
if (propsDict_.found("scaleDrag"))
scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag")));
}
示例11: forceModel
// Construct from components
KochHillDrag::KochHillDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
UsFieldName_(propsDict_.lookupOrDefault("granVelFieldName",word("Us"))),
UsField_(sm.mesh().lookupObject<volVectorField> (UsFieldName_))
{
// suppress particle probe
if (probeIt_ && propsDict_.found("suppressProbe"))
probeIt_=!Switch(propsDict_.lookup("suppressProbe"));
if(probeIt_)
{
particleCloud_.probeM().initialize(typeName, typeName+".logDat");
particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force
particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug
particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug
particleCloud_.probeM().scalarFields_.append("beta"); //other are debug
particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug
particleCloud_.probeM().writeHeader();
}
// init force sub model
setForceSubModels(propsDict_);
// define switches which can be read from dict
forceSubM(0).setSwitchesList(0,true); // activate search for treatExplicit switch
forceSubM(0).setSwitchesList(2,true); // activate search for implDEM switch
forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch
forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
forceSubM(0).setSwitchesList(7,true); // activate implForceDEMacc switch
forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch
// read those switches defined above, if provided in dict
for (int iFSub=0;iFSub<nrForceSubModels();iFSub++)
forceSubM(iFSub).readSwitches();
particleCloud_.checkCG(true);
}
示例12: abort
autoPtr<scalarTransportModel> scalarTransportModel::New
(
const dictionary& dict, //Not used at the moment
cfdemCloud& sm
)
{
IOdictionary tempDict
(
IOobject
(
"scalarTransportProperties",
sm.mesh().time().constant(),
sm.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
word scalarTransportModelType
(
tempDict.lookup("scalarTransportModel")
);
Info<< "Selecting scalarTransportModel "
<< scalarTransportModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(scalarTransportModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalError
<< "scalarTransportModel::New(const dictionary&, const spray&) : "
<< endl
<< " unknown scalarTransportModelType type "
<< scalarTransportModelType
<< ", constructor not in hash table" << endl << endl
<< " Valid scalarTransportModel types are :"
<< endl;
Info<< dictionaryConstructorTablePtr_->toc()
<< abort(FatalError);
}
return autoPtr<scalarTransportModel>(cstrIter()(tempDict,sm));
}
示例13: forceModel
// Construct from components
DiFeliceDrag::DiFeliceDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
UsFieldName_(propsDict_.lookup("granVelFieldName")),
UsField_(sm.mesh().lookupObject<volVectorField> (UsFieldName_)),
scaleDia_(1.),
scaleDrag_(1.)
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "diFeliceDrag.logDat");
particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force
particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug
particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug
particleCloud_.probeM().scalarFields_.append("Cd"); //other are debug
particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug
particleCloud_.probeM().writeHeader();
particleCloud_.checkCG(true);
if (propsDict_.found("scale"))
scaleDia_=scalar(readScalar(propsDict_.lookup("scale")));
if (propsDict_.found("scaleDrag"))
scaleDrag_=scalar(readScalar(propsDict_.lookup("scaleDrag")));
// init force sub model
setForceSubModels(propsDict_);
// define switches which can be read from dict
forceSubM(0).setSwitchesList(0,true); // activate treatExplicit switch
forceSubM(0).setSwitchesList(2,true); // activate implDEM switch
forceSubM(0).setSwitchesList(3,true); // activate search for verbose switch
forceSubM(0).setSwitchesList(4,true); // activate search for interpolate switch
forceSubM(0).setSwitchesList(8,true); // activate scalarViscosity switch
// read those switches defined above, if provided in dict
forceSubM(0).readSwitches();
}
示例14: forceModel
// Construct from components
GidaspowDrag::GidaspowDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_))
{
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
particleCloud_.checkCG(false);
}
示例15: forceModel
// Construct from components
KochHillDrag::KochHillDrag
(
const dictionary& dict,
cfdemCloud& sm
)
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
densityFieldName_(propsDict_.lookup("densityFieldName")),
rho_(sm.mesh().lookupObject<volScalarField> (densityFieldName_)),
voidfractionFieldName_(propsDict_.lookup("voidfractionFieldName")),
voidfraction_(sm.mesh().lookupObject<volScalarField> (voidfractionFieldName_)),
interpolation_(false),
scale_(1.)
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, "kochHillDrag.logDat");
particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force
particleCloud_.probeM().vectorFields_.append("Urel"); //other are debug
particleCloud_.probeM().scalarFields_.append("Rep"); //other are debug
particleCloud_.probeM().scalarFields_.append("beta"); //other are debug
particleCloud_.probeM().scalarFields_.append("voidfraction"); //other are debug
particleCloud_.probeM().writeHeader();
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("treatExplicit")) treatExplicit_=true;
if (propsDict_.found("interpolation")) interpolation_=true;
if (propsDict_.found("implDEM"))
{
treatExplicit_=false;
implDEM_=true;
setImpDEMdrag();
Info << "Using implicit DEM drag formulation." << endl;
}
particleCloud_.checkCG(true);
if (propsDict_.found("scale"))
scale_=scalar(readScalar(propsDict_.lookup("scale")));
}