mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added generic turbulenceModel base class to incompressible turbulence models.
This commit is contained in:
@ -0,0 +1,67 @@
|
||||
{
|
||||
word alphaScheme("div(phi,alpha)");
|
||||
word alpharScheme("div(phirb,alpha)");
|
||||
|
||||
surfaceScalarField phir("phir", phic*interface.nHatf());
|
||||
|
||||
for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
|
||||
{
|
||||
surfaceScalarField phiAlpha =
|
||||
fvc::flux
|
||||
(
|
||||
phi,
|
||||
alpha1,
|
||||
alphaScheme
|
||||
)
|
||||
+ fvc::flux
|
||||
(
|
||||
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
|
||||
alpha1,
|
||||
alpharScheme
|
||||
);
|
||||
|
||||
Pair<tmp<volScalarField> > vDotAlphal =
|
||||
twoPhaseProperties->vDotAlphal();
|
||||
const volScalarField& vDotcAlphal = vDotAlphal[0]();
|
||||
const volScalarField& vDotvAlphal = vDotAlphal[1]();
|
||||
|
||||
volScalarField Sp
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Sp",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
vDotvAlphal - vDotcAlphal
|
||||
);
|
||||
|
||||
volScalarField Su
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Su",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
// Divergence term is handled explicitly to be
|
||||
// consistent with the explicit transport solution
|
||||
divU*alpha1
|
||||
+ vDotcAlphal
|
||||
);
|
||||
|
||||
//MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
|
||||
//MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
|
||||
MULES::implicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
|
||||
|
||||
rhoPhi +=
|
||||
(runTime.deltaT()/totalDeltaT)
|
||||
*(phiAlpha*(rho1 - rho2) + phi*rho2);
|
||||
}
|
||||
|
||||
Info<< "Liquid phase volume fraction = "
|
||||
<< alpha1.weightedAverage(mesh.V()).value()
|
||||
<< " Min(alpha1) = " << min(alpha1).value()
|
||||
<< " Max(alpha1) = " << max(alpha1).value()
|
||||
<< endl;
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
surfaceScalarField rhoPhi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoPhi",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimensionSet(1, 0, -1, 0, 0), 0)
|
||||
);
|
||||
|
||||
{
|
||||
label nAlphaCorr
|
||||
(
|
||||
readLabel(piso.lookup("nAlphaCorr"))
|
||||
);
|
||||
|
||||
label nAlphaSubCycles
|
||||
(
|
||||
readLabel(piso.lookup("nAlphaSubCycles"))
|
||||
);
|
||||
|
||||
surfaceScalarField phic = mag(phi/mesh.magSf());
|
||||
phic = min(interface.cAlpha()*phic, max(phic));
|
||||
|
||||
volScalarField divU = fvc::div(phi);
|
||||
|
||||
dimensionedScalar totalDeltaT = runTime.deltaT();
|
||||
|
||||
if (nAlphaSubCycles > 1)
|
||||
{
|
||||
for
|
||||
(
|
||||
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
|
||||
!(++alphaSubCycle).end();
|
||||
)
|
||||
{
|
||||
# include "alphaEqn.H"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# include "alphaEqn.H"
|
||||
}
|
||||
|
||||
if (nOuterCorr == 1)
|
||||
{
|
||||
interface.correct();
|
||||
}
|
||||
|
||||
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
|
||||
}
|
||||
Reference in New Issue
Block a user