/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "SinglePhaseMixture.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template
void Foam::SinglePhaseMixture::constructIds()
{
if (this->phaseProps().size() == 0)
{
FatalErrorInFunction
<< "Phase list is empty" << exit(FatalError);
}
else if (this->phaseProps().size() > 1)
{
FatalErrorInFunction
<< "Only one phase permitted" << exit(FatalError);
}
switch (this->phaseProps()[0].phase())
{
case phaseProperties::GAS:
{
idGas_ = 0;
break;
}
case phaseProperties::LIQUID:
{
idLiquid_ = 0;
break;
}
case phaseProperties::SOLID:
{
idSolid_ = 0;
break;
}
default:
{
FatalErrorInFunction
<< "Unknown phase enumeration" << abort(FatalError);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
Foam::SinglePhaseMixture::SinglePhaseMixture
(
const dictionary& dict,
CloudType& owner
)
:
CompositionModel(dict, owner, typeName),
idGas_(-1),
idLiquid_(-1),
idSolid_(-1)
{
constructIds();
}
template
Foam::SinglePhaseMixture::SinglePhaseMixture
(
const SinglePhaseMixture& cm
)
:
CompositionModel(cm),
idGas_(cm.idGas_),
idLiquid_(cm.idLiquid_),
idSolid_(cm.idSolid_)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template
Foam::SinglePhaseMixture::~SinglePhaseMixture()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
const Foam::scalarField&
Foam::SinglePhaseMixture::YMixture0() const
{
return this->phaseProps()[0].Y();
}
template
Foam::label Foam::SinglePhaseMixture::idGas() const
{
return idGas_;
}
template
Foam::label Foam::SinglePhaseMixture::idLiquid() const
{
return idLiquid_;
}
template
Foam::label Foam::SinglePhaseMixture::idSolid() const
{
return idSolid_;
}
// ************************************************************************* //