Commit a14a231f authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: spelling and misc code style for interfaceHeatResistance

parent a6864911
......@@ -94,7 +94,6 @@ SourceFiles
#include "InterfaceCompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
namespace Foam
......@@ -103,7 +102,7 @@ namespace meltingEvaporationModels
{
/*---------------------------------------------------------------------------*\
Class Lee
Class Lee Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
......@@ -111,7 +110,7 @@ class Lee
:
public InterfaceCompositionModel<Thermo, OtherThermo>
{
// Private data
// Private Data
//- Condensation coefficient [1/s]
dimensionedScalar C_;
......@@ -168,10 +167,9 @@ public:
//- Return T transition between phases
virtual const dimensionedScalar& Tactivate() const;
//- Adds and substract alpha*div(U) as a source term
// for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
//- Add/subtract alpha*div(U) as a source term
//- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
virtual bool includeDivU();
};
......
......@@ -65,7 +65,7 @@ Foam::interfaceCompositionModel::interfaceCompositionModel
modelVariable::T
)
),
includeVolChange_(dict.lookupOrDefault<bool>("includeVolChange", true)),
includeVolChange_(dict.lookupOrDefault("includeVolChange", true)),
pair_(pair),
speciesName_(dict.lookupOrDefault<word>("species", "none")),
mesh_(pair_.from().mesh())
......
......@@ -39,16 +39,17 @@ SourceFiles
#ifndef interfaceCompositionModel_H
#define interfaceCompositionModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
#include "Enum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward Declarations
class phaseModel;
class phasePair;
......@@ -82,7 +83,7 @@ public:
protected:
// Protected data
// Protected Data
//- Phase pair
const phasePair& pair_;
......@@ -197,8 +198,8 @@ public:
//- Reference value
virtual const dimensionedScalar& Tactivate() const = 0;
//- Adds and substract alpha*div(U) as a source term
// for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
//- Add/subtract alpha*div(U) as a source term
//- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
virtual bool includeDivU();
//- Add volume change in pEq
......
......@@ -195,23 +195,20 @@ Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
updateInterface(T);
tmp<volScalarField> tdeltaT
auto tdeltaT = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"tdeltaT",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar(dimTemperature, Zero)
)
"tdeltaT",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar(dimTemperature, Zero)
);
volScalarField& deltaT = tdeltaT.ref();
auto& deltaT = tdeltaT.ref();
dimensionedScalar T0("T0", dimTemperature, Zero);
const dimensionedScalar T0(dimTemperature, Zero);
if (sign(R_.value()) > 0)
{
......@@ -257,7 +254,7 @@ Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
mDotc_ = interfaceArea_*htc_*deltaT;
return tmp<volScalarField>(new volScalarField(mDotc_));
return tmp<volScalarField>::New(mDotc_);
}
......@@ -283,10 +280,8 @@ Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
return(coeff*pos(Tactivate_ - refValue));
}
}
else
{
return tmp<volScalarField> ();
}
return nullptr;
}
......@@ -314,12 +309,10 @@ Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo>
}
else if (interfaceCompositionModel::P == variable)
{
return tmp<volScalarField>(new volScalarField(mDotcSpread_));
}
else
{
return tmp<volScalarField> ();
return tmp<volScalarField>::New(mDotcSpread_);
}
return nullptr;
}
......@@ -340,4 +333,5 @@ interfaceHeatResistance<Thermo, OtherThermo>::includeDivU()
return true;
}
// ************************************************************************* //
......@@ -74,7 +74,6 @@ SourceFiles
#ifndef meltingEvaporationModels_interfaceHeatResistance_H
#define meltingEvaporationModels_interfaceHeatResistance_H
#include "InterfaceCompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
......@@ -82,13 +81,14 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class phasePair;
namespace meltingEvaporationModels
{
/*---------------------------------------------------------------------------*\
Class interfaceHeatResistance
Class interfaceHeatResistance Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
......@@ -96,7 +96,7 @@ class interfaceHeatResistance
:
public InterfaceCompositionModel<Thermo, OtherThermo>
{
// Private data
// Private Data
//- Heat transfer coefficient [1/s/K]
dimensionedScalar R_;
......@@ -123,7 +123,7 @@ class interfaceHeatResistance
scalar spread_;
// Private member
// Private Member Functions
//- Update interface
void updateInterface(const volScalarField& T);
......@@ -173,8 +173,8 @@ public:
//- Return Tactivate
virtual const dimensionedScalar& Tactivate() const;
//- Adds and substract alpha*div(U) as a source term
// for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
//- Add/subtract alpha*div(U) as a source term
//- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
virtual bool includeDivU();
};
......
......@@ -63,13 +63,10 @@ void Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
}
}
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
forAll(pbm, patchi)
for (const polyPatch& pp : mesh.boundaryMesh())
{
if (isA<wallPolyPatch>(pbm[patchi]))
if (isA<wallPolyPatch>(pp))
{
const polyPatch& pp = pbm[patchi];
forAll(pp.faceCells(), faceI)
{
const label pCelli = pp.faceCells()[faceI];
......
......@@ -115,7 +115,6 @@ SourceFiles
#ifndef meltingEvaporationModels_kineticGasEvaporation_H
#define meltingEvaporationModels_kineticGasEvaporation_H
#include "InterfaceCompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
......@@ -123,13 +122,14 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class phasePair;
namespace meltingEvaporationModels
{
/*---------------------------------------------------------------------------*\
Class kineticGasEvaporation
Class kineticGasEvaporation Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
......@@ -137,7 +137,7 @@ class kineticGasEvaporation
:
public InterfaceCompositionModel<Thermo, OtherThermo>
{
// Private data
// Private Data
//- Evaporation coefficient
dimensionedScalar C_;
......@@ -161,7 +161,7 @@ class kineticGasEvaporation
scalar isoAlpha_;
// Private member
// Private Member Functions
//- Update interface
void updateInterface(const volScalarField& T);
......@@ -212,8 +212,8 @@ public:
//- Return Tactivate
virtual const dimensionedScalar& Tactivate() const;
//- Adds and substract alpha*div(U) as a source term
// for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
//- Add/subtract alpha*div(U) as a source term
//- for alpha, substituting div(U) = mDot(1/rho1 - 1/rho2)
virtual bool includeDivU();
};
......
......@@ -26,9 +26,7 @@ License
\*---------------------------------------------------------------------------*/
#include "MassTransferPhaseSystem.H"
#include "HashPtrTable.H"
#include "fvcDiv.H"
#include "fvmSup.H"
#include "fvMatrix.H"
......@@ -85,23 +83,20 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::calculateL
const volScalarField& T
) const
{
tmp<volScalarField> tL
auto tL = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"tL",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"tL",
this->mesh().time().timeName(),
this->mesh(),
dimensionedScalar(dimEnergy/dimMass, Zero)
)
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedScalar(dimEnergy/dimMass, Zero)
);
volScalarField& L = tL.ref();
auto& L = tL.ref();
if (massTransferModels_.found(keyik))
{
......@@ -110,10 +105,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::calculateL
word speciesName = interfacePtr->transferSpecie();
auto tempOpen = speciesName.find('.');
//const word species(speciesName(0, tempOpen));
const word species(speciesName.substr(0, tempOpen));
const word species(speciesName.substr(0, speciesName.find('.')));
L -= neg(dmdtNetki)*interfacePtr->L(species, T);
}
......@@ -125,9 +117,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::calculateL
word speciesName = interfacePtr->transferSpecie();
auto tempOpen = speciesName.find('.');
const word species(speciesName.substr(0, tempOpen));
const word species(speciesName.substr(0, speciesName.find('.')));
L += pos(dmdtNetki)*interfacePtr->L(species, T);
}
......@@ -145,22 +135,18 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::dmdt
const phasePairKey& key
) const
{
tmp<volScalarField> tdmdt
auto tdmdt = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"dmdt",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimDensity/dimTime, Zero)
)
"dmdt",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimDensity/dimTime, Zero)
);
volScalarField& dmdt = tdmdt.ref();
auto& dmdt = tdmdt.ref();
if (dmdt_.found(key))
{
......@@ -178,12 +164,8 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::heatTransfer
const volScalarField& T
)
{
tmp<fvScalarMatrix> tEqnPtr
(
new fvScalarMatrix(T, dimEnergy/dimTime)
);
fvScalarMatrix& eqn = tEqnPtr.ref();
auto teqn = tmp<fvScalarMatrix>::New(T, dimEnergy/dimTime);
auto& eqn = teqn.ref();
forAllConstIters(this->phaseModels_, iteri)
{
......@@ -204,53 +186,44 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::heatTransfer
const phasePairKey keyki(phasek.name(), phasei.name(), true);
// Net mass transfer from k to i phase
tmp<volScalarField> tdmdtNetki
auto tdmdtNetki = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"tdmdtYki",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimDensity/dimTime, Zero)
)
"tdmdtYki",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimDensity/dimTime, Zero)
);
volScalarField& dmdtNetki = tdmdtNetki.ref();
auto& dmdtNetki = tdmdtNetki.ref();
tmp<volScalarField> tSp
auto tSp = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"Sp",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimDensity/dimTime/dimTemperature, Zero)
)
"Sp",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimDensity/dimTime/dimTemperature, Zero)
);
volScalarField& Sp = tSp.ref();
auto& Sp = tSp.ref();
tmp<volScalarField> tSu
auto tSu = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"Su",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimDensity/dimTime, Zero)
)
"Su",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimDensity/dimTime, Zero)
);
volScalarField& Su = tSu.ref();
auto& Su = tSu.ref();
if (massTransferModels_.found(keyik))
......@@ -322,7 +295,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::heatTransfer
}
}
}
return tEqnPtr;
return teqn;
}
......@@ -333,44 +306,34 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::volTransfer
const volScalarField& p
)
{
tmp<fvScalarMatrix> tEqnPtr
(
new fvScalarMatrix(p, dimVolume/dimTime)
);
fvScalarMatrix& eqn = tEqnPtr.ref();
auto teqn = tmp<fvScalarMatrix>::New(p, dimVolume/dimTime);
auto& eqn = teqn.ref();
tmp<volScalarField> tSp
auto tSp = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"Sp",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimless/dimTime/dimPressure, Zero)
)
"Sp",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimless/dimTime/dimPressure, Zero)
);
volScalarField& Sp = tSp.ref();
auto& Sp = tSp.ref();
tmp<volScalarField> tSu
auto tSu = tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"Su",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimless/dimTime, Zero)
)
"Su",
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimless/dimTime, Zero)
);
volScalarField& Su = tSu.ref();
auto& Su = tSu.ref();
forAllConstIters(this->totalPhasePairs(), iter)
{
......@@ -482,7 +445,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::volTransfer
}
eqn += fvm::Sp(Sp, p) + Su;
return tEqnPtr;
return teqn;
}
...