update handling of model options in ShirgaonkarIB*

make options const bool if possible and bring in line with rest of code,
i.e. read values from dict already in initializer list
This commit is contained in:
danielque
2022-02-14 13:43:05 +01:00
parent a38dba8cfd
commit 3463f5ccc0
4 changed files with 9 additions and 16 deletions

View File

@ -67,7 +67,7 @@ ShirgaonkarIB::ShirgaonkarIB
verbose_(propsDict_.found("verbose")),
twoDimensional_(propsDict_.found("twoDimensional")),
depth_(1),
multisphere_(false), // drag for a multisphere particle
multisphere_(propsDict_.found("multisphere")), // drag for a multisphere particle
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
pressureFieldName_(propsDict_.lookup("pressureFieldName")),
@ -87,9 +87,6 @@ ShirgaonkarIB::ShirgaonkarIB
Info << "depth of domain is assumed to be :" << depth_ << endl;
}
// Switch to initiate the multisphere calculation
if(propsDict_.found("multisphere")) multisphere_=true;
// init force sub model
setForceSubModels(propsDict_);

View File

@ -67,7 +67,7 @@ private:
bool depth_;
bool multisphere_;
const bool multisphere_;
word velFieldName_;

View File

@ -63,31 +63,27 @@ ShirgaonkarIBTorque::ShirgaonkarIBTorque
:
forceModel(dict,sm),
propsDict_(dict.subDict(typeName + "Props")),
verbose_(false),
twoDimensional_(false),
verbose_(propsDict_.found("verbose")),
twoDimensional_(propsDict_.found("twoDimensional")),
depth_(1),
velFieldName_(propsDict_.lookup("velFieldName")),
U_(sm.mesh().lookupObject<volVectorField> (velFieldName_)),
pressureFieldName_(propsDict_.lookup("pressureFieldName")),
p_(sm.mesh().lookupObject<volScalarField> (pressureFieldName_)),
useTorque_(false)
useTorque_(propsDict_.found("useTorque"))
{
//Append the field names to be probed
particleCloud_.probeM().initialize(typeName, typeName+".logDat");
particleCloud_.probeM().vectorFields_.append("dragForce"); //first entry must the be the force
particleCloud_.probeM().writeHeader();
if (propsDict_.found("verbose")) verbose_=true;
if (propsDict_.found("twoDimensional"))
if (twoDimensional_)
{
twoDimensional_=true;
depth_ = propsDict_.lookup("depth");
Info << "2-dimensional simulation - make sure DEM side is 2D" << endl;
Info << "depth of domain is assumed to be :" << depth_ << endl;
}
if(propsDict_.found("useTorque")) useTorque_ = true;
// init force sub model
setForceSubModels(propsDict_);

View File

@ -60,9 +60,9 @@ class ShirgaonkarIBTorque
private:
dictionary propsDict_;
bool verbose_;
const bool verbose_;
bool twoDimensional_;
const bool twoDimensional_;
bool depth_;
@ -74,7 +74,7 @@ private:
const volScalarField& p_;
bool useTorque_;
const bool useTorque_;
public: