Commit d53245c8 authored by Henry's avatar Henry
Browse files

Multiphase: Update all solvers to accommodate the split between...

Multiphase: Update all solvers to accommodate the split between twoPhaseMixture and incompressibleTwoPhaseMixture
parent 7f87610a
EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
......
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 \
......
......@@ -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"
......
......@@ -34,7 +34,7 @@ Description
#include "fvCFD.H"
#include "barotropicCompressibilityModel.H"
#include "twoPhaseMixture.H"
#include "incompressibleTwoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
......
......@@ -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();
......
EXE_INC = \
-ItwoPhaseThermo \
-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 \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseProperties \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume
......@@ -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();
}
......@@ -2,7 +2,7 @@
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
+ turbulence->divDevRhoReff(rho, U)
+ turbulence->divDevRhoReff(U)
);
UEqn.relax();
......
......@@ -2,28 +2,24 @@ EXE_INC = \
-I.. \
-I../twoPhaseThermo \
-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 \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseProperties \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lphaseEquationsOfState \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-ldynamicMesh \
-lmeshTools \
-ldynamicFvMesh
-ldynamicFvMesh \
-lfiniteVolume
......@@ -28,36 +28,33 @@
#include "createPhi.H"
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phi);
Info<< "Constructing twoPhaseThermo\n" << endl;
twoPhaseThermo twoPhaseProperties(mesh);
volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());
Info<< "Reading thermophysical properties\n" << endl;
twoPhaseThermo thermo(twoPhaseProperties);
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& 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
(
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;
......
......@@ -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);
}
......
phaseEquationOfState/phaseEquationOfState.C
phaseEquationOfState/newPhaseEquationOfState.C
constant/constant.C
linear/linear.C
perfectFluid/perfectFluid.C
adiabaticPerfectFluid/adiabaticPerfectFluid.C
LIB = $(FOAM_LIBBIN)/libphaseEquationsOfState
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude
LIB_LIBS = \
-lincompressibleTransportModels
/*---------------------------------------------------------------------------*\
========= |
\\ / 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)
)
);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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)
)
);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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