mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
multiphase solver: Update and rationalize the alphaEqnSubCycling.H
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
surfaceScalarField phic(mag(phi/mesh.magSf()));
|
||||
phic = min(interface.cAlpha()*phic, max(phic));
|
||||
|
||||
volScalarField divU(fvc::div(phi));
|
||||
volScalarField divU(fvc::div(fvc::absolute(phi, U)));
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
@ -29,10 +29,4 @@
|
||||
{
|
||||
#include "alphaEqns.H"
|
||||
}
|
||||
|
||||
// correct interface on first PIMPLE corrector
|
||||
if (pimple.corr() == 1)
|
||||
{
|
||||
interface.correct();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
{
|
||||
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[])
|
||||
{
|
||||
#include "alphaEqnsSubCycle.H"
|
||||
|
||||
// correct interface on first PIMPLE corrector
|
||||
if (pimple.corr() == 1)
|
||||
{
|
||||
interface.correct();
|
||||
}
|
||||
|
||||
solve(fvm::ddt(rho) + fvc::div(rhoPhi));
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
@ -80,6 +80,12 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "alphaEqnsSubCycle.H"
|
||||
|
||||
// correct interface on first PIMPLE corrector
|
||||
if (pimple.corr() == 1)
|
||||
{
|
||||
interface.correct();
|
||||
}
|
||||
|
||||
solve(fvm::ddt(rho) + fvc::div(rhoPhi));
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
@ -77,6 +77,7 @@ int main(int argc, char *argv[])
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
|
||||
@ -30,8 +30,8 @@
|
||||
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
|
||||
}
|
||||
|
||||
Info<< "Liquid phase volume fraction = "
|
||||
<< alpha1.weightedAverage(mesh.V()).value()
|
||||
Info<< "Phase-1 volume fraction = "
|
||||
<< alpha1.weightedAverage(mesh.Vsc()).value()
|
||||
<< " Min(alpha1) = " << min(alpha1).value()
|
||||
<< " Max(alpha1) = " << max(alpha1).value()
|
||||
<< endl;
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
const dictionary& pimpleDict = pimple.dict();
|
||||
|
||||
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
|
||||
|
||||
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
|
||||
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
|
||||
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
@ -26,6 +23,4 @@ else
|
||||
#include "alphaEqn.H"
|
||||
}
|
||||
|
||||
interface.correct();
|
||||
|
||||
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
|
||||
|
||||
@ -81,6 +81,7 @@ int main(int argc, char *argv[])
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
#include "zonePhaseVolumes.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
|
||||
@ -23,6 +23,4 @@ else
|
||||
#include "alphaEqn.H"
|
||||
}
|
||||
|
||||
interface.correct();
|
||||
|
||||
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
|
||||
|
||||
@ -114,6 +114,7 @@ int main(int argc, char *argv[])
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
|
||||
@ -43,7 +43,6 @@ Description
|
||||
#include "interfaceProperties.H"
|
||||
#include "twoPhaseMixture.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "interpolationTable.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -82,6 +81,7 @@ int main(int argc, char *argv[])
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
|
||||
@ -83,6 +83,7 @@ int main(int argc, char *argv[])
|
||||
twoPhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
|
||||
@ -24,8 +24,6 @@ else
|
||||
#include "alphaEqns.H"
|
||||
}
|
||||
|
||||
interface.correct();
|
||||
|
||||
{
|
||||
volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3);
|
||||
|
||||
|
||||
@ -74,6 +74,7 @@ int main(int argc, char *argv[])
|
||||
threePhaseProperties.correct();
|
||||
|
||||
#include "alphaEqnsSubCycle.H"
|
||||
interface.correct();
|
||||
|
||||
#define twoPhaseProperties threePhaseProperties
|
||||
|
||||
|
||||
@ -40,10 +40,5 @@ surfaceScalarField rhoPhi
|
||||
#include "alphaEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.nCorrPIMPLE() == 1)
|
||||
{
|
||||
interface.correct();
|
||||
}
|
||||
|
||||
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
|
||||
}
|
||||
|
||||
@ -82,6 +82,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "alphaEqnSubCycle.H"
|
||||
|
||||
if (pimple.nCorrPIMPLE() == 1)
|
||||
{
|
||||
interface.correct();
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
Reference in New Issue
Block a user