mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Multiphase: Update all solvers to accommodate the split between twoPhaseMixture and incompressibleTwoPhaseMixture
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I.. \
|
-I.. \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
|
|||||||
@ -35,7 +35,7 @@ Description
|
|||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "dynamicFvMesh.H"
|
#include "dynamicFvMesh.H"
|
||||||
#include "barotropicCompressibilityModel.H"
|
#include "barotropicCompressibilityModel.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Description
|
|||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "barotropicCompressibilityModel.H"
|
#include "barotropicCompressibilityModel.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "Reading transportProperties\n" << endl;
|
||||||
|
|
||||||
twoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
|
incompressibleTwoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
|
||||||
|
|
||||||
volScalarField& gamma(twoPhaseProperties.alpha1());
|
volScalarField& gamma(twoPhaseProperties.alpha1());
|
||||||
gamma.oldTime();
|
gamma.oldTime();
|
||||||
|
|||||||
@ -1,20 +1,18 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-ItwoPhaseThermo \
|
-ItwoPhaseThermo \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-ltwoPhaseThermo \
|
-ltwoPhaseThermo \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
|
-ltwoPhaseProperties \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-lcompressibleTurbulenceModel \
|
||||||
-lincompressibleTransportModels \
|
-lcompressibleRASModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lcompressibleLESModels \
|
||||||
-lincompressibleRASModels \
|
|
||||||
-lincompressibleLESModels \
|
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|||||||
@ -3,12 +3,16 @@
|
|||||||
(
|
(
|
||||||
fvm::ddt(rho, T)
|
fvm::ddt(rho, T)
|
||||||
+ fvm::div(rhoPhi, T)
|
+ fvm::div(rhoPhi, T)
|
||||||
- fvm::laplacian(thermo.alphaEff(rho*turbulence->nut()), T)
|
- fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T)
|
||||||
+ (
|
+ (
|
||||||
p*fvc::div(phi)
|
p*fvc::div(phi)
|
||||||
+ fvc::ddt(rho, K) + fvc::div(rhoPhi, K)
|
+ fvc::ddt(rho, K) + fvc::div(rhoPhi, K)
|
||||||
)*(alpha1/thermo.thermo1().Cv() + alpha2/thermo.thermo2().Cv())
|
)
|
||||||
|
*(
|
||||||
|
alpha1/twoPhaseProperties.thermo1().Cv()
|
||||||
|
+ alpha2/twoPhaseProperties.thermo2().Cv()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
thermo.correct();
|
twoPhaseProperties.correct();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
(
|
(
|
||||||
fvm::ddt(rho, U)
|
fvm::ddt(rho, U)
|
||||||
+ fvm::div(rhoPhi, U)
|
+ fvm::div(rhoPhi, U)
|
||||||
+ turbulence->divDevRhoReff(rho, U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|||||||
@ -2,28 +2,24 @@ EXE_INC = \
|
|||||||
-I.. \
|
-I.. \
|
||||||
-I../twoPhaseThermo \
|
-I../twoPhaseThermo \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
-I../phaseEquationsOfState/lnInclude \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
|
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-ltwoPhaseThermo \
|
-ltwoPhaseThermo \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
|
-ltwoPhaseProperties \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-lcompressibleTurbulenceModel \
|
||||||
-lincompressibleTransportModels \
|
-lcompressibleRASModels \
|
||||||
-lphaseEquationsOfState \
|
-lcompressibleLESModels \
|
||||||
-lincompressibleTurbulenceModel \
|
|
||||||
-lincompressibleRASModels \
|
|
||||||
-lincompressibleLESModels \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-ldynamicMesh \
|
-ldynamicMesh \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-ldynamicFvMesh
|
-ldynamicFvMesh \
|
||||||
|
-lfiniteVolume
|
||||||
|
|||||||
@ -28,36 +28,33 @@
|
|||||||
|
|
||||||
#include "createPhi.H"
|
#include "createPhi.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "Constructing twoPhaseThermo\n" << endl;
|
||||||
twoPhaseMixture twoPhaseProperties(U, phi);
|
twoPhaseThermo twoPhaseProperties(mesh);
|
||||||
|
|
||||||
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
||||||
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
||||||
|
|
||||||
Info<< "Reading thermophysical properties\n" << endl;
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
twoPhaseThermo thermo(twoPhaseProperties);
|
volScalarField& p = twoPhaseProperties.p();
|
||||||
|
volScalarField& T = twoPhaseProperties.T();
|
||||||
|
const volScalarField& rho1 = twoPhaseProperties.thermo1().rho();
|
||||||
|
const volScalarField& psi1 = twoPhaseProperties.thermo1().psi();
|
||||||
|
const volScalarField& rho2 = twoPhaseProperties.thermo2().rho();
|
||||||
|
const volScalarField& psi2 = twoPhaseProperties.thermo2().psi();
|
||||||
|
|
||||||
volScalarField& rho = thermo.rho();
|
volScalarField rho
|
||||||
volScalarField& p = thermo.p();
|
(
|
||||||
volScalarField& T = thermo.T();
|
IOobject
|
||||||
const volScalarField& rho1 = thermo.thermo1().rho();
|
(
|
||||||
const volScalarField& psi1 = thermo.thermo1().psi();
|
"rho",
|
||||||
const volScalarField& rho2 = thermo.thermo2().rho();
|
runTime.timeName(),
|
||||||
const volScalarField& psi2 = thermo.thermo2().psi();
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
// volScalarField rho
|
IOobject::AUTO_WRITE
|
||||||
// (
|
),
|
||||||
// IOobject
|
alpha1*rho1 + alpha2*rho2
|
||||||
// (
|
);
|
||||||
// "rho",
|
|
||||||
// runTime.timeName(),
|
|
||||||
// mesh,
|
|
||||||
// IOobject::READ_IF_PRESENT,
|
|
||||||
// IOobject::AUTO_WRITE
|
|
||||||
// ),
|
|
||||||
// alpha1*rho1 + alpha2*rho2
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
|
||||||
dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
|
dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
|
||||||
@ -90,10 +87,10 @@
|
|||||||
// Construct interface from alpha1 distribution
|
// Construct interface from alpha1 distribution
|
||||||
interfaceProperties interface(alpha1, U, twoPhaseProperties);
|
interfaceProperties interface(alpha1, U, twoPhaseProperties);
|
||||||
|
|
||||||
// Construct incompressible turbulence model
|
// Construct compressible turbulence model
|
||||||
autoPtr<incompressible::turbulenceModel> turbulence
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
(
|
(
|
||||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
|
compressible::turbulenceModel::New(rho, U, rhoPhi, twoPhaseProperties)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Creating field dpdt\n" << endl;
|
Info<< "Creating field dpdt\n" << endl;
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
// pressure solution - done in 2 parts. Part 1:
|
||||||
//thermo.rho() -= psi*p_rgh;
|
//twoPhaseProperties.rho() -= psi*p_rgh;
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -70,7 +70,7 @@
|
|||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
// Second part of thermodynamic density update
|
// Second part of thermodynamic density update
|
||||||
//thermo.rho() += psi*p_rgh;
|
//twoPhaseProperties.rho() += psi*p_rgh;
|
||||||
|
|
||||||
dgdt =
|
dgdt =
|
||||||
(
|
(
|
||||||
@ -88,14 +88,14 @@
|
|||||||
|
|
||||||
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
|
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
|
||||||
|
|
||||||
// thermo.correct();
|
// twoPhaseProperties.correct();
|
||||||
|
|
||||||
Info<< "max(U) " << max(mag(U)).value() << endl;
|
Info<< "max(U) " << max(mag(U)).value() << endl;
|
||||||
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
|
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
|
||||||
|
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (twoPhaseProperties.dpdt())
|
||||||
{
|
{
|
||||||
dpdt = fvc::ddt(p);
|
dpdt = fvc::ddt(p);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
phaseEquationOfState/phaseEquationOfState.C
|
|
||||||
phaseEquationOfState/newPhaseEquationOfState.C
|
|
||||||
constant/constant.C
|
|
||||||
linear/linear.C
|
|
||||||
perfectFluid/perfectFluid.C
|
|
||||||
adiabaticPerfectFluid/adiabaticPerfectFluid.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libphaseEquationsOfState
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lincompressibleTransportModels
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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 "adiabaticPerfectFluid.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace phaseEquationsOfState
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(adiabaticPerfectFluid, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
phaseEquationOfState,
|
|
||||||
adiabaticPerfectFluid,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::phaseEquationsOfState::adiabaticPerfectFluid::adiabaticPerfectFluid
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
phaseEquationOfState(dict),
|
|
||||||
p0_("p0", dimPressure, dict.lookup("p0")),
|
|
||||||
rho0_("rho0", dimDensity, dict.lookup("rho0")),
|
|
||||||
gamma_("gamma", dimless, dict.lookup("gamma")),
|
|
||||||
B_("B", dimPressure, dict.lookup("B"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::phaseEquationsOfState::adiabaticPerfectFluid::~adiabaticPerfectFluid()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::phaseEquationsOfState::adiabaticPerfectFluid::rho
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<Foam::volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
p.time().timeName(),
|
|
||||||
p.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
rho0_*pow((p + B_)/(p0_ + B_), 1.0/gamma_)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::phaseEquationsOfState::adiabaticPerfectFluid::psi
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<Foam::volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"psi",
|
|
||||||
p.time().timeName(),
|
|
||||||
p.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
(rho0_/(gamma_*(p0_ + B_)))
|
|
||||||
*pow((p + B_)/(p0_ + B_), 1.0/gamma_ - 1.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,120 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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 "constant.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace phaseEquationsOfState
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(constant, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
phaseEquationOfState,
|
|
||||||
constant,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::phaseEquationsOfState::constant::constant
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
phaseEquationOfState(dict),
|
|
||||||
rho_("rho", dimDensity, dict.lookup("rho"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::phaseEquationsOfState::constant::~constant()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::constant::rho
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<Foam::volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
p.time().timeName(),
|
|
||||||
p.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
p.mesh(),
|
|
||||||
rho_
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::constant::psi
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<Foam::volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"psi",
|
|
||||||
p.time().timeName(),
|
|
||||||
p.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
p.mesh(),
|
|
||||||
dimensionedScalar("psi", dimDensity/dimPressure, 0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::phaseEquationsOfState::constant
|
|
||||||
|
|
||||||
Description
|
|
||||||
Constant phase density model.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
constant.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef constant_H
|
|
||||||
#define constant_H
|
|
||||||
|
|
||||||
#include "phaseEquationOfState.H"
|
|
||||||
#include "dimensionedTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace phaseEquationsOfState
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class constant Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class constant
|
|
||||||
:
|
|
||||||
public phaseEquationOfState
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- The constant density of the phase
|
|
||||||
dimensionedScalar rho_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("constant");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
constant
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~constant();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
tmp<volScalarField> rho
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const;
|
|
||||||
|
|
||||||
tmp<volScalarField> psi
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace phaseEquationsOfState
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,120 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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 "linear.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace phaseEquationsOfState
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(linear, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
phaseEquationOfState,
|
|
||||||
linear,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::phaseEquationsOfState::linear::linear
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
phaseEquationOfState(dict),
|
|
||||||
rho0_("rho0", dimDensity, dict.lookup("rho0")),
|
|
||||||
psi_("psi", dimDensity/dimPressure, dict.lookup("psi"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::phaseEquationsOfState::linear::~linear()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::linear::rho
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<Foam::volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
p.time().timeName(),
|
|
||||||
p.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
rho0_ + psi_*p
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::linear::psi
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<Foam::volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"psi",
|
|
||||||
p.time().timeName(),
|
|
||||||
p.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
p.mesh(),
|
|
||||||
psi_
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,109 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::phaseEquationsOfState::linear
|
|
||||||
|
|
||||||
Description
|
|
||||||
Linear phase density model.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
linear.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef linear_H
|
|
||||||
#define linear_H
|
|
||||||
|
|
||||||
#include "phaseEquationOfState.H"
|
|
||||||
#include "dimensionedTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace phaseEquationsOfState
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class linear Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class linear
|
|
||||||
:
|
|
||||||
public phaseEquationOfState
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- The reference density of the phase
|
|
||||||
dimensionedScalar rho0_;
|
|
||||||
|
|
||||||
//- The constant compressibility of the phase
|
|
||||||
dimensionedScalar psi_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("linear");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
linear
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~linear();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
tmp<volScalarField> rho
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const;
|
|
||||||
|
|
||||||
tmp<volScalarField> psi
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace phaseEquationsOfState
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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 "perfectFluid.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace phaseEquationsOfState
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(perfectFluid, 0);
|
|
||||||
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
phaseEquationOfState,
|
|
||||||
perfectFluid,
|
|
||||||
dictionary
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::phaseEquationsOfState::perfectFluid::perfectFluid
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
phaseEquationOfState(dict),
|
|
||||||
rho0_("rho0", dimDensity, dict.lookup("rho0")),
|
|
||||||
R_("R", dimensionSet(0, 2, -2, -1, 0), dict.lookup("R"))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::phaseEquationsOfState::perfectFluid::~perfectFluid()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::perfectFluid::rho
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<Foam::volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
p.time().timeName(),
|
|
||||||
p.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
rho0_ + psi(p, T)*p
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::perfectFluid::psi
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<Foam::volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"psi",
|
|
||||||
p.time().timeName(),
|
|
||||||
p.mesh(),
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
),
|
|
||||||
1.0/(R_*T)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,109 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::phaseEquationsOfState::perfectFluid
|
|
||||||
|
|
||||||
Description
|
|
||||||
PerfectFluid phase density model.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
perfectFluid.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef perfectFluid_H
|
|
||||||
#define perfectFluid_H
|
|
||||||
|
|
||||||
#include "phaseEquationOfState.H"
|
|
||||||
#include "dimensionedTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace phaseEquationsOfState
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class perfectFluid Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class perfectFluid
|
|
||||||
:
|
|
||||||
public phaseEquationOfState
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- The reference density of the phase
|
|
||||||
dimensionedScalar rho0_;
|
|
||||||
|
|
||||||
//- The fluid constant of the phase
|
|
||||||
dimensionedScalar R_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("perfectFluid");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from components
|
|
||||||
perfectFluid
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~perfectFluid();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
tmp<volScalarField> rho
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const;
|
|
||||||
|
|
||||||
tmp<volScalarField> psi
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace phaseEquationsOfState
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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 "phaseEquationOfState.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::phaseEquationOfState> Foam::phaseEquationOfState::New
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
{
|
|
||||||
word phaseEquationOfStateType
|
|
||||||
(
|
|
||||||
dict.subDict("equationOfState").lookup("type")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Selecting phaseEquationOfState "
|
|
||||||
<< phaseEquationOfStateType << endl;
|
|
||||||
|
|
||||||
dictionaryConstructorTable::iterator cstrIter =
|
|
||||||
dictionaryConstructorTablePtr_->find(phaseEquationOfStateType);
|
|
||||||
|
|
||||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
|
||||||
{
|
|
||||||
FatalErrorIn("phaseEquationOfState::New")
|
|
||||||
<< "Unknown phaseEquationOfStateType type "
|
|
||||||
<< phaseEquationOfStateType << endl << endl
|
|
||||||
<< "Valid phaseEquationOfState types are : " << endl
|
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cstrIter()(dict.subDict("equationOfState"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,127 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2012 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/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::phaseEquationOfState
|
|
||||||
|
|
||||||
Description
|
|
||||||
A2stract base-class for dispersed-phase particle diameter models.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
phaseEquationOfState.C
|
|
||||||
newDiameterModel.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef phaseEquationOfState_H
|
|
||||||
#define phaseEquationOfState_H
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "dictionary.H"
|
|
||||||
#include "volFieldsFwd.H"
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class phaseEquationOfState Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class phaseEquationOfState
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
const dictionary& dict_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("phaseEquationOfState");
|
|
||||||
|
|
||||||
|
|
||||||
// Declare runtime construction
|
|
||||||
|
|
||||||
declareRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
autoPtr,
|
|
||||||
phaseEquationOfState,
|
|
||||||
dictionary,
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
),
|
|
||||||
(dict)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
phaseEquationOfState
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
|
||||||
virtual ~phaseEquationOfState();
|
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
static autoPtr<phaseEquationOfState> New
|
|
||||||
(
|
|
||||||
const dictionary& dict
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
//- Return the phase density
|
|
||||||
virtual tmp<volScalarField> rho
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Return the phase compressibility
|
|
||||||
virtual tmp<volScalarField> psi
|
|
||||||
(
|
|
||||||
const volScalarField& p,
|
|
||||||
const volScalarField& T
|
|
||||||
) const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,11 +1,10 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lincompressibleTransportModels \
|
-ltwoPhaseProperties \
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|||||||
@ -39,18 +39,16 @@ namespace Foam
|
|||||||
|
|
||||||
Foam::twoPhaseThermo::twoPhaseThermo
|
Foam::twoPhaseThermo::twoPhaseThermo
|
||||||
(
|
(
|
||||||
const twoPhaseMixture& twoPhaseProperties
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
rhoThermo(twoPhaseProperties.alpha1().mesh(), word::null),
|
psiThermo(mesh, word::null),
|
||||||
tpm_(twoPhaseProperties),
|
twoPhaseMixture(mesh, *this),
|
||||||
thermo1_(rhoThermo::New(tpm_.alpha1().mesh(), tpm_.phase1Name())),
|
thermo1_(rhoThermo::New(mesh, phase1Name())),
|
||||||
thermo2_(rhoThermo::New(tpm_.alpha1().mesh(), tpm_.phase2Name()))
|
thermo2_(rhoThermo::New(mesh, phase2Name()))
|
||||||
{
|
{
|
||||||
thermo1_->validate(tpm_.phase1Name(), "e");
|
thermo1_->validate(phase1Name(), "e");
|
||||||
thermo2_->validate(tpm_.phase2Name(), "e");
|
thermo2_->validate(phase2Name(), "e");
|
||||||
|
|
||||||
rho_ = tpm_.alpha1()*thermo1_->rho() + tpm_.alpha2()*thermo2_->rho();
|
|
||||||
|
|
||||||
correct();
|
correct();
|
||||||
}
|
}
|
||||||
@ -72,9 +70,9 @@ void Foam::twoPhaseThermo::correct()
|
|||||||
thermo2_->he() = thermo2_->he(p_, T_);
|
thermo2_->he() = thermo2_->he(p_, T_);
|
||||||
thermo2_->correct();
|
thermo2_->correct();
|
||||||
|
|
||||||
psi_ = tpm_.alpha1()*thermo1_->psi() + tpm_.alpha2()*thermo2_->psi();
|
psi_ = alpha1()*thermo1_->psi() + alpha2()*thermo2_->psi();
|
||||||
mu_ = tpm_.alpha1()*thermo1_->mu() + tpm_.alpha2()*thermo2_->mu();
|
mu_ = alpha1()*thermo1_->mu() + alpha2()*thermo2_->mu();
|
||||||
alpha_ = tpm_.alpha1()*thermo1_->alpha() + tpm_.alpha2()*thermo2_->alpha();
|
alpha_ = alpha1()*thermo1_->alpha() + alpha2()*thermo2_->alpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -96,7 +94,7 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::he
|
|||||||
const volScalarField& T
|
const volScalarField& T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tpm_.alpha1()*thermo1_->he(p, T) + tpm_.alpha2()*thermo2_->he(p, T);
|
return alpha1()*thermo1_->he(p, T) + alpha2()*thermo2_->he(p, T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,8 +106,8 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::he
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
scalarField(tpm_.alpha1(), cells)*thermo1_->he(p, T, cells)
|
scalarField(alpha1(), cells)*thermo1_->he(p, T, cells)
|
||||||
+ scalarField(tpm_.alpha2(), cells)*thermo2_->he(p, T, cells);
|
+ scalarField(alpha2(), cells)*thermo2_->he(p, T, cells);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -121,14 +119,14 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::he
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->he(p, T, patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->he(p, T, patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->he(p, T, patchi);
|
+ alpha2().boundaryField()[patchi]*thermo2_->he(p, T, patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::hc() const
|
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::hc() const
|
||||||
{
|
{
|
||||||
return tpm_.alpha1()*thermo1_->hc() + tpm_.alpha2()*thermo2_->hc();
|
return alpha1()*thermo1_->hc() + alpha2()*thermo2_->hc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -160,7 +158,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::THE
|
|||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cp() const
|
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cp() const
|
||||||
{
|
{
|
||||||
return tpm_.alpha1()*thermo1_->Cp() + tpm_.alpha2()*thermo2_->Cp();
|
return alpha1()*thermo1_->Cp() + alpha2()*thermo2_->Cp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -172,14 +170,14 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cp
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cp(p, T, patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->Cp(p, T, patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cp(p, T, patchi);
|
+ alpha2().boundaryField()[patchi]*thermo2_->Cp(p, T, patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cv() const
|
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cv() const
|
||||||
{
|
{
|
||||||
return tpm_.alpha1()*thermo1_->Cv() + tpm_.alpha2()*thermo2_->Cv();
|
return alpha1()*thermo1_->Cv() + alpha2()*thermo2_->Cv();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -191,14 +189,14 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cv
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cv(p, T, patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->Cv(p, T, patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cv(p, T, patchi);
|
+ alpha2().boundaryField()[patchi]*thermo2_->Cv(p, T, patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::gamma() const
|
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::gamma() const
|
||||||
{
|
{
|
||||||
return tpm_.alpha1()*thermo1_->gamma() + tpm_.alpha2()*thermo2_->gamma();
|
return alpha1()*thermo1_->gamma() + alpha2()*thermo2_->gamma();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -210,14 +208,14 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::gamma
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->gamma(p, T, patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->gamma(p, T, patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->gamma(p, T, patchi);
|
+ alpha2().boundaryField()[patchi]*thermo2_->gamma(p, T, patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cpv() const
|
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cpv() const
|
||||||
{
|
{
|
||||||
return tpm_.alpha1()*thermo1_->Cpv() + tpm_.alpha2()*thermo2_->Cpv();
|
return alpha1()*thermo1_->Cpv() + alpha2()*thermo2_->Cpv();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -229,16 +227,16 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cpv
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi);
|
+ alpha2().boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::CpByCpv() const
|
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::CpByCpv() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1()*thermo1_->CpByCpv()
|
alpha1()*thermo1_->CpByCpv()
|
||||||
+ tpm_.alpha2()*thermo2_->CpByCpv();
|
+ alpha2()*thermo2_->CpByCpv();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -250,14 +248,14 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::CpByCpv
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi);
|
+ alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::kappa() const
|
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::kappa() const
|
||||||
{
|
{
|
||||||
return tpm_.alpha1()*thermo1_->kappa() + tpm_.alpha2()*thermo2_->kappa();
|
return alpha1()*thermo1_->kappa() + alpha2()*thermo2_->kappa();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -267,8 +265,8 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::kappa
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->kappa(patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->kappa(patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->kappa(patchi);
|
+ alpha2().boundaryField()[patchi]*thermo2_->kappa(patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -278,8 +276,8 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::kappaEff
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1()*thermo1_->kappaEff(alphat)
|
alpha1()*thermo1_->kappaEff(alphat)
|
||||||
+ tpm_.alpha2()*thermo2_->kappaEff(alphat);
|
+ alpha2()*thermo2_->kappaEff(alphat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -290,8 +288,8 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::kappaEff
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi)
|
+ alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,8 +300,8 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::alphaEff
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1()*thermo1_->alphaEff(alphat)
|
alpha1()*thermo1_->alphaEff(alphat)
|
||||||
+ tpm_.alpha2()*thermo2_->alphaEff(alphat);
|
+ alpha2()*thermo2_->alphaEff(alphat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -314,8 +312,8 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::alphaEff
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
tpm_.alpha1().boundaryField()[patchi]*thermo1_->alphaEff(alphat, patchi)
|
alpha1().boundaryField()[patchi]*thermo1_->alphaEff(alphat, patchi)
|
||||||
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi)
|
+ alpha2().boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ SourceFiles
|
|||||||
#define twoPhaseThermo_H
|
#define twoPhaseThermo_H
|
||||||
|
|
||||||
#include "rhoThermo.H"
|
#include "rhoThermo.H"
|
||||||
|
#include "psiThermo.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "twoPhaseMixture.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -50,12 +51,11 @@ namespace Foam
|
|||||||
|
|
||||||
class twoPhaseThermo
|
class twoPhaseThermo
|
||||||
:
|
:
|
||||||
public rhoThermo
|
public psiThermo,
|
||||||
|
public twoPhaseMixture
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
const twoPhaseMixture& tpm_;
|
|
||||||
|
|
||||||
//- Thermo-package of phase 1
|
//- Thermo-package of phase 1
|
||||||
autoPtr<rhoThermo> thermo1_;
|
autoPtr<rhoThermo> thermo1_;
|
||||||
|
|
||||||
@ -71,10 +71,10 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from mesh and phase fractions
|
//- Construct from mesh
|
||||||
twoPhaseThermo
|
twoPhaseThermo
|
||||||
(
|
(
|
||||||
const twoPhaseMixture& twoPhaseProperties
|
const fvMesh& mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Description
|
|||||||
#include "MULES.H"
|
#include "MULES.H"
|
||||||
#include "subCycle.H"
|
#include "subCycle.H"
|
||||||
#include "interfaceProperties.H"
|
#include "interfaceProperties.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "fvcSmooth.H"
|
#include "fvcSmooth.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I.. \
|
-I.. \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
@ -11,7 +12,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Description
|
|||||||
#include "MULES.H"
|
#include "MULES.H"
|
||||||
#include "subCycle.H"
|
#include "subCycle.H"
|
||||||
#include "interfaceProperties.H"
|
#include "interfaceProperties.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "IOMRFZoneList.H"
|
#include "IOMRFZoneList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I.. \
|
-I.. \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
@ -11,7 +12,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
@ -10,7 +11,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "Reading transportProperties\n" << endl;
|
||||||
twoPhaseMixture twoPhaseProperties(U, phi);
|
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
|
||||||
|
|
||||||
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
||||||
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I.. \
|
-I.. \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
@ -13,7 +14,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Description
|
|||||||
#include "MULES.H"
|
#include "MULES.H"
|
||||||
#include "subCycle.H"
|
#include "subCycle.H"
|
||||||
#include "interfaceProperties.H"
|
#include "interfaceProperties.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Description
|
|||||||
#include "MULES.H"
|
#include "MULES.H"
|
||||||
#include "subCycle.H"
|
#include "subCycle.H"
|
||||||
#include "interfaceProperties.H"
|
#include "interfaceProperties.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I.. \
|
-I.. \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-IincompressibleThreePhaseMixture \
|
-IincompressibleThreePhaseMixture \
|
||||||
-IthreePhaseInterfaceProperties \
|
-IthreePhaseInterfaceProperties \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle \
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle \
|
||||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
@ -12,7 +13,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/sampling/lnInclude
|
-I$(LIB_SRC)/sampling/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I.. \
|
-I.. \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
@ -11,7 +12,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
|||||||
@ -42,7 +42,7 @@ Description
|
|||||||
#include "MULES.H"
|
#include "MULES.H"
|
||||||
#include "subCycle.H"
|
#include "subCycle.H"
|
||||||
#include "interfaceProperties.H"
|
#include "interfaceProperties.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "IOporosityModelList.H"
|
#include "IOporosityModelList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
@ -8,7 +9,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
|||||||
@ -24,7 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "phaseChangeTwoPhaseMixture.H"
|
#include "phaseChangeTwoPhaseMixture.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture
|
|||||||
const word& alpha1Name
|
const word& alpha1Name
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
twoPhaseMixture(U, phi, alpha1Name),
|
incompressibleTwoPhaseMixture(U, phi, alpha1Name),
|
||||||
phaseChangeTwoPhaseMixtureCoeffs_(subDict(type + "Coeffs")),
|
phaseChangeTwoPhaseMixtureCoeffs_(subDict(type + "Coeffs")),
|
||||||
pSat_(lookup("pSat"))
|
pSat_(lookup("pSat"))
|
||||||
{}
|
{}
|
||||||
@ -76,7 +76,7 @@ Foam::phaseChangeTwoPhaseMixture::vDotP() const
|
|||||||
|
|
||||||
bool Foam::phaseChangeTwoPhaseMixture::read()
|
bool Foam::phaseChangeTwoPhaseMixture::read()
|
||||||
{
|
{
|
||||||
if (twoPhaseMixture::read())
|
if (incompressibleTwoPhaseMixture::read())
|
||||||
{
|
{
|
||||||
phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs");
|
phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs");
|
||||||
lookup("pSat") >> pSat_;
|
lookup("pSat") >> pSat_;
|
||||||
|
|||||||
@ -35,7 +35,7 @@ SourceFiles
|
|||||||
#ifndef phaseChangeTwoPhaseMixture_H
|
#ifndef phaseChangeTwoPhaseMixture_H
|
||||||
#define phaseChangeTwoPhaseMixture_H
|
#define phaseChangeTwoPhaseMixture_H
|
||||||
|
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
@ -54,7 +54,7 @@ namespace Foam
|
|||||||
|
|
||||||
class phaseChangeTwoPhaseMixture
|
class phaseChangeTwoPhaseMixture
|
||||||
:
|
:
|
||||||
public twoPhaseMixture
|
public incompressibleTwoPhaseMixture
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I../interFoam \
|
-I../interFoam \
|
||||||
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||||
@ -7,7 +8,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
#include "createPhi.H"
|
#include "createPhi.H"
|
||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "Reading transportProperties\n" << endl;
|
||||||
twoPhaseMixture twoPhaseProperties(U, phi);
|
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
|
||||||
|
|
||||||
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
||||||
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Description
|
|||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "MULES.H"
|
#include "MULES.H"
|
||||||
#include "subCycle.H"
|
#include "subCycle.H"
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
|
|||||||
@ -63,5 +63,5 @@ EXE_LIBS = \
|
|||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-ltopoChangerFvMesh \
|
-ltopoChangerFvMesh \
|
||||||
-ltriSurface \
|
-ltriSurface \
|
||||||
-ltwoPhaseInterfaceProperties \
|
-ltwoPhaseProperties \
|
||||||
-lutilityFunctionObjects
|
-lutilityFunctionObjects
|
||||||
|
|||||||
@ -0,0 +1,102 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 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 "adiabaticPerfectFluid.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
Foam::adiabaticPerfectFluid<Specie>::adiabaticPerfectFluid(Istream& is)
|
||||||
|
:
|
||||||
|
Specie(is),
|
||||||
|
p0_(readScalar(is)),
|
||||||
|
rho0_(readScalar(is)),
|
||||||
|
gamma_(readScalar(is)),
|
||||||
|
B_(readScalar(is))
|
||||||
|
{
|
||||||
|
is.check
|
||||||
|
(
|
||||||
|
"adiabaticPerfectFluid<Specie>::adiabaticPerfectFluid(Istream& is)"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
Foam::adiabaticPerfectFluid<Specie>::adiabaticPerfectFluid
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Specie(dict),
|
||||||
|
p0_(readScalar(dict.subDict("equationOfState").lookup("p0"))),
|
||||||
|
rho0_(readScalar(dict.subDict("equationOfState").lookup("rho0"))),
|
||||||
|
gamma_(readScalar(dict.subDict("equationOfState").lookup("gamma"))),
|
||||||
|
B_(readScalar(dict.subDict("equationOfState").lookup("B")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
void Foam::adiabaticPerfectFluid<Specie>::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
Specie::write(os);
|
||||||
|
|
||||||
|
dictionary dict("equationOfState");
|
||||||
|
dict.add("p0", p0_);
|
||||||
|
dict.add("rho0", rho0_);
|
||||||
|
dict.add("gamma", gamma_);
|
||||||
|
dict.add("B", B_);
|
||||||
|
|
||||||
|
os << indent << dict.dictName() << dict;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
os << static_cast<const Specie&>(pf)
|
||||||
|
<< token::SPACE << pf.R_
|
||||||
|
<< token::SPACE << pf.rho0_
|
||||||
|
<< token::SPACE << pf.gamma_
|
||||||
|
<< token::SPACE << pf.B_;
|
||||||
|
|
||||||
|
os.check
|
||||||
|
(
|
||||||
|
"Ostream& operator<<(Ostream&, const adiabaticPerfectFluid<Specie>&)"
|
||||||
|
);
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,247 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 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/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::adiabaticPerfectFluid
|
||||||
|
|
||||||
|
Description
|
||||||
|
AdiabaticPerfect gas equation of state.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
adiabaticPerfectFluidI.H
|
||||||
|
adiabaticPerfectFluid.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef adiabaticPerfectFluid_H
|
||||||
|
#define adiabaticPerfectFluid_H
|
||||||
|
|
||||||
|
#include "autoPtr.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
|
||||||
|
template<class Specie> class adiabaticPerfectFluid;
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline adiabaticPerfectFluid<Specie> operator+
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid<Specie>&,
|
||||||
|
const adiabaticPerfectFluid<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline adiabaticPerfectFluid<Specie> operator-
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid<Specie>&,
|
||||||
|
const adiabaticPerfectFluid<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline adiabaticPerfectFluid<Specie> operator*
|
||||||
|
(
|
||||||
|
const scalar,
|
||||||
|
const adiabaticPerfectFluid<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline adiabaticPerfectFluid<Specie> operator==
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid<Specie>&,
|
||||||
|
const adiabaticPerfectFluid<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const adiabaticPerfectFluid<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class adiabaticPerfectFluid Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
class adiabaticPerfectFluid
|
||||||
|
:
|
||||||
|
public Specie
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Reference pressure
|
||||||
|
scalar p0_;
|
||||||
|
|
||||||
|
//- Reference density
|
||||||
|
scalar rho0_;
|
||||||
|
|
||||||
|
//- The isentropic exponent
|
||||||
|
scalar gamma_;
|
||||||
|
|
||||||
|
//- Pressure offset for a stiffened gas
|
||||||
|
scalar B_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline adiabaticPerfectFluid
|
||||||
|
(
|
||||||
|
const Specie& sp,
|
||||||
|
const scalar p0,
|
||||||
|
const scalar rho0,
|
||||||
|
const scalar gamma,
|
||||||
|
const scalar B
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
adiabaticPerfectFluid(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
adiabaticPerfectFluid(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct as named copy
|
||||||
|
inline adiabaticPerfectFluid
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const adiabaticPerfectFluid&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
inline autoPtr<adiabaticPerfectFluid> clone() const;
|
||||||
|
|
||||||
|
// Selector from Istream
|
||||||
|
inline static autoPtr<adiabaticPerfectFluid> New(Istream& is);
|
||||||
|
|
||||||
|
// Selector from dictionary
|
||||||
|
inline static autoPtr<adiabaticPerfectFluid> New
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Return the instantiated type name
|
||||||
|
static word typeName()
|
||||||
|
{
|
||||||
|
return "adiabaticPerfectFluid<" + word(Specie::typeName_()) + '>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Fundamental properties
|
||||||
|
|
||||||
|
//- Is the equation of state is incompressible i.e. rho != f(p)
|
||||||
|
static const bool incompressible = false;
|
||||||
|
|
||||||
|
//- Is the equation of state is isochoric i.e. rho = const
|
||||||
|
static const bool isochoric = false;
|
||||||
|
|
||||||
|
//- Return density [kg/m^3]
|
||||||
|
inline scalar rho(scalar p, scalar T) const;
|
||||||
|
|
||||||
|
//- Return compressibility rho/p [s^2/m^2]
|
||||||
|
inline scalar psi(scalar p, scalar T) const;
|
||||||
|
|
||||||
|
//- Return compression factor []
|
||||||
|
inline scalar Z(scalar p, scalar T) const;
|
||||||
|
|
||||||
|
//- Return (cp - cv) [J/(kmol K]
|
||||||
|
inline scalar cpMcv(scalar p, scalar T) const;
|
||||||
|
|
||||||
|
|
||||||
|
// IO
|
||||||
|
|
||||||
|
//- Write to Ostream
|
||||||
|
void write(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
inline void operator+=(const adiabaticPerfectFluid&);
|
||||||
|
inline void operator-=(const adiabaticPerfectFluid&);
|
||||||
|
|
||||||
|
inline void operator*=(const scalar);
|
||||||
|
|
||||||
|
|
||||||
|
// Friend operators
|
||||||
|
|
||||||
|
friend adiabaticPerfectFluid operator+ <Specie>
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid&,
|
||||||
|
const adiabaticPerfectFluid&
|
||||||
|
);
|
||||||
|
|
||||||
|
friend adiabaticPerfectFluid operator- <Specie>
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid&,
|
||||||
|
const adiabaticPerfectFluid&
|
||||||
|
);
|
||||||
|
|
||||||
|
friend adiabaticPerfectFluid operator* <Specie>
|
||||||
|
(
|
||||||
|
const scalar s,
|
||||||
|
const adiabaticPerfectFluid&
|
||||||
|
);
|
||||||
|
|
||||||
|
friend adiabaticPerfectFluid operator== <Specie>
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid&,
|
||||||
|
const adiabaticPerfectFluid&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<< <Specie>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const adiabaticPerfectFluid&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "adiabaticPerfectFluidI.H"
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "adiabaticPerfectFluid.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,271 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 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 "adiabaticPerfectFluid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::adiabaticPerfectFluid<Specie>::adiabaticPerfectFluid
|
||||||
|
(
|
||||||
|
const Specie& sp,
|
||||||
|
const scalar p0,
|
||||||
|
const scalar rho0,
|
||||||
|
const scalar gamma,
|
||||||
|
const scalar B
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Specie(sp),
|
||||||
|
p0_(p0),
|
||||||
|
rho0_(rho0),
|
||||||
|
gamma_(gamma),
|
||||||
|
B_(B)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::adiabaticPerfectFluid<Specie>::adiabaticPerfectFluid
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Specie(name, pf),
|
||||||
|
p0_(pf.p0_),
|
||||||
|
rho0_(pf.rho0_),
|
||||||
|
gamma_(pf.gamma_),
|
||||||
|
B_(pf.B_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::autoPtr<Foam::adiabaticPerfectFluid<Specie> >
|
||||||
|
Foam::adiabaticPerfectFluid<Specie>::clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<adiabaticPerfectFluid<Specie> >
|
||||||
|
(
|
||||||
|
new adiabaticPerfectFluid<Specie>(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::autoPtr<Foam::adiabaticPerfectFluid<Specie> >
|
||||||
|
Foam::adiabaticPerfectFluid<Specie>::New(Istream& is)
|
||||||
|
{
|
||||||
|
return autoPtr<adiabaticPerfectFluid<Specie> >
|
||||||
|
(
|
||||||
|
new adiabaticPerfectFluid<Specie>(is)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::autoPtr<Foam::adiabaticPerfectFluid<Specie> >
|
||||||
|
Foam::adiabaticPerfectFluid<Specie>::New
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return autoPtr<adiabaticPerfectFluid<Specie> >
|
||||||
|
(
|
||||||
|
new adiabaticPerfectFluid<Specie>(dict)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::rho
|
||||||
|
(
|
||||||
|
scalar p,
|
||||||
|
scalar
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return rho0_*pow((p + B_)/(p0_ + B_), 1.0/gamma_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::psi
|
||||||
|
(
|
||||||
|
scalar p,
|
||||||
|
scalar
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(rho0_/(gamma_*(p0_ + B_)))
|
||||||
|
*pow((p + B_)/(p0_ + B_), 1.0/gamma_ - 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::Z(scalar, scalar) const
|
||||||
|
{
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::scalar Foam::adiabaticPerfectFluid<Specie>::cpMcv
|
||||||
|
(
|
||||||
|
scalar,
|
||||||
|
scalar
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline void Foam::adiabaticPerfectFluid<Specie>::operator+=
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar molr1 = this->nMoles();
|
||||||
|
|
||||||
|
Specie::operator+=(pf);
|
||||||
|
|
||||||
|
molr1 /= this->nMoles();
|
||||||
|
scalar molr2 = pf.nMoles()/this->nMoles();
|
||||||
|
|
||||||
|
p0_ = molr1*p0_ + molr2*pf.p0_;
|
||||||
|
rho0_ = molr1*rho0_ + molr2*pf.rho0_;
|
||||||
|
gamma_ = molr1*gamma_ + molr2*pf.gamma_;
|
||||||
|
B_ = molr1*B_ + molr2*pf.B_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline void Foam::adiabaticPerfectFluid<Specie>::operator-=
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar molr1 = this->nMoles();
|
||||||
|
|
||||||
|
Specie::operator-=(pf);
|
||||||
|
|
||||||
|
molr1 /= this->nMoles();
|
||||||
|
scalar molr2 = pf.nMoles()/this->nMoles();
|
||||||
|
|
||||||
|
p0_ = molr1*p0_ - molr2*pf.p0_;
|
||||||
|
rho0_ = molr1*rho0_ - molr2*pf.rho0_;
|
||||||
|
gamma_ = molr1*gamma_ - molr2*pf.gamma_;
|
||||||
|
B_ = molr1*B_ - molr2*pf.B_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline void Foam::adiabaticPerfectFluid<Specie>::operator*=(const scalar s)
|
||||||
|
{
|
||||||
|
Specie::operator*=(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::adiabaticPerfectFluid<Specie> Foam::operator+
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf1,
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar nMoles = pf1.nMoles() + pf2.nMoles();
|
||||||
|
scalar molr1 = pf1.nMoles()/nMoles;
|
||||||
|
scalar molr2 = pf2.nMoles()/nMoles;
|
||||||
|
|
||||||
|
return rhoConst<Specie>
|
||||||
|
(
|
||||||
|
static_cast<const Specie&>(pf1)
|
||||||
|
+ static_cast<const Specie&>(pf2),
|
||||||
|
molr1*pf1.p0_ + molr2*pf2.p0_,
|
||||||
|
molr1*pf1.rho0_ + molr2*pf2.rho0_,
|
||||||
|
molr1*pf1.gamma_ + molr2*pf2.gamma_,
|
||||||
|
molr1*pf1.B_ + molr2*pf2.B_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::adiabaticPerfectFluid<Specie> Foam::operator-
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf1,
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar nMoles = pf1.nMoles() + pf2.nMoles();
|
||||||
|
scalar molr1 = pf1.nMoles()/nMoles;
|
||||||
|
scalar molr2 = pf2.nMoles()/nMoles;
|
||||||
|
|
||||||
|
return rhoConst<Specie>
|
||||||
|
(
|
||||||
|
static_cast<const Specie&>(pf1)
|
||||||
|
- static_cast<const Specie&>(pf2),
|
||||||
|
molr1*pf1.p0_ - molr2*pf2.p0_,
|
||||||
|
molr1*pf1.rho0_ - molr2*pf2.rho0_,
|
||||||
|
molr1*pf1.gamma_ - molr2*pf2.gamma_,
|
||||||
|
molr1*pf1.B_ - molr2*pf2.B_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::adiabaticPerfectFluid<Specie> Foam::operator*
|
||||||
|
(
|
||||||
|
const scalar s,
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return adiabaticPerfectFluid<Specie>
|
||||||
|
(
|
||||||
|
s*static_cast<const Specie&>(pf),
|
||||||
|
pf.p0_,
|
||||||
|
pf.rho0_,
|
||||||
|
pf.gamma_,
|
||||||
|
pf.B_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::adiabaticPerfectFluid<Specie> Foam::operator==
|
||||||
|
(
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf1,
|
||||||
|
const adiabaticPerfectFluid<Specie>& pf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return pf2 - pf1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 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 "linear.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
Foam::linear<Specie>::linear(Istream& is)
|
||||||
|
:
|
||||||
|
Specie(is),
|
||||||
|
psi_(readScalar(is)),
|
||||||
|
rho0_(readScalar(is))
|
||||||
|
{
|
||||||
|
is.check("linear<Specie>::linear(Istream& is)");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
Foam::linear<Specie>::linear(const dictionary& dict)
|
||||||
|
:
|
||||||
|
Specie(dict),
|
||||||
|
psi_(readScalar(dict.subDict("equationOfState").lookup("psi"))),
|
||||||
|
rho0_(readScalar(dict.subDict("equationOfState").lookup("rho0")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
void Foam::linear<Specie>::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
Specie::write(os);
|
||||||
|
|
||||||
|
dictionary dict("equationOfState");
|
||||||
|
dict.add("psi", psi_);
|
||||||
|
dict.add("rho0", rho0_);
|
||||||
|
|
||||||
|
os << indent << dict.dictName() << dict;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const linear<Specie>& pf)
|
||||||
|
{
|
||||||
|
os << static_cast<const Specie&>(pf)
|
||||||
|
<< token::SPACE << pf.psi_
|
||||||
|
<< token::SPACE << pf.rho0_;
|
||||||
|
|
||||||
|
os.check("Ostream& operator<<(Ostream&, const linear<Specie>&)");
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
232
src/thermophysicalModels/specie/equationOfState/linear/linear.H
Normal file
232
src/thermophysicalModels/specie/equationOfState/linear/linear.H
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 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/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::linear
|
||||||
|
|
||||||
|
Description
|
||||||
|
Perfect gas equation of state.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
linearI.H
|
||||||
|
linear.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef linear_H
|
||||||
|
#define linear_H
|
||||||
|
|
||||||
|
#include "autoPtr.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
|
||||||
|
template<class Specie> class linear;
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline linear<Specie> operator+
|
||||||
|
(
|
||||||
|
const linear<Specie>&,
|
||||||
|
const linear<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline linear<Specie> operator-
|
||||||
|
(
|
||||||
|
const linear<Specie>&,
|
||||||
|
const linear<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline linear<Specie> operator*
|
||||||
|
(
|
||||||
|
const scalar,
|
||||||
|
const linear<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline linear<Specie> operator==
|
||||||
|
(
|
||||||
|
const linear<Specie>&,
|
||||||
|
const linear<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const linear<Specie>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class linear Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
class linear
|
||||||
|
:
|
||||||
|
public Specie
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Compressibility
|
||||||
|
scalar psi_;
|
||||||
|
|
||||||
|
//- The reference density
|
||||||
|
scalar rho0_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline linear
|
||||||
|
(
|
||||||
|
const Specie& sp,
|
||||||
|
const scalar psi,
|
||||||
|
const scalar rho0
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
linear(Istream&);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
linear(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct as named copy
|
||||||
|
inline linear(const word& name, const linear&);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
inline autoPtr<linear> clone() const;
|
||||||
|
|
||||||
|
// Selector from Istream
|
||||||
|
inline static autoPtr<linear> New(Istream& is);
|
||||||
|
|
||||||
|
// Selector from dictionary
|
||||||
|
inline static autoPtr<linear> New(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Return the instantiated type name
|
||||||
|
static word typeName()
|
||||||
|
{
|
||||||
|
return "linear<" + word(Specie::typeName_()) + '>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Fundamental properties
|
||||||
|
|
||||||
|
//- Is the equation of state is incompressible i.e. rho != f(p)
|
||||||
|
static const bool incompressible = false;
|
||||||
|
|
||||||
|
//- Is the equation of state is isochoric i.e. rho = const
|
||||||
|
static const bool isochoric = false;
|
||||||
|
|
||||||
|
//- Return density [kg/m^3]
|
||||||
|
inline scalar rho(scalar p, scalar T) const;
|
||||||
|
|
||||||
|
//- Return compressibility rho/p [s^2/m^2]
|
||||||
|
inline scalar psi(scalar p, scalar T) const;
|
||||||
|
|
||||||
|
//- Return compression factor []
|
||||||
|
inline scalar Z(scalar p, scalar T) const;
|
||||||
|
|
||||||
|
//- Return (cp - cv) [J/(kmol K]
|
||||||
|
inline scalar cpMcv(scalar p, scalar T) const;
|
||||||
|
|
||||||
|
|
||||||
|
// IO
|
||||||
|
|
||||||
|
//- Write to Ostream
|
||||||
|
void write(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
inline void operator+=(const linear&);
|
||||||
|
inline void operator-=(const linear&);
|
||||||
|
|
||||||
|
inline void operator*=(const scalar);
|
||||||
|
|
||||||
|
|
||||||
|
// Friend operators
|
||||||
|
|
||||||
|
friend linear operator+ <Specie>
|
||||||
|
(
|
||||||
|
const linear&,
|
||||||
|
const linear&
|
||||||
|
);
|
||||||
|
|
||||||
|
friend linear operator- <Specie>
|
||||||
|
(
|
||||||
|
const linear&,
|
||||||
|
const linear&
|
||||||
|
);
|
||||||
|
|
||||||
|
friend linear operator* <Specie>
|
||||||
|
(
|
||||||
|
const scalar s,
|
||||||
|
const linear&
|
||||||
|
);
|
||||||
|
|
||||||
|
friend linear operator== <Specie>
|
||||||
|
(
|
||||||
|
const linear&,
|
||||||
|
const linear&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<< <Specie>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const linear&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "linearI.H"
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "linear.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
232
src/thermophysicalModels/specie/equationOfState/linear/linearI.H
Normal file
232
src/thermophysicalModels/specie/equationOfState/linear/linearI.H
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 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 "linear.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::linear<Specie>::linear
|
||||||
|
(
|
||||||
|
const Specie& sp,
|
||||||
|
const scalar psi,
|
||||||
|
const scalar rho0
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Specie(sp),
|
||||||
|
psi_(psi),
|
||||||
|
rho0_(rho0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::linear<Specie>::linear
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const linear<Specie>& pf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Specie(name, pf),
|
||||||
|
psi_(pf.psi_),
|
||||||
|
rho0_(pf.rho0_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::autoPtr<Foam::linear<Specie> >
|
||||||
|
Foam::linear<Specie>::clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<linear<Specie> >(new linear<Specie>(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::autoPtr<Foam::linear<Specie> >
|
||||||
|
Foam::linear<Specie>::New(Istream& is)
|
||||||
|
{
|
||||||
|
return autoPtr<linear<Specie> >(new linear<Specie>(is));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::autoPtr<Foam::linear<Specie> >
|
||||||
|
Foam::linear<Specie>::New
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return autoPtr<linear<Specie> >(new linear<Specie>(dict));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::scalar Foam::linear<Specie>::rho(scalar p, scalar T) const
|
||||||
|
{
|
||||||
|
return rho0_ + psi_*p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::scalar Foam::linear<Specie>::psi(scalar, scalar T) const
|
||||||
|
{
|
||||||
|
return psi_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::scalar Foam::linear<Specie>::Z(scalar, scalar) const
|
||||||
|
{
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::scalar Foam::linear<Specie>::cpMcv(scalar, scalar) const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline void Foam::linear<Specie>::operator+=
|
||||||
|
(
|
||||||
|
const linear<Specie>& pf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar molr1 = this->nMoles();
|
||||||
|
|
||||||
|
Specie::operator+=(pf);
|
||||||
|
|
||||||
|
molr1 /= this->nMoles();
|
||||||
|
scalar molr2 = pf.nMoles()/this->nMoles();
|
||||||
|
|
||||||
|
psi_ = molr1*psi_ + molr2*pf.psi_;
|
||||||
|
rho0_ = molr1*rho0_ + molr2*pf.rho0_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline void Foam::linear<Specie>::operator-=
|
||||||
|
(
|
||||||
|
const linear<Specie>& pf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar molr1 = this->nMoles();
|
||||||
|
|
||||||
|
Specie::operator-=(pf);
|
||||||
|
|
||||||
|
molr1 /= this->nMoles();
|
||||||
|
scalar molr2 = pf.nMoles()/this->nMoles();
|
||||||
|
|
||||||
|
psi_ = molr1*psi_ - molr2*pf.psi_;
|
||||||
|
rho0_ = molr1*rho0_ - molr2*pf.rho0_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline void Foam::linear<Specie>::operator*=(const scalar s)
|
||||||
|
{
|
||||||
|
Specie::operator*=(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::linear<Specie> Foam::operator+
|
||||||
|
(
|
||||||
|
const linear<Specie>& pf1,
|
||||||
|
const linear<Specie>& pf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar nMoles = pf1.nMoles() + pf2.nMoles();
|
||||||
|
scalar molr1 = pf1.nMoles()/nMoles;
|
||||||
|
scalar molr2 = pf2.nMoles()/nMoles;
|
||||||
|
|
||||||
|
return rhoConst<Specie>
|
||||||
|
(
|
||||||
|
static_cast<const Specie&>(pf1)
|
||||||
|
+ static_cast<const Specie&>(pf2),
|
||||||
|
molr1*pf1.psi_ + molr2*pf2.psi_,
|
||||||
|
molr1*pf1.rho0_ + molr2*pf2.rho0_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::linear<Specie> Foam::operator-
|
||||||
|
(
|
||||||
|
const linear<Specie>& pf1,
|
||||||
|
const linear<Specie>& pf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar nMoles = pf1.nMoles() + pf2.nMoles();
|
||||||
|
scalar molr1 = pf1.nMoles()/nMoles;
|
||||||
|
scalar molr2 = pf2.nMoles()/nMoles;
|
||||||
|
|
||||||
|
return rhoConst<Specie>
|
||||||
|
(
|
||||||
|
static_cast<const Specie&>(pf1)
|
||||||
|
- static_cast<const Specie&>(pf2),
|
||||||
|
molr1*pf1.psi_ - molr2*pf2.psi_,
|
||||||
|
molr1*pf1.rho0_ - molr2*pf2.rho0_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::linear<Specie> Foam::operator*
|
||||||
|
(
|
||||||
|
const scalar s,
|
||||||
|
const linear<Specie>& pf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return linear<Specie>
|
||||||
|
(
|
||||||
|
s*static_cast<const Specie&>(pf),
|
||||||
|
pf.psi_,
|
||||||
|
pf.rho0_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Specie>
|
||||||
|
inline Foam::linear<Specie> Foam::operator==
|
||||||
|
(
|
||||||
|
const linear<Specie>& pf1,
|
||||||
|
const linear<Specie>& pf2
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return pf2 - pf1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -3,9 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
makeType=${1:-libso}
|
makeType=${1:-libso}
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
wmake $makeType incompressible
|
|
||||||
wmake $makeType interfaceProperties
|
wmake $makeType interfaceProperties
|
||||||
wmake $makeType twoPhaseInterfaceProperties
|
wmake $makeType twoPhaseProperties
|
||||||
# wmake $makeType compressible
|
wmake $makeType incompressible
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
@ -9,6 +9,6 @@ viscosityModels/HerschelBulkley/HerschelBulkley.C
|
|||||||
transportModel/transportModel.C
|
transportModel/transportModel.C
|
||||||
singlePhaseTransportModel/singlePhaseTransportModel.C
|
singlePhaseTransportModel/singlePhaseTransportModel.C
|
||||||
|
|
||||||
incompressibleTwoPhaseMixture/twoPhaseMixture.C
|
incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libincompressibleTransportModels
|
LIB = $(FOAM_LIBBIN)/libincompressibleTransportModels
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I.. \
|
-I.. \
|
||||||
|
-I../twoPhaseProperties/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
|
-ltwoPhaseProperties \
|
||||||
-lfiniteVolume
|
-lfiniteVolume
|
||||||
|
|||||||
@ -23,7 +23,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "twoPhaseMixture.H"
|
#include "incompressibleTwoPhaseMixture.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
#include "fvc.H"
|
#include "fvc.H"
|
||||||
@ -32,7 +32,7 @@ License
|
|||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Calculate and return the laminar viscosity
|
//- Calculate and return the laminar viscosity
|
||||||
void Foam::twoPhaseMixture::calcNu()
|
void Foam::incompressibleTwoPhaseMixture::calcNu()
|
||||||
{
|
{
|
||||||
nuModel1_->correct();
|
nuModel1_->correct();
|
||||||
nuModel2_->correct();
|
nuModel2_->correct();
|
||||||
@ -50,7 +50,7 @@ void Foam::twoPhaseMixture::calcNu()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::twoPhaseMixture::twoPhaseMixture
|
Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
|
||||||
(
|
(
|
||||||
const volVectorField& U,
|
const volVectorField& U,
|
||||||
const surfaceScalarField& phi,
|
const surfaceScalarField& phi,
|
||||||
@ -59,16 +59,14 @@ Foam::twoPhaseMixture::twoPhaseMixture
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
transportModel(U, phi),
|
transportModel(U, phi),
|
||||||
|
twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name),
|
||||||
phase1Name_(found("phases") ? wordList(lookup("phases"))[0] : "phase1"),
|
|
||||||
phase2Name_(found("phases") ? wordList(lookup("phases"))[1] : "phase2"),
|
|
||||||
|
|
||||||
nuModel1_
|
nuModel1_
|
||||||
(
|
(
|
||||||
viscosityModel::New
|
viscosityModel::New
|
||||||
(
|
(
|
||||||
"nu1",
|
"nu1",
|
||||||
subDict(phase1Name_),
|
subDict(phase1Name_ == "1" ? "phase1": phase1Name_),
|
||||||
U,
|
U,
|
||||||
phi
|
phi
|
||||||
)
|
)
|
||||||
@ -78,7 +76,7 @@ Foam::twoPhaseMixture::twoPhaseMixture
|
|||||||
viscosityModel::New
|
viscosityModel::New
|
||||||
(
|
(
|
||||||
"nu2",
|
"nu2",
|
||||||
subDict(phase2Name_),
|
subDict(phase2Name_ == "2" ? "phase2": phase2Name_),
|
||||||
U,
|
U,
|
||||||
phi
|
phi
|
||||||
)
|
)
|
||||||
@ -90,30 +88,6 @@ Foam::twoPhaseMixture::twoPhaseMixture
|
|||||||
U_(U),
|
U_(U),
|
||||||
phi_(phi),
|
phi_(phi),
|
||||||
|
|
||||||
alpha1_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
found("phases") ? word("alpha" + phase1Name_) : alpha1Name,
|
|
||||||
U_.time().timeName(),
|
|
||||||
U_.db(),
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
U_.mesh()
|
|
||||||
),
|
|
||||||
|
|
||||||
alpha2_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
found("phases") ? word("alpha" + phase2Name_) : alpha2Name,
|
|
||||||
U_.time().timeName(),
|
|
||||||
U_.db()
|
|
||||||
),
|
|
||||||
1.0 - alpha1_
|
|
||||||
),
|
|
||||||
|
|
||||||
nu_
|
nu_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -133,7 +107,8 @@ Foam::twoPhaseMixture::twoPhaseMixture
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixture::mu() const
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::incompressibleTwoPhaseMixture::mu() const
|
||||||
{
|
{
|
||||||
const volScalarField limitedAlpha1
|
const volScalarField limitedAlpha1
|
||||||
(
|
(
|
||||||
@ -152,7 +127,8 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixture::mu() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::muf() const
|
Foam::tmp<Foam::surfaceScalarField>
|
||||||
|
Foam::incompressibleTwoPhaseMixture::muf() const
|
||||||
{
|
{
|
||||||
const surfaceScalarField alpha1f
|
const surfaceScalarField alpha1f
|
||||||
(
|
(
|
||||||
@ -171,7 +147,8 @@ Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::muf() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::nuf() const
|
Foam::tmp<Foam::surfaceScalarField>
|
||||||
|
Foam::incompressibleTwoPhaseMixture::nuf() const
|
||||||
{
|
{
|
||||||
const surfaceScalarField alpha1f
|
const surfaceScalarField alpha1f
|
||||||
(
|
(
|
||||||
@ -192,7 +169,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::nuf() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::twoPhaseMixture::read()
|
bool Foam::incompressibleTwoPhaseMixture::read()
|
||||||
{
|
{
|
||||||
if (transportModel::read())
|
if (transportModel::read())
|
||||||
{
|
{
|
||||||
@ -22,23 +22,23 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::twoPhaseMixture
|
Foam::incompressibleTwoPhaseMixture
|
||||||
|
|
||||||
Description
|
Description
|
||||||
A two-phase incompressible transportModel
|
A two-phase incompressible transportModel
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
twoPhaseMixture.C
|
incompressibleTwoPhaseMixture.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef twoPhaseMixture_H
|
#ifndef incompressibleTwoPhaseMixture_H
|
||||||
#define twoPhaseMixture_H
|
#define incompressibleTwoPhaseMixture_H
|
||||||
|
|
||||||
#include "incompressible/transportModel/transportModel.H"
|
#include "incompressible/transportModel/transportModel.H"
|
||||||
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
|
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
|
||||||
#include "dimensionedScalar.H"
|
#include "twoPhaseMixture.H"
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -46,20 +46,18 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class twoPhaseMixture Declaration
|
Class incompressibleTwoPhaseMixture Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class twoPhaseMixture
|
class incompressibleTwoPhaseMixture
|
||||||
:
|
:
|
||||||
public transportModel
|
public transportModel,
|
||||||
|
public twoPhaseMixture
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
word phase1Name_;
|
|
||||||
word phase2Name_;
|
|
||||||
|
|
||||||
autoPtr<viscosityModel> nuModel1_;
|
autoPtr<viscosityModel> nuModel1_;
|
||||||
autoPtr<viscosityModel> nuModel2_;
|
autoPtr<viscosityModel> nuModel2_;
|
||||||
|
|
||||||
@ -69,9 +67,6 @@ protected:
|
|||||||
const volVectorField& U_;
|
const volVectorField& U_;
|
||||||
const surfaceScalarField& phi_;
|
const surfaceScalarField& phi_;
|
||||||
|
|
||||||
volScalarField alpha1_;
|
|
||||||
volScalarField alpha2_;
|
|
||||||
|
|
||||||
volScalarField nu_;
|
volScalarField nu_;
|
||||||
|
|
||||||
|
|
||||||
@ -86,7 +81,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
twoPhaseMixture
|
incompressibleTwoPhaseMixture
|
||||||
(
|
(
|
||||||
const volVectorField& U,
|
const volVectorField& U,
|
||||||
const surfaceScalarField& phi,
|
const surfaceScalarField& phi,
|
||||||
@ -96,46 +91,12 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~twoPhaseMixture()
|
virtual ~incompressibleTwoPhaseMixture()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
const word phase1Name() const
|
|
||||||
{
|
|
||||||
return phase1Name_;
|
|
||||||
}
|
|
||||||
|
|
||||||
const word phase2Name() const
|
|
||||||
{
|
|
||||||
return phase2Name_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the phase-fraction of phase 1
|
|
||||||
const volScalarField& alpha1() const
|
|
||||||
{
|
|
||||||
return alpha1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the phase-fraction of phase 1
|
|
||||||
volScalarField& alpha1()
|
|
||||||
{
|
|
||||||
return alpha1_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the phase-fraction of phase 2
|
|
||||||
const volScalarField& alpha2() const
|
|
||||||
{
|
|
||||||
return alpha2_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return the phase-fraction of phase 2
|
|
||||||
volScalarField& alpha2()
|
|
||||||
{
|
|
||||||
return alpha2_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return const-access to phase1 viscosityModel
|
//- Return const-access to phase1 viscosityModel
|
||||||
const viscosityModel& nuModel1() const
|
const viscosityModel& nuModel1() const
|
||||||
{
|
{
|
||||||
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle \
|
-I$(LIB_SRC)/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = -lfiniteVolume
|
LIB_LIBS = -lfiniteVolume
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
|
twoPhaseMixture/twoPhaseMixture.C
|
||||||
|
|
||||||
alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
|
alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
|
||||||
alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
|
alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
|
||||||
alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
|
alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
|
||||||
alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
|
alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
|
||||||
alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
|
alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libtwoPhaseInterfaceProperties
|
LIB = $(FOAM_LIBBIN)/libtwoPhaseProperties
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,31 +23,55 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "phaseEquationOfState.H"
|
#include "twoPhaseMixture.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(phaseEquationOfState, 0);
|
|
||||||
defineRunTimeSelectionTable(phaseEquationOfState, dictionary);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::phaseEquationOfState::phaseEquationOfState
|
Foam::twoPhaseMixture::twoPhaseMixture
|
||||||
(
|
(
|
||||||
const dictionary& dict
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict,
|
||||||
|
const word& alpha1Name,
|
||||||
|
const word& alpha2Name
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
dict_(dict)
|
phase1Name_
|
||||||
{}
|
(
|
||||||
|
dict.found("phases")
|
||||||
|
? wordList(dict.lookup("phases"))[0]
|
||||||
|
: "1"
|
||||||
|
),
|
||||||
|
phase2Name_
|
||||||
|
(
|
||||||
|
dict.found("phases")
|
||||||
|
? wordList(dict.lookup("phases"))[1]
|
||||||
|
: "2"
|
||||||
|
),
|
||||||
|
|
||||||
|
alpha1_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
dict.found("phases") ? word("alpha" + phase1Name_) : alpha1Name,
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
alpha2_
|
||||||
|
(
|
||||||
Foam::phaseEquationOfState::~phaseEquationOfState()
|
IOobject
|
||||||
|
(
|
||||||
|
dict.found("phases") ? word("alpha" + phase2Name_) : alpha2Name,
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
1.0 - alpha1_
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,90 +22,102 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::phaseEquationsOfState::adiabaticPerfectFluid
|
Foam::twoPhaseMixture
|
||||||
|
|
||||||
Description
|
Description
|
||||||
AdiabaticPerfectFluid phase density model.
|
A two-phase mixture model
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
adiabaticPerfectFluid.C
|
twoPhaseMixture.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef adiabaticPerfectFluid_H
|
#ifndef twoPhaseMixture_H
|
||||||
#define adiabaticPerfectFluid_H
|
#define twoPhaseMixture_H
|
||||||
|
|
||||||
#include "phaseEquationOfState.H"
|
#include "volFields.H"
|
||||||
#include "dimensionedTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
namespace phaseEquationsOfState
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class adiabaticPerfectFluid Declaration
|
Class twoPhaseMixture Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class adiabaticPerfectFluid
|
class twoPhaseMixture
|
||||||
:
|
|
||||||
public phaseEquationOfState
|
|
||||||
{
|
{
|
||||||
// Private data
|
protected:
|
||||||
|
|
||||||
//- Reference pressure
|
// Protected data
|
||||||
dimensionedScalar p0_;
|
|
||||||
|
|
||||||
//- Reference density
|
word phase1Name_;
|
||||||
dimensionedScalar rho0_;
|
word phase2Name_;
|
||||||
|
|
||||||
//- The isentropic exponent
|
volScalarField alpha1_;
|
||||||
dimensionedScalar gamma_;
|
volScalarField alpha2_;
|
||||||
|
|
||||||
//- Pressure offset for a stiffened gas
|
|
||||||
dimensionedScalar B_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("adiabaticPerfectFluid");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
adiabaticPerfectFluid
|
twoPhaseMixture
|
||||||
(
|
(
|
||||||
const dictionary& dict
|
const fvMesh& mesh,
|
||||||
|
const dictionary& dict,
|
||||||
|
const word& alpha1Name = "alpha1",
|
||||||
|
const word& alpha2Name = "alpha2"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~adiabaticPerfectFluid();
|
~twoPhaseMixture()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
tmp<volScalarField> rho
|
const word phase1Name() const
|
||||||
(
|
{
|
||||||
const volScalarField& p,
|
return phase1Name_;
|
||||||
const volScalarField& T
|
}
|
||||||
) const;
|
|
||||||
|
|
||||||
tmp<volScalarField> psi
|
const word phase2Name() const
|
||||||
(
|
{
|
||||||
const volScalarField& p,
|
return phase2Name_;
|
||||||
const volScalarField& T
|
}
|
||||||
) const;
|
|
||||||
|
//- Return the phase-fraction of phase 1
|
||||||
|
const volScalarField& alpha1() const
|
||||||
|
{
|
||||||
|
return alpha1_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the phase-fraction of phase 1
|
||||||
|
volScalarField& alpha1()
|
||||||
|
{
|
||||||
|
return alpha1_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the phase-fraction of phase 2
|
||||||
|
const volScalarField& alpha2() const
|
||||||
|
{
|
||||||
|
return alpha2_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the phase-fraction of phase 2
|
||||||
|
volScalarField& alpha2()
|
||||||
|
{
|
||||||
|
return alpha2_;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace phaseEquationsOfState
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -10,7 +10,7 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class volScalarField;
|
class volScalarField;
|
||||||
object alpha1;
|
object T;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -15,5 +15,10 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
phases (water air);
|
||||||
|
|
||||||
|
pMin pMin [ 1 -1 -2 0 0 0 0 ] 10000;
|
||||||
|
|
||||||
|
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -1,39 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: dev |
|
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class dictionary;
|
|
||||||
location "constant";
|
|
||||||
object transportProperties;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
phases (water air);
|
|
||||||
|
|
||||||
water
|
|
||||||
{
|
|
||||||
transportModel Newtonian;
|
|
||||||
nu 1e-06;
|
|
||||||
rho 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
air
|
|
||||||
{
|
|
||||||
transportModel Newtonian;
|
|
||||||
nu 1.589e-05;
|
|
||||||
rho 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pMin pMin [ 1 -1 -2 0 0 0 0 ] 10000;
|
|
||||||
|
|
||||||
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -15,7 +15,7 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
simulationType LESModel;
|
simulationType laminar;
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -35,7 +35,7 @@ divSchemes
|
|||||||
div(rho*phi,T) Gauss upwind;
|
div(rho*phi,T) Gauss upwind;
|
||||||
div(rho*phi,K) Gauss upwind;
|
div(rho*phi,K) Gauss upwind;
|
||||||
div(phi,k) Gauss vanLeer;
|
div(phi,k) Gauss vanLeer;
|
||||||
div((muEff*dev(T(grad(U))))) Gauss linear;
|
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
laplacianSchemes
|
laplacianSchemes
|
||||||
|
|||||||
@ -10,7 +10,7 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class volScalarField;
|
class volScalarField;
|
||||||
object alpha1;
|
object T;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
simulationType LESModel;
|
simulationType laminar;
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -33,8 +33,9 @@ divSchemes
|
|||||||
div(phid1,p_rgh) Gauss upwind;
|
div(phid1,p_rgh) Gauss upwind;
|
||||||
div(phid2,p_rgh) Gauss upwind;
|
div(phid2,p_rgh) Gauss upwind;
|
||||||
div(rho*phi,T) Gauss upwind;
|
div(rho*phi,T) Gauss upwind;
|
||||||
|
div(rho*phi,K) Gauss upwind;
|
||||||
div(phi,k) Gauss vanLeer;
|
div(phi,k) Gauss vanLeer;
|
||||||
div((muEff*dev(T(grad(U))))) Gauss linear;
|
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
laplacianSchemes
|
laplacianSchemes
|
||||||
|
|||||||
@ -39,7 +39,7 @@ solvers
|
|||||||
maxIter 100;
|
maxIter 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(rho|rhoFinal)"
|
".*(rho|rhoFinal)"
|
||||||
{
|
{
|
||||||
solver diagonal;
|
solver diagonal;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,11 +31,12 @@ mixture
|
|||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
nMoles 1;
|
||||||
molWeight 28.9;
|
molWeight 18;
|
||||||
}
|
}
|
||||||
equationOfState
|
equationOfState
|
||||||
{
|
{
|
||||||
rho0 1027;
|
rho0 1027;
|
||||||
|
R 3000;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
{
|
{
|
||||||
|
|||||||
@ -31,11 +31,12 @@ mixture
|
|||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
nMoles 1;
|
||||||
molWeight 28.9;
|
molWeight 18;
|
||||||
}
|
}
|
||||||
equationOfState
|
equationOfState
|
||||||
{
|
{
|
||||||
rho0 1027;
|
rho0 1027;
|
||||||
|
R 3000;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user