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