populationBalance: Corrected fraction field registration
This commit is contained in:
@ -62,61 +62,6 @@ const Foam::NamedEnum
|
||||
> Foam::diameterModels::shapeModels::fractal::sgTypeNames_;
|
||||
|
||||
|
||||
// * * * * * * * * * * * Private Static Member Functions * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::diameterModels::shapeModels::fractal::readKappa(const sizeGroup& group)
|
||||
{
|
||||
auto io = [&](const word& name, const IOobject::readOption r)
|
||||
{
|
||||
return
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName
|
||||
(
|
||||
"kappa" + name,
|
||||
group.phase().name()
|
||||
),
|
||||
group.mesh().time().name(),
|
||||
group.mesh(),
|
||||
r,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
};
|
||||
|
||||
const word name(Foam::name(group.i()));
|
||||
|
||||
typeIOobject<volScalarField> fio(io(name, IOobject::MUST_READ));
|
||||
|
||||
// Read the field, if it is available
|
||||
if (fio.headerOk())
|
||||
{
|
||||
return tmp<volScalarField>(new volScalarField(fio, group.mesh()));
|
||||
}
|
||||
|
||||
// Read the default field
|
||||
tmp<volScalarField> tfDefault
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
io("Default", IOobject::MUST_READ),
|
||||
group.mesh()
|
||||
)
|
||||
);
|
||||
|
||||
// Transfer it into a result field with the correct name
|
||||
return
|
||||
tmp<volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
io(name, IOobject::NO_READ),
|
||||
tfDefault
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
@ -152,7 +97,11 @@ Foam::diameterModels::shapeModels::fractal::fractal
|
||||
)
|
||||
:
|
||||
SecondaryPropertyModel<shapeModel>(group),
|
||||
kappa_(readKappa(group)),
|
||||
kappa_
|
||||
(
|
||||
sizeGroup::fieldIo("kappa", group.i(), group.group()),
|
||||
sizeGroup::field("kappa", group.i(), group.group())
|
||||
),
|
||||
Df_("Df", dimless, groupDict),
|
||||
alphaC_("alphaC", dimless, groupDict),
|
||||
dColl_
|
||||
|
||||
@ -125,12 +125,6 @@ private:
|
||||
autoPtr<sinteringModel> sinteringModel_;
|
||||
|
||||
|
||||
// Private Static Member Functions
|
||||
|
||||
//- Read and return the kappa field. Construction helper.
|
||||
static tmp<volScalarField> readKappa(const sizeGroup& group);
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Compute and return the collisional diameter
|
||||
|
||||
@ -29,63 +29,55 @@ License
|
||||
|
||||
using Foam::constant::mathematical::pi;
|
||||
|
||||
// * * * * * * * * * * * Private Static Member Functions * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::diameterModels::sizeGroup::readF
|
||||
Foam::IOobject Foam::diameterModels::sizeGroup::fieldIo
|
||||
(
|
||||
const word& name,
|
||||
const label i,
|
||||
const velocityGroup& group,
|
||||
const IOobject::readOption r,
|
||||
const bool registerObject
|
||||
)
|
||||
{
|
||||
return
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName
|
||||
(
|
||||
"f" + (i == -1 ? "Default" : Foam::name(i)),
|
||||
group.phase().name()
|
||||
),
|
||||
group.phase().mesh().time().name(),
|
||||
group.phase().mesh(),
|
||||
r,
|
||||
IOobject::AUTO_WRITE,
|
||||
registerObject
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::diameterModels::sizeGroup::field
|
||||
(
|
||||
const word& name,
|
||||
const label i,
|
||||
const velocityGroup& group
|
||||
)
|
||||
{
|
||||
auto io = [&](const word& name, const IOobject::readOption r)
|
||||
{
|
||||
return
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName
|
||||
(
|
||||
"f" + name,
|
||||
group.phase().name()
|
||||
),
|
||||
group.phase().mesh().time().name(),
|
||||
group.phase().mesh(),
|
||||
r,
|
||||
IOobject::AUTO_WRITE
|
||||
);
|
||||
};
|
||||
|
||||
const word name(Foam::name(i));
|
||||
|
||||
typeIOobject<volScalarField> fio(io(name, IOobject::MUST_READ));
|
||||
|
||||
// Read the field, if it is available
|
||||
if (fio.headerOk())
|
||||
{
|
||||
return
|
||||
tmp<volScalarField>
|
||||
(
|
||||
new volScalarField(fio, group.phase().mesh())
|
||||
);
|
||||
}
|
||||
|
||||
// Read the default field
|
||||
tmp<volScalarField> tfDefault
|
||||
typeIOobject<volScalarField> io
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
io("Default", IOobject::MUST_READ),
|
||||
group.phase().mesh()
|
||||
)
|
||||
fieldIo(name, i, group, IOobject::MUST_READ, false)
|
||||
);
|
||||
|
||||
// Transfer it into a result field with the correct name
|
||||
return
|
||||
tmp<volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
io(name, IOobject::NO_READ),
|
||||
tfDefault
|
||||
io.headerOk()
|
||||
? io
|
||||
: fieldIo(name, -1, group, IOobject::MUST_READ, false),
|
||||
group.phase().mesh()
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -100,7 +92,7 @@ Foam::diameterModels::sizeGroup::sizeGroup
|
||||
const velocityGroup& group
|
||||
)
|
||||
:
|
||||
volScalarField(readF(i, group)),
|
||||
volScalarField(fieldIo("f", i, group), field("f", i, group)),
|
||||
i_(i),
|
||||
group_(group),
|
||||
dSph_("dSph", dimLength, dict),
|
||||
|
||||
@ -104,18 +104,29 @@ private:
|
||||
autoPtr<shapeModel> shapeModel_;
|
||||
|
||||
|
||||
// Private Static Member Functions
|
||||
public:
|
||||
|
||||
//- Read and return the fraction field. Construction helper.
|
||||
static tmp<volScalarField> readF
|
||||
// Static Member Functions
|
||||
|
||||
//- Return IO for a size-group field. Construction helper.
|
||||
static IOobject fieldIo
|
||||
(
|
||||
const word& name,
|
||||
const label i,
|
||||
const velocityGroup& group,
|
||||
const IOobject::readOption r = IOobject::NO_READ,
|
||||
const bool registerObject = true
|
||||
);
|
||||
|
||||
//- Return IO a size-group field. Construction helper.
|
||||
static tmp<volScalarField> field
|
||||
(
|
||||
const word& name,
|
||||
const label i,
|
||||
const velocityGroup& group
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from index, dictionary and velocity group
|
||||
|
||||
Reference in New Issue
Block a user