Merge branch 'master' into feature/cvMesh

Conflicts:
	applications/test/Matrix/Test-Matrix.C
	applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.C
	applications/utilities/mesh/generation/extrude2DMesh/extrude2DMesh/extrude2DMesh/extrude2DMesh.H
	src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
	src/OpenFOAM/primitives/Tensor2D/Tensor2DI.H
This commit is contained in:
laurence
2013-04-05 16:09:24 +01:00
1087 changed files with 16553 additions and 13759 deletions

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en" xml:lang="en">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>OpenFOAM README for version dev</title>
<title>OpenFOAM README for version 2.2.0</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="title" content="OpenFOAM README for version 2.2.0"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="15th August 2011"/>
<meta name="generated" content="11th January 2013"/>
<meta name="author" content="The OpenFOAM Foundation"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
@ -44,6 +44,12 @@ lang="en" xml:lang="en">
dt { font-weight: bold; }
div.figure { padding: 0.5em; }
div.figure p { text-align: center; }
div.inlinetask {
padding:10px;
border:2px solid gray;
margin:10px;
background: #ffffcc;
}
textarea { overflow-x: auto; }
.linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;}
@ -79,9 +85,14 @@ lang="en" xml:lang="en">
</head>
<body>
<div id="content">
<h1 class="title">OpenFOAM README for version dev</h1>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">OpenFOAM README for version 2.2.0</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
@ -147,7 +158,7 @@ lang="en" xml:lang="en">
<h2 id="sec-4"><span class="section-number-2">4</span> Release notes</h2>
<div class="outline-text-2" id="text-4">
<p> <a href="http://www.OpenFOAM.com/version2.0.0">http://www.OpenFOAM.com/version2.0.0</a>
<p> <a href="http://www.OpenFOAM.org/version2.2.0">http://www.OpenFOAM.org/version2.2.0</a>
</p>
</div>
@ -180,11 +191,13 @@ lang="en" xml:lang="en">
<p> <a href="http://www.OpenFOAM.com/bugs">http://www.OpenFOAM.com/bugs</a>
</p></div>
</div>
<div id="postamble">
<p class="date">Date: 15th August 2011</p>
<p class="creator">Org version 7.5 with Emacs version 23</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
<div id="postamble">
<p class="date">Date: 11th January 2013</p>
<p class="creator">Org version 7.8.11 with Emacs version 24</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
</body>
</html>

View File

@ -1,11 +1,11 @@
# -*- mode: org; -*-
#
#+TITLE: OpenFOAM README for version dev
#+TITLE: OpenFOAM README for version 2.2.0
#+AUTHOR: The OpenFOAM Foundation
#+DATE: 15th August 2011
#+DATE: 11th January 2013
#+LINK: http://www.openfoam.org
#+OPTIONS: author:nil ^:{}
# Copyright (c) 2011 OpenFOAM Foundation.
# Copyright (c) 2013 OpenFOAM Foundation.
* About OpenFOAM
OpenFOAM is a free, open source computational fluid dynamcis (CFD) software
@ -28,7 +28,7 @@
[[http://www.OpenFOAM.org/git.php]]
* Release notes
[[http://www.OpenFOAM.com/version2.0.0]]
[[http://www.OpenFOAM.org/version2.2.0]]
* Documentation
[[http://www.OpenFOAM.com/docs]]

View File

@ -1,4 +1,11 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = -lfiniteVolume
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lfvOptions \
-lsampling

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
@ -31,7 +31,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "fvIOoptionList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,17 +49,20 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "readControls.H"
#include "createFields.H"
#include "createFvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< nl << "Calculating potential flow" << endl;
// Since solver contains no time loop it would never execute
// function objects so do it ourselves.
// function objects so do it ourselves
runTime.functionObjects().start();
adjustPhi(phi, U, p);
fvOptions.relativeFlux(phi);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
@ -87,6 +90,8 @@ int main(int argc, char *argv[])
}
}
fvOptions.absoluteFlux(phi);
Info<< "continuity error = "
<< mag(fvc::div(phi))().weightedAverage(mesh.V()).value()
<< endl;

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
@ -116,7 +116,7 @@ void PDRkEpsilon::correct()
}
tmp<volTensorField> tgradU = fvc::grad(U_);
volScalarField G(type() + ".G", mut_*(tgradU() && dev(twoSymm(tgradU()))));
volScalarField G(GName(), mut_*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear();
// Update espsilon and G at the wall

View File

@ -27,7 +27,7 @@
fvScalarMatrix pDDtEqn
(
fvc::ddt(rho) + fvc::div(phiHbyA)
+ correction(fvm::ddt(psi, p) + fvm::div(phid, p))
+ correction(psi*fvm::ddt(p) + fvm::div(phid, p))
);
while (pimple.correctNonOrthogonal())

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
@ -165,7 +165,6 @@ int main(int argc, char *argv[])
mesh.movePoints(motionPtr->newPoints());
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
Info<< phi.boundaryField()[0] << endl;
surfaceVectorField phiUp
(

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
buoyantSimpleRadiationFoam
buoyantSimpleFoam
Description
Steady-state solver for buoyant, turbulent flow of compressible fluids,
@ -31,7 +31,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "psiThermo.H"
#include "rhoThermo.H"
#include "RASModel.H"
#include "radiationModel.H"
#include "simpleControl.H"

View File

@ -1,10 +1,7 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiThermo> pThermo
(
psiThermo::New(mesh)
);
psiThermo& thermo = pThermo();
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
rhoThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");
volScalarField rho

View File

@ -11,9 +11,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
@ -25,6 +23,7 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lmeshTools \
-lfiniteVolume \
-lradiationModels \

View File

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

View File

@ -0,0 +1,34 @@
{
volScalarField& he = thermo.he();
fvScalarMatrix EEqn
(
fvm::ddt(rho, he) + fvm::div(phi, he)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(alphaEff, he)
==
radiation->Sh(thermo)
+ fvOptions(rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);
EEqn.solve();
fvOptions.correct(he);
thermo.correct();
radiation->correct();
}

View File

@ -0,0 +1,3 @@
thermoFoam.C
EXE = $(FOAM_APPBIN)/thermoFoam

View File

@ -0,0 +1,24 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lsampling \
-lmeshTools \
-lfvOptions \
-lfluidThermophysicalModels \
-lradiationModels \
-lspecie \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels

View File

@ -0,0 +1,54 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
rhoThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
thermo.rho()
);
volScalarField& p = thermo.p();
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
#include "setAlphaEff.H"
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -0,0 +1,93 @@
Info<< "Creating turbulence model\n" << endl;
tmp<volScalarField> talphaEff;
IOobject turbulenceHeader
(
"turbulenceProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ
);
IOobject RASHeader
(
"RASProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ
);
IOobject LESHeader
(
"LESProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ
);
if (turbulenceHeader.headerOk())
{
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
talphaEff = turbulence->alphaEff();
}
else if (RASHeader.headerOk())
{
autoPtr<compressible::RASModel> turbulence
(
compressible::RASModel::New
(
rho,
U,
phi,
thermo
)
);
talphaEff = turbulence->alphaEff();
}
else if (LESHeader.headerOk())
{
autoPtr<compressible::LESModel> turbulence
(
compressible::LESModel::New
(
rho,
U,
phi,
thermo
)
);
talphaEff = turbulence->alphaEff();
}
else
{
talphaEff = tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"alphaEff",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("0", dimMass/dimLength/dimTime, 0.0)
)
);
}
const volScalarField& alphaEff = talphaEff();

View File

@ -0,0 +1,107 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Application
thermoFoam
Description
Evolves the thermodynamics on a forzen flow field
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "rhoThermo.H"
#include "turbulenceModel.H"
#include "RASModel.H"
#include "LESModel.H"
#include "radiationModel.H"
#include "fvIOoptionList.H"
#include "simpleControl.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "createRadiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nEvolving thermodynamics\n" << endl;
if (mesh.solutionDict().found("SIMPLE"))
{
simpleControl simple(mesh);
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
while (simple.correctNonOrthogonal())
{
#include "EEqn.H"
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.write();
}
}
else
{
pimpleControl pimple(mesh);
while (runTime.run())
{
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
while (pimple.correctNonOrthogonal())
{
#include "EEqn.H"
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.write();
}
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -68,4 +68,6 @@
}
}
phi.oldTime() = phi;
#include "continuityErrs.H"

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/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/twoPhaseMixture/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

@ -4,8 +4,8 @@
p =
(
rho
- (1.0 - gamma)*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
- gamma2*rhol0
- ((gamma*psiv + gamma2*psil) - psi)*pSat
)/psi;
}
@ -57,8 +57,8 @@
p =
(
rho
- (1.0 - gamma)*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
- gamma2*rhol0
- ((gamma*psiv + gamma2*psil) - psi)*pSat
)/psi;
p.correctBoundaryConditions();

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

@ -1,5 +1,5 @@
{
volScalarField thermoRho = psi*p + (1.0 - gamma)*rhol0;
volScalarField thermoRho = psi*p + gamma2*rhol0;
dimensionedScalar totalMass = fvc::domainIntegrate(rho);

View File

@ -44,11 +44,13 @@
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
incompressibleTwoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
volScalarField& gamma(twoPhaseProperties.alpha1());
gamma.oldTime();
volScalarField& gamma2(twoPhaseProperties.alpha2());
Info<< "Creating compressibilityModel\n" << endl;
autoPtr<barotropicCompressibilityModel> psiModel =
barotropicCompressibilityModel::New
@ -62,8 +64,8 @@
rho == max
(
psi*p
+ (1.0 - gamma)*rhol0
+ ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat,
+ gamma2*rhol0
+ ((gamma*psiv + gamma2*psil) - psi)*pSat,
rhoMin
);

View File

@ -1,5 +1,6 @@
{
gamma = max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));
gamma2 = 1.0 - gamma;
Info<< "max-min gamma: " << max(gamma).value()
<< " " << min(gamma).value() << endl;

View File

@ -4,8 +4,8 @@
p =
(
rho
- (1.0 - gamma)*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
- gamma2*rhol0
- ((gamma*psiv + gamma2*psil) - psi)*pSat
)/psi;
}
@ -49,8 +49,8 @@
rho == max
(
psi*p
+ (1.0 - gamma)*rhol0
+ ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat,
+ gamma2*rhol0
+ ((gamma*psiv + gamma2*psil) - psi)*pSat,
rhoMin
);
@ -59,8 +59,8 @@
p =
(
rho
- (1.0 - gamma)*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
- gamma2*rhol0
- ((gamma*psiv + gamma2*psil) - psi)*pSat
)/psi;
p.correctBoundaryConditions();

View File

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

View File

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

View File

@ -1,4 +1,3 @@
derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C
compressibleInterFoam.C
EXE = $(FOAM_APPBIN)/compressibleInterFoam

View File

@ -1,17 +1,19 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-ItwoPhaseMixtureThermo \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-IphaseEquationsOfState/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-ltwoPhaseMixtureThermo \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseMixture \
-ltwoPhaseProperties \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lphaseEquationsOfState \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume

View File

@ -1,20 +1,21 @@
{
volScalarField kByCv
(
"kByCv",
(alpha1*k1/Cv1 + alpha2*k2/Cv2)
+ (alpha1*rho1 + alpha2*rho2)*turbulence->nut()
);
solve
fvScalarMatrix TEqn
(
fvm::ddt(rho, T)
+ fvm::div(rhoPhi, T)
- fvm::laplacian(kByCv, T)
+ p*fvc::div(phi)*(alpha1/Cv1 + alpha2/Cv2)
- fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T)
+ (
fvc::div(fvc::absolute(phi, U), p)
+ fvc::ddt(rho, K) + fvc::div(rhoPhi, K)
)
*(
alpha1/twoPhaseProperties.thermo1().Cv()
+ alpha2/twoPhaseProperties.thermo2().Cv()
)
);
// Update compressibilities
psi1 = eos1->psi(p, T);
psi2 = eos2->psi(p, T);
TEqn.relax();
TEqn.solve();
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();
@ -22,4 +22,6 @@
) * mesh.magSf()
)
);
K = 0.5*magSqr(U);
}

View File

@ -1,24 +1,26 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I../twoPhaseMixtureThermo \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/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 = \
-ltwoPhaseMixtureThermo \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseMixture \
-ltwoPhaseProperties \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lphaseEquationsOfState \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-ldynamicMesh \
-lmeshTools \
-ldynamicFvMesh
-ldynamicFvMesh \
-lfiniteVolume

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
@ -43,7 +43,7 @@ Description
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "phaseEquationOfState.H"
#include "twoPhaseMixtureThermo.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"

View File

@ -56,6 +56,8 @@
phi -= pcorrEqn.flux();
}
}
}
phi.oldTime() = phi;
#include "continuityErrs.H"
}

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
@ -38,9 +38,10 @@ Description
#include "fvCFD.H"
#include "MULES.H"
#include "subCycle.H"
#include "rhoThermo.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "phaseEquationOfState.H"
#include "twoPhaseMixtureThermo.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
@ -103,8 +104,6 @@ int main(int argc, char *argv[])
}
}
rho = alpha1*rho1 + alpha2*rho2;
runTime.write();
Info<< "ExecutionTime = "

View File

@ -28,141 +28,20 @@
#include "createPhi.H"
Info<< "Reading field T\n" << endl;
volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
p_rgh
);
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<< "Calculating phase-fraction alpha" << twoPhaseProperties.phase2Name()
<< nl << endl;
volScalarField alpha2
(
"alpha" + twoPhaseProperties.phase2Name(),
scalar(1) - alpha1
);
Info<< "Reading thermophysical properties\n" << endl;
dimensionedScalar k1
(
"k",
dimensionSet(1, 1, -3, -1, 0),
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
).lookup("k")
);
dimensionedScalar k2
(
"k",
dimensionSet(1, 1, -3, -1, 0),
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
).lookup("k")
);
dimensionedScalar Cv1
(
"Cv",
dimensionSet(0, 2, -2, -1, 0),
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
).lookup("Cv")
);
dimensionedScalar Cv2
(
"Cv",
dimensionSet(0, 2, -2, -1, 0),
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
).lookup("Cv")
);
autoPtr<phaseEquationOfState> eos1
(
phaseEquationOfState::New
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
)
)
);
autoPtr<phaseEquationOfState> eos2
(
phaseEquationOfState::New
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
)
)
);
volScalarField psi1
(
IOobject
(
"psi1",
runTime.timeName(),
mesh
),
eos1->psi(p, T)
);
psi1.oldTime();
volScalarField psi2
(
IOobject
(
"psi2",
runTime.timeName(),
mesh
),
eos2->psi(p, T)
);
psi2.oldTime();
dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
volScalarField rho1("rho1", eos1->rho(p, T));
volScalarField rho2("rho2", eos2->rho(p, T));
volScalarField& p = twoPhaseProperties.p();
volScalarField& T = twoPhaseProperties.T();
volScalarField& rho1 = twoPhaseProperties.thermo1().rho();
const volScalarField& psi1 = twoPhaseProperties.thermo1().psi();
volScalarField& rho2 = twoPhaseProperties.thermo2().rho();
const volScalarField& psi2 = twoPhaseProperties.thermo2().psi();
volScalarField rho
(
@ -178,6 +57,12 @@
);
dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
// Mass flux
// Initialisation does not matter because rhoPhi is reset after the
// alpha1 solution before it is used in the U equation.
@ -202,8 +87,11 @@
// 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 kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -1,184 +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 "wallHeatTransferFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(p, iF),
Tinf_(p.size(), 0.0),
alphaWall_(p.size(), 0.0)
{
refValue() = 0.0;
refGrad() = 0.0;
valueFraction() = 0.0;
}
Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField
(
const wallHeatTransferFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mixedFvPatchScalarField(ptf, p, iF, mapper),
Tinf_(ptf.Tinf_, mapper),
alphaWall_(ptf.alphaWall_, mapper)
{}
Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mixedFvPatchScalarField(p, iF),
Tinf_("Tinf", dict, p.size()),
alphaWall_("alphaWall", dict, p.size())
{
refValue() = Tinf_;
refGrad() = 0.0;
valueFraction() = 0.0;
if (dict.found("value"))
{
fvPatchField<scalar>::operator=
(
scalarField("value", dict, p.size())
);
}
else
{
evaluate();
}
}
Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField
(
const wallHeatTransferFvPatchScalarField& tppsf
)
:
mixedFvPatchScalarField(tppsf),
Tinf_(tppsf.Tinf_),
alphaWall_(tppsf.alphaWall_)
{}
Foam::wallHeatTransferFvPatchScalarField::wallHeatTransferFvPatchScalarField
(
const wallHeatTransferFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(tppsf, iF),
Tinf_(tppsf.Tinf_),
alphaWall_(tppsf.alphaWall_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::wallHeatTransferFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
scalarField::autoMap(m);
Tinf_.autoMap(m);
alphaWall_.autoMap(m);
}
void Foam::wallHeatTransferFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
mixedFvPatchScalarField::rmap(ptf, addr);
const wallHeatTransferFvPatchScalarField& tiptf =
refCast<const wallHeatTransferFvPatchScalarField>(ptf);
Tinf_.rmap(tiptf.Tinf_, addr);
alphaWall_.rmap(tiptf.alphaWall_, addr);
}
void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const fvPatchScalarField& Cpw =
patch().lookupPatchField<volScalarField, scalar>("Cp");
const fvPatchScalarField& kByCpw =
patch().lookupPatchField<volScalarField, scalar>("kByCp");
valueFraction() =
1.0/
(
1.0
+ Cpw*kByCpw*patch().deltaCoeffs()/alphaWall_
);
mixedFvPatchScalarField::updateCoeffs();
}
void Foam::wallHeatTransferFvPatchScalarField::write(Ostream& os) const
{
fvPatchScalarField::write(os);
Tinf_.writeEntry("Tinf", os);
alphaWall_.writeEntry("alphaWall", os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField(fvPatchScalarField, wallHeatTransferFvPatchScalarField);
}
// ************************************************************************* //

View File

@ -1,194 +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::wallHeatTransferFvPatchScalarField
Description
Enthalpy boundary conditions for wall heat transfer
SourceFiles
wallHeatTransferFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef wallHeatTransferFvPatchScalarField_H
#define wallHeatTransferFvPatchScalarField_H
#include "mixedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class wallHeatTransferFvPatch Declaration
\*---------------------------------------------------------------------------*/
class wallHeatTransferFvPatchScalarField
:
public mixedFvPatchScalarField
{
// Private data
//- Tinf
scalarField Tinf_;
//- alphaWall
scalarField alphaWall_;
public:
//- Runtime type information
TypeName("wallHeatTransfer");
// Constructors
//- Construct from patch and internal field
wallHeatTransferFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
wallHeatTransferFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given wallHeatTransferFvPatchScalarField
// onto a new patch
wallHeatTransferFvPatchScalarField
(
const wallHeatTransferFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
wallHeatTransferFvPatchScalarField
(
const wallHeatTransferFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new wallHeatTransferFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
wallHeatTransferFvPatchScalarField
(
const wallHeatTransferFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new wallHeatTransferFvPatchScalarField(*this, iF)
);
}
// Member functions
// Access
//- Return Tinf
const scalarField& Tinf() const
{
return Tinf_;
}
//- Return reference to Tinf to allow adjustment
scalarField& Tinf()
{
return Tinf_;
}
//- Return alphaWall
const scalarField& alphaWall() const
{
return alphaWall_;
}
//- Return reference to alphaWall to allow adjustment
scalarField& alphaWall()
{
return alphaWall_;
}
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,7 +1,4 @@
{
rho1 = eos1->rho(p, T);
rho2 = eos2->rho(p, T);
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
@ -29,28 +26,44 @@
tmp<fvScalarMatrix> p_rghEqnComp1;
tmp<fvScalarMatrix> p_rghEqnComp2;
//if (transonic)
//{
//}
//else
if (pimple.transonic())
{
surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi);
surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi);
p_rghEqnComp1 =
fvc::ddt(rho1) + fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1)
+ correction
(
psi1*fvm::ddt(p_rgh)
+ fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh)
);
deleteDemandDrivenData(p_rghEqnComp1().faceFluxCorrectionPtr());
p_rghEqnComp1().relax();
p_rghEqnComp2 =
fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2)
+ correction
(
psi2*fvm::ddt(p_rgh)
+ fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh)
);
deleteDemandDrivenData(p_rghEqnComp2().faceFluxCorrectionPtr());
p_rghEqnComp2().relax();
}
else
{
p_rghEqnComp1 =
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh))
+ fvc::div(phid1, p_rgh)
- fvc::Sp(fvc::div(phid1), p_rgh);
+ fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1);
p_rghEqnComp2 =
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh))
+ fvc::div(phid2, p_rgh)
- fvc::Sp(fvc::div(phid2), p_rgh);
+ fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2);
}
// 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;
// Cache p_rgh prior to solve for density update
volScalarField p_rgh_0(p_rgh);
while (pimple.correctNonOrthogonal())
{
@ -72,8 +85,8 @@
if (pimple.finalNonOrthogonalIter())
{
// Second part of thermodynamic density update
//thermo.rho() += psi*p_rgh;
//p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
//p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
dgdt =
(
@ -91,8 +104,13 @@
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
rho1 = eos1->rho(p, T);
rho2 = eos2->rho(p, T);
// Update densities from change in p_rgh
rho1 += psi1*(p_rgh - p_rgh_0);
rho2 += psi2*(p_rgh - p_rgh_0);
rho = alpha1*rho1 + alpha2*rho2;
K = 0.5*magSqr(U);
Info<< "max(U) " << max(mag(U)).value() << endl;
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;

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

@ -0,0 +1,10 @@
EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseMixture \
-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

@ -0,0 +1,287 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::twoPhaseMixtureThermo
Description
SourceFiles
twoPhaseMixtureThermoI.H
twoPhaseMixtureThermo.C
twoPhaseMixtureThermoIO.C
\*---------------------------------------------------------------------------*/
#ifndef twoPhaseMixtureThermo_H
#define twoPhaseMixtureThermo_H
#include "rhoThermo.H"
#include "psiThermo.H"
#include "twoPhaseMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class twoPhaseMixtureThermo Declaration
\*---------------------------------------------------------------------------*/
class twoPhaseMixtureThermo
:
public psiThermo,
public twoPhaseMixture
{
// Private data
//- Thermo-package of phase 1
autoPtr<rhoThermo> thermo1_;
//- Thermo-package of phase 2
autoPtr<rhoThermo> thermo2_;
public:
//- Runtime type information
TypeName("twoPhaseMixtureThermo");
// Constructors
//- Construct from mesh
twoPhaseMixtureThermo
(
const fvMesh& mesh
);
//- Destructor
virtual ~twoPhaseMixtureThermo();
// Member Functions
const rhoThermo& thermo1() const
{
return thermo1_();
}
const rhoThermo& thermo2() const
{
return thermo2_();
}
rhoThermo& thermo1()
{
return thermo1_();
}
rhoThermo& thermo2()
{
return thermo2_();
}
//- Update properties
virtual void correct();
//- Return true if the equation of state is incompressible
// i.e. rho != f(p)
virtual bool incompressible() const;
//- Return true if the equation of state is isochoric
// i.e. rho = const
virtual bool isochoric() const;
// Access to thermodynamic state variables
//- Enthalpy/Internal energy [J/kg]
// Non-const access allowed for transport equations
virtual volScalarField& he()
{
notImplemented("twoPhaseMixtureThermo::he()");
return thermo1_->he();
}
//- Enthalpy/Internal energy [J/kg]
virtual const volScalarField& he() const
{
notImplemented("twoPhaseMixtureThermo::he() const");
return thermo1_->he();
}
//- Enthalpy/Internal energy
// for given pressure and temperature [J/kg]
virtual tmp<volScalarField> he
(
const volScalarField& p,
const volScalarField& T
) const;
//- Enthalpy/Internal energy for cell-set [J/kg]
virtual tmp<scalarField> he
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const;
//- Enthalpy/Internal energy for patch [J/kg]
virtual tmp<scalarField> he
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
//- Chemical enthalpy [J/kg]
virtual tmp<volScalarField> hc() const;
//- Temperature from enthalpy/internal energy for cell-set
virtual tmp<scalarField> THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0, // starting temperature
const labelList& cells
) const;
//- Temperature from enthalpy/internal energy for patch
virtual tmp<scalarField> THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0, // starting temperature
const label patchi
) const;
// Fields derived from thermodynamic state variables
//- Heat capacity at constant pressure [J/kg/K]
virtual tmp<volScalarField> Cp() const;
//- Heat capacity at constant pressure for patch [J/kg/K]
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
//- Heat capacity at constant volume [J/kg/K]
virtual tmp<volScalarField> Cv() const;
//- Heat capacity at constant volume for patch [J/kg/K]
virtual tmp<scalarField> Cv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
//- gamma = Cp/Cv []
virtual tmp<volScalarField> gamma() const;
//- gamma = Cp/Cv for patch []
virtual tmp<scalarField> gamma
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
//- Heat capacity at constant pressure/volume [J/kg/K]
virtual tmp<volScalarField> Cpv() const;
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
virtual tmp<scalarField> Cpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
//- Heat capacity ratio []
virtual tmp<volScalarField> CpByCpv() const;
//- Heat capacity ratio for patch []
virtual tmp<scalarField> CpByCpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
// Fields derived from transport state variables
//- Thermal diffusivity for temperature of mixture [J/m/s/K]
virtual tmp<volScalarField> kappa() const;
//- Thermal diffusivity of mixture for patch [J/m/s/K]
virtual tmp<scalarField> kappa
(
const label patchi
) const;
//- Effective thermal diffusivity of mixture [J/m/s/K]
virtual tmp<volScalarField> kappaEff
(
const volScalarField& alphat
) const;
//- Effective thermal diffusivity of mixture for patch [J/m/s/K]
virtual tmp<scalarField> kappaEff
(
const scalarField& alphat,
const label patchi
) const;
//- Effective thermal diffusivity of mixture [J/m/s/K]
virtual tmp<volScalarField> alphaEff
(
const volScalarField& alphat
) const;
//- Effective thermal diffusivity of mixture for patch [J/m/s/K]
virtual tmp<scalarField> alphaEff
(
const scalarField& alphat,
const label patchi
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -19,34 +19,46 @@
fvScalarMatrix he1Eqn
(
fvm::ddt(alpha1, he1)
+ fvm::div(alphaPhi1, he1)
fvm::ddt(alpha1, he1) + fvm::div(alphaPhi1, he1)
+ fvc::ddt(alpha1, K1) + fvc::div(alphaPhi1, K1)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), he1)
- (fvc::ddt(alpha1) + fvc::div(alphaPhi1))*K1
+ (
he1.name() == thermo1.phasePropertyName("e")
? fvc::div(alphaPhi1, p)
: -dalpha1pdt
)/rho1
- fvm::laplacian(k1, he1)
==
heatTransferCoeff*(thermo2.T() - thermo1.T())/rho1
+ heatTransferCoeff*he1/Cpv1/rho1
- fvm::Sp(heatTransferCoeff/Cpv1/rho1, he1)
+ alpha1*(dpdt/rho1 - (fvc::ddt(K1) + fvc::div(phi1, K1)))
);
fvScalarMatrix he2Eqn
(
fvm::ddt(alpha2, he2)
+ fvm::div(alphaPhi2, he2)
fvm::ddt(alpha2, he2) + fvm::div(alphaPhi2, he2)
+ fvc::ddt(alpha2, K2) + fvc::div(alphaPhi2, K2)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), he2)
- (fvc::ddt(alpha2) + fvc::div(alphaPhi2))*K2
+ (
he2.name() == thermo2.phasePropertyName("e")
? fvc::div(alphaPhi2, p)
: -dalpha2pdt
)/rho2
- fvm::laplacian(k2, he2)
==
heatTransferCoeff*(thermo1.T() - thermo2.T())/rho2
+ heatTransferCoeff*he2/Cpv2/rho2
- fvm::Sp(heatTransferCoeff/Cpv2/rho2, he2)
+ alpha2*(dpdt/rho2 - (fvc::ddt(K2) + fvc::div(phi2, K2)))
);
he1Eqn.relax();

View File

@ -1,3 +1,7 @@
mrfZones.correctBoundaryVelocity(U1);
mrfZones.correctBoundaryVelocity(U2);
mrfZones.correctBoundaryVelocity(U);
fvVectorMatrix U1Eqn(U1, U1.dimensions()*dimVol/dimTime);
fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);

View File

@ -104,6 +104,35 @@ surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2);
{
alphaPhi1 = alphaPhic1;
}
/*
// Legacy semi-implicit and potentially unbounded form
fvScalarMatrix alpha1Eqn
(
fvm::ddt(alpha1)
+ fvm::div(phic, alpha1, alphaScheme)
+ fvm::div
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
==
fvm::Sp(Sp, alpha1) + Su
);
alpha1Eqn.relax();
alpha1Eqn.solve();
if (nAlphaSubCycles > 1)
{
alphaPhi1 += (runTime.deltaT()/totalDeltaT)*alpha1Eqn.flux();
}
else
{
alphaPhi1 = alpha1Eqn.flux();
}
*/
}
if (g0.value() > 0.0)

View File

@ -62,10 +62,10 @@
volScalarField& p = thermo1.p();
volScalarField rho1("rho" + phase1Name, thermo1.rho());
volScalarField& rho1 = thermo1.rho();
const volScalarField& psi1 = thermo1.psi();
volScalarField rho2("rho" + phase2Name, thermo2.rho());
volScalarField& rho2 = thermo2.rho();
const volScalarField& psi2 = thermo2.psi();
volVectorField U
@ -275,8 +275,8 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
Info<< "Creating field dalpha1pdt\n" << endl;
volScalarField dalpha1pdt
(
IOobject
(
@ -285,7 +285,20 @@
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
dimensionedScalar("dalpha1pdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field dalpha2pdt\n" << endl;
volScalarField dalpha2pdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dalpha2pdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;

View File

@ -1,7 +1,4 @@
{
rho1 = thermo1.rho();
rho2 = thermo2.rho();
surfaceScalarField alpha1f(fvc::interpolate(alpha1));
surfaceScalarField alpha2f(scalar(1) - alpha1f);
@ -91,10 +88,7 @@
tmp<fvScalarMatrix> pEqnComp1;
tmp<fvScalarMatrix> pEqnComp2;
//if (transonic)
//{
//}
//else
if (pimple.transonic())
{
surfaceScalarField phid1
(
@ -107,17 +101,42 @@
fvc::interpolate(psi2)*phi2
);
pEqnComp1 =
fvc::ddt(rho1)
+ fvc::div(phi1, rho1) - fvc::Sp(fvc::div(phi1), rho1)
+ correction
(
psi1*fvm::ddt(p)
+ fvm::div(phid1, p) - fvm::Sp(fvc::div(phid1), p)
);
deleteDemandDrivenData(pEqnComp1().faceFluxCorrectionPtr());
pEqnComp1().relax();
pEqnComp2 =
fvc::ddt(rho2)
+ fvc::div(phi2, rho2) - fvc::Sp(fvc::div(phi2), rho2)
+ correction
(
psi2*fvm::ddt(p)
+ fvm::div(phid2, p) - fvm::Sp(fvc::div(phid2), p)
);
deleteDemandDrivenData(pEqnComp2().faceFluxCorrectionPtr());
pEqnComp2().relax();
}
else
{
pEqnComp1 =
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p))
+ fvc::div(phid1, p)
- fvc::Sp(fvc::div(phid1), p);
+ fvc::div(phi1, rho1) - fvc::Sp(fvc::div(phi1), rho1);
pEqnComp2 =
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p))
+ fvc::div(phid2, p)
- fvc::Sp(fvc::div(phid2), p);
+ fvc::div(phi2, rho2) - fvc::Sp(fvc::div(phi2), rho2);
}
// Cache p prior to solve for density update
volScalarField p_0(p);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqnIncomp
@ -182,16 +201,20 @@
p = max(p, pMin);
thermo1.correct();
thermo2.correct();
rho1 = thermo1.rho();
rho2 = thermo2.rho();
// Update densities from change in p
rho1 += psi1*(p - p_0);
rho2 += psi2*(p - p_0);
K1 = 0.5*magSqr(U1);
K2 = 0.5*magSqr(U2);
if (thermo1.dpdt())
{
dpdt = fvc::ddt(p);
dalpha1pdt = fvc::ddt(alpha1, p);
}
if (thermo2.dpdt())
{
dalpha2pdt = fvc::ddt(alpha2, p);
}
}

View File

@ -26,6 +26,7 @@ License
#include "phaseModel.H"
#include "diameterModel.H"
#include "fixedValueFvPatchFields.H"
#include "slipFvPatchFields.H"
#include "surfaceInterpolate.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -118,7 +119,11 @@ Foam::phaseModel::phaseModel
forAll(U_.boundaryField(), i)
{
if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
if
(
isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i])
|| isA<slipFvPatchVectorField>(U_.boundaryField()[i])
)
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}

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/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -11,7 +12,8 @@ EXE_INC = \
EXE_LIBS = \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseMixture \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -18,7 +18,7 @@
)
+ fvc::flux
(
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
@ -27,6 +27,7 @@
MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0);
//MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
alpha2 = 1.0 - alpha1;
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
}

View File

@ -23,4 +23,4 @@ else
#include "alphaEqn.H"
}
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
rho == alpha1*rho1 + alpha2*rho2;

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/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -10,8 +11,9 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-ltwoPhaseMixture \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

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

View File

@ -18,7 +18,7 @@
)
+ fvc::flux
(
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
@ -26,6 +26,7 @@
MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
alpha2 = 1.0 - alpha1;
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
}

View File

@ -23,4 +23,4 @@ else
#include "alphaEqn.H"
}
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
rho == alpha1*rho1 + alpha2*rho2;

View File

@ -30,9 +30,10 @@
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phi);
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
@ -48,7 +49,7 @@
mesh,
IOobject::READ_IF_PRESENT
),
alpha1*rho1 + (scalar(1) - alpha1)*rho2,
alpha1*rho1 + alpha2*rho2,
alpha1.boundaryField().types()
);
rho.oldTime();

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -12,8 +13,9 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-ltwoPhaseMixture \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -53,6 +53,8 @@
fvc::makeRelative(phi, U);
}
}
}
phi.oldTime() = phi;
#include "continuityErrs.H"
}

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/twoPhaseMixture/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,8 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseMixture \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -10,8 +11,9 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-ltwoPhaseMixture \
-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/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@ -7,8 +8,9 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-ltwoPhaseMixture \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-ltwoPhaseProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -49,8 +49,6 @@
}
}
#include "continuityErrs.H"
p == p_rgh + rho*gh;
if (p_rgh.needReference())

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,3 +1,5 @@
#include "mrfZonesCorrectBCs.H"
PtrList<fvVectorMatrix> UEqns(fluid.phases().size());
autoPtr<multiphaseSystem::dragCoeffFields> dragCoeffs(fluid.dragCoeffs());

View File

@ -0,0 +1,6 @@
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
{
mrfZones.correctBoundaryVelocity(iter().U());
}
mrfZones.correctBoundaryVelocity(U);

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
@ -418,6 +418,47 @@ Foam::multiphaseSystem::multiphaseSystem
).ptr()
);
}
forAllConstIter(PtrDictionary<phaseModel>, phases_, iter1)
{
const phaseModel& phase1 = iter1();
forAllConstIter(PtrDictionary<phaseModel>, phases_, iter2)
{
const phaseModel& phase2 = iter2();
if (&phase2 != &phase1)
{
scalarCoeffSymmTable::const_iterator sigma
(
sigmas_.find(interfacePair(phase1, phase2))
);
if (sigma != sigmas_.end())
{
scalarCoeffSymmTable::const_iterator cAlpha
(
cAlphas_.find(interfacePair(phase1, phase2))
);
if (cAlpha == cAlphas_.end())
{
WarningIn
(
"multiphaseSystem::multiphaseSystem"
"(const volVectorField& U,"
"const surfaceScalarField& phi)"
) << "Compression coefficient not specified for "
"phase pair ("
<< phase1.name() << ' ' << phase2.name()
<< ") for which a surface tension "
"coefficient is specified"
<< endl;
}
}
}
}
}
}

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
@ -26,6 +26,7 @@ License
#include "phaseModel.H"
#include "diameterModel.H"
#include "fixedValueFvPatchFields.H"
#include "slipFvPatchFields.H"
#include "surfaceInterpolate.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -152,7 +153,11 @@ Foam::phaseModel::phaseModel
forAll(U_.boundaryField(), i)
{
if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
if
(
isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i])
|| isA<slipFvPatchVectorField>(U_.boundaryField()[i])
)
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I../interFoam \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/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 \
-ltwoPhaseMixture \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -12,7 +12,8 @@
alpha1Eqn.solve();
alpha2 = 1.0 - alpha1;
rhoPhi += alpha1Eqn.flux()*(rho1 - rho2);
}
rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2;
rho = alpha1*rho1 + alpha2*rho2;

View File

@ -23,4 +23,4 @@ else
#include "alphaEqn.H"
}
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
rho == alpha1*rho1 + alpha2*rho2;

View File

@ -29,9 +29,10 @@
#include "createPhi.H"
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phi);
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
@ -42,7 +43,7 @@
dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab"));
// Need to store rho for ddt(rho, U)
volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2);
volScalarField rho("rho", alpha1*rho1 + alpha2*rho2);
rho.oldTime();

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

@ -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
@ -25,6 +25,7 @@ License
#include "phaseModel.H"
#include "fixedValueFvPatchFields.H"
#include "slipFvPatchFields.H"
#include "surfaceInterpolate.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -114,7 +115,11 @@ Foam::phaseModel::phaseModel
forAll(U_.boundaryField(), i)
{
if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
if
(
isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i])
|| isA<slipFvPatchVectorField>(U_.boundaryField()[i])
)
{
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
}

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
@ -181,7 +181,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
gradient() =
(
(traction_ + pressure_*n)/rho
(traction_ - pressure_*n)/rho
+ twoMuLambda*fvPatchField<vector>::snGrad() - (n & sigmaD)
)/twoMuLambda;

View File

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

View File

@ -56,9 +56,9 @@ int main(int argc, char *argv[])
Info<< hmm << endl;
SquareMatrix<scalar> hmm3(Sin);
//SquareMatrix<scalar> hmm3(Sin);
Info<< hmm3 << endl;
//Info<< hmm3 << endl;
SquareMatrix<scalar> hmm4;
@ -71,6 +71,38 @@ int main(int argc, char *argv[])
hmm4 = hmm5;
Info<< hmm5 << endl;
{
scalarSymmetricSquareMatrix symmMatrix(3, 3, 0);
symmMatrix(0, 0) = 4;
symmMatrix(1, 0) = 12;
symmMatrix(1, 1) = 37;
symmMatrix(2, 0) = -16;
symmMatrix(2, 1) = -43;
symmMatrix(2, 2) = 98;
Info<< "Symmetric Square Matrix = " << symmMatrix << endl;
Info<< "Inverse = " << inv(symmMatrix) << endl;
Info<< "Determinant = " << det(symmMatrix) << endl;
scalarSymmetricSquareMatrix symmMatrix2(symmMatrix);
LUDecompose(symmMatrix2);
Info<< "Inverse = " << invDecomposed(symmMatrix2) << endl;
Info<< "Determinant = " << detDecomposed(symmMatrix2) << endl;
scalarDiagonalMatrix rhs(3, 0);
rhs[0] = 1;
rhs[1] = 2;
rhs[2] = 3;
LUsolve(symmMatrix, rhs);
Info<< "Decomposition = " << symmMatrix << endl;
Info<< "Solution = " << rhs << endl;
}
{
scalarSquareMatrix squareMatrix(3, 3, 0);
@ -97,64 +129,6 @@ int main(int argc, char *argv[])
Info<< "Solution = " << rhs << endl;
}
{
scalarSymmetricSquareMatrix symmMatrix(4, 4, 0);
symmMatrix(0, 0) = 3.44854;
symmMatrix(1, 0) = -2.70766;
symmMatrix(1, 1) = 5.49922;
symmMatrix(2, 0) = -0.96245;
symmMatrix(2, 1) = 2.40948;
symmMatrix(2, 2) = 1.56918;
symmMatrix(3, 0) = 1.95912;
symmMatrix(3, 1) = -3.46118;
symmMatrix(3, 2) = -1.01410;
symmMatrix(3, 3) = 3.24753;
Info<< "Symmetric Square Matrix = " << symmMatrix << endl;
Info<< "Inverse = " << inv(symmMatrix) << endl;
Info<< "Determinant = " << det(symmMatrix) << endl;
scalarSymmetricSquareMatrix symmMatrix2(symmMatrix);
LUDecompose(symmMatrix2);
Info<< "Inverse = " << invDecomposed(symmMatrix2) << endl;
Info<< "Determinant = " << detDecomposed(symmMatrix2) << endl;
scalarDiagonalMatrix rhs(4, 0);
rhs[0] = 1;
rhs[1] = 2;
rhs[2] = 3;
rhs[3] = 4;
LUsolve(symmMatrix, rhs);
Info<< "Decomposition = " << symmMatrix << endl;
Info<< "Solution = " << rhs << endl;
}
{
IFstream str("datafile");
scalarSymmetricSquareMatrix symmMatrix(str);
Info<< "Symmetric Square Matrix = " << symmMatrix << endl;
Info<< "Inverse = " << inv(symmMatrix) << endl;
Info<< "Determinant (ans = 0.24130) = " << det(symmMatrix) << endl;
scalarDiagonalMatrix rhs(4, 0);
rhs[0] = 1;
rhs[1] = 2;
rhs[2] = 3;
rhs[3] = 4;
LUsolve(symmMatrix, rhs);
Info<< "Solution = " << rhs << endl;
}
Info<< "\nEnd\n" << endl;
return 0;

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
@ -41,50 +41,50 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::validArgs.append("patch");
argList::validArgs.append("(patches)");
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
const polyBoundaryMesh& patches = mesh.boundaryMesh();
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
// Get name of patch
const word patchName = args[1];
labelList patchIDs
(
pbm.patchSet(wordReList(IStringStream(args[1])())).sortedToc()
);
// Find the label in patches by name.
label patchI = patches.findPatchID(patchName);
Info<< "Starting walk from patches "
<< UIndirectList<word>(pbm.names(), patchIDs)
<< nl
<< endl;
label nPoints = 0;
forAll(patchIDs, i)
{
// Test whether any processor has patch
label maxPatchI = patchI;
reduce(maxPatchI, maxOp<label>());
if (maxPatchI == -1)
{
FatalErrorIn(args.executable())
<< "Cannot find patch named " << patchName << exit(FatalError);
}
nPoints += pbm[patchIDs[i]].nPoints();
}
Info<< "Seeding " << returnReduce(nPoints, sumOp<label>())
<< " patch points" << nl << endl;
// Set initial changed points to all the patch points(if patch present)
List<pointEdgePoint> wallInfo;
labelList wallPoints;
List<pointEdgePoint> wallInfo(nPoints);
labelList wallPoints(nPoints);
nPoints = 0;
if (patchI != -1)
forAll(patchIDs, i)
{
// Retrieve the patch now we have its index in patches.
const polyPatch& pp = mesh.boundaryMesh()[patchI];
const polyPatch& pp = pbm[patchIDs[i]];
wallPoints = pp.meshPoints();
wallInfo.setSize(pp.nPoints());
forAll(pp.localPoints(), ppI)
forAll(pp.meshPoints(), ppI)
{
wallInfo[ppI] = pointEdgePoint(pp.localPoints()[ppI], 0.0);
label meshPointI = pp.meshPoints()[ppI];
wallPoints[nPoints] = meshPointI;
wallInfo[nPoints] = pointEdgePoint(mesh.points()[meshPointI], 0.0);
nPoints++;
}
}

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
@ -53,7 +53,9 @@ Description
//#include "upwindCECCellToFaceStencilObject.H"
//#include "upwindCFCCellToFaceStencilObject.H"
#include "centredCFCFaceToCellStencilObject.H"
//#include "centredCFCFaceToCellStencilObject.H"
#include "centredCECCellToCellStencilObject.H"
using namespace Foam;
@ -437,20 +439,20 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~~~~~~~~~~~~
{
const extendedCentredFaceToCellStencil& addressing =
centredCFCFaceToCellStencilObject::New
const extendedCentredCellToCellStencil& addressing =
centredCECCellToCellStencilObject::New
(
mesh
);
Info<< "cellFaceCell:" << endl;
Info<< "cellCellCell:" << endl;
writeStencilStats(addressing.stencil());
// Collect stencil face centres
// Collect stencil cell centres
List<List<point> > stencilPoints(mesh.nCells());
addressing.collectData
(
mesh.Cf(),
mesh.C(),
stencilPoints
);

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

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

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