mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
Added generic turbulenceModel base class to incompressible turbulence models.
This commit is contained in:
@ -2,13 +2,13 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
|
||||
-IphaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-linterfaceProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lincompressibleRASModels \
|
||||
-lincompressibleLESModels \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
surfaceScalarField muf =
|
||||
twoPhaseProperties->muf()
|
||||
+ fvc::interpolate(rho*turbulence->nuSgs());
|
||||
+ fvc::interpolate(rho*turbulence->nut());
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
@ -23,7 +23,7 @@
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(pd)
|
||||
) * mesh.magSf()
|
||||
|
||||
@ -12,12 +12,12 @@
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< "Reading field gamma\n" << endl;
|
||||
volScalarField gamma
|
||||
Info<< "Reading field alpha1\n" << endl;
|
||||
volScalarField alpha1
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"gamma",
|
||||
"alpha1",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -44,7 +44,7 @@
|
||||
|
||||
Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
|
||||
autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties =
|
||||
phaseChangeTwoPhaseMixture::New(U, phi, "gamma");
|
||||
phaseChangeTwoPhaseMixture::New(U, phi);
|
||||
|
||||
const dimensionedScalar& rho1 = twoPhaseProperties->rho1();
|
||||
const dimensionedScalar& rho2 = twoPhaseProperties->rho2();
|
||||
@ -60,8 +60,8 @@
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
gamma*rho1 + (scalar(1) - gamma)*rho2,
|
||||
gamma.boundaryField().types()
|
||||
alpha1*rho1 + (scalar(1) - alpha1)*rho2,
|
||||
alpha1.boundaryField().types()
|
||||
);
|
||||
rho.oldTime();
|
||||
|
||||
@ -88,11 +88,11 @@
|
||||
);
|
||||
|
||||
|
||||
// Construct interface from gamma distribution
|
||||
interfaceProperties interface(gamma, U, twoPhaseProperties());
|
||||
// Construct interface from alpha1 distribution
|
||||
interfaceProperties interface(alpha1, U, twoPhaseProperties());
|
||||
|
||||
// Construct LES model
|
||||
autoPtr<incompressible::LESModel> turbulence
|
||||
// Construct incompressible turbulence model
|
||||
autoPtr<incompressible::turbulenceModel> turbulence
|
||||
(
|
||||
incompressible::LESModel::New(U, phi, twoPhaseProperties())
|
||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties())
|
||||
);
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
{
|
||||
word gammaScheme("div(phi,gamma)");
|
||||
word gammarScheme("div(phirb,gamma)");
|
||||
|
||||
surfaceScalarField phir("phir", phic*interface.nHatf());
|
||||
|
||||
for (int gCorr=0; gCorr<nGammaCorr; gCorr++)
|
||||
{
|
||||
surfaceScalarField phiGamma =
|
||||
fvc::flux
|
||||
(
|
||||
phi,
|
||||
gamma,
|
||||
gammaScheme
|
||||
)
|
||||
+ fvc::flux
|
||||
(
|
||||
-fvc::flux(-phir, scalar(1) - gamma, gammarScheme),
|
||||
gamma,
|
||||
gammarScheme
|
||||
);
|
||||
|
||||
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*gamma
|
||||
+ vDotcAlphal
|
||||
);
|
||||
|
||||
//MULES::explicitSolve(gamma, phi, phiGamma, 1, 0);
|
||||
//MULES::explicitSolve(oneField(), gamma, phi, phiGamma, Sp, Su, 1, 0);
|
||||
MULES::implicitSolve(oneField(), gamma, phi, phiGamma, Sp, Su, 1, 0);
|
||||
|
||||
rhoPhi +=
|
||||
(runTime.deltaT()/totalDeltaT)
|
||||
*(phiGamma*(rho1 - rho2) + phi*rho2);
|
||||
}
|
||||
|
||||
Info<< "Liquid phase volume fraction = "
|
||||
<< gamma.weightedAverage(mesh.V()).value()
|
||||
<< " Min(gamma) = " << min(gamma).value()
|
||||
<< " Max(gamma) = " << max(gamma).value()
|
||||
<< endl;
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
surfaceScalarField rhoPhi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoPhi",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimensionSet(1, 0, -1, 0, 0), 0)
|
||||
);
|
||||
|
||||
{
|
||||
label nGammaCorr
|
||||
(
|
||||
readLabel(piso.lookup("nGammaCorr"))
|
||||
);
|
||||
|
||||
label nGammaSubCycles
|
||||
(
|
||||
readLabel(piso.lookup("nGammaSubCycles"))
|
||||
);
|
||||
|
||||
surfaceScalarField phic = mag(phi/mesh.magSf());
|
||||
phic = min(interface.cGamma()*phic, max(phic));
|
||||
|
||||
volScalarField divU = fvc::div(phi);
|
||||
|
||||
dimensionedScalar totalDeltaT = runTime.deltaT();
|
||||
|
||||
if (nGammaSubCycles > 1)
|
||||
{
|
||||
for
|
||||
(
|
||||
subCycle<volScalarField> gammaSubCycle(gamma, nGammaSubCycles);
|
||||
!(++gammaSubCycle).end();
|
||||
)
|
||||
{
|
||||
# include "gammaEqn.H"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# include "gammaEqn.H"
|
||||
}
|
||||
|
||||
if (nOuterCorr == 1)
|
||||
{
|
||||
interface.correct();
|
||||
}
|
||||
|
||||
rho == gamma*rho1 + (scalar(1) - gamma)*rho2;
|
||||
}
|
||||
@ -35,6 +35,8 @@ Description
|
||||
but other mechanisms of phase-change are supported within this solver
|
||||
framework.
|
||||
|
||||
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
@ -42,7 +44,7 @@ Description
|
||||
#include "subCycle.H"
|
||||
#include "interfaceProperties.H"
|
||||
#include "phaseChangeTwoPhaseMixture.H"
|
||||
#include "incompressible/LESModel/LESModel.H"
|
||||
#include "turbulenceModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -60,7 +62,7 @@ int main(int argc, char *argv[])
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
@ -75,9 +77,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
twoPhaseProperties->correct();
|
||||
|
||||
#include "gammaEqnSubCycle.H"
|
||||
#include "alphaEqnSubCycle.H"
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
@ -95,6 +95,8 @@ int main(int argc, char *argv[])
|
||||
#include "continuityErrs.H"
|
||||
}
|
||||
|
||||
twoPhaseProperties->correct();
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
phi = phiU +
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rUAf*mesh.magSf();
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ public:
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word& alpha1Name
|
||||
const word& alpha1Name = "alpha1"
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user