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

This commit is contained in:
mattijs
2011-08-09 10:48:25 +01:00
91 changed files with 38245 additions and 9880 deletions

View File

@ -27,11 +27,13 @@ License
#include "alphaContactAngleFvPatchScalarField.H"
#include "Time.H"
#include "subCycle.H"
#include "fvCFD.H"
#include "MULES.H"
#include "fvcSnGrad.H"
#include "fvcFlux.H"
// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * //
const scalar Foam::multiphaseMixture::convertToRad =
const Foam::scalar Foam::multiphaseMixture::convertToRad =
Foam::constant::mathematical::pi/180.0;
@ -249,10 +251,6 @@ void Foam::multiphaseMixture::solve()
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
bool cycleAlpha(Switch(pimpleDict.lookup("cycleAlpha")));
scalar cAlpha(readScalar(pimpleDict.lookup("cAlpha")));
@ -269,7 +267,7 @@ void Foam::multiphaseMixture::solve()
!(++alphaSubCycle).end();
)
{
solveAlphas(nAlphaCorr, cycleAlpha, cAlpha);
solveAlphas(cAlpha);
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi_;
}
@ -277,7 +275,7 @@ void Foam::multiphaseMixture::solve()
}
else
{
solveAlphas(nAlphaCorr, cycleAlpha, cAlpha);
solveAlphas(cAlpha);
}
}
@ -481,8 +479,6 @@ Foam::multiphaseMixture::nearInterface() const
void Foam::multiphaseMixture::solveAlphas
(
const label nAlphaCorr,
const bool cycleAlpha,
const scalar cAlpha
)
{
@ -490,92 +486,108 @@ void Foam::multiphaseMixture::solveAlphas
nSolves++;
word alphaScheme("div(phi,alpha)");
word alphacScheme("div(phirb,alpha)");
tmp<fv::convectionScheme<scalar> > mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh_,
alphaTable_,
phi_,
mesh_.divScheme(alphaScheme)
)
);
word alpharScheme("div(phirb,alpha)");
surfaceScalarField phic(mag(phi_/mesh_.magSf()));
phic = min(cAlpha*phic, max(phic));
for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size());
int phasei = 0;
forAllIter(PtrDictionary<phase>, phases_, iter)
{
phase* refPhasePtr = &refPhase_;
phase& alpha = iter();
if (cycleAlpha)
{
PtrDictionary<phase>::iterator refPhaseIter = phases_.begin();
for (label i=0; i<nSolves%phases_.size(); i++)
{
++refPhaseIter;
}
refPhasePtr = &refPhaseIter();
}
phase& refPhase = *refPhasePtr;
volScalarField refPhaseNew(refPhase);
refPhaseNew == 1.0;
rhoPhi_ = phi_*refPhase.rho();
forAllIter(PtrDictionary<phase>, phases_, iter)
{
phase& alpha = iter();
if (&alpha == &refPhase) continue;
fvScalarMatrix alphaEqn
phiAlphaCorrs.set
(
phasei,
new surfaceScalarField
(
fvm::ddt(alpha)
+ mvConvection->fvmDiv(phi_, alpha)
);
forAllIter(PtrDictionary<phase>, phases_, iter2)
{
phase& alpha2 = iter2();
if (&alpha2 == &alpha) continue;
surfaceScalarField phir(phic*nHatf(alpha, alpha2));
surfaceScalarField phirb12
fvc::flux
(
-fvc::flux(-phir, alpha2, alphacScheme)
);
phi_,
alpha,
alphaScheme
)
)
);
alphaEqn += fvm::div(phirb12, alpha, alphacScheme);
}
surfaceScalarField& phiAlphaCorr = phiAlphaCorrs[phasei];
alphaEqn.solve(mesh_.solver("alpha"));
forAllIter(PtrDictionary<phase>, phases_, iter2)
{
phase& alpha2 = iter2();
rhoPhi_ += alphaEqn.flux()*(alpha.rho() - refPhase.rho());
if (&alpha2 == &alpha) continue;
Info<< alpha.name() << " volume fraction, min, max = "
<< alpha.weightedAverage(mesh_.V()).value()
<< ' ' << min(alpha).value()
<< ' ' << max(alpha).value()
<< endl;
surfaceScalarField phir(phic*nHatf(alpha, alpha2));
refPhaseNew == refPhaseNew - alpha;
phiAlphaCorr += fvc::flux
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha,
alpharScheme
);
}
refPhase == refPhaseNew;
MULES::limit
(
geometricOneField(),
alpha,
phi_,
phiAlphaCorr,
zeroField(),
zeroField(),
1,
0,
3,
true
);
Info<< refPhase.name() << " volume fraction, min, max = "
<< refPhase.weightedAverage(mesh_.V()).value()
<< ' ' << min(refPhase).value()
<< ' ' << max(refPhase).value()
<< endl;
phasei++;
}
MULES::limitSum(phiAlphaCorrs);
rhoPhi_ = 0.0*phi_*refPhase_.rho();
volScalarField sumAlpha("sumAlpha", 0.0*refPhase_);
phasei = 0;
forAllIter(PtrDictionary<phase>, phases_, iter)
{
phase& alpha = iter();
surfaceScalarField& phiAlpha = phiAlphaCorrs[phasei];
phiAlpha += upwind<scalar>(mesh_, phi_).flux(alpha);
MULES::explicitSolve
(
geometricOneField(),
alpha,
phiAlpha,
zeroField(),
zeroField()
);
rhoPhi_ += phiAlpha*alpha.rho();
Info<< alpha.name() << " volume fraction, min, max = "
<< alpha.weightedAverage(mesh_.V()).value()
<< ' ' << min(alpha).value()
<< ' ' << max(alpha).value()
<< endl;
sumAlpha += alpha;
phasei++;
}
Info<< "Phase-sum volume fraction, min, max = "
<< sumAlpha.weightedAverage(mesh_.V()).value()
<< ' ' << min(sumAlpha).value()
<< ' ' << max(sumAlpha).value()
<< endl;
calcAlphas();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -168,12 +168,7 @@ private:
void calcAlphas();
void solveAlphas
(
const label nAlphaCorr,
const bool cycleAlpha,
const scalar cAlpha
);
void solveAlphas(const scalar cAlpha);
tmp<surfaceVectorField> nHatfv
(

View File

@ -9,7 +9,7 @@ wmake snappyHexMesh
if [ -d "$CGAL_ARCH_PATH" ]
then
wmake cvMesh
cd cvMesh && ./Allwmake
fi
# ----------------------------------------------------------------- end-of-file

View File

@ -105,19 +105,19 @@ int main(int argc, char *argv[])
"file",
"specify an alternative dictionary for the topoSet dictionary"
);
# include "addRegionOption.H"
#include "addRegionOption.H"
argList::addBoolOption
(
"noSync",
"do not synchronise selection across coupled patches"
);
# include "setRootCase.H"
# include "createTime.H"
#include "setRootCase.H"
#include "createTime.H"
instantList timeDirs = timeSelector::selectIfPresent(runTime, args);
# include "createNamedPolyMesh.H"
#include "createNamedPolyMesh.H"
const bool noSync = args.optionFound("noSync");