129 lines
3.1 KiB
C
129 lines
3.1 KiB
C
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
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 <http://www.gnu.org/licenses/>.
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
#include "GasState.H"
|
|
|
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
|
|
// const dataType Foam::GasState::staticData();
|
|
|
|
|
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
|
|
|
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
|
|
|
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
|
|
Foam::GasState::GasState(const scalar p, const scalar T, const label n)
|
|
:
|
|
p_(p),
|
|
T_(T),
|
|
Y_(n, 0.0),
|
|
X_(n, 0.0)
|
|
{
|
|
Y_[0] = 1.0;
|
|
X_[0] = 1.0;
|
|
|
|
calculateW();
|
|
}
|
|
|
|
|
|
Foam::GasState::GasState(const scalar p, const scalar T, const scalarField &Y)
|
|
:
|
|
p_(p),
|
|
T_(T),
|
|
Y_(Y),
|
|
X_(Y)
|
|
{
|
|
Y_ /= Foam::sum(Y_);
|
|
|
|
calculateX();
|
|
|
|
calculateW();
|
|
}
|
|
|
|
|
|
Foam::GasState::GasState(const scalar p, const scalar T, tmp<scalarField> Y)
|
|
:
|
|
p_(p),
|
|
T_(T),
|
|
Y_(Y),
|
|
X_(Y_)
|
|
{
|
|
Y_ /= Foam::sum(Y_);
|
|
|
|
calculateX();
|
|
|
|
calculateW();
|
|
}
|
|
|
|
|
|
Foam::GasState::GasState(const GasState& state)
|
|
:
|
|
p_(state.p_),
|
|
T_(state.T_),
|
|
Y_(state.Y_),
|
|
X_(state.X_),
|
|
W_(state.W_)
|
|
{}
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
|
|
Foam::GasState::~GasState()
|
|
{}
|
|
|
|
|
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
|
|
|
|
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
|
|
void Foam::GasState::operator=(const GasState& rhs)
|
|
{
|
|
// Check for assignment to self
|
|
if (this == &rhs)
|
|
{
|
|
FatalErrorInFunction
|
|
<< "Attempted assignment to self"
|
|
<< abort(FatalError);
|
|
}
|
|
}
|
|
|
|
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
|
|
|
|
|
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
|
|
|
|
|
// ************************************************************************* //
|