Skip to content
Snippets Groups Projects
Commit 766abbc0 authored by Henry's avatar Henry
Browse files

multiphase solver: Update and rationalize the alphaEqnSubCycling.H

parent 54842e87
No related merge requests found
Showing
with 29 additions and 67 deletions
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
surfaceScalarField phic(mag(phi/mesh.magSf())); surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic)); phic = min(interface.cAlpha()*phic, max(phic));
volScalarField divU(fvc::div(phi)); volScalarField divU(fvc::div(fvc::absolute(phi, U)));
if (nAlphaSubCycles > 1) if (nAlphaSubCycles > 1)
{ {
...@@ -29,10 +29,4 @@ ...@@ -29,10 +29,4 @@
{ {
#include "alphaEqns.H" #include "alphaEqns.H"
} }
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
} }
{
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
fvc::makeAbsolute(phi, U);
volScalarField divU(fvc::div(phi));
fvc::makeRelative(phi, U);
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum(0.0*rhoPhi);
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
#include "alphaEqns.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
#include "alphaEqns.H"
}
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
}
...@@ -122,6 +122,12 @@ int main(int argc, char *argv[]) ...@@ -122,6 +122,12 @@ int main(int argc, char *argv[])
{ {
#include "alphaEqnsSubCycle.H" #include "alphaEqnsSubCycle.H"
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
solve(fvm::ddt(rho) + fvc::div(rhoPhi)); solve(fvm::ddt(rho) + fvc::div(rhoPhi));
#include "UEqn.H" #include "UEqn.H"
......
...@@ -80,6 +80,12 @@ int main(int argc, char *argv[]) ...@@ -80,6 +80,12 @@ int main(int argc, char *argv[])
{ {
#include "alphaEqnsSubCycle.H" #include "alphaEqnsSubCycle.H"
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
solve(fvm::ddt(rho) + fvc::div(rhoPhi)); solve(fvm::ddt(rho) + fvc::div(rhoPhi));
#include "UEqn.H" #include "UEqn.H"
......
...@@ -77,6 +77,7 @@ int main(int argc, char *argv[]) ...@@ -77,6 +77,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct(); twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct();
turbulence->correct(); turbulence->correct();
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
} }
Info<< "Liquid phase volume fraction = " Info<< "Phase-1 volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value() << alpha1.weightedAverage(mesh.Vsc()).value()
<< " Min(alpha1) = " << min(alpha1).value() << " Min(alpha1) = " << min(alpha1).value()
<< " Max(alpha1) = " << max(alpha1).value() << " Max(alpha1) = " << max(alpha1).value()
<< endl; << endl;
......
const dictionary& pimpleDict = pimple.dict(); label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1) if (nAlphaSubCycles > 1)
{ {
...@@ -26,6 +23,4 @@ else ...@@ -26,6 +23,4 @@ else
#include "alphaEqn.H" #include "alphaEqn.H"
} }
interface.correct();
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
...@@ -81,6 +81,7 @@ int main(int argc, char *argv[]) ...@@ -81,6 +81,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct(); twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct();
#include "zonePhaseVolumes.H" #include "zonePhaseVolumes.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
......
...@@ -23,6 +23,4 @@ else ...@@ -23,6 +23,4 @@ else
#include "alphaEqn.H" #include "alphaEqn.H"
} }
interface.correct();
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
...@@ -114,6 +114,7 @@ int main(int argc, char *argv[]) ...@@ -114,6 +114,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct(); twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct();
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
......
...@@ -43,7 +43,6 @@ Description ...@@ -43,7 +43,6 @@ Description
#include "interfaceProperties.H" #include "interfaceProperties.H"
#include "twoPhaseMixture.H" #include "twoPhaseMixture.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "interpolationTable.H"
#include "pimpleControl.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...@@ -82,6 +81,7 @@ int main(int argc, char *argv[]) ...@@ -82,6 +81,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct(); twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct();
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
......
...@@ -83,6 +83,7 @@ int main(int argc, char *argv[]) ...@@ -83,6 +83,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct(); twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
interface.correct();
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
......
...@@ -24,8 +24,6 @@ else ...@@ -24,8 +24,6 @@ else
#include "alphaEqns.H" #include "alphaEqns.H"
} }
interface.correct();
{ {
volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3); volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3);
......
...@@ -74,6 +74,7 @@ int main(int argc, char *argv[]) ...@@ -74,6 +74,7 @@ int main(int argc, char *argv[])
threePhaseProperties.correct(); threePhaseProperties.correct();
#include "alphaEqnsSubCycle.H" #include "alphaEqnsSubCycle.H"
interface.correct();
#define twoPhaseProperties threePhaseProperties #define twoPhaseProperties threePhaseProperties
......
...@@ -40,10 +40,5 @@ surfaceScalarField rhoPhi ...@@ -40,10 +40,5 @@ surfaceScalarField rhoPhi
#include "alphaEqn.H" #include "alphaEqn.H"
} }
if (pimple.nCorrPIMPLE() == 1)
{
interface.correct();
}
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
} }
...@@ -82,6 +82,11 @@ int main(int argc, char *argv[]) ...@@ -82,6 +82,11 @@ int main(int argc, char *argv[])
#include "alphaEqnSubCycle.H" #include "alphaEqnSubCycle.H"
if (pimple.nCorrPIMPLE() == 1)
{
interface.correct();
}
turbulence->correct(); turbulence->correct();
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
......
...@@ -2,7 +2,7 @@ ...@@ -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-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment