Merge remote-tracking branch 'origin/master' into feature/procAgglom

Conflicts:
	src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H
	src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C
	src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
	src/OpenFOAM/db/IOstreams/Pstreams/combineGatherScatter.C
	src/OpenFOAM/db/IOstreams/Pstreams/gatherScatter.C
	src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C
	src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.C
	src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H
	src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H
	src/finiteVolume/fvMesh/fvMesh.H
This commit is contained in:
mattijs
2013-04-23 09:41:15 +01:00
1468 changed files with 43779 additions and 20227 deletions

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
lang="en" xml:lang="en">
<head> <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 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="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="author" content="The OpenFOAM Foundation"/>
<meta name="description" content=""/> <meta name="description" content=""/>
<meta name="keywords" content=""/> <meta name="keywords" content=""/>
@ -44,6 +44,12 @@ lang="en" xml:lang="en">
dt { font-weight: bold; } dt { font-weight: bold; }
div.figure { padding: 0.5em; } div.figure { padding: 0.5em; }
div.figure p { text-align: center; } div.figure p { text-align: center; }
div.inlinetask {
padding:10px;
border:2px solid gray;
margin:10px;
background: #ffffcc;
}
textarea { overflow-x: auto; } textarea { overflow-x: auto; }
.linenr { font-size:smaller } .linenr { font-size:smaller }
.code-highlighted {background-color:#ffff00;} .code-highlighted {background-color:#ffff00;}
@ -79,27 +85,32 @@ lang="en" xml:lang="en">
</head> </head>
<body> <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"> <div id="table-of-contents">
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#sec-1">1 About OpenFOAM </a></li> <li><a href="#sec-1">1 About OpenFOAM</a></li>
<li><a href="#sec-2">2 Copyright </a></li> <li><a href="#sec-2">2 Copyright</a></li>
<li><a href="#sec-3">3 Download and installation instructions </a></li> <li><a href="#sec-3">3 Download and installation instructions</a></li>
<li><a href="#sec-4">4 Release notes </a></li> <li><a href="#sec-4">4 Release notes</a></li>
<li><a href="#sec-5">5 Documentation </a></li> <li><a href="#sec-5">5 Documentation</a></li>
<li><a href="#sec-6">6 Support and development contracts </a></li> <li><a href="#sec-6">6 Support and development contracts</a></li>
<li><a href="#sec-7">7 Reporting Bugs in OpenFOAM </a></li> <li><a href="#sec-7">7 Reporting Bugs in OpenFOAM</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-1" class="outline-2"> <div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> About OpenFOAM </h2> <h2 id="sec-1"><span class="section-number-2">1</span> About OpenFOAM</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> OpenFOAM is a free, open source computational fluid dynamcis (CFD) software <p> OpenFOAM is a free, open source computational fluid dynamcis (CFD) software
@ -114,7 +125,7 @@ lang="en" xml:lang="en">
</div> </div>
<div id="outline-container-2" class="outline-2"> <div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Copyright </h2> <h2 id="sec-2"><span class="section-number-2">2</span> Copyright</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> OpenFOAM is free software: you can redistribute it and/or modify it under the <p> OpenFOAM is free software: you can redistribute it and/or modify it under the
@ -129,7 +140,7 @@ lang="en" xml:lang="en">
</div> </div>
<div id="outline-container-3" class="outline-2"> <div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> Download and installation instructions </h2> <h2 id="sec-3"><span class="section-number-2">3</span> Download and installation instructions</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
<ul> <ul>
@ -144,17 +155,17 @@ lang="en" xml:lang="en">
</div> </div>
<div id="outline-container-4" class="outline-2"> <div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Release notes </h2> <h2 id="sec-4"><span class="section-number-2">4</span> Release notes</h2>
<div class="outline-text-2" id="text-4"> <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> </p>
</div> </div>
</div> </div>
<div id="outline-container-5" class="outline-2"> <div id="outline-container-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> Documentation </h2> <h2 id="sec-5"><span class="section-number-2">5</span> Documentation</h2>
<div class="outline-text-2" id="text-5"> <div class="outline-text-2" id="text-5">
<p> <a href="http://www.OpenFOAM.com/docs">http://www.OpenFOAM.com/docs</a> <p> <a href="http://www.OpenFOAM.com/docs">http://www.OpenFOAM.com/docs</a>
@ -164,7 +175,7 @@ lang="en" xml:lang="en">
</div> </div>
<div id="outline-container-6" class="outline-2"> <div id="outline-container-6" class="outline-2">
<h2 id="sec-6"><span class="section-number-2">6</span> Support and development contracts </h2> <h2 id="sec-6"><span class="section-number-2">6</span> Support and development contracts</h2>
<div class="outline-text-2" id="text-6"> <div class="outline-text-2" id="text-6">
<p> <a href="http://www.OpenFOAM.com/support">http://www.OpenFOAM.com/support</a> <p> <a href="http://www.OpenFOAM.com/support">http://www.OpenFOAM.com/support</a>
@ -174,17 +185,19 @@ lang="en" xml:lang="en">
</div> </div>
<div id="outline-container-7" class="outline-2"> <div id="outline-container-7" class="outline-2">
<h2 id="sec-7"><span class="section-number-2">7</span> Reporting Bugs in OpenFOAM </h2> <h2 id="sec-7"><span class="section-number-2">7</span> Reporting Bugs in OpenFOAM</h2>
<div class="outline-text-2" id="text-7"> <div class="outline-text-2" id="text-7">
<p> <a href="http://www.OpenFOAM.com/bugs">http://www.OpenFOAM.com/bugs</a> <p> <a href="http://www.OpenFOAM.com/bugs">http://www.OpenFOAM.com/bugs</a>
</p></div> </p></div>
</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>
<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> </div>
</body> </body>
</html> </html>

View File

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

View File

@ -1,4 +1,11 @@
EXE_INC = \ 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 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,7 +31,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "fvIOoptionList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,17 +49,20 @@ int main(int argc, char *argv[])
#include "createMesh.H" #include "createMesh.H"
#include "readControls.H" #include "readControls.H"
#include "createFields.H" #include "createFields.H"
#include "createFvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< nl << "Calculating potential flow" << endl; Info<< nl << "Calculating potential flow" << endl;
// Since solver contains no time loop it would never execute // 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(); runTime.functionObjects().start();
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
fvOptions.relativeFlux(phi);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
@ -87,6 +90,8 @@ int main(int argc, char *argv[])
} }
} }
fvOptions.absoluteFlux(phi);
Info<< "continuity error = " Info<< "continuity error = "
<< mag(fvc::div(phi))().weightedAverage(mesh.V()).value() << mag(fvc::div(phi))().weightedAverage(mesh.V()).value()
<< endl; << endl;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -116,7 +116,7 @@ void PDRkEpsilon::correct()
} }
tmp<volTensorField> tgradU = fvc::grad(U_); 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(); tgradU.clear();
// Update espsilon and G at the wall // Update espsilon and G at the wall

View File

@ -15,15 +15,15 @@
} }
label nSpecie = Y.size(); label nSpecie = Y.size();
PtrList<gasThermoPhysics> specieData(Y.size()); PtrList<gasHThermoPhysics> specieData(Y.size());
forAll(specieData, i) forAll(specieData, i)
{ {
specieData.set specieData.set
( (
i, i,
new gasThermoPhysics new gasHThermoPhysics
( (
dynamic_cast<const reactingMixture<gasThermoPhysics>&> dynamic_cast<const reactingMixture<gasHThermoPhysics>&>
(thermo).speciesData()[i] (thermo).speciesData()[i]
) )
); );

View File

@ -27,7 +27,7 @@
fvScalarMatrix pDDtEqn fvScalarMatrix pDDtEqn
( (
fvc::ddt(rho) + fvc::div(phiHbyA) 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()) while (pimple.correctNonOrthogonal())

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -185,12 +185,10 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
dimensionedScalar Pr dimensionedScalar Pr
( (
dimensionedScalar::lookupOrDefault "Pr",
( dimless,
"Pr", thermophysicalProperties.subDict("mixture").subDict("transport")
thermophysicalProperties, .lookup("Pr")
1.0
)
); );
Field<scalar> C2 Field<scalar> C2

View File

@ -1,23 +0,0 @@
Info<< "Reading thermophysicalProperties\n" << endl;
// Pr defined as a separate constant to enable calculation of k, currently
// inaccessible through thermo
IOdictionary thermophysicalProperties
(
IOobject
(
"thermophysicalProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar Pr
(
"Pr",
dimless,
thermophysicalProperties.subDict("mixture").subDict("transport")
.lookup("Pr")
);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,7 +46,6 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createFields.H" #include "createFields.H"
#include "readThermophysicalProperties.H"
#include "readTimeControls.H" #include "readTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -166,7 +165,6 @@ int main(int argc, char *argv[])
mesh.movePoints(motionPtr->newPoints()); mesh.movePoints(motionPtr->newPoints());
phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg; phi = aphiv_pos*rho_pos + aphiv_neg*rho_neg;
Info<< phi.boundaryField()[0] << endl;
surfaceVectorField phiUp surfaceVectorField phiUp
( (
@ -236,13 +234,10 @@ int main(int argc, char *argv[])
if (!inviscid) if (!inviscid)
{ {
volScalarField k("k", thermo.Cp()*muEff/Pr);
solve solve
( (
fvm::ddt(rho, e) - fvc::ddt(rho, e) fvm::ddt(rho, e) - fvc::ddt(rho, e)
- fvm::laplacian(turbulence->alphaEff(), e) - fvm::laplacian(turbulence->alphaEff(), e)
+ fvc::laplacian(turbulence->alpha(), e)
- fvc::laplacian(k, T)
); );
thermo.correct(); thermo.correct();
rhoE = rho*(e + 0.5*magSqr(U)); rhoE = rho*(e + 0.5*magSqr(U));

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,7 +45,6 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createFields.H" #include "createFields.H"
#include "readThermophysicalProperties.H"
#include "readTimeControls.H" #include "readTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -5,11 +5,10 @@ rho.relax();
volScalarField rAU(1.0/UEqn().A()); volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(rho, U))().H(); HbyA = rAU*UEqn().H();
if (pimple.nCorrPIMPLE() <= 1) if (pimple.nCorrPISO() <= 1)
{ {
UEqn.clear(); UEqn.clear();
} }
@ -26,6 +25,8 @@ if (pimple.transonic())
) )
); );
fvOptions.relativeFlux(fvc::interpolate(psi), phid);
surfaceScalarField phic surfaceScalarField phic
( (
"phic", "phic",
@ -48,12 +49,9 @@ if (pimple.transonic())
fvOptions(psi, p, rho.name()) fvOptions(psi, p, rho.name())
); );
// Relax the pressure equation to maintain diagonal dominance
pEqn.relax();
fvOptions.constrain(pEqn); fvOptions.constrain(pEqn);
pEqn.solve(); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter()) if (pimple.finalNonOrthogonalIter())
{ {
@ -73,6 +71,8 @@ else
) )
); );
fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA);
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf(); phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
HbyA -= (rAU - rAtU)*fvc::grad(p); HbyA -= (rAU - rAtU)*fvc::grad(p);
@ -91,7 +91,7 @@ else
fvOptions.constrain(pEqn); fvOptions.constrain(pEqn);
pEqn.solve(); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter()) if (pimple.finalNonOrthogonalIter())
{ {

View File

@ -1,9 +1,4 @@
{ {
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A()); volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H(); HbyA = rAU*UEqn().H();

View File

@ -4,12 +4,12 @@
( (
fvm::div(phi, U) fvm::div(phi, U)
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
==
fvOptions(rho, U)
); );
UEqn().relax(); UEqn().relax();
mrfZones.addCoriolis(rho, UEqn());
// Include the porous media resistance and solve the momentum equation // Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by // either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal // including the spherical part of the resistance in the momentum diagonal
@ -30,7 +30,7 @@
for (int UCorr=0; UCorr<nUCorr; UCorr++) for (int UCorr=0; UCorr<nUCorr; UCorr++)
{ {
U = trTU() & ((UEqn() == fvOptions(rho, U))().H() - gradp); U = trTU() & (UEqn().H() - gradp);
} }
U.correctBoundaryConditions(); U.correctBoundaryConditions();
@ -42,7 +42,7 @@
fvOptions.constrain(UEqn()); fvOptions.constrain(UEqn());
solve(UEqn() == -fvc::grad(p) + fvOptions(rho, U)); solve(UEqn() == -fvc::grad(p));
fvOptions.correct(U); fvOptions.correct(U);

View File

@ -1,6 +1,3 @@
IOMRFZoneList mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
IOporosityModelList pZones(mesh); IOporosityModelList pZones(mesh);
Switch pressureImplicitPorosity(false); Switch pressureImplicitPorosity(false);

View File

@ -1,20 +1,15 @@
{ {
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
if (pressureImplicitPorosity) if (pressureImplicitPorosity)
{ {
HbyA = trTU() & (UEqn() == fvOptions(rho, U))().H(); HbyA = trTU() & UEqn().H();
} }
else else
{ {
HbyA = trAU()*(UEqn() == fvOptions(rho, U))().H(); HbyA = trAU()*UEqn().H();
} }
UEqn.clear(); UEqn.clear();
@ -27,7 +22,7 @@
fvc::interpolate(rho*HbyA) & mesh.Sf() fvc::interpolate(rho*HbyA) & mesh.Sf()
); );
mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA); fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA);
closedVolume = adjustPhi(phiHbyA, U, p); closedVolume = adjustPhi(phiHbyA, U, p);

View File

@ -27,14 +27,13 @@ Application
Description Description
Steady-state solver for turbulent flow of compressible fluids with Steady-state solver for turbulent flow of compressible fluids with
RANS turbulence modelling, implicit or explicit porosity treatment RANS turbulence modelling, implicit or explicit porosity treatment
and MRF for HVAC and similar applications. and run-time selectable finite volume sources.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "rhoThermo.H" #include "rhoThermo.H"
#include "RASModel.H" #include "RASModel.H"
#include "IOMRFZoneList.H"
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "IOporosityModelList.H" #include "IOporosityModelList.H"
#include "simpleControl.H" #include "simpleControl.H"

View File

@ -1,13 +1,8 @@
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A()); volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(rho, U))().H(); HbyA = rAU*UEqn().H();
UEqn.clear(); UEqn.clear();

View File

@ -4,11 +4,13 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lincompressibleTurbulenceModel \ -lincompressibleTurbulenceModel \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleTransportModels -lincompressibleTransportModels \
-lradiationModels

View File

@ -1,18 +1,22 @@
{ {
kappat = turbulence->nut()/Prt; alphat = turbulence->nut()/Prt;
kappat.correctBoundaryConditions(); alphat.correctBoundaryConditions();
volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat); volScalarField alphaEff("alphaEff", turbulence->nu()/Pr + alphat);
fvScalarMatrix TEqn fvScalarMatrix TEqn
( (
fvm::ddt(T) fvm::ddt(T)
+ fvm::div(phi, T) + fvm::div(phi, T)
- fvm::laplacian(kappaEff, T) - fvm::laplacian(alphaEff, T)
==
radiation->ST(rhoCpRef, T)
); );
TEqn.relax(); TEqn.relax();
TEqn.solve(); TEqn.solve();
radiation->correct();
rhok = 1.0 - beta*(T - TRef); rhok = 1.0 - beta*(T - TRef);
} }

View File

@ -49,6 +49,7 @@ Description
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,6 +60,7 @@ int main(int argc, char *argv[])
#include "createMesh.H" #include "createMesh.H"
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "createFields.H" #include "createFields.H"
#include "createIncompressibleRadiationModel.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "readTimeControls.H" #include "readTimeControls.H"
#include "CourantNo.H" #include "CourantNo.H"

View File

@ -65,12 +65,12 @@
); );
// kinematic turbulent thermal thermal conductivity m2/s // kinematic turbulent thermal thermal conductivity m2/s
Info<< "Reading field kappat\n" << endl; Info<< "Reading field alphat\n" << endl;
volScalarField kappat volScalarField alphat
( (
IOobject IOobject
( (
"kappat", "alphat",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -116,4 +116,3 @@
pRefValue - getRefCellValue(p, pRefCell) pRefValue - getRefCellValue(p, pRefCell)
); );
} }

View File

@ -1,13 +1,13 @@
{ {
kappat = turbulence->nut()/Prt; alphat = turbulence->nut()/Prt;
kappat.correctBoundaryConditions(); alphat.correctBoundaryConditions();
volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat); volScalarField alphaEff("alphaEff", turbulence->nu()/Pr + alphat);
fvScalarMatrix TEqn fvScalarMatrix TEqn
( (
fvm::div(phi, T) fvm::div(phi, T)
- fvm::laplacian(kappaEff, T) - fvm::laplacian(alphaEff, T)
); );
TEqn.relax(); TEqn.relax();

View File

@ -65,12 +65,12 @@
); );
// kinematic turbulent thermal thermal conductivity m2/s // kinematic turbulent thermal thermal conductivity m2/s
Info<< "Reading field kappat\n" << endl; Info<< "Reading field alphat\n" << endl;
volScalarField kappat volScalarField alphat
( (
IOobject IOobject
( (
"kappat", "alphat",
runTime.timeName(), runTime.timeName(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,

View File

@ -17,7 +17,8 @@
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)
== ==
fvOptions(rho, he) radiation->Sh(thermo)
+ fvOptions(rho, he)
); );
EEqn.relax(); EEqn.relax();
@ -29,4 +30,5 @@
fvOptions.correct(he); fvOptions.correct(he);
thermo.correct(); thermo.correct();
radiation->correct();
} }

View File

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

View File

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

View File

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

View File

@ -40,13 +40,14 @@ Description
#include "rhoThermo.H" #include "rhoThermo.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "fixedGradientFvPatchFields.H" #include "fixedGradientFvPatchFields.H"
#include "zeroGradientFvPatchFields.H"
#include "regionProperties.H" #include "regionProperties.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "solidRegionDiffNo.H" #include "solidRegionDiffNo.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "coordinateSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -37,6 +37,7 @@ Description
#include "solidThermo.H" #include "solidThermo.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "coordinateSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -3,7 +3,9 @@
{ {
fvScalarMatrix hEqn fvScalarMatrix hEqn
( (
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)") thermo.isotropic()
? -fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
: -fvm::laplacian(betav*tAnialpha(), h, "laplacian(alpha,h)")
+ fvOptions(rho, h) + fvOptions(rho, h)
); );

View File

@ -1,4 +1,5 @@
// Initialise solid field pointer lists // Initialise solid field pointer lists
PtrList<coordinateSystem> coordinates(solidRegions.size());
PtrList<solidThermo> thermos(solidRegions.size()); PtrList<solidThermo> thermos(solidRegions.size());
PtrList<radiation::radiationModel> radiations(solidRegions.size()); PtrList<radiation::radiationModel> radiations(solidRegions.size());
PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size()); PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size());
@ -23,6 +24,16 @@
new fv::IOoptionList(solidRegions[i]) new fv::IOoptionList(solidRegions[i])
); );
if (!thermos[i].isotropic())
{
Info<< " Adding coordinateSystems\n" << endl;
coordinates.set
(
i,
coordinateSystem::New(solidRegions[i], thermos[i])
);
}
IOobject betavSolidIO IOobject betavSolidIO
( (
"betavSolid", "betavSolid",

View File

@ -8,10 +8,36 @@
tmp<volScalarField> tcp = thermo.Cp(); tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp(); const volScalarField& cp = tcp();
tmp<volScalarField> talpha = thermo.alpha(); tmp<volSymmTensorField> tAnialpha;
const volScalarField& alpha = talpha();
tmp<volScalarField> tkappa = thermo.kappa(); if (!thermo.isotropic())
const volScalarField& kappa = tkappa(); {
tmp<volVectorField> tkappaByCp = thermo.Kappa()/cp;
const coordinateSystem& coodSys = coordinates[i];
tAnialpha =
tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"Anialpha",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
tkappaByCp().dimensions(),
zeroGradientFvPatchVectorField::typeName
)
);
volSymmTensorField& Anialpha = tAnialpha();
Anialpha.internalField() = coodSys.R().transformVector(tkappaByCp());
Anialpha.correctBoundaryConditions();
}
volScalarField& h = thermo.he(); volScalarField& h = thermo.he();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,38 +56,4 @@ Foam::scalar Foam::solidRegionDiffNo
return DiNum; return DiNum;
} }
Foam::scalar Foam::solidRegionDiffNo
(
const fvMesh& mesh,
const Time& runTime,
const volScalarField& Cprho,
const volSymmTensorField& kappadirectional
)
{
scalar DiNum = 0.0;
scalar meanDiNum = 0.0;
volScalarField kappa(mag(kappadirectional));
//- Take care: can have fluid domains with 0 cells so do not test for
// zero internal faces.
surfaceScalarField kapparhoCpbyDelta
(
mesh.surfaceInterpolation::deltaCoeffs()
* fvc::interpolate(kappa)
/ fvc::interpolate(Cprho)
);
DiNum = gMax(kapparhoCpbyDelta.internalField())*runTime.deltaT().value();
meanDiNum = (average(kapparhoCpbyDelta)).value()*runTime.deltaT().value();
Info<< "Region: " << mesh.name() << " Diffusion Number mean: " << meanDiNum
<< " max: " << DiNum << endl;
return DiNum;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -41,15 +41,6 @@ namespace Foam
const volScalarField& Cprho, const volScalarField& Cprho,
const volScalarField& kappa const volScalarField& kappa
); );
scalar solidRegionDiffNo
(
const fvMesh& mesh,
const Time& runTime,
const volScalarField& Cprho,
const volSymmTensorField& kappa
);
} }
#endif #endif

View File

@ -1,18 +1,29 @@
scalar DiNum = -GREAT; scalar DiNum = -GREAT;
forAll(solidRegions, i) forAll(solidRegions, i)
{
#include "setRegionSolidFields.H"
tmp<volScalarField> magKappa;
if (thermo.isotropic())
{ {
#include "setRegionSolidFields.H" magKappa = thermo.kappa();
DiNum = max
(
solidRegionDiffNo
(
solidRegions[i],
runTime,
rho*cp,
kappa
),
DiNum
);
} }
else
{
magKappa = mag(thermo.Kappa());
}
DiNum = max
(
solidRegionDiffNo
(
solidRegions[i],
runTime,
rho*cp,
magKappa()
),
DiNum
);
}

View File

@ -9,7 +9,11 @@ if (finalIter)
tmp<fvScalarMatrix> hEqn tmp<fvScalarMatrix> hEqn
( (
fvm::ddt(betav*rho, h) fvm::ddt(betav*rho, h)
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)") - (
thermo.isotropic()
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
: fvm::laplacian(betav*tAnialpha(), h, "laplacian(alpha,h)")
)
== ==
fvOptions(rho, h) fvOptions(rho, h)
); );

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

@ -5,12 +5,14 @@
+ fvm::div(phi, Urel) + fvm::div(phi, Urel)
+ turbulence->divDevReff(Urel) + turbulence->divDevReff(Urel)
+ SRF->Su() + SRF->Su()
==
fvOptions(Urel)
); );
UrelEqn().relax(); UrelEqn().relax();
fvOptions.constrain(UrelEqn()); fvOptions.constrain(UrelEqn());
solve(UrelEqn() == -fvc::grad(p) + fvOptions(Urel)); solve(UrelEqn() == -fvc::grad(p));
fvOptions.correct(Urel); fvOptions.correct(Urel);

View File

@ -1,6 +1,6 @@
volScalarField rAUrel(1.0/UrelEqn().A()); volScalarField rAUrel(1.0/UrelEqn().A());
volVectorField HbyA("HbyA", Urel); volVectorField HbyA("HbyA", Urel);
HbyA = rAUrel*(UrelEqn() == fvOptions(Urel))().H(); HbyA = rAUrel*UrelEqn().H();
if (pimple.nCorrPISO() <= 1) if (pimple.nCorrPISO() <= 1)
{ {

View File

@ -5,6 +5,8 @@ tmp<fvVectorMatrix> UEqn
fvm::ddt(U) fvm::ddt(U)
+ fvm::div(phi, U) + fvm::div(phi, U)
+ turbulence->divDevReff(U) + turbulence->divDevReff(U)
==
fvOptions(U)
); );
UEqn().relax(); UEqn().relax();
@ -15,7 +17,7 @@ rAU = 1.0/UEqn().A();
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p) + fvOptions(U)); solve(UEqn() == -fvc::grad(p));
fvOptions.correct(U); fvOptions.correct(U);
} }

View File

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

View File

@ -1,5 +1,5 @@
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(U))().H(); HbyA = rAU*UEqn().H();
if (pimple.nCorrPISO() <= 1) if (pimple.nCorrPISO() <= 1)
{ {

View File

@ -3,6 +3,8 @@ tmp<fvVectorMatrix> UEqn
fvm::ddt(U) fvm::ddt(U)
+ fvm::div(phi, U) + fvm::div(phi, U)
+ turbulence->divDevReff(U) + turbulence->divDevReff(U)
==
fvOptions(U)
); );
@ -12,7 +14,7 @@ fvOptions.constrain(UEqn());
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p_gh) + fvOptions(U)); solve(UEqn() == -fvc::grad(p_gh));
fvOptions.correct(U); fvOptions.correct(U);
} }

View File

@ -2,7 +2,7 @@ volScalarField rAU(1.0/UEqn().A());
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(U))().H(); HbyA = rAU*UEqn().H();
if (pimple.nCorrPISO() <= 1) if (pimple.nCorrPISO() <= 1)
{ {
@ -18,6 +18,7 @@ surfaceScalarField phiHbyA
adjustPhi(phiHbyA, U, p_gh); adjustPhi(phiHbyA, U, p_gh);
fvOptions.relativeFlux(phiHbyA);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())

View File

@ -36,7 +36,6 @@ Description
#include "basicReactingMultiphaseCloud.H" #include "basicReactingMultiphaseCloud.H"
#include "rhoCombustionModel.H" #include "rhoCombustionModel.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "IOporosityModelList.H"
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "SLGThermo.H" #include "SLGThermo.H"
#include "pimpleControl.H" #include "pimpleControl.H"

View File

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

View File

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

View File

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

View File

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

View File

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

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); dimensionedScalar totalMass = fvc::domainIntegrate(rho);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,20 +1,21 @@
{ {
volScalarField kByCv fvScalarMatrix TEqn
(
"kByCv",
(alpha1*k1/Cv1 + alpha2*k2/Cv2)
+ (alpha1*rho1 + alpha2*rho2)*turbulence->nut()
);
solve
( (
fvm::ddt(rho, T) fvm::ddt(rho, T)
+ fvm::div(rhoPhi, T) + fvm::div(rhoPhi, T)
- fvm::laplacian(kByCv, T) - fvm::laplacian(twoPhaseProperties.alphaEff(turbulence->mut()), T)
+ p*fvc::div(phi)*(alpha1/Cv1 + alpha2/Cv2) + (
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 TEqn.relax();
psi1 = eos1->psi(p, T); TEqn.solve();
psi2 = eos2->psi(p, T);
twoPhaseProperties.correct();
} }

View File

@ -2,7 +2,7 @@
( (
fvm::ddt(rho, U) fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U) + fvm::div(rhoPhi, U)
+ turbulence->divDevRhoReff(rho, U) + turbulence->divDevRhoReff(U)
); );
UEqn.relax(); UEqn.relax();
@ -22,4 +22,6 @@
) * mesh.magSf() ) * mesh.magSf()
) )
); );
K = 0.5*magSqr(U);
} }

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,9 +38,10 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "MULES.H" #include "MULES.H"
#include "subCycle.H" #include "subCycle.H"
#include "rhoThermo.H"
#include "interfaceProperties.H" #include "interfaceProperties.H"
#include "twoPhaseMixture.H" #include "twoPhaseMixture.H"
#include "phaseEquationOfState.H" #include "twoPhaseMixtureThermo.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "pimpleControl.H" #include "pimpleControl.H"
@ -103,8 +104,6 @@ int main(int argc, char *argv[])
} }
} }
rho = alpha1*rho1 + alpha2*rho2;
runTime.write(); runTime.write();
Info<< "ExecutionTime = " Info<< "ExecutionTime = "

View File

@ -28,141 +28,20 @@
#include "createPhi.H" #include "createPhi.H"
Info<< "Reading field T\n" << endl; Info<< "Constructing twoPhaseMixtureThermo\n" << endl;
volScalarField T twoPhaseMixtureThermo twoPhaseProperties(mesh);
(
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);
volScalarField& alpha1(twoPhaseProperties.alpha1()); volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());
Info<< "Calculating phase-fraction alpha" << twoPhaseProperties.phase2Name() Info<< "Reading thermophysical properties\n" << endl;
<< nl << endl;
volScalarField alpha2
(
"alpha" + twoPhaseProperties.phase2Name(),
scalar(1) - alpha1
);
dimensionedScalar k1 volScalarField& p = twoPhaseProperties.p();
( volScalarField& T = twoPhaseProperties.T();
"k", volScalarField& rho1 = twoPhaseProperties.thermo1().rho();
dimensionSet(1, 1, -3, -1, 0), const volScalarField& psi1 = twoPhaseProperties.thermo1().psi();
twoPhaseProperties.subDict volScalarField& rho2 = twoPhaseProperties.thermo2().rho();
( const volScalarField& psi2 = twoPhaseProperties.thermo2().psi();
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 rho 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 // Mass flux
// Initialisation does not matter because rhoPhi is reset after the // Initialisation does not matter because rhoPhi is reset after the
// alpha1 solution before it is used in the U equation. // alpha1 solution before it is used in the U equation.
@ -202,8 +87,11 @@
// Construct interface from alpha1 distribution // Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, twoPhaseProperties); interfaceProperties interface(alpha1, U, twoPhaseProperties);
// Construct incompressible turbulence model // Construct compressible turbulence model
autoPtr<incompressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties) compressible::turbulenceModel::New(rho, U, rhoPhi, twoPhaseProperties)
); );
Info<< "Creating field 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()); volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
@ -29,28 +26,44 @@
tmp<fvScalarMatrix> p_rghEqnComp1; tmp<fvScalarMatrix> p_rghEqnComp1;
tmp<fvScalarMatrix> p_rghEqnComp2; tmp<fvScalarMatrix> p_rghEqnComp2;
//if (transonic) if (pimple.transonic())
//{
//}
//else
{ {
surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi); surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi);
surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*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 = p_rghEqnComp1 =
fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh)) fvc::ddt(rho1) + psi1*correction(fvm::ddt(p_rgh))
+ fvc::div(phid1, p_rgh) + fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1);
- fvc::Sp(fvc::div(phid1), p_rgh);
p_rghEqnComp2 = p_rghEqnComp2 =
fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh)) fvc::ddt(rho2) + psi2*correction(fvm::ddt(p_rgh))
+ fvc::div(phid2, p_rgh) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2);
- fvc::Sp(fvc::div(phid2), p_rgh);
} }
// Thermodynamic density needs to be updated by psi*d(p) after the // Cache p_rgh prior to solve for density update
// pressure solution - done in 2 parts. Part 1: volScalarField p_rgh_0(p_rgh);
//thermo.rho() -= psi*p_rgh;
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
@ -72,8 +85,8 @@
if (pimple.finalNonOrthogonalIter()) if (pimple.finalNonOrthogonalIter())
{ {
// Second part of thermodynamic density update //p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
//thermo.rho() += psi*p_rgh; //p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh;
dgdt = dgdt =
( (
@ -91,8 +104,13 @@
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin); p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
rho1 = eos1->rho(p, T); // Update densities from change in p_rgh
rho2 = eos2->rho(p, T); 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<< "max(U) " << max(mag(U)).value() << endl;
Info<< "min(p_rgh) " << min(p_rgh).value() << endl; Info<< "min(p_rgh) " << min(p_rgh).value() << endl;

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

@ -14,28 +14,51 @@
volScalarField& he1 = thermo1.he(); volScalarField& he1 = thermo1.he();
volScalarField& he2 = thermo2.he(); volScalarField& he2 = thermo2.he();
Info<< max(he1) << min(he1) << endl; volScalarField Cpv1(thermo1.Cpv());
volScalarField Cpv2(thermo2.Cpv());
fvScalarMatrix he1Eqn fvScalarMatrix he1Eqn
( (
fvm::ddt(alpha1, he1) fvm::ddt(alpha1, he1) + fvm::div(alphaPhi1, 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) - fvm::laplacian(k1, he1)
== ==
heatTransferCoeff*(he1/thermo1.Cp())/rho1 heatTransferCoeff*(thermo2.T() - thermo1.T())/rho1
- fvm::Sp(heatTransferCoeff/thermo1.Cp()/rho1, he1) + heatTransferCoeff*he1/Cpv1/rho1
+ alpha1*(dpdt/rho1 - (fvc::ddt(K1) + fvc::div(phi1, K1))) - fvm::Sp(heatTransferCoeff/Cpv1/rho1, he1)
); );
fvScalarMatrix he2Eqn fvScalarMatrix he2Eqn
( (
fvm::ddt(alpha2, he2) fvm::ddt(alpha2, he2) + fvm::div(alphaPhi2, 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) - fvm::laplacian(k2, he2)
== ==
heatTransferCoeff*(he2/thermo2.Cp())/rho2 heatTransferCoeff*(thermo1.T() - thermo2.T())/rho2
- fvm::Sp(heatTransferCoeff/thermo2.Cp()/rho2, he2) + heatTransferCoeff*he2/Cpv2/rho2
+ alpha2*(dpdt/rho2 - (fvc::ddt(K2) + fvc::div(phi2, K2))) - fvm::Sp(heatTransferCoeff/Cpv2/rho2, he2)
); );
he1Eqn.relax(); 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 U1Eqn(U1, U1.dimensions()*dimVol/dimTime);
fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
@ -31,6 +35,9 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
fvm::ddt(alpha1, U1) fvm::ddt(alpha1, U1)
+ fvm::div(alphaPhi1, U1) + fvm::div(alphaPhi1, U1)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1)
+ Cvm*rho2*alpha1*alpha2/rho1* + Cvm*rho2*alpha1*alpha2/rho1*
( (
fvm::ddt(U1) fvm::ddt(U1)
@ -61,6 +68,9 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
fvm::ddt(alpha2, U2) fvm::ddt(alpha2, U2)
+ fvm::div(alphaPhi2, U2) + fvm::div(alphaPhi2, U2)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2)
+ Cvm*rho2*alpha1*alpha2/rho2* + Cvm*rho2*alpha1*alpha2/rho2*
( (
fvm::ddt(U2) fvm::ddt(U2)

View File

@ -1,9 +1,9 @@
surfaceScalarField alphaPhi1("alphaPhi", phi1); surfaceScalarField alphaPhi1("alphaPhi" + phase1Name, phi1);
surfaceScalarField alphaPhi2("alphaPhi", phi2); surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2);
{ {
word scheme("div(phi,alpha)"); word alphaScheme("div(phi," + alpha1.name() + ')');
word schemer("div(phir,alpha)"); word alpharScheme("div(phir," + alpha1.name() + ')');
surfaceScalarField phic("phic", phi); surfaceScalarField phic("phic", phi);
surfaceScalarField phir("phir", phi1 - phi2); surfaceScalarField phir("phir", phi1 - phi2);
@ -56,15 +56,84 @@ surfaceScalarField alphaPhi2("alphaPhi", phi2);
} }
} }
dimensionedScalar totalDeltaT = runTime.deltaT();
if (nAlphaSubCycles > 1)
{
alphaPhi1 = dimensionedScalar("0", alphaPhi1.dimensions(), 0);
}
fvScalarMatrix alpha1Eqn for
( (
fvm::ddt(alpha1) subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
+ fvm::div(phic, alpha1, scheme) !(++alphaSubCycle).end();
+ fvm::div(-fvc::flux(-phir, alpha2, schemer), alpha1, schemer) )
== {
fvm::Sp(Sp, alpha1) + Su surfaceScalarField alphaPhic1
); (
fvc::flux
(
phic,
alpha1,
alphaScheme
)
+ fvc::flux
(
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
alpha1,
alpharScheme
)
);
MULES::explicitSolve
(
geometricOneField(),
alpha1,
phi,
alphaPhic1,
Sp,
Su,
(g0.value() > 0 ? alphaMax : 1),
0
);
if (nAlphaSubCycles > 1)
{
alphaPhi1 += (runTime.deltaT()/totalDeltaT)*alphaPhic1;
}
else
{
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) if (g0.value() > 0.0)
{ {
@ -74,30 +143,25 @@ surfaceScalarField alphaPhi2("alphaPhi", phi2);
fvc::interpolate((1.0/rho1)*rAU1) fvc::interpolate((1.0/rho1)*rAU1)
*g0*min(exp(preAlphaExp*(alpha1f - alphaMax)), expMax); *g0*min(exp(preAlphaExp*(alpha1f - alphaMax)), expMax);
// ppMagf = fvScalarMatrix alpha1Eqn
// fvc::interpolate((1.0/rho1)*rAU1)
// *fvc::interpolate
// (
// g0*min(exp(preAlphaExp*(alpha1 - alphaMax)), expMax)
// );
alpha1Eqn -= fvm::laplacian
( (
alpha1f*ppMagf, fvm::ddt(alpha1) - fvc::ddt(alpha1)
alpha1, - fvm::laplacian
"laplacian(alphaPpMag,alpha1)" (
alpha1f*ppMagf,
alpha1,
"laplacian(alpha1PpMag,alpha1)"
)
); );
alpha1Eqn.relax();
alpha1Eqn.solve();
#include "packingLimiter.H"
alphaPhi1 += alpha1Eqn.flux();
} }
alpha1Eqn.relax();
alpha1Eqn.solve();
//***HGW temporary boundedness-fix pending the introduction of MULES
alpha1 = max(min(alpha1, scalar(1)), scalar(0));
#include "packingLimiter.H"
alphaPhi1 = alpha1Eqn.flux();
alphaPhi2 = phi - alphaPhi1; alphaPhi2 = phi - alphaPhi1;
alpha2 = scalar(1) - alpha1; alpha2 = scalar(1) - alpha1;

View File

@ -31,6 +31,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "MULES.H"
#include "subCycle.H"
#include "rhoThermo.H" #include "rhoThermo.H"
#include "nearWallDist.H" #include "nearWallDist.H"
#include "wallFvPatch.H" #include "wallFvPatch.H"

View File

@ -16,14 +16,14 @@
( (
transportProperties.found("phases") transportProperties.found("phases")
? wordList(transportProperties.lookup("phases"))[0] ? wordList(transportProperties.lookup("phases"))[0]
: "phase1" : "1"
); );
word phase2Name word phase2Name
( (
transportProperties.found("phases") transportProperties.found("phases")
? wordList(transportProperties.lookup("phases"))[1] ? wordList(transportProperties.lookup("phases"))[1]
: "phase2" : "2"
); );
autoPtr<phaseModel> phase1 = phaseModel::New autoPtr<phaseModel> phase1 = phaseModel::New
@ -62,10 +62,10 @@
volScalarField& p = thermo1.p(); volScalarField& p = thermo1.p();
volScalarField rho1("rho" + phase1Name, thermo1.rho()); volScalarField& rho1 = thermo1.rho();
const volScalarField& psi1 = thermo1.psi(); const volScalarField& psi1 = thermo1.psi();
volScalarField rho2("rho" + phase2Name, thermo2.rho()); volScalarField& rho2 = thermo2.rho();
const volScalarField& psi2 = thermo2.psi(); const volScalarField& psi2 = thermo2.psi();
volVectorField U volVectorField U
@ -275,8 +275,8 @@
); );
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dalpha1pdt\n" << endl;
volScalarField dpdt volScalarField dalpha1pdt
( (
IOobject IOobject
( (
@ -285,7 +285,20 @@
mesh mesh
), ),
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; Info<< "Creating field kinetic energy K\n" << endl;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,7 +73,7 @@ Foam::kineticTheoryModels::conductivityModels::Gidaspow::kappa
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& Theta, const volScalarField& Theta,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const volScalarField& da, const volScalarField& da,
const dimensionedScalar& e const dimensionedScalar& e
) const ) const

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -77,7 +77,7 @@ public:
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& Theta, const volScalarField& Theta,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const volScalarField& da, const volScalarField& da,
const dimensionedScalar& e const dimensionedScalar& e
) const; ) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,7 +76,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& Theta, const volScalarField& Theta,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const volScalarField& da, const volScalarField& da,
const dimensionedScalar& e const dimensionedScalar& e
) const ) const

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -82,7 +82,7 @@ public:
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& Theta, const volScalarField& Theta,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const volScalarField& da, const volScalarField& da,
const dimensionedScalar& e const dimensionedScalar& e
) const; ) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,7 +73,7 @@ Foam::kineticTheoryModels::conductivityModels::Syamlal::kappa
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& Theta, const volScalarField& Theta,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const volScalarField& da, const volScalarField& da,
const dimensionedScalar& e const dimensionedScalar& e
) const ) const

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -77,7 +77,7 @@ public:
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& Theta, const volScalarField& Theta,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const volScalarField& da, const volScalarField& da,
const dimensionedScalar& e const dimensionedScalar& e
) const; ) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -109,7 +109,7 @@ public:
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& Theta, const volScalarField& Theta,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const volScalarField& da, const volScalarField& da,
const dimensionedScalar& e const dimensionedScalar& e
) const = 0; ) const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -71,7 +71,7 @@ Foam::kineticTheoryModels::granularPressureModels::Lun::granularPressureCoeff
( (
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const dimensionedScalar& e const dimensionedScalar& e
) const ) const
{ {
@ -87,7 +87,7 @@ granularPressureCoeffPrime
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& g0, const volScalarField& g0,
const volScalarField& g0prime, const volScalarField& g0prime,
const dimensionedScalar& rho1, const volScalarField& rho1,
const dimensionedScalar& e const dimensionedScalar& e
) const ) const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,7 +76,7 @@ public:
( (
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const dimensionedScalar& e const dimensionedScalar& e
) const; ) const;
@ -85,7 +85,7 @@ public:
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& g0, const volScalarField& g0,
const volScalarField& g0prime, const volScalarField& g0prime,
const dimensionedScalar& rho1, const volScalarField& rho1,
const dimensionedScalar& e const dimensionedScalar& e
) const; ) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -74,7 +74,7 @@ granularPressureCoeff
( (
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& g0, const volScalarField& g0,
const dimensionedScalar& rho1, const volScalarField& rho1,
const dimensionedScalar& e const dimensionedScalar& e
) const ) const
{ {
@ -90,7 +90,7 @@ granularPressureCoeffPrime
const volScalarField& alpha1, const volScalarField& alpha1,
const volScalarField& g0, const volScalarField& g0,
const volScalarField& g0prime, const volScalarField& g0prime,
const dimensionedScalar& rho1, const volScalarField& rho1,
const dimensionedScalar& e const dimensionedScalar& e
) const ) const
{ {

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