typeInfo: Added typedName functions to supersede the modelName function in IOobject

The typedName functions prepend the typeName to the object/field name to make a
unique name within the context of model or type.

Within a type which includes a typeName the typedName function can be called
with just the name of the object, e.g. within the kEpsilon model

    typeName("G")

generates the name

    kEpsilon:G

To create a typed name within another context the type name can be obtained from
the type specified in the function instantiation, e.g.

    Foam::typedName<viscosityModel>("nu")

generates the name

    viscosityModel:nu

This supersedes the modelName functionality provided in IOobject which could
only be used for IOobjects which provide the typeName, whereas typedName can be
used for any type providing a typeName.
This commit is contained in:
Henry Weller
2022-08-25 17:14:47 +01:00
parent 51bb40ce3d
commit 63892b01f4
66 changed files with 194 additions and 230 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -128,7 +128,7 @@ Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu
(
IOobject::groupName
(
IOobject::modelName("nu", frictionalStressModel::typeName),
Foam::typedName<frictionalStressModel>("nu"),
phase.group()
),
dimensionedScalar(dimTime, 0.5)*pf*sin(phi_)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -133,7 +133,7 @@ JohnsonJacksonSchaeffer::nu
(
IOobject::groupName
(
IOobject::modelName("nu", frictionalStressModel::typeName),
Foam::typedName<frictionalStressModel>("nu"),
phase.group()
),
phase.mesh(),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -122,7 +122,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
(
IOobject::groupName
(
IOobject::modelName("nu", frictionalStressModel::typeName),
Foam::typedName<frictionalStressModel>("nu"),
phase.group()
),
phase.mesh(),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,7 +78,7 @@ Foam::kineticTheoryModels::viscosityModels::Gidaspow::nu
(
IOobject::groupName
(
IOobject::modelName("nu", viscosityModel::typeName),
Foam::typedName<viscosityModel>("nu"),
Theta.group()
),
da*sqrt(Theta)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -88,7 +88,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::nu
(
IOobject::groupName
(
IOobject::modelName("nu", viscosityModel::typeName),
Foam::typedName<viscosityModel>("nu"),
Theta.group()
),
da*sqrt(Theta)*

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,7 +78,7 @@ Foam::kineticTheoryModels::viscosityModels::Syamlal::nu
(
IOobject::groupName
(
IOobject::modelName("nu", viscosityModel::typeName),
Foam::typedName<viscosityModel>("nu"),
Theta.group()
),
da*sqrt(Theta)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -67,7 +67,7 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::noneViscosity::nu
(
IOobject::groupName
(
IOobject::modelName("nu", viscosityModel::typeName),
Foam::typedName<viscosityModel>("nu"),
Theta.group()
),
alpha1.mesh(),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,7 +54,7 @@ Foam::diameterModels::IATEsources::dummy::R
(
IOobject
(
"dummy:R",
typedName("R"),
iate_.phase().time().timeName(),
iate_.phase().mesh()
),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,7 +71,7 @@ Foam::diameterModels::IATEsources::randomCoalescence::R
(
IOobject
(
"randomCoalescence:R",
typedName("R"),
iate_.phase().time().timeName(),
iate_.phase().mesh()
),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,7 +70,7 @@ Foam::diameterModels::IATEsources::turbulentBreakUp::R
(
IOobject
(
"turbulentBreakUp:R",
typedName("R"),
iate_.phase().time().timeName(),
iate_.phase().mesh()
),

View File

@ -68,7 +68,7 @@ Foam::diameterModels::IATEsources::wallBoiling::R
(
IOobject
(
"wallBoiling:R",
typedName("R"),
phase().time().timeName(),
phase().mesh()
),
@ -80,7 +80,7 @@ Foam::diameterModels::IATEsources::wallBoiling::R
(
IOobject
(
"wallBoiling:Rdk",
typedName("Rdk"),
phase().time().timeName(),
phase().mesh()
),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -115,7 +115,7 @@ Foam::diameterModels::shapeModels::sinteringModels::KochFriedlander::R() const
(
IOobject
(
"KochFriedlander:R",
typedName("R"),
fi.time().timeName(),
fi.mesh()
),

View File

@ -74,7 +74,7 @@ Foam::diameterModels::shapeModels::sinteringModels::noSintering::R() const
(
IOobject
(
"noSintering:R",
typedName("R"),
fi.time().timeName(),
fi.mesh()
),

View File

@ -70,7 +70,7 @@ Foam::diameterModels::driftModels::phaseChange::phaseChange
(
IOobject
(
IOobject::groupName(type() + ":W", interfaces_[i].name()),
IOobject::groupName(typedName("W"), interfaces_[i].name()),
popBal_.mesh().time().timeName(),
popBal_.mesh()
),

View File

@ -233,7 +233,7 @@ void Foam::diameterModels::populationBalanceModel::initialiseDmdtfs()
(
IOobject::groupName
(
"populationBalance:dmdtf",
typedName("dmdtf"),
interface.name()
),
mesh().time().timeName(),