Merged all multiphase developments in OpenFOAM-1.7.x

This commit is contained in:
Henry
2010-09-29 22:22:48 +01:00
parent fbf4d9ec10
commit 89ee9b3e0f
406 changed files with 32059 additions and 34733 deletions

View File

@ -1,6 +1,6 @@
interPhaseChangeFoam.C
phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C
phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C
phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/newPhaseChangeTwoPhaseMixture.C
phaseChangeTwoPhaseMixtures/Kunz/Kunz.C
phaseChangeTwoPhaseMixtures/Merkle/Merkle.C
phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C

View File

@ -7,7 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-linterfaceProperties \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \

View File

@ -25,10 +25,10 @@
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
+ (
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- fvc::snGrad(p)
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
) * mesh.magSf()
)
);

View File

@ -50,18 +50,18 @@
+ vDotcAlphal
);
// MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
// MULES::explicitSolve
// (
// geometricOneField(),
// alpha1,
// phi,
// phiAlpha,
// Sp,
// Su,
// 1,
// 0
// );
//MULES::explicitSolve
//(
// geometricOneField(),
// alpha1,
// phi,
// phiAlpha,
// Sp,
// Su,
// 1,
// 0
//);
MULES::implicitSolve
(
geometricOneField(),

View File

@ -36,12 +36,12 @@ surfaceScalarField rhoPhi
!(++alphaSubCycle).end();
)
{
# include "alphaEqn.H"
#include "alphaEqn.H"
}
}
else
{
# include "alphaEqn.H"
#include "alphaEqn.H"
}
if (nOuterCorr == 1)

View File

@ -1,54 +0,0 @@
{
#include "continuityErrs.H"
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
forAll(p.boundaryField(), i)
{
if (p.boundaryField()[i].fixesValue())
{
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
}
}
volScalarField pcorr
(
IOobject
(
"pcorr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("pcorr", p.dimensions(), 0.0),
pcorrTypes
);
dimensionedScalar rUAf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
adjustPhi(phi, U, pcorr);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pcorrEqn
(
fvm::laplacian(rUAf, pcorr) == fvc::div(phi)
);
pcorrEqn.setReference(pRefCell, pRefValue);
pcorrEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi -= pcorrEqn.flux();
}
}
# include "continuityErrs.H"
}

View File

@ -1,9 +1,9 @@
Info<< "Reading field p\n" << endl;
volScalarField p
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
(
IOobject
(
"p",
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
@ -40,7 +40,7 @@
mesh
);
# include "createPhi.H"
#include "createPhi.H"
Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties =
@ -65,12 +65,6 @@
);
rho.oldTime();
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
// Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, twoPhaseProperties());
@ -79,3 +73,43 @@
(
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties())
);
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
p_rgh + rho*gh
);
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
p,
p_rgh,
mesh.solutionDict().subDict("PISO"),
pRefCell,
pRefValue
);
if (p_rgh.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - rho*gh;
}

View File

@ -59,7 +59,7 @@ int main(int argc, char *argv[])
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
#include "correctPhi.H"
#include "../interFoam/correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
@ -82,9 +82,11 @@ int main(int argc, char *argv[])
turbulence->correct();
// --- Outer-corrector loop
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
bool finalIter = oCorr == nOuterCorr-1;
#include "UEqn.H"
// --- PISO loop
@ -92,8 +94,6 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
#include "continuityErrs.H"
}
twoPhaseProperties->correct();

View File

@ -11,14 +11,13 @@
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
adjustPhi(phiU, U, p);
adjustPhi(phiU, U, p_rgh);
phi = phiU +
(
fvc::interpolate(interface.sigmaK())
*fvc::snGrad(alpha1)*mesh.magSf()
+ fvc::interpolate(rho)*(g & mesh.Sf())
)*rUAf;
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
)*rUAf*mesh.magSf();
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
const volScalarField& vDotcP = vDotP[0]();
@ -26,29 +25,48 @@
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
fvScalarMatrix p_rghEqn
(
fvc::div(phi) - fvm::laplacian(rUAf, p)
- (vDotvP - vDotcP)*pSat + fvm::Sp(vDotvP - vDotcP, p)
fvc::div(phi) - fvm::laplacian(rUAf, p_rgh)
- (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
);
pEqn.setReference(pRefCell, pRefValue);
p_rghEqn.setReference(pRefCell, pRefValue);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
}
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
phi += p_rghEqn.flux();
}
}
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
U.correctBoundaryConditions();
#include "continuityErrs.H"
p == p_rgh + rho*gh;
if (p_rgh.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - rho*gh;
}
}

View File

@ -9,16 +9,16 @@ 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 Generac License as published by
the Free Software Foundation; either 2 of the License, or
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 ho it will be useful, but WITHOUT
ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
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 oNU General Public License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class

View File

@ -9,16 +9,16 @@ 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 Generac License as published by
the Free Software Foundation; either 2 of the License, or
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 ho it will be useful, but WITHOUT
ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
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 oNU General Public License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class

View File

@ -1,5 +1,5 @@
/*---------------------------------------------------------------------------*\
========Merkle= |
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
@ -9,16 +9,16 @@ 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 Generac License as published by
the Free Software Foundation; either 2 of the License, or
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 ho it will be useful, but WITHOUT
ANY WARRANTY; without even the imarranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.he GNU General Public License
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 oNU General Public License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class

View File

@ -36,27 +36,30 @@ Foam::phaseChangeTwoPhaseMixture::New
const word& alpha1Name
)
{
// get model name, but do not register the dictionary
const word mixtureType
IOdictionary transportPropertiesDict
(
IOdictionary
IOobject
(
IOobject
(
"transportProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).lookup("phaseChangeTwoPhaseMixture")
"transportProperties",
U.time().constant(),
U.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
Info<< "Selecting phaseChange model " << mixtureType << endl;
word phaseChangeTwoPhaseMixtureTypeName
(
transportPropertiesDict.lookup("phaseChangeTwoPhaseMixture")
);
Info<< "Selecting phaseChange model "
<< phaseChangeTwoPhaseMixtureTypeName << endl;
componentsConstructorTable::iterator cstrIter =
componentsConstructorTablePtr_->find(mixtureType);
componentsConstructorTablePtr_
->find(phaseChangeTwoPhaseMixtureTypeName);
if (cstrIter == componentsConstructorTablePtr_->end())
{
@ -64,8 +67,8 @@ Foam::phaseChangeTwoPhaseMixture::New
(
"phaseChangeTwoPhaseMixture::New"
) << "Unknown phaseChangeTwoPhaseMixture type "
<< mixtureType << nl << nl
<< "Valid phaseChangeTwoPhaseMixture types are : " << endl
<< phaseChangeTwoPhaseMixtureTypeName << endl << endl
<< "Valid phaseChangeTwoPhaseMixtures are : " << endl
<< componentsConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -28,7 +28,7 @@ Description
SourceFiles
phaseChangeTwoPhaseMixture.C
phaseChangeModelNew.C
newPhaseChangeModel.C
\*---------------------------------------------------------------------------*/