INT: integration updates

This commit is contained in:
Andrew Heather
2018-06-20 16:28:48 +01:00
parent 3603cf289f
commit c103331a6a
68 changed files with 292 additions and 554 deletions

View File

@ -74,4 +74,5 @@ Info<< "Maximum ddtAlpha : " << ddtAlphaNum << endl;
Info<< "Maximum DiffNum : " << DiNum << endl;
// ************************************************************************* //

View File

@ -0,0 +1,2 @@
// Volumatric flux
surfaceScalarField& phi = fluid.phi();

View File

@ -114,9 +114,6 @@
p_rgh = p - rho*gh;
}
// Total volumetric flux
surfaceScalarField& phi = fluid.phi();
// Mass flux
surfaceScalarField& rhoPhi = fluid.rhoPhi();

View File

@ -29,7 +29,8 @@ Group
Description
Solver for n incompressible, non-isothermal immiscible fluids with
phase-change. Uses a VOF (volume of fluid) phase-fraction based interface capturing approach.
phase-change. Uses a VOF (volume of fluid) phase-fraction based interface
capturing approach.
The momentum, energy and other fluid properties are of the "mixture" and a
single momentum equation is solved.
@ -54,6 +55,8 @@ Description
int main(int argc, char *argv[])
{
#include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
@ -61,12 +64,15 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createFieldRefs.H"
#include "createFvOptions.H"
#include "createTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H"
//#include "alphaCourantNo.H"
#include "setInitialDeltaT.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -92,6 +98,7 @@ int main(int argc, char *argv[])
#include "UEqn.H"
#include "YEqns.H"
#include "TEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
@ -108,9 +115,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;

View File

@ -62,9 +62,6 @@ class DTRMParticle
:
public particle
{
private:
// Private data
//- Size in bytes of the fields
@ -98,8 +95,6 @@ public:
:
public particle::trackingData
{
// Interpolators for continuous phase fields
const interpolationCell<scalar>& aInterp_;
@ -135,10 +130,6 @@ public:
volScalarField& Q
);
// Public data
// Member functions
@ -151,7 +142,6 @@ public:
inline const UPtrList<reflectionModel>& reflection() const;
inline scalar& Q(label celli);
};
// Static data members
@ -268,7 +258,6 @@ public:
// Edit
//- Return access to the target position
inline point& p1();
@ -293,7 +282,6 @@ public:
// Member Operators
//- Overridable function to handle the particle hitting a processorPatch
void hitProcessorPatch
(

View File

@ -60,7 +60,6 @@ Foam::DTRMParticle::DTRMParticle
if (is.format() == IOstream::ASCII)
{
is >> p0_ >> p1_ >> I0_ >> I_ >> dA_ >> transmissiveId_;
DebugVar(transmissiveId_);
}
else
{
@ -95,7 +94,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const DTRMParticle& p)
}
// Check state of Ostream
os.check("Ostream& operator<<(Ostream&, const DTRMParticle&)");
os.check(FUNCTION_NAME);
return os;
}

View File

@ -54,20 +54,17 @@ namespace Foam
0
);
namespace radiation
template<>
const char* Foam::NamedEnum
<
Foam::radiation::laserDTRM::powerDistributionMode,
3
>::names[] =
{
template<>
const char* Foam::NamedEnum
<
Foam::radiation::laserDTRM::powerDistributionMode,
3
>::names[] =
{
"Gaussian",
"manual",
"uniform"
};
}
"Gaussian",
"manual",
"uniform"
};
}
const Foam::NamedEnum
@ -82,35 +79,32 @@ const Foam::NamedEnum
Foam::scalar Foam::radiation::laserDTRM::calculateIp(scalar r, scalar theta)
{
const scalar t = mesh_.time().value();
const scalar power = laserPower_->value(t);
switch(mode_)
{
case pdGaussian:
{
scalar I0 =
laserPower_->value(t)/(mathematical::twoPi*sqr(sigma_));
return(I0*exp(-sqr(r)/2.0/sqr(sigma_)));
scalar I0 = power/(mathematical::twoPi*sqr(sigma_));
return I0*exp(-sqr(r)/2.0/sqr(sigma_));
break;
}
case pdManual:
{
return(laserPower_->value(t)*powerDistribution_()(theta, r));
return power*powerDistribution_()(theta, r);
break;
}
case pdUniform:
{
return
(
laserPower_->value(t)/(mathematical::pi*sqr(focalLaserRadius_))
);
return power/(mathematical::pi*sqr(focalLaserRadius_));
break;
}
default:
{
FatalErrorInFunction
<< "Unhandled type " << powerDistypeNames_
<< abort(FatalError);
return(0);
<< "Unhandled type " << powerDistypeNames_
<< abort(FatalError);
return (0);
}
}
}
@ -125,7 +119,7 @@ Foam::tmp<Foam::volVectorField> Foam::radiation::laserDTRM::nHatfv
const dimensionedScalar deltaN
(
"deltaN",
1e-7/pow(average(mesh_.V()), 1.0/3.0)
1e-7/cbrt(average(mesh_.V()))
);
const volVectorField gradAlphaf
@ -134,8 +128,8 @@ Foam::tmp<Foam::volVectorField> Foam::radiation::laserDTRM::nHatfv
- alpha1*fvc::grad(alpha2)
);
// Face unit interface normal
return gradAlphaf/(mag(gradAlphaf)+ deltaN);
// Face unit interface normal
return gradAlphaf/(mag(gradAlphaf)+ deltaN);
}
@ -203,7 +197,7 @@ void Foam::radiation::laserDTRM::initialise()
nParticles_ = ndr_*ndTheta_;
switch(mode_)
switch (mode_)
{
case pdGaussian:
{
@ -285,8 +279,8 @@ void Foam::radiation::laserDTRM::initialise()
if (cellI != -1)
{
// Create a new particle
DTRMParticle* pPtr = new DTRMParticle
(mesh_, p0, p1, Ip, cellI, dAi, -1);
DTRMParticle* pPtr =
new DTRMParticle(mesh_, p0, p1, Ip, cellI, dAi, -1);
// Add to cloud
DTRMCloud_.addParticle(pPtr);
@ -294,7 +288,7 @@ void Foam::radiation::laserDTRM::initialise()
if (returnReduce(cellI, maxOp<label>()) == -1)
{
WarningIn("void Foam::radiation::laserDTRM::initialise()")
WarningInFunction
<< "Cannot find owner cell for particle at position " << p0
<< endl;
}
@ -303,18 +297,16 @@ void Foam::radiation::laserDTRM::initialise()
}
else
{
FatalErrorIn("void Foam::radiation::laserDTRM::initialise()")
FatalErrorInFunction
<< "Current functionality limited to 3-D cases"
<< exit(FatalError);
}
if (debug)
{
Info << "Total Power in the laser : " << power << endl;
Info << "Total Area in the laser : " << area << endl;
Info << "Number of particles in the laser : "
<< returnReduce(DTRMCloud_.size(), sumOp<label>()) << 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;
}
@ -534,12 +526,6 @@ Foam::radiation::laserDTRM::laserDTRM
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::laserDTRM::~laserDTRM()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::radiation::laserDTRM::read()
@ -661,8 +647,6 @@ void Foam::radiation::laserDTRM::calculate()
{
nHat[cellI] += nHatPhase[cellI];
}
}
}
reflectionModelId++;
@ -687,8 +671,8 @@ void Foam::radiation::laserDTRM::calculate()
Q_
);
Info << "Move particles..."
<< returnReduce(DTRMCloud_.size(), sumOp<label>()) << endl;
Info<< "Move particles..."
<< returnReduce(DTRMCloud_.size(), sumOp<label>()) << endl;
DTRMCloud_.move(DTRMCloud_, td, mesh_.time().deltaTValue());
@ -697,13 +681,10 @@ void Foam::radiation::laserDTRM::calculate()
if (debug)
{
Info<< "Final number of particles..."
<< returnReduce(DTRMCloud_.size(), sumOp<label>()) << endl;
Info<< "Final number of particles..."
<< returnReduce(DTRMCloud_.size(), sumOp<label>()) << endl;
OFstream osRef
(
type() + ":particlePath.obj"
);
OFstream osRef(type() + ":particlePath.obj");
label vertI = 0;
List<pointField> positions(Pstream::nProcs());
@ -727,7 +708,7 @@ void Foam::radiation::laserDTRM::calculate()
Pstream::gatherList(p0);
Pstream::scatterList(p0);
for (label proci = 0; proci < Pstream::nProcs(); proci++)
for (label proci = 0; proci < Pstream::nProcs(); ++proci)
{
const pointField& pos = positions[proci];
const pointField& pfinal = p0[proci];
@ -748,8 +729,8 @@ void Foam::radiation::laserDTRM::calculate()
if (mesh_.time().outputTime())
{
reflectingCellsVol.write();
nHat.write();
reflectingCellsVol.write();
nHat.write();
}
}
@ -762,32 +743,29 @@ void Foam::radiation::laserDTRM::calculate()
Foam::tmp<Foam::volScalarField> Foam::radiation::laserDTRM::Rp() const
{
return tmp<volScalarField>
return tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"zero",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"zero",
mesh_.time().timeName(),
mesh_,
dimensionedScalar
(
"zero",
dimPower/dimVolume/pow4(dimTemperature),
0.0
)
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh_,
dimensionedScalar
(
"zero",
dimPower/dimVolume/pow4(dimTemperature),
0.0
)
);
}
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::radiation::laserDTRM::Ru() const
{
return Q_.internalField();

View File

@ -237,7 +237,7 @@ public:
//- Destructor
virtual ~laserDTRM();
virtual ~laserDTRM() = default;
// Member functions

View File

@ -52,11 +52,7 @@ Foam::radiation::localDensityAbsorptionEmission::alpha(word alphaName) const
{
if (!mesh_.foundObject<volScalarField>(alphaName))
{
FatalErrorIn
(
"const Foam::volScalarField& "
"Foam::radiation::localDensityAbsorptionEmission::alpha() const"
)
FatalErrorInFunction
<< "Unable to retrieve density field " << alphaName << " from "
<< "database. Available objects:" << mesh_.sortedNames()
<< exit(FatalError);
@ -83,13 +79,6 @@ Foam::radiation::localDensityAbsorptionEmission::localDensityAbsorptionEmission
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::localDensityAbsorptionEmission::
~localDensityAbsorptionEmission()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>

View File

@ -33,8 +33,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef radiationLocalDensityAbsorptionEmission_H
#define radiationLocalDensityAbsorptionEmission_H
#ifndef radiation_localDensityAbsorptionEmission_H
#define radiation_localDensityAbsorptionEmission_H
#include "absorptionEmissionModel.H"
@ -94,7 +94,7 @@ public:
//- Destructor
virtual ~localDensityAbsorptionEmission();
virtual ~localDensityAbsorptionEmission() = default;
// Member Functions

View File

@ -119,7 +119,7 @@ Foam::scalar Foam::radiation::Fresnel::rho
(sqr(sqrt(sqrP) + sqrt(n1)*sinTheta1*tanTheta1) + sqrQ)
)*rhoP;
return (rhoP + rhoN)/2;
return 0.5*(rhoP + rhoN);
}
@ -133,5 +133,4 @@ Foam::vector Foam::radiation::Fresnel::R
}
// ************************************************************************* //

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef Fresnel_H
#define Fresnel_H
#ifndef radiation_Fresnel_H
#define radiation_Fresnel_H
#include "reflectionModel.H"
@ -48,14 +48,13 @@ namespace radiation
{
/*---------------------------------------------------------------------------*\
Class Fresnel Declaration
Class Fresnel Declaration
\*---------------------------------------------------------------------------*/
class Fresnel
:
public reflectionModel
{
// Private data
//- Coefficients dictionary
@ -73,12 +72,8 @@ public:
//- Runtime type information
TypeName("Fresnel");
// Constructors
//- Construct from components
Fresnel(const dictionary& dict, const fvMesh& mesh);
//- Construct from components
Fresnel(const dictionary& dict, const fvMesh& mesh);
//- Destructor
virtual ~Fresnel();
@ -90,11 +85,8 @@ public:
virtual vector R(const vector& incident, const vector& n) const;
//- Return reflectivity from medium1 to medium2 and a incident angle.
// nk1 = (n1 - i k1) from medium 1.
virtual scalar rho
(
const scalar incidentAngle
) const;
// nk1 = (n1 - i k1) from medium 1.
virtual scalar rho(const scalar incidentAngle) const;
};

View File

@ -57,12 +57,6 @@ Foam::radiation::FresnelLaser::FresnelLaser
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::FresnelLaser::~FresnelLaser()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::radiation::FresnelLaser::rho
@ -75,7 +69,7 @@ Foam::scalar Foam::radiation::FresnelLaser::rho
scalar rho =
0.5
* (
(1 + sqr(1 - epsilon_*cosTheta))/(1 + sqr(1 + epsilon_*cosTheta))
(1 + sqr(1 - epsilon_*cosTheta))/(1 + sqr(1 + epsilon_*cosTheta))
+
(sqr(epsilon_) - 2*epsilon_*cosTheta + 2*sqr(cosTheta))
/

View File

@ -39,8 +39,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef FresnelLaser_H
#define FresnelLaser_H
#ifndef radiation_FresnelLaser_H
#define radiation_FresnelLaser_H
#include "reflectionModel.H"
@ -71,15 +71,11 @@ public:
//- Runtime type information
TypeName("FresnelLaser");
// Constructors
//- Construct from components
FresnelLaser(const dictionary& dict, const fvMesh& mesh);
//- Construct from components
FresnelLaser(const dictionary& dict, const fvMesh& mesh);
//- Destructor
virtual ~FresnelLaser();
virtual ~FresnelLaser() = default;
// Member Functions
@ -88,11 +84,8 @@ public:
virtual vector R(const vector& incident, const vector& n) const;
//- Return reflectivity from medium1 to medium2 and a incident angle.
// nk1 = (n1 - i k1) from medium 1.
virtual scalar rho
(
const scalar incidentAngle
) const;
// nk1 = (n1 - i k1) from medium 1.
virtual scalar rho(const scalar incidentAngle) const;
};

View File

@ -50,12 +50,6 @@ Foam::radiation::noReflection::noReflection
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::noReflection::~noReflection()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::radiation::noReflection::rho

View File

@ -32,8 +32,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef radiationConstantScatter_H
#define radiationConstantScatter_H
#ifndef radiation_noReflection_H
#define radiation_noReflection_H
#include "reflectionModel.H"
@ -45,7 +45,7 @@ namespace radiation
{
/*---------------------------------------------------------------------------*\
Class noReflection Declaration
Class noReflection Declaration
\*---------------------------------------------------------------------------*/
class noReflection
@ -58,15 +58,11 @@ public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from components
noReflection(const dictionary& dict, const fvMesh& mesh);
//- Construct from components
noReflection(const dictionary& dict, const fvMesh& mesh);
//- Destructor
virtual ~noReflection();
virtual ~noReflection() = default;
// Member Functions

View File

@ -50,10 +50,4 @@ Foam::radiation::reflectionModel::reflectionModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::radiation::reflectionModel::~reflectionModel()
{}
// ************************************************************************* //

View File

@ -29,8 +29,8 @@ Description
\*---------------------------------------------------------------------------*/
#ifndef reflectionModel_H
#define reflectionModel_H
#ifndef radiation_reflectionModel_H
#define radiation_reflectionModel_H
#include "IOdictionary.H"
#include "autoPtr.H"
@ -46,7 +46,7 @@ namespace radiation
{
/*---------------------------------------------------------------------------*\
Class reflectionModel Declaration
Class reflectionModel Declaration
\*---------------------------------------------------------------------------*/
class reflectionModel
@ -59,6 +59,7 @@ protected:
//- Reference to the fvMesh
const fvMesh& mesh_;
public:
//- Runtime type information
@ -95,7 +96,7 @@ public:
//- Destructor
virtual ~reflectionModel();
virtual ~reflectionModel() = default;
// Member Functions
@ -104,10 +105,7 @@ public:
virtual vector R(const vector& incident, const vector& n) const = 0;
//- Return reflectivity from medium1 to medium2 and a incident angle.
virtual scalar rho
(
const scalar incidentAngle
) const = 0;
virtual scalar rho(const scalar incidentAngle) const = 0;
};

View File

@ -28,9 +28,8 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::radiation::reflectionModel> Foam::radiation::
reflectionModel::
New
Foam::autoPtr<Foam::radiation::reflectionModel>
Foam::radiation::reflectionModel::New
(
const dictionary& dict,
const fvMesh& mesh
@ -40,19 +39,16 @@ New
Info<< "Selecting reflectionModel " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalErrorIn
(
"reflectionModel::New(const dictionary&, const fvMesh&)"
) << "Unknown reflectionModel type "
FatalIOErrorInFunction(dict)
<< "Unknown reflectionModel type "
<< modelType << nl << nl
<< "Valid reflectionModel types are :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
<< exit(FatalIOError);
}
return autoPtr<reflectionModel>(cstrIter()(dict, mesh));

View File

@ -220,14 +220,6 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::InterfaceCompositionModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
Foam::InterfaceCompositionModel<Thermo, OtherThermo>::
~InterfaceCompositionModel()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Thermo, class OtherThermo>
@ -288,17 +280,9 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L
) const
{
const typename Thermo::thermoType& fromThermo =
getLocalThermo
(
speciesName,
fromThermo_
);
getLocalThermo(speciesName, fromThermo_);
const typename OtherThermo::thermoType& toThermo =
getLocalThermo
(
speciesName,
toThermo_
);
getLocalThermo(speciesName, toThermo_);
const volScalarField& p(fromThermo_.p());

View File

@ -49,7 +49,7 @@ template <class ThermoType> class pureMixture;
template <class ThermoType> class multiComponentMixture;
/*---------------------------------------------------------------------------*\
Class InterfaceCompositionModel Declaration
Class InterfaceCompositionModel Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
@ -125,14 +125,11 @@ protected:
public:
// Constructors
//- Construct from components
InterfaceCompositionModel(const dictionary& dict, const phasePair& pair);
//- Construct from components
InterfaceCompositionModel(const dictionary& dict, const phasePair& pair);
//- Destructor
~InterfaceCompositionModel();
~InterfaceCompositionModel() = default;
// Member Functions

View File

@ -107,7 +107,8 @@ namespace Foam
constIncompressibleGasHThermoPhysics
);
// From pure liquid (BoussinesqFluid) to a multi-component gas incomp phase
// From pure liquid (BoussinesqFluid) to a multi-component gas incomp
// phase
makeInterfaceContSpecieMixtureType
(
kineticGasEvaporation,
@ -284,4 +285,5 @@ namespace Foam
);
}
// ************************************************************************* //

View File

@ -47,8 +47,11 @@ Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::Lee
template<class Thermo, class OtherThermo>
Foam::tmp<Foam::volScalarField>
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>
::Kexp(label variable, const volScalarField& refValue)
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::Kexp
(
label variable,
const volScalarField& refValue
)
{
if (this->modelVariable_ == variable)
{
@ -92,8 +95,7 @@ Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>
template<class Thermo, class OtherThermo>
const Foam::dimensionedScalar&
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>
::Tactivate() const
Foam::meltingEvaporationModels::Lee<Thermo, OtherThermo>::Tactivate() const
{
return Tactivate_;
}

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::phaseChangeTwoPhaseMixtures::Lee
Foam::meltingEvaporationModels::Lee
Description
Mass tranfer Lee model. Simple model driven by field value difference as:
@ -85,8 +85,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef Lee_H
#define Lee_H
#ifndef meltingEvaporationModels_Lee_H
#define meltingEvaporationModels_Lee_H
#include "InterfaceCompositionModel.H"
@ -99,7 +99,7 @@ namespace meltingEvaporationModels
{
/*---------------------------------------------------------------------------*\
Class Lee
Class Lee
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
@ -136,8 +136,7 @@ public:
//- Destructor
virtual ~Lee()
{}
virtual ~Lee() = default;
// Member Functions
@ -151,7 +150,6 @@ public:
//- Return T transition between phases
virtual const dimensionedScalar& Tactivate() const;
};

View File

@ -1,5 +1,5 @@
interfaceCompositionModel/interfaceCompositionModel.C
interfaceCompositionModel/newInterfaceCompositionModel.C
interfaceCompositionModel/interfaceCompositionModelNew.C
InterfaceCompositionModel/InterfaceCompositionModels.C
LIB = $(FOAM_LIBBIN)/libmassTransferModels

View File

@ -49,9 +49,7 @@ namespace Foam
"pressure",
"massFraction"
};
} // End namespace Foam
}
const Foam::NamedEnum
<
@ -83,12 +81,6 @@ Foam::interfaceCompositionModel::interfaceCompositionModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::interfaceCompositionModel::~interfaceCompositionModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::word Foam::interfaceCompositionModel::transferSpecie() const
@ -108,4 +100,5 @@ const Foam::word Foam::interfaceCompositionModel::variable() const
return modelVariableNames[modelVariable_];
}
// ************************************************************************* //

View File

@ -52,7 +52,7 @@ class phaseModel;
class phasePair;
/*---------------------------------------------------------------------------*\
Class interfaceCompositionModel Declaration
Class interfaceCompositionModel Declaration
\*---------------------------------------------------------------------------*/
class interfaceCompositionModel
@ -121,7 +121,7 @@ public:
//- Destructor
virtual ~interfaceCompositionModel();
virtual ~interfaceCompositionModel() = default;
// Selectors
@ -181,9 +181,9 @@ public:
//- Returns the variable on which the model is based
const word variable() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -49,15 +49,15 @@ Foam::interfaceCompositionModel::New
Info<< "Selecting interfaceCompositionModel for "
<< pair << ": " << interfaceCompositionModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(interfaceCompositionModelType);
const auto cstrIter =
dictionaryConstructorTablePtr_->cfind(interfaceCompositionModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown interfaceCompositionModelType type "
<< interfaceCompositionModelType << endl << endl
<< "Valid interfaceCompositionModel types are : " << endl
<< interfaceCompositionModelType << nl << nl
<< "Valid interfaceCompositionModel types are : " << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -130,20 +130,17 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>
const volVectorField gradFrom(fvc::grad(from));
const volVectorField gradTo(fvc::grad(to));
const volScalarField areaDensity
(
"areaDensity", mag(gradFrom)
);
const volScalarField areaDensity("areaDensity", mag(gradFrom));
const volScalarField gradAlphaf(gradFrom & gradTo);
volScalarField Tmask("Tmask", from*0.0);
forAll (Tmask, celli)
forAll(Tmask, celli)
{
if (gradAlphaf[celli] < 0)
{
if (from[celli] > alphaMin_ && from[celli] < alphaMax_)
if (from[celli] > alphaMin_ && from[celli] < alphaMax_)
{
{
scalar alphaRes = 1.0 - from[celli] - to[celli];

View File

@ -22,12 +22,13 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::phaseChangeTwoPhaseMixtures::kineticGasEvaporation
Foam::meltingEvaporationModels::kineticGasEvaporation
Description
Considering the Hertz Knudsen formula, which gives the evaporation-condensation
flux based on the kinetic theory for flat interface:
Considering the Hertz Knudsen formula, which gives the
evaporation-condensation flux based on the kinetic theory for flat
interface:
\f[
Flux = C sqrt(M/(2 \pi \R T_{activate}))(\p - pSat)
@ -74,8 +75,8 @@ Description
Hertz-Knudsen-Schrage.
Based on the reference:
-# Van P. Carey, “Liquid-Vapor Phase Change Phenomena”, ISBN 0-89116836, 1992,
pp. 112-121.
- Van P. Carey, “Liquid-Vapor Phase Change Phenomena”, ISBN 0-89116836,
1992, pp. 112-121.
Usage
@ -107,15 +108,13 @@ Usage
species | Specie name on the other phase | yes
\endtable
SourceFiles
kineticGasEvaporation.C
\*---------------------------------------------------------------------------*/
#ifndef kineticGasEvaporation_H
#define kineticGasEvaporation_H
#ifndef meltingEvaporationModels_kineticGasEvaporation_H
#define meltingEvaporationModels_kineticGasEvaporation_H
#include "InterfaceCompositionModel.H"
@ -131,7 +130,7 @@ namespace meltingEvaporationModels
{
/*---------------------------------------------------------------------------*\
Class kineticGasEvaporation
Class kineticGasEvaporation
\*---------------------------------------------------------------------------*/
template<class Thermo, class OtherThermo>
@ -177,8 +176,7 @@ public:
//- Destructor
virtual ~kineticGasEvaporation()
{}
virtual ~kineticGasEvaporation() = default;
// Member Functions
@ -190,9 +188,8 @@ public:
const volScalarField& field
);
//- Return Tref
//- Return Tactivate
virtual const dimensionedScalar& Tactivate() const;
};

View File

@ -1,5 +1,5 @@
interfaceModels/porousModels/porousModel/porousModel.C
interfaceModels/porousModels/porousModel/newPorousModel.C
interfaceModels/porousModels/porousModel/porousModelNew.C
interfaceModels/porousModels/VollerPrakash/VollerPrakash.C
phasePair/phasePairKey/phasePairKey.C
@ -7,13 +7,13 @@ phasePair/phasePair/phasePair.C
phasePair/orderedPhasePair/orderedPhasePair.C
phaseModel/phaseModel/phaseModel.C
phaseModel/phaseModel/newphaseModel.C
phaseModel/phaseModel/phaseModelNew.C
phaseModel/phaseModel/phaseModels.C
phaseSystem/phaseSystem.C
phaseSystem/multiphaseSystem/multiphaseSystem.C
phaseSystem/multiphaseSystem/newMultiphaseSystem.C
phaseSystem/multiphaseSystem/multiphaseSystemNew.C
phaseSystem/multiphaseSystem/multiphaseSystems.C
LIB = $(FOAM_LIBBIN)/libIncompressibleMultiphaseSystems

View File

@ -35,8 +35,10 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::MassTransferPhaseSystem<BasePhaseSystem>::
MassTransferPhaseSystem(const fvMesh& mesh)
Foam::MassTransferPhaseSystem<BasePhaseSystem>::MassTransferPhaseSystem
(
const fvMesh& mesh
)
:
BasePhaseSystem(mesh)
{
@ -68,13 +70,6 @@ MassTransferPhaseSystem(const fvMesh& mesh)
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
Foam::MassTransferPhaseSystem<BasePhaseSystem>::
~MassTransferPhaseSystem()
{}
// * * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * //
template<class BasePhaseSystem>
@ -137,6 +132,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::calculateL
return tL;
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class BasePhaseSystem>
@ -243,11 +239,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::heatTransfer
// Explicit temperature mass transfer rate
tmp<volScalarField> Kexp =
interfacePtr->Kexp
(
interfaceCompositionModel::T,
T
);
interfacePtr->Kexp(interfaceCompositionModel::T, T);
if (Kexp.valid())
{
@ -264,11 +256,7 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::heatTransfer
// Explicit temperature mass transfer rate
const tmp<volScalarField> Kexp =
interfacePtr->Kexp
(
interfaceCompositionModel::T,
T
);
interfacePtr->Kexp(interfaceCompositionModel::T, T);
if (Kexp.valid())
{
@ -315,9 +303,9 @@ void Foam::MassTransferPhaseSystem<BasePhaseSystem>::massSpeciesTransfer
Su +=
this->Su()[phase.name()]
+ this->Sp()[phase.name()]*phase.oldTime();
}
}
}
// ************************************************************************* //

View File

@ -110,7 +110,7 @@ public:
//- Destructor
virtual ~MassTransferPhaseSystem();
virtual ~MassTransferPhaseSystem() = default;
// Member Functions

View File

@ -58,13 +58,6 @@ Foam::porousModels::VollerPrakash::VollerPrakash
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::porousModels::VollerPrakash::
~ VollerPrakash()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::VollerPrakash
Foam::porousModels::VollerPrakash
Description
Porous model to apply a porous media on a solid phase.
@ -61,8 +61,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef VollerPrakash_H
#define VollerPrakash_H
#ifndef porousModels_VollerPrakash_H
#define porousModels_VollerPrakash_H
#include "porousModel.H"
@ -107,7 +107,7 @@ public:
//- Destructor
virtual ~VollerPrakash();
virtual ~VollerPrakash() = default;
// Member Functions

View File

@ -58,12 +58,6 @@ Foam::porousModel::porousModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::porousModel::~porousModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::porousModel::writeData(Ostream& os) const

View File

@ -46,7 +46,7 @@ namespace Foam
class fvMesh;
/*---------------------------------------------------------------------------*\
Class porousModel Declaration
Class porousModel Declaration
\*---------------------------------------------------------------------------*/
class porousModel
@ -92,7 +92,7 @@ public:
//- Destructor
virtual ~porousModel();
virtual ~porousModel() = default;
// Selectors

View File

@ -28,26 +28,24 @@ License
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::porousModel >
Foam::porousModel::New
Foam::autoPtr<Foam::porousModel> Foam::porousModel::New
(
const dictionary& dict,
const fvMesh& mesh
)
{
word porousModelType(dict.lookup("type"));
word modelType(dict.lookup("type"));
Info<< "Selecting porousModel for "
<< ": " << porousModelType << endl;
<< ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(porousModelType);
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalErrorIn("porousModel::New")
<< "Unknown porousModelType type "
<< porousModelType << endl << endl
FatalErrorInFunction
<< "Unknown modelType type "
<< modelType << endl << endl
<< "Valid porousModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);

View File

@ -59,13 +59,6 @@ constantSurfaceTensionCoefficient
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::
~constantSurfaceTensionCoefficient()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
@ -74,19 +67,16 @@ Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::sigma() const
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
tmp<volScalarField>::New
(
new volScalarField
IOobject
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
sigma_
)
"zero",
mesh.time().timeName(),
mesh
),
mesh,
sigma_
);
}

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::constantSurfaceTensionCoefficient
Foam::surfaceTensionModels::constantSurfaceTensionCoefficient
Description
Constant value surface tension model.
@ -32,8 +32,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef constantSurfaceTensionCoefficient_H
#define constantSurfaceTensionCoefficient_H
#ifndef surfaceTensionModels_constantSurfaceTensionCoefficient_H
#define surfaceTensionModels_constantSurfaceTensionCoefficient_H
#include "surfaceTensionModel.H"
@ -76,7 +76,7 @@ public:
//- Destructor
virtual ~constantSurfaceTensionCoefficient();
virtual ~constantSurfaceTensionCoefficient() = default;
// Member Functions

View File

@ -60,12 +60,6 @@ Foam::surfaceTensionModel::surfaceTensionModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceTensionModel::~surfaceTensionModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::surfaceTensionModel::writeData(Ostream& os) const

View File

@ -28,7 +28,7 @@ Description
SourceFiles
surfaceTensionModel.C
newAspectRatioModel.C
surfaceTensionModelNew.C
\*---------------------------------------------------------------------------*/
@ -47,7 +47,7 @@ namespace Foam
class phasePair;
/*---------------------------------------------------------------------------*\
Class surfaceTensionModel Declaration
Class surfaceTensionModel Declaration
\*---------------------------------------------------------------------------*/
class surfaceTensionModel
@ -95,7 +95,7 @@ public:
//- Destructor
virtual ~surfaceTensionModel();
virtual ~surfaceTensionModel() = default;
// Selectors

View File

@ -28,29 +28,27 @@ License
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::surfaceTensionModel >
Foam::surfaceTensionModel::New
Foam::autoPtr<Foam::surfaceTensionModel> Foam::surfaceTensionModel::New
(
const dictionary& dict,
const phasePair& pair
)
{
word surfaceTensionModelType(dict.lookup("type"));
word modelType(dict.lookup("type"));
Info<< "Selecting surfaceTensionModel for "
<< pair << ": " << surfaceTensionModelType << endl;
<< pair << ": " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(surfaceTensionModelType);
const auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalErrorIn("surfaceTensionModel::New")
<< "Unknown surfaceTensionModelType type "
FatalIOErrorInFunction(dict)
<< "Unknown surfaceTensionModel type "
<< surfaceTensionModelType << endl << endl
<< "Valid surfaceTensionModel types are : " << endl
<< "Valid modelType types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
<< exit(FatalIOError);
}
return cstrIter()(dict, pair, true);

View File

@ -65,13 +65,6 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseModel>
Foam::MovingPhaseModel<BasePhaseModel>::~MovingPhaseModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasePhaseModel>
@ -125,20 +118,18 @@ template<class BasePhaseModel>
Foam::tmp<Foam::surfaceScalarField> Foam::MovingPhaseModel<BasePhaseModel>::
diffNo() const
{
return tmp<surfaceScalarField>
return tmp<surfaceScalarField>::New
(
new surfaceScalarField
IOobject
(
IOobject
(
IOobject::groupName("diffNo", phaseModel::name()),
U_.mesh().time().timeName(),
U_.mesh()
),
U_.mesh(),
dimensionedScalar("0", dimless, 0.0)
)
IOobject::groupName("diffNo", phaseModel::name()),
U_.mesh().time().timeName(),
U_.mesh()
),
U_.mesh(),
dimensionedScalar("0", dimless, 0.0)
);
}
// ************************************************************************* //

View File

@ -79,7 +79,7 @@ public:
//- Destructor
virtual ~MovingPhaseModel();
virtual ~MovingPhaseModel() = default;
// Member Functions
@ -90,7 +90,6 @@ public:
// Momentum
//- Constant access the volumetric flux
virtual tmp<surfaceScalarField> phi() const;
@ -108,7 +107,6 @@ public:
//- Diffusion number
virtual tmp<surfaceScalarField> diffNo() const;
};

View File

@ -99,18 +99,9 @@ MultiComponentPhaseModel
// Init vol fractions from mass fractions
calculateVolumeFractions();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseModel, class phaseThermo>
Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::
~MultiComponentPhaseModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -139,13 +130,12 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>
}
X_[inertIndex_] = 1.0 - Xtotal;
X_[inertIndex_].correctBoundaryConditions();
}
template<class BasePhaseModel, class phaseThermo>
void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>
::calculateMassFractions()
void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::
calculateMassFractions()
{
volScalarField W(X_[0]*thermo().composition().W(0));
for(label i=1; i< species_.size(); i++)
@ -421,4 +411,5 @@ Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>::inertIndex() const
return inertIndex_;
}
// ************************************************************************* //

View File

@ -57,7 +57,6 @@ class MultiComponentPhaseModel
{
protected:
// Protected data
//- Species table
@ -82,7 +81,6 @@ protected:
void calculateVolumeFractions();
public:
// Constructors
@ -95,7 +93,7 @@ public:
//- Destructor
virtual ~MultiComponentPhaseModel();
virtual ~MultiComponentPhaseModel() = default;
// Member Functions
@ -135,7 +133,6 @@ public:
//- Return inert species index
label inertIndex() const;
};

View File

@ -50,13 +50,6 @@ Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::PurePhaseModel
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseModel, class phaseThermo>
Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::~PurePhaseModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasePhaseModel, class phaseThermo>
@ -66,16 +59,10 @@ void Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::solveYi
PtrList<Foam::volScalarField::Internal>&
)
{
notImplemented
(
"template<class BasePhaseModel> "
"Foam::tmp<Foam::fvScalarMatrix> "
"Foam::PurePhaseModel<BasePhaseModel>::solveYi()"
);
NotImplemented;
}
template<class BasePhaseModel, class phaseThermo>
const Foam::PtrList<Foam::volScalarField>&
Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::Y() const
@ -99,11 +86,12 @@ thermo() const
return thermoPtr_();
}
template<class BasePhaseModel, class phaseThermo>
phaseThermo& Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::
thermo()
phaseThermo& Foam::PurePhaseModel<BasePhaseModel, phaseThermo>::thermo()
{
return thermoPtr_();
}
// ************************************************************************* //

View File

@ -79,7 +79,7 @@ public:
//- Destructor
virtual ~PurePhaseModel();
virtual ~PurePhaseModel() = default;
// Member Functions

View File

@ -68,13 +68,6 @@ Foam::StaticPhaseModel<BasePhaseModel>::StaticPhaseModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class BasePhaseModel>
Foam::StaticPhaseModel<BasePhaseModel>::~StaticPhaseModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasePhaseModel>
@ -88,19 +81,16 @@ template<class BasePhaseModel>
Foam::tmp<Foam::surfaceScalarField>
Foam::StaticPhaseModel<BasePhaseModel>::phi() const
{
return tmp<surfaceScalarField>
return tmp<surfaceScalarField>::New
(
new surfaceScalarField
IOobject
(
IOobject
(
IOobject::groupName("phi", phaseModel::name()),
U_.mesh().time().timeName(),
U_.mesh()
),
U_.mesh(),
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
)
IOobject::groupName("phi", phaseModel::name()),
U_.mesh().time().timeName(),
U_.mesh()
),
U_.mesh(),
dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0)
);
}
@ -179,4 +169,5 @@ Foam::tmp<Foam::surfaceScalarField> Foam::StaticPhaseModel<BasePhaseModel>
return tkapparhoCpbyDelta;
}
// ************************************************************************* //

View File

@ -75,7 +75,7 @@ public:
//- Destructor
virtual ~StaticPhaseModel();
virtual ~StaticPhaseModel() = default;
// Member Functions
@ -86,7 +86,6 @@ public:
// Momentum
//- Constant access the volumetric flux. Return zero field
virtual tmp<surfaceScalarField> phi() const;
@ -104,7 +103,6 @@ public:
//- Maximum diffusion number
virtual tmp<surfaceScalarField> diffNo() const;
};

View File

@ -35,10 +35,15 @@ License
\
namespace Foam \
{ \
typedef Foam::MomemtumType<Foam::CompType<Foam::Phase, Foam::Thermo> > \
Name; \
\
\
typedef Foam::MomemtumType \
< \
Foam::CompType \
< \
Foam::Phase, \
Foam::Thermo \
> \
> \
Name; \
\
addNamedToRunTimeSelectionTable \
( \

View File

@ -60,12 +60,6 @@ Foam::phaseModel::phaseModel
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseModel::~phaseModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::word& Foam::phaseModel::name() const

View File

@ -52,7 +52,7 @@ namespace Foam
class phaseSystem;
/*---------------------------------------------------------------------------*\
Class phaseModel Declaration
Class phaseModel Declaration
\*---------------------------------------------------------------------------*/
class phaseModel
@ -94,7 +94,7 @@ public:
//- Destructor
virtual ~phaseModel();
virtual ~phaseModel() = default;
// Selectors
@ -212,10 +212,8 @@ public:
}
// Transport
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
const volScalarField& alpha() const;
@ -265,7 +263,6 @@ public:
virtual tmp<surfaceScalarField> diffNo() const = 0;
// Species
//- Constant access the species mass fractions
@ -275,27 +272,25 @@ public:
virtual PtrList<volScalarField>& Y() = 0;
// Momentum
//- Constant access the volumetric flux
virtual tmp<surfaceScalarField> phi() const = 0;
//- Constant access the volumetric flux
virtual tmp<surfaceScalarField> phi() const = 0;
//- Access the volumetric flux
virtual const surfaceScalarField& phi() = 0;
//- Access the volumetric flux
virtual const surfaceScalarField& phi() = 0;
//- Constant access the volumetric flux of the phase
virtual tmp<surfaceScalarField> alphaPhi() const = 0;
//- Constant access the volumetric flux of the phase
virtual tmp<surfaceScalarField> alphaPhi() const = 0;
//- Access the volumetric flux of the phase
virtual surfaceScalarField& alphaPhi() = 0;
//- Access the volumetric flux of the phase
virtual surfaceScalarField& alphaPhi() = 0;
//- Access const reference to U
virtual tmp<volVectorField> U() const = 0;
//- Access const reference to U
virtual tmp<volVectorField> U() const = 0;
// Turbulence (WIP: possible to add turbulent on each phase)
// Turbulence (WIP: possible to add turbulence on each phase)
/*
//- Return the turbulent dynamic viscosity

View File

@ -34,19 +34,18 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
const word& phaseName
)
{
word phaseModelType(fluid.subDict(phaseName).lookup("type"));
word modelType(fluid.subDict(phaseName).lookup("type"));
Info<< "Selecting phaseModel for "
<< phaseName << ": " << phaseModelType << endl;
<< phaseName << ": " << modelType << endl;
phaseSystemConstructorTable::iterator cstrIter =
phaseSystemConstructorTablePtr_->find(phaseModelType);
const auto cstrIter = phaseSystemConstructorTablePtr_->cfind(modelType);
if (cstrIter == phaseSystemConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalErrorIn("phaseModel::New")
<< "Unknown phaseModelType type "
<< phaseModelType << endl << endl
FatalErrorInFunction
<< "Unknown phaseModel type "
<< modelType << endl << endl
<< "Valid phaseModel types are : " << endl
<< phaseSystemConstructorTablePtr_->sortedToc()
<< exit(FatalError);
@ -55,4 +54,5 @@ Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New
return cstrIter()(fluid, phaseName);
}
// ************************************************************************* //

View File

@ -33,18 +33,7 @@ Foam::orderedPhasePair::orderedPhasePair
const phaseModel& to
)
:
phasePair
(
from,
to,
true
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::orderedPhasePair::~orderedPhasePair()
phasePair(from, to, true)
{}
@ -69,4 +58,5 @@ Foam::word Foam::orderedPhasePair::name() const
return first() + "To" + namec;
}
// ************************************************************************* //

View File

@ -42,7 +42,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class orderedPhasePair Declaration
Class orderedPhasePair Declaration
\*---------------------------------------------------------------------------*/
class orderedPhasePair
@ -62,7 +62,7 @@ public:
//- Destructor
virtual ~orderedPhasePair();
virtual ~orderedPhasePair() = default;
// Member Functions
@ -75,7 +75,6 @@ public:
//- Pair name
virtual word name() const;
};

View File

@ -42,17 +42,11 @@ Foam::phasePair::phasePair
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phasePair::~phasePair()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::phaseModel& Foam::phasePair::from() const
{
FatalErrorIn("Foam::phasePair::from() const")
FatalErrorInFunction
<< "Requested from phase from an unordered pair."
<< exit(FatalError);
@ -62,7 +56,7 @@ const Foam::phaseModel& Foam::phasePair::from() const
const Foam::phaseModel& Foam::phasePair::to() const
{
FatalErrorIn("Foam::phasePair::to() const")
FatalErrorInFunction
<< "Requested to phase from an unordered pair."
<< exit(FatalError);

View File

@ -53,11 +53,6 @@ class phasePair
:
public phasePairKey
{
public:
private:
// Private data
//- Phase 1
@ -81,7 +76,7 @@ public:
//- Destructor
virtual ~phasePair();
virtual ~phasePair() = default;
// Member Functions
@ -96,7 +91,6 @@ public:
virtual word name() const;
// Access
// Phase 1
@ -104,7 +98,6 @@ public:
// Phase 2
inline const phaseModel& phase2() const;
};

View File

@ -47,12 +47,6 @@ Foam::phasePairKey::phasePairKey
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phasePairKey::~phasePairKey()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::phasePairKey::ordered() const
@ -133,14 +127,8 @@ Foam::Istream& Foam::operator>>(Istream& is, phasePairKey& key)
}
else
{
FatalErrorIn
(
"friend Istream& operator>>"
"("
"Istream& is, "
"phasePairKey& key"
")"
) << "Phase pair type is not recognised. "
FatalErrorInFunction
<< "Phase pair type is not recognised. "
<< temp
<< "Use (phaseDispersed to phaseContinuous) for an ordered"
<< "pair, or (phase1 and pase2) for an unordered pair."

View File

@ -94,7 +94,7 @@ public:
// Destructor
virtual ~phasePairKey();
virtual ~phasePairKey() = default;
// Access

View File

@ -113,13 +113,6 @@ Foam::multiphaseSystem::multiphaseSystem
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::multiphaseSystem::~multiphaseSystem()
{
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::multiphaseSystem::calculateSuSp()
@ -623,6 +616,7 @@ Foam::dimensionedScalar Foam::multiphaseSystem::ddtAlphaMax() const
return ddtAlphaMax_;
}
Foam::scalar Foam::multiphaseSystem::maxDiffNo() const
{
phaseModelTable::const_iterator phaseModelIter = phaseModels_.begin();
@ -645,24 +639,30 @@ Foam::scalar Foam::multiphaseSystem::maxDiffNo() const
return DiNum;
}
const Foam::multiphaseSystem::compressionFluxTable&
Foam::multiphaseSystem::limitedPhiAlphas() const
{
return limitedPhiAlphas_;
}
Foam::multiphaseSystem::SuSpTable& Foam::multiphaseSystem::Su()
{
return Su_;
}
Foam::multiphaseSystem::SuSpTable& Foam::multiphaseSystem::Sp()
{
return Sp_;
}
bool Foam::multiphaseSystem::read()
{
return true;
}
// ************************************************************************* //

View File

@ -95,6 +95,7 @@ protected:
//- Calculate Sp and Su
void calculateSuSp();
public:
//- Runtime type information
@ -121,7 +122,7 @@ public:
//- Destructor
virtual ~multiphaseSystem();
virtual ~multiphaseSystem() = default;
// Selectors
@ -137,7 +138,6 @@ public:
// Access
//- Return phases
const UPtrList<phaseModel>& phases() const;
@ -167,9 +167,6 @@ public:
//- Read thermophysical properties dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -50,15 +50,13 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
Info<< "Selecting multiphaseSystem " << multiphaseSystemType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(multiphaseSystemType);
const auto cstrIter =
dictionaryConstructorTablePtr_->cfind(multiphaseSystemType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalErrorIn
(
"multiphaseSystem::New"
) << "Unknown multiphaseSystemType type "
FatalErrorInFunction
<< "Unknown multiphaseSystemType type "
<< multiphaseSystemType << endl
<< "Valid multiphaseSystem types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
@ -68,4 +66,5 @@ Foam::autoPtr<Foam::multiphaseSystem> Foam::multiphaseSystem::New
return autoPtr<multiphaseSystem> (cstrIter()(mesh));
}
// ************************************************************************* //

View File

@ -438,7 +438,7 @@ Foam::tmp<Foam::scalarField> Foam::phaseSystem::Cp
);
++phaseModelIter;
for (; phaseModelIter != phaseModels_.end(); ++ phaseModelIter)
for (; phaseModelIter != phaseModels_.end(); ++phaseModelIter)
{
tmpCp.ref() += phaseModelIter()()*phaseModelIter()->Cp(p, T, patchI);
}
@ -1196,5 +1196,5 @@ bool Foam::phaseSystem::read()
}
}
// ************************************************************************* //
// ************************************************************************* //

View File

@ -235,8 +235,6 @@ protected:
);
public:
//- Runtime type information
@ -351,7 +349,6 @@ public:
//- Return Cv of the mixture
virtual tmp<volScalarField> Cv() const;
//- Heat capacity at constant volume for patch [J/kg/K]
virtual tmp<scalarField> Cv
(
@ -360,7 +357,6 @@ public:
const label patchI
) const;
//- Gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
@ -400,7 +396,6 @@ public:
// Transport
//- Thermal diffusivity for temperature of mixture [J/m/s/K]
virtual tmp<volScalarField> kappa() const;
@ -503,7 +498,6 @@ public:
//- Return interfacial source mass rate per phase pair
virtual tmp<volScalarField> dmdt(const phasePairKey& key) const = 0;
//- Return the heat transfer matrices
virtual tmp<fvScalarMatrix> heatTransfer
(
@ -546,7 +540,6 @@ public:
virtual bool read();
// Access to phases models
//- Constant access the total phase pairs
@ -626,7 +619,6 @@ public:
//- Near Interface of alpha'n
tmp<volScalarField> nearInterface() const;
};

View File

@ -84,6 +84,7 @@ void Foam::phaseSystem::createSubModels
}
}
template<class modelType>
void Foam::phaseSystem::generatePairsAndSubModels
(
@ -96,13 +97,11 @@ void Foam::phaseSystem::generatePairsAndSubModels
>& models
)
{
dictTable modelDicts(lookup(modelName));
generatePairs(modelDicts);
createSubModels(modelDicts, models);
}
@ -119,13 +118,11 @@ void Foam::phaseSystem::generatePairsAndSubModels
>& models
)
{
dictTable modelDicts(lookup(modelName));
generatePairs(modelDicts);
createSubModels(modelDicts, mesh, models);
}

View File

@ -61,4 +61,5 @@ if (adjustTimeStep)
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}
// ************************************************************************* //