mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: code tidying for icoReactingMultiPhaseInterFoam
- use Enum instead of NamedEnum - shorter form for dimensionedScalar - reduce verbosity about missed seeding for DTRM cloud. Re-enable old warnings in debug mode.
This commit is contained in:
@ -118,7 +118,7 @@
|
||||
surfaceScalarField& rhoPhi = fluid.rhoPhi();
|
||||
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr<CompressibleTurbulenceModel<multiphaseSystem> > turbulence
|
||||
autoPtr<CompressibleTurbulenceModel<multiphaseSystem>> turbulence
|
||||
(
|
||||
CompressibleTurbulenceModel<multiphaseSystem>::New
|
||||
(
|
||||
|
||||
@ -54,24 +54,16 @@ namespace Foam
|
||||
0
|
||||
);
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::radiation::laserDTRM::powerDistributionMode,
|
||||
3
|
||||
>::names[] =
|
||||
{
|
||||
"Gaussian",
|
||||
"manual",
|
||||
"uniform"
|
||||
};
|
||||
}
|
||||
} // End namespace Foam
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::radiation::laserDTRM::powerDistributionMode,
|
||||
3
|
||||
> Foam::radiation::laserDTRM::powerDistypeNames_;
|
||||
|
||||
const Foam::Enum<Foam::radiation::laserDTRM::powerDistributionMode>
|
||||
Foam::radiation::laserDTRM::powerDistNames_
|
||||
{
|
||||
{ powerDistributionMode::pdGaussian, "Gaussian" },
|
||||
{ powerDistributionMode::pdManual, "manual" },
|
||||
{ powerDistributionMode::pdUniform, "uniform" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -80,7 +72,7 @@ Foam::scalar Foam::radiation::laserDTRM::calculateIp(scalar r, scalar theta)
|
||||
{
|
||||
const scalar t = mesh_.time().value();
|
||||
const scalar power = laserPower_->value(t);
|
||||
switch(mode_)
|
||||
switch (mode_)
|
||||
{
|
||||
case pdGaussian:
|
||||
{
|
||||
@ -102,11 +94,13 @@ Foam::scalar Foam::radiation::laserDTRM::calculateIp(scalar r, scalar theta)
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unhandled type " << powerDistypeNames_
|
||||
<< "Unhandled type " << powerDistNames_[mode_]
|
||||
<< abort(FatalError);
|
||||
return (0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -154,7 +148,7 @@ void Foam::radiation::laserDTRM::initialiseReflection()
|
||||
);
|
||||
}
|
||||
|
||||
if (reflections_.size() > 0)
|
||||
if (reflections_.size())
|
||||
{
|
||||
reflectionSwitch_ = true;
|
||||
}
|
||||
@ -183,12 +177,16 @@ void Foam::radiation::laserDTRM::initialise()
|
||||
// Find a vector on the area plane. Normal to laser direction
|
||||
vector rArea = vector::zero;
|
||||
scalar magr = 0.0;
|
||||
while (magr < VSMALL)
|
||||
|
||||
{
|
||||
Random rnd(1234);
|
||||
vector v = rnd.sample01<vector>();
|
||||
rArea = v - (v & lDir)*lDir;
|
||||
magr = mag(rArea);
|
||||
|
||||
while (magr < VSMALL)
|
||||
{
|
||||
vector v = rnd.sample01<vector>();
|
||||
rArea = v - (v & lDir)*lDir;
|
||||
magr = mag(rArea);
|
||||
}
|
||||
}
|
||||
rArea /= mag(rArea);
|
||||
|
||||
@ -219,6 +217,9 @@ void Foam::radiation::laserDTRM::initialise()
|
||||
}
|
||||
}
|
||||
|
||||
// Count the number of missed positions
|
||||
label nMissed = 0;
|
||||
|
||||
// Target position
|
||||
point p1 = vector::zero;
|
||||
|
||||
@ -288,9 +289,12 @@ void Foam::radiation::laserDTRM::initialise()
|
||||
|
||||
if (returnReduce(cellI, maxOp<label>()) == -1)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Cannot find owner cell for particle at position " << p0
|
||||
<< endl;
|
||||
if (++nMissed <= 10)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Cannot find owner cell for focalPoint at "
|
||||
<< p0 << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -302,11 +306,15 @@ void Foam::radiation::laserDTRM::initialise()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (nMissed)
|
||||
{
|
||||
Info<< "Seeding missed " << nMissed << " locations" << endl;
|
||||
}
|
||||
|
||||
DebugInfo
|
||||
<< "Total Power in the laser : " << power << endl
|
||||
<< "Total Area in the laser : " << area << endl
|
||||
<< "Number of particles in the laser : "
|
||||
<< returnReduce(DTRMCloud_.size(), sumOp<label>()) << endl;
|
||||
<< "Total Power in the laser : " << power << nl
|
||||
<< "Total Area in the laser : " << area << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -315,7 +323,7 @@ void Foam::radiation::laserDTRM::initialise()
|
||||
Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
:
|
||||
radiationModel(typeName, T),
|
||||
mode_(powerDistypeNames_.read(lookup("mode"))),
|
||||
mode_(powerDistNames_.lookup("mode", *this)),
|
||||
DTRMCloud_(mesh_, "DTRMCloud", IDLList<DTRMParticle>()),
|
||||
nParticles_(0),
|
||||
ndTheta_(readLabel(lookup("nTheta"))),
|
||||
@ -344,7 +352,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
|
||||
reflectionSwitch_(false),
|
||||
|
||||
alphaCut_( lookupOrDefault<scalar>("alphaCut", 0.5)),
|
||||
alphaCut_(lookupOrDefault<scalar>("alphaCut", 0.5)),
|
||||
|
||||
Qin_
|
||||
(
|
||||
@ -357,7 +365,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("Qin", dimPower/dimArea, 0.0)
|
||||
dimensionedScalar(dimPower/dimArea, Zero)
|
||||
),
|
||||
a_
|
||||
(
|
||||
@ -370,7 +378,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("a", dimless/dimLength, 0.0)
|
||||
dimensionedScalar(dimless/dimLength, Zero)
|
||||
),
|
||||
e_
|
||||
(
|
||||
@ -383,7 +391,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("a", dimless/dimLength, 0.0)
|
||||
dimensionedScalar(dimless/dimLength, Zero)
|
||||
),
|
||||
E_
|
||||
(
|
||||
@ -396,7 +404,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("E", dimMass/dimLength/pow3(dimTime), 0.0)
|
||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||
),
|
||||
Q_
|
||||
(
|
||||
@ -409,7 +417,7 @@ Foam::radiation::laserDTRM::laserDTRM(const volScalarField& T)
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("Q", dimPower/dimVolume, 0.0)
|
||||
dimensionedScalar(dimPower/dimVolume, Zero)
|
||||
)
|
||||
{
|
||||
initialiseReflection();
|
||||
@ -425,7 +433,7 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
)
|
||||
:
|
||||
radiationModel(typeName, dict, T),
|
||||
mode_(powerDistypeNames_.read(lookup("mode"))),
|
||||
mode_(powerDistNames_.lookup("mode", *this)),
|
||||
DTRMCloud_(mesh_, "DTRMCloud", IDLList<DTRMParticle>()),
|
||||
nParticles_(0),
|
||||
ndTheta_(readLabel(lookup("nTheta"))),
|
||||
@ -453,7 +461,7 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
|
||||
reflectionSwitch_(false),
|
||||
|
||||
alphaCut_( lookupOrDefault<scalar>("alphaCut", 0.5)),
|
||||
alphaCut_(lookupOrDefault<scalar>("alphaCut", 0.5)),
|
||||
|
||||
Qin_
|
||||
(
|
||||
@ -466,7 +474,7 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("Qin", dimPower/dimArea, 0.0)
|
||||
dimensionedScalar(dimPower/dimArea, Zero)
|
||||
),
|
||||
a_
|
||||
(
|
||||
@ -479,7 +487,7 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("a", dimless/dimLength, 0.0)
|
||||
dimensionedScalar(dimless/dimLength, Zero)
|
||||
),
|
||||
e_
|
||||
(
|
||||
@ -492,7 +500,7 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("a", dimless/dimLength, 0.0)
|
||||
dimensionedScalar(dimless/dimLength, Zero)
|
||||
),
|
||||
E_
|
||||
(
|
||||
@ -505,11 +513,11 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("E", dimMass/dimLength/pow3(dimTime), 0.0)
|
||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||
),
|
||||
Q_
|
||||
(
|
||||
IOobject
|
||||
IOobject
|
||||
(
|
||||
"Q",
|
||||
mesh_.time().timeName(),
|
||||
@ -518,7 +526,7 @@ Foam::radiation::laserDTRM::laserDTRM
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("Q", dimPower/pow3(dimLength), 0.0)
|
||||
dimensionedScalar(dimPower/pow3(dimLength), Zero)
|
||||
)
|
||||
{
|
||||
initialiseReflection();
|
||||
@ -575,15 +583,15 @@ void Foam::radiation::laserDTRM::calculate()
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedVector("zero", dimless, vector::zero)
|
||||
dimensionedVector(dimless, Zero)
|
||||
)
|
||||
);
|
||||
volVectorField& nHat = tnHat.ref();
|
||||
|
||||
|
||||
// Reset the fields
|
||||
Qin_ == dimensionedScalar("zero", Qin_.dimensions(), 0);
|
||||
Q_ == dimensionedScalar("zero", Q_.dimensions(), 0);
|
||||
Qin_ == dimensionedScalar(Qin_.dimensions(), Zero);
|
||||
Q_ == dimensionedScalar(Q_.dimensions(), Zero);
|
||||
|
||||
a_ = absorptionEmission_->a();
|
||||
e_ = absorptionEmission_->e();
|
||||
@ -598,18 +606,18 @@ void Foam::radiation::laserDTRM::calculate()
|
||||
|
||||
autoPtr<interpolationCellPoint<vector>> nHatIntrPtr;
|
||||
|
||||
UPtrList<reflectionModel> reflactionUPtr;
|
||||
UPtrList<reflectionModel> reflectionUPtr;
|
||||
|
||||
if (reflectionSwitch_)
|
||||
{
|
||||
reflactionUPtr.resize(reflections_.size());
|
||||
reflectionUPtr.resize(reflections_.size());
|
||||
|
||||
label reflectionModelId(0);
|
||||
forAllIter(reflectionModelTable, reflections_, iter1)
|
||||
{
|
||||
reflectionModel& model = iter1()();
|
||||
|
||||
reflactionUPtr.set(reflectionModelId, &model);
|
||||
reflectionUPtr.set(reflectionModelId, &model);
|
||||
|
||||
const word alpha1Name = "alpha." + iter1.key().first();
|
||||
const word alpha2Name = "alpha." + iter1.key().second();
|
||||
@ -667,7 +675,7 @@ void Foam::radiation::laserDTRM::calculate()
|
||||
TInterp,
|
||||
nHatIntrPtr,
|
||||
reflectingCells,
|
||||
reflactionUPtr,
|
||||
reflectionUPtr,
|
||||
Q_
|
||||
);
|
||||
|
||||
@ -755,12 +763,7 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::laserDTRM::Rp() const
|
||||
false
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar
|
||||
(
|
||||
"zero",
|
||||
dimPower/dimVolume/pow4(dimTemperature),
|
||||
0.0
|
||||
)
|
||||
dimensionedScalar(dimPower/dimVolume/pow4(dimTemperature), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ SourceFiles
|
||||
#include "interpolation2DTable.H"
|
||||
#include "labelField.H"
|
||||
#include "phasePairKey.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -111,8 +111,7 @@ private:
|
||||
|
||||
// Private data
|
||||
|
||||
|
||||
static const NamedEnum<powerDistributionMode, 3> powerDistypeNames_;
|
||||
static const Enum<powerDistributionMode> powerDistNames_;
|
||||
|
||||
//- Operating mode for power distribution
|
||||
powerDistributionMode mode_;
|
||||
@ -214,11 +213,11 @@ private:
|
||||
) const;
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
laserDTRM(const laserDTRM&);
|
||||
//- No copy construct
|
||||
laserDTRM(const laserDTRM&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const laserDTRM&);
|
||||
//- No copy assignment
|
||||
void operator=(const laserDTRM&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
@ -242,23 +241,22 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Edit
|
||||
|
||||
// Edit
|
||||
//- Solve radiation equation(s)
|
||||
void calculate();
|
||||
|
||||
//- Solve radiation equation(s)
|
||||
void calculate();
|
||||
|
||||
//- Read radiation properties dictionary
|
||||
bool read();
|
||||
//- Read radiation properties dictionary
|
||||
bool read();
|
||||
|
||||
|
||||
// Access
|
||||
// Access
|
||||
|
||||
//- Source term component (for power of T^4)
|
||||
virtual tmp<volScalarField> Rp() const;
|
||||
//- Source term component (for power of T^4)
|
||||
virtual tmp<volScalarField> Rp() const;
|
||||
|
||||
//- Source term component (constant)
|
||||
virtual tmp<DimensionedField<scalar, volMesh> > Ru() const;
|
||||
//- Source term component (constant)
|
||||
virtual tmp<DimensionedField<scalar, volMesh>> Ru() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -84,7 +84,6 @@ Foam::radiation::localDensityAbsorptionEmission::localDensityAbsorptionEmission
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::radiation::localDensityAbsorptionEmission::aCont(const label bandI) const
|
||||
{
|
||||
|
||||
tmp<volScalarField> ta
|
||||
(
|
||||
new volScalarField
|
||||
@ -99,7 +98,7 @@ Foam::radiation::localDensityAbsorptionEmission::aCont(const label bandI) const
|
||||
false
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", inv(dimLength), 0)
|
||||
dimensionedScalar(inv(dimLength), Zero)
|
||||
)
|
||||
);
|
||||
|
||||
@ -132,7 +131,7 @@ Foam::radiation::localDensityAbsorptionEmission::eCont(const label bandI) const
|
||||
false
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", inv(dimLength), 0)
|
||||
dimensionedScalar(inv(dimLength), Zero)
|
||||
)
|
||||
);
|
||||
|
||||
@ -165,7 +164,7 @@ Foam::radiation::localDensityAbsorptionEmission::ECont(const label bandI) const
|
||||
false
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("zero", dimMass/dimLength/pow3(dimTime), 0.0)
|
||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -99,28 +99,17 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
//- Absorption coefficient for continuous phase
|
||||
tmp<volScalarField> aCont(const label bandI = 0) const;
|
||||
|
||||
// Absorption coefficient
|
||||
//- Emission coefficient for continuous phase
|
||||
tmp<volScalarField> eCont(const label bandI = 0) const;
|
||||
|
||||
//- Absorption coefficient for continuous phase
|
||||
tmp<volScalarField> aCont(const label bandI = 0) const;
|
||||
//- Emission contribution for continuous phase
|
||||
tmp<volScalarField> ECont(const label bandI = 0) const;
|
||||
|
||||
|
||||
// Emission coefficient
|
||||
|
||||
//- Emission coefficient for continuous phase
|
||||
tmp<volScalarField> eCont(const label bandI = 0) const;
|
||||
|
||||
|
||||
// Emission contribution
|
||||
|
||||
//- Emission contribution for continuous phase
|
||||
tmp<volScalarField> ECont(const label bandI = 0) const;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Is grey
|
||||
inline bool isGrey() const
|
||||
{
|
||||
return true;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -59,12 +59,6 @@ Foam::radiation::Fresnel::Fresnel
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::radiation::Fresnel::~Fresnel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::radiation::Fresnel::rho
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::radiation::Fresnel
|
||||
|
||||
Description
|
||||
Genral Fresnel reflection model bewtween a dialectric and an absorbing
|
||||
General Fresnel reflection model bewtween a dialectric and an absorbing
|
||||
medium.
|
||||
|
||||
Radiative heat transfer. Micheal Modest. 3dr Edition. Chapter 2.5
|
||||
@ -76,7 +76,7 @@ public:
|
||||
Fresnel(const dictionary& dict, const fvMesh& mesh);
|
||||
|
||||
//- Destructor
|
||||
virtual ~Fresnel();
|
||||
virtual ~Fresnel() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -90,5 +90,4 @@ Foam::vector Foam::radiation::FresnelLaser::R
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -25,7 +25,6 @@ Class
|
||||
Foam::radiation::FresnelLaser
|
||||
|
||||
Description
|
||||
|
||||
Modified Fresnel reflection model.
|
||||
|
||||
\verbatim
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,18 +35,17 @@ Foam::radiation::reflectionModel::New
|
||||
const fvMesh& mesh
|
||||
)
|
||||
{
|
||||
const word modelType(dict.lookup("type"));
|
||||
const word modelType(dict.get<word>("type"));
|
||||
|
||||
Info<< "Selecting reflectionModel " << modelType << endl;
|
||||
|
||||
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Unknown reflectionModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid reflectionModel types are :" << nl
|
||||
<< "Unknown reflectionModel type " << modelType << nl << nl
|
||||
<< "Valid types :" << nl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
@ -36,26 +36,13 @@ namespace Foam
|
||||
}
|
||||
|
||||
|
||||
namespace Foam
|
||||
const Foam::Enum<Foam::interfaceCompositionModel::modelVariable>
|
||||
Foam::interfaceCompositionModel::modelVariableNames
|
||||
{
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::interfaceCompositionModel::modelVariable,
|
||||
3
|
||||
>::names[] =
|
||||
{
|
||||
"temperature",
|
||||
"pressure",
|
||||
"massFraction"
|
||||
};
|
||||
}
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::interfaceCompositionModel::modelVariable,
|
||||
3
|
||||
> Foam::interfaceCompositionModel::modelVariableNames;
|
||||
{ modelVariable::T, "temperature" },
|
||||
{ modelVariable::P, "pressure" },
|
||||
{ modelVariable::Y, "massFraction" },
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -43,7 +43,7 @@ SourceFiles
|
||||
#include "dictionary.H"
|
||||
#include "hashedWordList.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Enum.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
@ -69,7 +69,7 @@ public:
|
||||
Y /* mass fraction based */
|
||||
};
|
||||
|
||||
static const NamedEnum<modelVariable, 3> modelVariableNames;
|
||||
static const Enum<modelVariable> modelVariableNames;
|
||||
|
||||
//- Enumeration for model variables
|
||||
modelVariable modelVariable_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,14 +67,14 @@ Foam::multiphaseSystem::multiphaseSystem
|
||||
{
|
||||
label phaseI = 0;
|
||||
phases_.setSize(phaseModels_.size());
|
||||
forAllConstIter(HashTable<autoPtr<phaseModel> >, phaseModels_, iter)
|
||||
forAllConstIter(HashTable<autoPtr<phaseModel>>, phaseModels_, iter)
|
||||
{
|
||||
phaseModel& pm = const_cast<phaseModel&>(iter()());
|
||||
phases_.set(phaseI++, &pm);
|
||||
}
|
||||
|
||||
// Initiate Su and Sp
|
||||
forAllConstIter(HashTable<autoPtr<phaseModel> >, phaseModels_, iter)
|
||||
forAllConstIter(HashTable<autoPtr<phaseModel>>, phaseModels_, iter)
|
||||
{
|
||||
phaseModel& pm = const_cast<phaseModel&>(iter()());
|
||||
|
||||
@ -90,7 +90,7 @@ Foam::multiphaseSystem::multiphaseSystem
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("Su", dimless/dimTime, 0.0)
|
||||
dimensionedScalar(dimless/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
|
||||
@ -106,7 +106,7 @@ Foam::multiphaseSystem::multiphaseSystem
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("Sp", dimless/dimTime, 0.0)
|
||||
dimensionedScalar(dimless/dimTime, Zero)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -274,7 +274,7 @@ void Foam::multiphaseSystem::solve()
|
||||
mesh.solverDict("alpha").lookup("cAlphas") >> cAlphas_;
|
||||
|
||||
// Reset ddtAlphaMax
|
||||
ddtAlphaMax_ = dimensionedScalar("zero", dimless, 0.0);
|
||||
ddtAlphaMax_ = dimensionedScalar(dimless, Zero);
|
||||
|
||||
PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size());
|
||||
|
||||
@ -387,8 +387,8 @@ void Foam::multiphaseSystem::solve()
|
||||
forAllIter(UPtrList<phaseModel>, phases_, iter)
|
||||
{
|
||||
phaseModel& phase = iter();
|
||||
Su_[phase.name()] = dimensionedScalar("Su", dimless/dimTime, 0.0);
|
||||
Sp_[phase.name()] = dimensionedScalar("Sp", dimless/dimTime, 0.0);
|
||||
Su_[phase.name()] = dimensionedScalar("Su", dimless/dimTime, Zero);
|
||||
Sp_[phase.name()] = dimensionedScalar("Sp", dimless/dimTime, Zero);
|
||||
|
||||
// Add alpha*div(U)
|
||||
const volScalarField& alpha = phase;
|
||||
@ -439,7 +439,7 @@ void Foam::multiphaseSystem::solve()
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("sumAlpha", dimless, 0)
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
|
||||
phasei = 0;
|
||||
@ -544,11 +544,11 @@ void Foam::multiphaseSystem::solve()
|
||||
mesh_
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("sumAlpha", dimless, 0)
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
|
||||
// Reset rhoPhi
|
||||
rhoPhi_ = dimensionedScalar("rhoPhi", dimMass/dimTime, 0.0);
|
||||
rhoPhi_ = dimensionedScalar("rhoPhi", dimMass/dimTime, Zero);
|
||||
|
||||
forAllIter(UPtrList<phaseModel>, phases_, iter)
|
||||
{
|
||||
|
||||
@ -148,7 +148,7 @@ protected:
|
||||
|
||||
|
||||
//- Generate the phases
|
||||
HashTable<autoPtr<phaseModel> > generatePhaseModels
|
||||
HashTable<autoPtr<phaseModel>> generatePhaseModels
|
||||
(
|
||||
const wordList& names
|
||||
) const;
|
||||
@ -156,7 +156,7 @@ protected:
|
||||
//- Generate the mixture flux
|
||||
tmp<surfaceScalarField> generatePhi
|
||||
(
|
||||
const HashTable<autoPtr<phaseModel> >& phaseModels
|
||||
const HashTable<autoPtr<phaseModel>>& phaseModels
|
||||
) const;
|
||||
|
||||
//- Generate pairs
|
||||
@ -228,7 +228,7 @@ protected:
|
||||
const word& modelName,
|
||||
HashTable
|
||||
<
|
||||
HashTable<autoPtr<modelType> >,
|
||||
HashTable<autoPtr<modelType>>,
|
||||
phasePairKey,
|
||||
phasePairKey::hash
|
||||
>& models
|
||||
|
||||
@ -132,7 +132,7 @@ void Foam::phaseSystem::generatePairsAndSubModels
|
||||
const word& modelName,
|
||||
HashTable
|
||||
<
|
||||
HashTable<autoPtr<modelType> >,
|
||||
HashTable<autoPtr<modelType>>,
|
||||
phasePairKey,
|
||||
phasePairKey::hash
|
||||
>& models
|
||||
@ -160,7 +160,7 @@ void Foam::phaseSystem::generatePairsAndSubModels
|
||||
models.insert
|
||||
(
|
||||
key,
|
||||
HashTable<autoPtr<modelType> >()
|
||||
HashTable<autoPtr<modelType>>()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user