Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
sergio
2013-02-08 11:25:27 +00:00
128 changed files with 2197 additions and 1663 deletions

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ Description
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "barotropicCompressibilityModel.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,7 +34,7 @@ Description
#include "fvCFD.H"
#include "barotropicCompressibilityModel.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"

View File

@ -44,7 +44,7 @@
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
incompressibleTwoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
volScalarField& gamma(twoPhaseProperties.alpha1());
gamma.oldTime();

View File

@ -2,7 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso twoPhaseThermo
wclean libso twoPhaseMixtureThermo
wclean
wclean compressibleInterDyMFoam

View File

@ -2,7 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso twoPhaseThermo
wmake libso twoPhaseMixtureThermo
wmake
wmake compressibleInterDyMFoam

View File

@ -1,20 +1,18 @@
EXE_INC = \
-ItwoPhaseThermo \
-ItwoPhaseMixtureThermo \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-ltwoPhaseThermo \
-ltwoPhaseMixtureThermo \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseProperties \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume

View File

@ -3,12 +3,16 @@
(
fvm::ddt(rho, T)
+ fvm::div(rhoPhi, T)
- fvm::laplacian(thermo.alphaEff(rho*turbulence->nut()), T)
- fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T)
+ (
p*fvc::div(phi)
+ 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();
}

View File

@ -2,7 +2,7 @@
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
+ turbulence->divDevRhoReff(rho, U)
+ turbulence->divDevRhoReff(U)
);
UEqn.relax();

View File

@ -1,29 +1,25 @@
EXE_INC = \
-I.. \
-I../twoPhaseThermo \
-I../twoPhaseMixtureThermo \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I../phaseEquationsOfState/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-ltwoPhaseThermo \
-ltwoPhaseMixtureThermo \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseProperties \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lphaseEquationsOfState \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-ldynamicMesh \
-lmeshTools \
-ldynamicFvMesh
-ldynamicFvMesh \
-lfiniteVolume

View File

@ -43,7 +43,7 @@ Description
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "twoPhaseThermo.H"
#include "twoPhaseMixtureThermo.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"

View File

@ -41,7 +41,7 @@ Description
#include "rhoThermo.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "twoPhaseThermo.H"
#include "twoPhaseMixtureThermo.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"

View File

@ -28,36 +28,33 @@
#include "createPhi.H"
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phi);
Info<< "Constructing twoPhaseMixtureThermo\n" << endl;
twoPhaseMixtureThermo twoPhaseProperties(mesh);
volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());
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& p = thermo.p();
volScalarField& T = thermo.T();
const volScalarField& rho1 = thermo.thermo1().rho();
const volScalarField& psi1 = thermo.thermo1().psi();
const volScalarField& rho2 = thermo.thermo2().rho();
const volScalarField& psi2 = thermo.thermo2().psi();
// volScalarField rho
// (
// IOobject
// (
// "rho",
// runTime.timeName(),
// mesh,
// IOobject::READ_IF_PRESENT,
// IOobject::AUTO_WRITE
// ),
// alpha1*rho1 + alpha2*rho2
// );
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
alpha1*rho1 + alpha2*rho2
);
dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
@ -90,10 +87,10 @@
// Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, twoPhaseProperties);
// Construct incompressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence
// Construct compressible turbulence model
autoPtr<compressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
compressible::turbulenceModel::New(rho, U, rhoPhi, twoPhaseProperties)
);
Info<< "Creating field dpdt\n" << endl;

View File

@ -47,7 +47,7 @@
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1:
//thermo.rho() -= psi*p_rgh;
//twoPhaseProperties.rho() -= psi*p_rgh;
while (pimple.correctNonOrthogonal())
{
@ -70,7 +70,7 @@
if (pimple.finalNonOrthogonalIter())
{
// Second part of thermodynamic density update
//thermo.rho() += psi*p_rgh;
//twoPhaseProperties.rho() += psi*p_rgh;
dgdt =
(
@ -88,14 +88,14 @@
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
// thermo.correct();
// twoPhaseProperties.correct();
Info<< "max(U) " << max(mag(U)).value() << endl;
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
K = 0.5*magSqr(U);
if (thermo.dpdt())
if (twoPhaseProperties.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -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

View File

@ -1,6 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude
LIB_LIBS = \
-lincompressibleTransportModels

View File

@ -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)
)
);
}
// ************************************************************************* //

View File

@ -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)
)
);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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_
)
);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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)
)
);
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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"));
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
twoPhaseMixtureThermo.C
LIB = $(FOAM_LIBBIN)/libtwoPhaseMixtureThermo

View File

@ -1,11 +1,10 @@
EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lfluidThermophysicalModels \
-lspecie \
-lincompressibleTransportModels \
-ltwoPhaseProperties \
-lfiniteVolume

View File

@ -0,0 +1,335 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "twoPhaseMixtureThermo.H"
#include "gradientEnergyFvPatchScalarField.H"
#include "mixedEnergyFvPatchScalarField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(twoPhaseMixtureThermo, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo
(
const fvMesh& mesh
)
:
psiThermo(mesh, word::null),
twoPhaseMixture(mesh, *this),
thermo1_(NULL),
thermo2_(NULL)
{
{
volScalarField T1("T" + phase1Name(), T_);
T1.write();
}
{
volScalarField T2("T" + phase2Name(), T_);
T2.write();
}
thermo1_ = rhoThermo::New(mesh, phase1Name());
thermo2_ = rhoThermo::New(mesh, phase2Name());
thermo1_->validate(phase1Name(), "e");
thermo2_->validate(phase2Name(), "e");
correct();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::twoPhaseMixtureThermo::~twoPhaseMixtureThermo()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::twoPhaseMixtureThermo::correct()
{
thermo1_->he() = thermo1_->he(p_, T_);
thermo1_->correct();
thermo2_->he() = thermo2_->he(p_, T_);
thermo2_->correct();
psi_ = alpha1()*thermo1_->psi() + alpha2()*thermo2_->psi();
mu_ = alpha1()*thermo1_->mu() + alpha2()*thermo2_->mu();
alpha_ = alpha1()*thermo1_->alpha() + alpha2()*thermo2_->alpha();
}
bool Foam::twoPhaseMixtureThermo::incompressible() const
{
return thermo1_->incompressible() && thermo2_->incompressible();
}
bool Foam::twoPhaseMixtureThermo::isochoric() const
{
return thermo1_->isochoric() && thermo2_->isochoric();
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::he
(
const volScalarField& p,
const volScalarField& T
) const
{
return alpha1()*thermo1_->he(p, T) + alpha2()*thermo2_->he(p, T);
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::he
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
return
scalarField(alpha1(), cells)*thermo1_->he(p, T, cells)
+ scalarField(alpha2(), cells)*thermo2_->he(p, T, cells);
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::he
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->he(p, T, patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->he(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::hc() const
{
return alpha1()*thermo1_->hc() + alpha2()*thermo2_->hc();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0,
const labelList& cells
) const
{
notImplemented("twoPhaseMixtureThermo::THE(...)");
return T0;
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0,
const label patchi
) const
{
notImplemented("twoPhaseMixtureThermo::THE(...)");
return T0;
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::Cp() const
{
return alpha1()*thermo1_->Cp() + alpha2()*thermo2_->Cp();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::Cp
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->Cp(p, T, patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->Cp(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::Cv() const
{
return alpha1()*thermo1_->Cv() + alpha2()*thermo2_->Cv();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::Cv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->Cv(p, T, patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->Cv(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::gamma() const
{
return alpha1()*thermo1_->gamma() + alpha2()*thermo2_->gamma();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::gamma
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->gamma(p, T, patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->gamma(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::Cpv() const
{
return alpha1()*thermo1_->Cpv() + alpha2()*thermo2_->Cpv();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::Cpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::CpByCpv() const
{
return
alpha1()*thermo1_->CpByCpv()
+ alpha2()*thermo2_->CpByCpv();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::CpByCpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::kappa() const
{
return alpha1()*thermo1_->kappa() + alpha2()*thermo2_->kappa();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::kappa
(
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->kappa(patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->kappa(patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::kappaEff
(
const volScalarField& alphat
) const
{
return
alpha1()*thermo1_->kappaEff(alphat)
+ alpha2()*thermo2_->kappaEff(alphat);
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::kappaEff
(
const scalarField& alphat,
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi)
;
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::alphaEff
(
const volScalarField& alphat
) const
{
return
alpha1()*thermo1_->alphaEff(alphat)
+ alpha2()*thermo2_->alphaEff(alphat);
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::alphaEff
(
const scalarField& alphat,
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->alphaEff(alphat, patchi)
+ alpha2().boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi)
;
}
// ************************************************************************* //

View File

@ -22,21 +22,22 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::twoPhaseThermo
Foam::twoPhaseMixtureThermo
Description
SourceFiles
twoPhaseThermoI.H
twoPhaseThermo.C
twoPhaseThermoIO.C
twoPhaseMixtureThermoI.H
twoPhaseMixtureThermo.C
twoPhaseMixtureThermoIO.C
\*---------------------------------------------------------------------------*/
#ifndef twoPhaseThermo_H
#define twoPhaseThermo_H
#ifndef twoPhaseMixtureThermo_H
#define twoPhaseMixtureThermo_H
#include "rhoThermo.H"
#include "psiThermo.H"
#include "twoPhaseMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,17 +46,16 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class twoPhaseThermo Declaration
Class twoPhaseMixtureThermo Declaration
\*---------------------------------------------------------------------------*/
class twoPhaseThermo
class twoPhaseMixtureThermo
:
public rhoThermo
public psiThermo,
public twoPhaseMixture
{
// Private data
const twoPhaseMixture& tpm_;
//- Thermo-package of phase 1
autoPtr<rhoThermo> thermo1_;
@ -66,20 +66,20 @@ class twoPhaseThermo
public:
//- Runtime type information
TypeName("twoPhaseThermo");
TypeName("twoPhaseMixtureThermo");
// Constructors
//- Construct from mesh and phase fractions
twoPhaseThermo
//- Construct from mesh
twoPhaseMixtureThermo
(
const twoPhaseMixture& twoPhaseProperties
const fvMesh& mesh
);
//- Destructor
virtual ~twoPhaseThermo();
virtual ~twoPhaseMixtureThermo();
// Member Functions
@ -112,14 +112,14 @@ public:
// Non-const access allowed for transport equations
virtual volScalarField& he()
{
notImplemented("twoPhaseThermo::he()");
notImplemented("twoPhaseMixtureThermo::he()");
return thermo1_->he();
}
//- Enthalpy/Internal energy [J/kg]
virtual const volScalarField& he() const
{
notImplemented("twoPhaseThermo::he() const");
notImplemented("twoPhaseMixtureThermo::he() const");
return thermo1_->he();
}

View File

@ -1,3 +0,0 @@
twoPhaseThermo.C
LIB = $(FOAM_LIBBIN)/libtwoPhaseThermo

View File

@ -1,323 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "twoPhaseThermo.H"
#include "gradientEnergyFvPatchScalarField.H"
#include "mixedEnergyFvPatchScalarField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(twoPhaseThermo, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::twoPhaseThermo::twoPhaseThermo
(
const twoPhaseMixture& twoPhaseProperties
)
:
rhoThermo(twoPhaseProperties.alpha1().mesh(), word::null),
tpm_(twoPhaseProperties),
thermo1_(rhoThermo::New(tpm_.alpha1().mesh(), tpm_.phase1Name())),
thermo2_(rhoThermo::New(tpm_.alpha1().mesh(), tpm_.phase2Name()))
{
thermo1_->validate(tpm_.phase1Name(), "e");
thermo2_->validate(tpm_.phase2Name(), "e");
rho_ = tpm_.alpha1()*thermo1_->rho() + tpm_.alpha2()*thermo2_->rho();
correct();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::twoPhaseThermo::~twoPhaseThermo()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::twoPhaseThermo::correct()
{
thermo1_->he() = thermo1_->he(p_, T_);
thermo1_->correct();
thermo2_->he() = thermo2_->he(p_, T_);
thermo2_->correct();
psi_ = tpm_.alpha1()*thermo1_->psi() + tpm_.alpha2()*thermo2_->psi();
mu_ = tpm_.alpha1()*thermo1_->mu() + tpm_.alpha2()*thermo2_->mu();
alpha_ = tpm_.alpha1()*thermo1_->alpha() + tpm_.alpha2()*thermo2_->alpha();
}
bool Foam::twoPhaseThermo::incompressible() const
{
return thermo1_->incompressible() && thermo2_->incompressible();
}
bool Foam::twoPhaseThermo::isochoric() const
{
return thermo1_->isochoric() && thermo2_->isochoric();
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::he
(
const volScalarField& p,
const volScalarField& T
) const
{
return tpm_.alpha1()*thermo1_->he(p, T) + tpm_.alpha2()*thermo2_->he(p, T);
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::he
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
{
return
scalarField(tpm_.alpha1(), cells)*thermo1_->he(p, T, cells)
+ scalarField(tpm_.alpha2(), cells)*thermo2_->he(p, T, cells);
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::he
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->he(p, T, patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->he(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::hc() const
{
return tpm_.alpha1()*thermo1_->hc() + tpm_.alpha2()*thermo2_->hc();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0,
const labelList& cells
) const
{
notImplemented("twoPhaseThermo::THE(...)");
return T0;
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0,
const label patchi
) const
{
notImplemented("twoPhaseThermo::THE(...)");
return T0;
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cp() const
{
return tpm_.alpha1()*thermo1_->Cp() + tpm_.alpha2()*thermo2_->Cp();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cp
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cp(p, T, patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cp(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cv() const
{
return tpm_.alpha1()*thermo1_->Cv() + tpm_.alpha2()*thermo2_->Cv();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cv(p, T, patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cv(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::gamma() const
{
return tpm_.alpha1()*thermo1_->gamma() + tpm_.alpha2()*thermo2_->gamma();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::gamma
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->gamma(p, T, patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->gamma(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::Cpv() const
{
return tpm_.alpha1()*thermo1_->Cpv() + tpm_.alpha2()*thermo2_->Cpv();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::Cpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->Cpv(p, T, patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->Cpv(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::CpByCpv() const
{
return
tpm_.alpha1()*thermo1_->CpByCpv()
+ tpm_.alpha2()*thermo2_->CpByCpv();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::CpByCpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->CpByCpv(p, T, patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->CpByCpv(p, T, patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::kappa() const
{
return tpm_.alpha1()*thermo1_->kappa() + tpm_.alpha2()*thermo2_->kappa();
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::kappa
(
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->kappa(patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->kappa(patchi);
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::kappaEff
(
const volScalarField& alphat
) const
{
return
tpm_.alpha1()*thermo1_->kappaEff(alphat)
+ tpm_.alpha2()*thermo2_->kappaEff(alphat);
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::kappaEff
(
const scalarField& alphat,
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi)
;
}
Foam::tmp<Foam::volScalarField> Foam::twoPhaseThermo::alphaEff
(
const volScalarField& alphat
) const
{
return
tpm_.alpha1()*thermo1_->alphaEff(alphat)
+ tpm_.alpha2()*thermo2_->alphaEff(alphat);
}
Foam::tmp<Foam::scalarField> Foam::twoPhaseThermo::alphaEff
(
const scalarField& alphat,
const label patchi
) const
{
return
tpm_.alpha1().boundaryField()[patchi]*thermo1_->alphaEff(alphat, patchi)
+ tpm_.alpha2().boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi)
;
}
// ************************************************************************* //

View File

@ -41,7 +41,7 @@ Description
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "fvcSmooth.H"
#include "pimpleControl.H"

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -11,7 +12,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -40,7 +40,7 @@ Description
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "IOMRFZoneList.H"
#include "pimpleControl.H"

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -11,7 +12,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -10,7 +11,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -30,7 +30,7 @@
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phi);
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -13,7 +14,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -37,7 +37,7 @@ Description
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"

View File

@ -41,7 +41,7 @@ Description
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"

View File

@ -1,9 +1,10 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-IincompressibleThreePhaseMixture \
-IthreePhaseInterfaceProperties \
-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)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \
@ -12,7 +13,7 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -11,7 +12,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -42,7 +42,7 @@ Description
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "IOporosityModelList.H"
#include "pimpleControl.H"

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -8,7 +9,7 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "phaseChangeTwoPhaseMixture.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,7 +43,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture
const word& alpha1Name
)
:
twoPhaseMixture(U, phi, alpha1Name),
incompressibleTwoPhaseMixture(U, phi, alpha1Name),
phaseChangeTwoPhaseMixtureCoeffs_(subDict(type + "Coeffs")),
pSat_(lookup("pSat"))
{}
@ -76,7 +76,7 @@ Foam::phaseChangeTwoPhaseMixture::vDotP() const
bool Foam::phaseChangeTwoPhaseMixture::read()
{
if (twoPhaseMixture::read())
if (incompressibleTwoPhaseMixture::read())
{
phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs");
lookup("pSat") >> pSat_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ SourceFiles
#ifndef phaseChangeTwoPhaseMixture_H
#define phaseChangeTwoPhaseMixture_H
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "typeInfo.H"
#include "runTimeSelectionTables.H"
#include "volFields.H"
@ -54,7 +54,7 @@ namespace Foam
class phaseChangeTwoPhaseMixture
:
public twoPhaseMixture
public incompressibleTwoPhaseMixture
{
protected:

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I../interFoam \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -7,7 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -29,7 +29,7 @@
#include "createPhi.H"
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phi);
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,7 +34,7 @@ Description
#include "fvCFD.H"
#include "MULES.H"
#include "subCycle.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"

View File

@ -63,5 +63,5 @@ EXE_LIBS = \
-lthermophysicalFunctions \
-ltopoChangerFvMesh \
-ltriSurface \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lutilityFunctionObjects

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -30,6 +30,7 @@ License
#include "IFstream.H"
#include "OFstream.H"
#include "globalIndex.H"
#include "ListListOps.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -52,6 +53,62 @@ Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::baseDir() const
}
template<class Type>
void Foam::externalCoupledMixedFvPatchField<Type>::writeGeometry() const
{
int tag = Pstream::msgType() + 1;
const label procI = Pstream::myProcNo();
const polyPatch& p = this->patch().patch();
const polyMesh& mesh = p.boundaryMesh().mesh();
labelList pointToGlobal;
labelList uniquePointIDs;
(void)mesh.globalData().mergePoints
(
p.meshPoints(),
p.meshPointMap(),
pointToGlobal,
uniquePointIDs
);
List<pointField> allPoints(Pstream::nProcs());
allPoints[procI] = pointField(mesh.points(), uniquePointIDs);
Pstream::gatherList(allPoints, tag);
List<faceList> allFaces(Pstream::nProcs());
faceList& patchFaces = allFaces[procI];
patchFaces = p.localFaces();
forAll(patchFaces, faceI)
{
inplaceRenumber(pointToGlobal, patchFaces[faceI]);
}
Pstream::gatherList(allFaces, tag);
if (Pstream::master())
{
OFstream osPoints(baseDir()/"patchPoints");
if (log_)
{
Info<< "writing patch points to: " << osPoints.name() << endl;
}
osPoints<<
ListListOps::combine<pointField>(allPoints, accessOp<pointField>());
OFstream osFaces(baseDir()/"patchFaces");
if (log_)
{
Info<< "writing patch faces to: " << osFaces.name() << endl;
}
osFaces<<
ListListOps::combine<faceList>(allFaces, accessOp<faceList>());
}
}
template<class Type>
Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::lockFile() const
{
@ -346,6 +403,8 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField
this->refValue() = *this;
this->refGrad() = pTraits<Type>::zero;
this->valueFraction() = 1.0;
writeGeometry();
}

View File

@ -137,6 +137,9 @@ protected:
//- Return the file path to the base communications folder
fileName baseDir() const;
//- Write the geometry to the comms dir
void writeGeometry() const;
//- Return the file path to the lock file
fileName lockFile() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -135,6 +135,7 @@ void Foam::mappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
break;
}
case mappedPatchBase::NEARESTPATCHFACE:
case mappedPatchBase::NEARESTPATCHFACEAMI:
{
const label samplePatchI = mpp.samplePolyPatch().index();
const fvPatchField<Type>& nbrPatchField =

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,6 +42,7 @@ Description
SourceFiles
AMIInterpolation.C
AMIInterpolationName.C
AMIInterpolationParallelOps.C
\*---------------------------------------------------------------------------*/

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View 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
// ************************************************************************* //

View 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;
}
// ************************************************************************* //

View File

@ -3,9 +3,8 @@ cd ${0%/*} || exit 1 # run from this directory
makeType=${1:-libso}
set -x
wmake $makeType incompressible
wmake $makeType interfaceProperties
wmake $makeType twoPhaseInterfaceProperties
# wmake $makeType compressible
wmake $makeType twoPhaseProperties
wmake $makeType incompressible
# ----------------------------------------------------------------- end-of-file

View File

@ -9,6 +9,6 @@ viscosityModels/HerschelBulkley/HerschelBulkley.C
transportModel/transportModel.C
singlePhaseTransportModel/singlePhaseTransportModel.C
incompressibleTwoPhaseMixture/twoPhaseMixture.C
incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
LIB = $(FOAM_LIBBIN)/libincompressibleTransportModels

View File

@ -1,6 +1,8 @@
EXE_INC = \
-I.. \
-I../twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-ltwoPhaseProperties \
-lfiniteVolume

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "addToRunTimeSelectionTable.H"
#include "surfaceFields.H"
#include "fvc.H"
@ -32,7 +32,7 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
//- Calculate and return the laminar viscosity
void Foam::twoPhaseMixture::calcNu()
void Foam::incompressibleTwoPhaseMixture::calcNu()
{
nuModel1_->correct();
nuModel2_->correct();
@ -50,7 +50,7 @@ void Foam::twoPhaseMixture::calcNu()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::twoPhaseMixture::twoPhaseMixture
Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi,
@ -59,16 +59,14 @@ Foam::twoPhaseMixture::twoPhaseMixture
)
:
transportModel(U, phi),
phase1Name_(found("phases") ? wordList(lookup("phases"))[0] : "phase1"),
phase2Name_(found("phases") ? wordList(lookup("phases"))[1] : "phase2"),
twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name),
nuModel1_
(
viscosityModel::New
(
"nu1",
subDict(phase1Name_),
subDict(phase1Name_ == "1" ? "phase1": phase1Name_),
U,
phi
)
@ -78,7 +76,7 @@ Foam::twoPhaseMixture::twoPhaseMixture
viscosityModel::New
(
"nu2",
subDict(phase2Name_),
subDict(phase2Name_ == "2" ? "phase2": phase2Name_),
U,
phi
)
@ -90,30 +88,6 @@ Foam::twoPhaseMixture::twoPhaseMixture
U_(U),
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_
(
IOobject
@ -133,7 +107,8 @@ Foam::twoPhaseMixture::twoPhaseMixture
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixture::mu() const
Foam::tmp<Foam::volScalarField>
Foam::incompressibleTwoPhaseMixture::mu() const
{
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
(
@ -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
(
@ -192,7 +169,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseMixture::nuf() const
}
bool Foam::twoPhaseMixture::read()
bool Foam::incompressibleTwoPhaseMixture::read()
{
if (transportModel::read())
{

View File

@ -22,23 +22,23 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::twoPhaseMixture
Foam::incompressibleTwoPhaseMixture
Description
A two-phase incompressible transportModel
SourceFiles
twoPhaseMixture.C
incompressibleTwoPhaseMixture.C
\*---------------------------------------------------------------------------*/
#ifndef twoPhaseMixture_H
#define twoPhaseMixture_H
#ifndef incompressibleTwoPhaseMixture_H
#define incompressibleTwoPhaseMixture_H
#include "incompressible/transportModel/transportModel.H"
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
#include "dimensionedScalar.H"
#include "volFields.H"
#include "twoPhaseMixture.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 data
word phase1Name_;
word phase2Name_;
autoPtr<viscosityModel> nuModel1_;
autoPtr<viscosityModel> nuModel2_;
@ -69,9 +67,6 @@ protected:
const volVectorField& U_;
const surfaceScalarField& phi_;
volScalarField alpha1_;
volScalarField alpha2_;
volScalarField nu_;
@ -86,7 +81,7 @@ public:
// Constructors
//- Construct from components
twoPhaseMixture
incompressibleTwoPhaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi,
@ -96,46 +91,12 @@ public:
//- Destructor
~twoPhaseMixture()
virtual ~incompressibleTwoPhaseMixture()
{}
// 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
const viscosityModel& nuModel1() const
{

View File

@ -1,5 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/alphaContactAngle \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = -lfiniteVolume

View File

@ -1,7 +1,9 @@
twoPhaseMixture/twoPhaseMixture.C
alphaContactAngle/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libtwoPhaseInterfaceProperties
LIB = $(FOAM_LIBBIN)/libtwoPhaseProperties

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,31 +23,55 @@ License
\*---------------------------------------------------------------------------*/
#include "phaseEquationOfState.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(phaseEquationOfState, 0);
defineRunTimeSelectionTable(phaseEquationOfState, dictionary);
}
#include "twoPhaseMixture.H"
// * * * * * * * * * * * * * * * * 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 * * * * * * * * * * * * * * * //
Foam::phaseEquationOfState::~phaseEquationOfState()
alpha2_
(
IOobject
(
dict.found("phases") ? word("alpha" + phase2Name_) : alpha2Name,
mesh.time().timeName(),
mesh
),
1.0 - alpha1_
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,90 +22,102 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::phaseEquationsOfState::adiabaticPerfectFluid
Foam::twoPhaseMixture
Description
AdiabaticPerfectFluid phase density model.
A two-phase mixture model
SourceFiles
adiabaticPerfectFluid.C
twoPhaseMixture.C
\*---------------------------------------------------------------------------*/
#ifndef adiabaticPerfectFluid_H
#define adiabaticPerfectFluid_H
#ifndef twoPhaseMixture_H
#define twoPhaseMixture_H
#include "phaseEquationOfState.H"
#include "dimensionedTypes.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace phaseEquationsOfState
{
/*---------------------------------------------------------------------------*\
Class adiabaticPerfectFluid Declaration
Class twoPhaseMixture Declaration
\*---------------------------------------------------------------------------*/
class adiabaticPerfectFluid
:
public phaseEquationOfState
class twoPhaseMixture
{
// Private data
protected:
//- Reference pressure
dimensionedScalar p0_;
// Protected data
//- Reference density
dimensionedScalar rho0_;
word phase1Name_;
word phase2Name_;
//- The isentropic exponent
dimensionedScalar gamma_;
//- Pressure offset for a stiffened gas
dimensionedScalar B_;
volScalarField alpha1_;
volScalarField alpha2_;
public:
//- Runtime type information
TypeName("adiabaticPerfectFluid");
// Constructors
//- Construct from components
adiabaticPerfectFluid
twoPhaseMixture
(
const dictionary& dict
const fvMesh& mesh,
const dictionary& dict,
const word& alpha1Name = "alpha1",
const word& alpha2Name = "alpha2"
);
//- Destructor
virtual ~adiabaticPerfectFluid();
~twoPhaseMixture()
{}
// Member Functions
tmp<volScalarField> rho
(
const volScalarField& p,
const volScalarField& T
) const;
const word phase1Name() const
{
return phase1Name_;
}
tmp<volScalarField> psi
(
const volScalarField& p,
const volScalarField& T
) const;
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_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace phaseEquationsOfState
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -233,8 +233,7 @@ public:
//- Return the effective turbulent temperature diffusivity for a patch
virtual tmp<scalarField> kappaEff(const label patchI) const
{
return
thermo().kappaEff(alphat()().boundaryField()[patchI], patchI);
return thermo().kappaEff(alphat(patchI), patchI);
}
//- Return the effective turbulent thermal diffusivity
@ -246,8 +245,7 @@ public:
//- Return the effective turbulent thermal diffusivity for a patch
virtual tmp<scalarField> alphaEff(const label patchI) const
{
return
thermo().alphaEff(alphat()().boundaryField()[patchI], patchI);
return thermo().alphaEff(alphat(patchI), patchI);
}
//- Solve the turbulence equations and correct the turbulence viscosity

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -212,6 +212,12 @@ public:
//- Return the turbulence thermal diffusivity
virtual tmp<volScalarField> alphat() const = 0;
//- Return the turbulence thermal diffusivity for a patch
virtual tmp<scalarField> alphat(const label patchI) const
{
return alphat()().boundaryField()[patchI];
}
//- Return the effective turbulence temperature diffusivity
virtual tmp<volScalarField> kappaEff() const = 0;

View File

@ -0,0 +1,23 @@
THERMO ALL
200.000 1000.000 6000.000
C7H16 P10/85C 7.H 16. 0. 0.G 200.000 6000.000 1000. 1
2.04565203E+01 3.48575357E-02-1.09226846E-05 1.67201776E-09-9.81024850E-14 2
-3.25556365E+04-8.04405017E+01 1.11532994E+01-9.49419773E-03 1.95572075E-04 3
-2.49753662E-07 9.84877715E-11-2.67688904E+04-1.59096837E+01-2.25846141E+04 4
O2 ATcT06O 2. 0. 0. 0.G 200.000 6000.000 1000. 1
3.45852381E+00 1.04045351E-03-2.79664041E-07 3.11439672E-11-8.55656058E-16 2
1.0dev 63E+04 4.15264119E+00 3.78535371E+00-3.21928540E-03 1.12323443E-05 3
-1.17254068E-08 4.17659585E-12 1.02922572E+04 3.27320239E+00 1.13558105E+04 4
N2 G 8/02N 2. 0. 0. 0.G 200.000 6000.000 1000. 1
2.95257637E+00 1.39690040E-03-4.92631603E-07 7.86010195E-11-4.60755204E-15 2
-9.23948688E+02 5.87188762E+00 3.53100528E+00-1.23660988E-04-5.02999433E-07 3
2.43530612E-09-1.40881235E-12-1.04697628E+03 2.96747038E+00 0.00000000E+00 4
CO2 L 7/88C 1O 2 0 0G 200.000 6000.000 1000. 1
0.46365111E+01 0.27414569E-02-0.99589759E-06 0.16038666E-09-0.91619857E-14 2
-0.49024904E+05-0.19348955E+01 0.23568130E+01 0.89841299E-02-0.71220632E-05 3
0.24573008E-08-0.14288548E-12-0.48371971E+05 0.99009035E+01-0.47328105E+05 4
H2O L 5/89H 2O 1 0 0G 200.000 6000.000 1000. 1
0.26770389E+01 0.29731816E-02-0.77376889E-06 0.94433514E-10-0.42689991E-14 2
-0.29885894E+05 0.68825500E+01 0.41986352E+01-0.20364017E-02 0.65203416E-05 3
-0.54879269E-08 0.17719680E-11-0.30293726E+05-0.84900901E+00-0.29084817E+05 4
END

View File

@ -10,7 +10,7 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
object alpha1;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- 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 volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
walls
{
type calculated;
value uniform 1e5;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -3,4 +3,4 @@ cd ${0%/*} || exit 1 # run from this directory
foamCleanTutorials cases
rm -rf processor*
rm -rf 0/p_rgh.gz 0/alphawater.gz 0/T.gz
rm -rf 0/p_rgh.gz 0/p.gz 0/alphawater.gz 0/T*.gz

View File

@ -10,6 +10,7 @@ application=`getApplication`
runApplication blockMesh
cp 0/alphawater.org 0/alphawater
cp 0/p_rgh.org 0/p_rgh
cp 0/p.org 0/p
cp 0/T.org 0/T
runApplication setFields
runApplication $application

View File

@ -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;
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- 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 thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleInternalEnergy;
}
mixture
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics
{
Cp 1007;
Hf 0;
}
transport
{
mu 1.84e-05;
Pr 0.7;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- 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 thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectFluid;
specie specie;
energy sensibleInternalEnergy;
}
mixture
{
specie
{
nMoles 1;
molWeight 18.0;
}
equationOfState
{
R 3000;
rho0 1027;
}
thermodynamics
{
Cp 4195;
Hf 0;
}
transport
{
mu 3.645e-4;
Pr 2.289;
}
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More