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

This commit is contained in:
mattijs
2012-02-17 15:08:56 +00:00
38 changed files with 212 additions and 207 deletions

View File

@ -1,7 +1,8 @@
rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = invA & UEqn.H();
volVectorField HbyA("HbyA", U);
HbyA = invA & UEqn.H();
if (pimple.transonic())
{
@ -10,7 +11,7 @@ if (pimple.transonic())
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
);
@ -34,11 +35,14 @@ if (pimple.transonic())
}
else
{
phi =
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*
(
(fvc::interpolate(U) & mesh.Sf())
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
);
while (pimple.correctNonOrthogonal())
@ -46,7 +50,7 @@ else
fvScalarMatrix pEqn
(
betav*fvm::ddt(psi, p)
+ fvc::div(phi)
+ fvc::div(phiHbyA)
- fvm::laplacian(rho*invA, p)
);
@ -54,7 +58,7 @@ else
if (pimple.finalNonOrthogonalIter())
{
phi += pEqn.flux();
phi = phiHbyA + pEqn.flux();
}
}
}
@ -62,7 +66,7 @@ else
#include "rhoEqn.H"
#include "continuityErrs.H"
U -= invA & (betav*fvc::grad(p));
U = HbyA - (invA & (betav*fvc::grad(p)));
U.correctBoundaryConditions();
K = 0.5*magSqr(U);

View File

@ -41,12 +41,6 @@
{
label faceCelli = currPatch.faceCells()[facei];
scalar yPlus =
Cmu25*y[patchi][facei]
*::sqrt(k[faceCelli])
/nub_;
// For corner cells (with two boundary or more faces),
// epsilon and G in the near-wall cell are calculated
// as an average
@ -57,8 +51,6 @@
Cmu75*::pow(k[faceCelli], 1.5)
/(kappa_*y[patchi][facei]);
if (yPlus > 11.6)
{
G[faceCelli] +=
(nutbw[facei] + nub_)*magFaceGradU[facei]
*Cmu25*::sqrt(k[faceCelli])
@ -66,7 +58,6 @@
}
}
}
}
// perform the averaging
@ -83,6 +74,7 @@
epsilon[faceCelli] /= cellBoundaryFaceCount[faceCelli];
G[faceCelli] /= cellBoundaryFaceCount[faceCelli];
cellBoundaryFaceCount[faceCelli] = 1;
}
}
}

View File

@ -20,16 +20,11 @@
// calculate yPlus
scalar yPlus =
Cmu25*y[patchi][facei]
*::sqrt(k[faceCelli])
/nub_;
Cmu25*y[patchi][facei]*::sqrt(k[faceCelli])/nub_;
if (yPlus > 11.6)
{
nutw[facei] =
yPlus*nub_*kappa_
/::log(E_*yPlus)
- nub_;
nutw[facei] = nub_*(yPlus*kappa_/::log(E_*yPlus) -1);
}
else
{

View File

@ -41,12 +41,6 @@
{
label faceCelli = currPatch.faceCells()[facei];
scalar yPlus =
Cmu25*y[patchi][facei]
*::sqrt(k[faceCelli])
/nu2_;
// For corner cells (with two boundary or more faces),
// epsilon and G in the near-wall cell are calculated
// as an average
@ -57,8 +51,6 @@
Cmu75*::pow(k[faceCelli], 1.5)
/(kappa_*y[patchi][facei]);
if (yPlus > 11.6)
{
G[faceCelli] +=
(nut2w[facei] + nu2_)*magFaceGradU[facei]
*Cmu25*::sqrt(k[faceCelli])
@ -66,7 +58,6 @@
}
}
}
}
// perform the averaging
@ -83,6 +74,7 @@
epsilon[faceCelli] /= cellBoundaryFaceCount[faceCelli];
G[faceCelli] /= cellBoundaryFaceCount[faceCelli];
cellBoundaryFaceCount[faceCelli] = 1;
}
}
}

View File

@ -20,16 +20,11 @@
// calculate yPlus
scalar yPlus =
Cmu25*y[patchi][facei]
*::sqrt(k[faceCelli])
/nu2_;
Cmu25*y[patchi][facei]*::sqrt(k[faceCelli])/nu2_;
if (yPlus > 11.6)
{
nutw[facei] =
yPlus*nu2_*kappa_
/::log(E_*yPlus)
- nu2_;
nutw[facei] = nu2_*(yPlus*kappa_/::log(E_*yPlus) - 1);
}
else
{

View File

@ -9,7 +9,9 @@
(Alpha/(scalar(1.001) - Alpha))*(sqr(rhoc)/rho)*Vdj*Vdj,
"div(phiVdj,Vdj)"
)
- fvm::laplacian(mu, U, "laplacian(muEff,U)")
- fvm::laplacian(muEff, U, "laplacian(muEff,U)")
- (fvc::grad(U) & fvc::grad(muEff))
//- fvc::div(muEff*dev2(T(fvc::grad(U))))
);
UEqn.relax();

View File

@ -10,13 +10,16 @@
phi + rhoc*(mesh.Sf() & fvc::interpolate(Vdj))
);
solve
fvScalarMatrix AlphaEqn
(
fvm::ddt(rho, Alpha)
+ fvm::div(phiAlpha, Alpha)
- fvm::laplacian(mut, Alpha)
);
AlphaEqn.relax();
AlphaEqn.solve();
Info<< "Solid phase fraction = "
<< Alpha.weightedAverage(mesh.V()).value()
<< " Min(Alpha) = " << min(Alpha).value()

View File

@ -34,4 +34,6 @@
)
+ mul;
}
mul = min(mul, muMax);
}

View File

@ -61,6 +61,7 @@
dimensionedScalar rhod(transportProperties.lookup("rhod"));
dimensionedScalar muc(transportProperties.lookup("muc"));
dimensionedScalar muMax(transportProperties.lookup("muMax"));
dimensionedScalar plasticViscosityCoeff
(
@ -328,12 +329,12 @@
);
Info<< "Calculating field mu\n" << endl;
volScalarField mu
Info<< "Calculating field muEff\n" << endl;
volScalarField muEff
(
IOobject
(
"mu",
"muEff",
runTime.timeName(),
mesh,
IOobject::NO_READ,
@ -345,7 +346,7 @@
Info<< "Calculating field (g.h)f\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf(surfaceScalarField("gh", g & mesh.Cf()));
surfaceScalarField ghf("gh", g & mesh.Cf());
volScalarField p
(

View File

@ -5,7 +5,9 @@ if (turbulence)
y.correct();
}
dimensionedScalar k0("k0", k.dimensions(), 0);
dimensionedScalar kMin("kMin", k.dimensions(), SMALL);
dimensionedScalar epsilon0("epsilon0", epsilon.dimensions(), 0);
dimensionedScalar epsilonMin("epsilonMin", epsilon.dimensions(), SMALL);
volScalarField divU(fvc::div(phi/fvc::interpolate(rho)));
@ -28,13 +30,13 @@ if (turbulence)
+ fvm::div(phi, epsilon)
- fvm::laplacian
(
mut/sigmaEps + mul, epsilon,
mut/sigmaEps + muc, epsilon,
"laplacian(DepsilonEff,epsilon)"
)
==
C1*G*epsilon/k
C1*G*epsilon/(k + kMin)
- fvm::SuSp(C1*(1.0 - C3)*Gcoef + (2.0/3.0*C1)*rho*divU, epsilon)
- fvm::Sp(C2*rho*epsilon/k, epsilon)
- fvm::Sp(C2*rho*epsilon/(k + kMin), epsilon)
);
#include "wallDissipation.H"
@ -42,7 +44,7 @@ if (turbulence)
epsEqn.relax();
epsEqn.solve();
bound(epsilon, epsilonMin);
bound(epsilon, epsilon0);
// Turbulent kinetic energy equation
@ -52,19 +54,19 @@ if (turbulence)
+ fvm::div(phi, k)
- fvm::laplacian
(
mut/sigmak + mul, k,
mut/sigmak + muc, k,
"laplacian(DkEff,k)"
)
==
G
- fvm::SuSp(Gcoef + 2.0/3.0*rho*divU, k)
- fvm::Sp(rho*epsilon/k, k)
- fvm::Sp(rho*epsilon/(k + kMin), k)
);
kEqn.relax();
kEqn.solve();
bound(k, kMin);
bound(k, k0);
//- Re-calculate viscosity
@ -73,4 +75,4 @@ if (turbulence)
#include "wallViscosity.H"
}
mu = mut + mul;
muEff = mut + mul;

View File

@ -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
@ -57,11 +57,15 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (runTime.run())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"

View File

@ -1,9 +1,10 @@
{
labelList cellBoundaryFaceCount(epsilon.size(), 0);
scalar Cmu25 = ::pow(Cmu.value(), 0.25);
scalar Cmu75 = ::pow(Cmu.value(), 0.75);
scalar kappa_ = kappa.value();
const scalar Cmu25 = ::pow(Cmu.value(), 0.25);
const scalar Cmu75 = ::pow(Cmu.value(), 0.75);
const scalar kappa_ = kappa.value();
const scalar muc_ = muc.value();
const fvPatchList& patches = mesh.boundary();
@ -32,9 +33,6 @@
if (isA<wallFvPatch>(curPatch))
{
const scalarField& rhow = rho.boundaryField()[patchi];
const scalarField muw(mul.boundaryField()[patchi]);
const scalarField& mutw = mut.boundaryField()[patchi];
scalarField magFaceGradU
@ -46,10 +44,6 @@
{
label faceCelli = curPatch.faceCells()[facei];
scalar yPlus =
Cmu25*y[patchi][facei]*::sqrt(k[faceCelli])
/(muw[facei]/rhow[facei]);
// For corner cells (with two boundary or more faces),
// epsilon and G in the near-wall cell are calculated
// as an average
@ -57,19 +51,17 @@
cellBoundaryFaceCount[faceCelli]++;
epsilon[faceCelli] +=
Cmu75*rho[faceCelli]*::pow(k[faceCelli], 1.5)
Cmu75*::pow(k[faceCelli], 1.5)
/(kappa_*y[patchi][facei]);
if (yPlus > 11.6)
{
G[faceCelli] +=
mutw[facei]*magFaceGradU[facei]
(mutw[facei] + muc_)
*magFaceGradU[facei]
*Cmu25*::sqrt(k[faceCelli])
/(kappa_*y[patchi][facei]);
}
}
}
}
// perform the averaging
@ -86,6 +78,7 @@
epsilon[faceCelli] /= cellBoundaryFaceCount[faceCelli];
G[faceCelli] /= cellBoundaryFaceCount[faceCelli];
cellBoundaryFaceCount[faceCelli] = 1;
}
}
}

View File

@ -1,7 +1,9 @@
{
scalar Cmu25 = ::pow(Cmu.value(), 0.25);
scalar kappa_ = kappa.value();
scalar E_ = E.value();
const scalar Cmu25 = ::pow(Cmu.value(), 0.25);
const scalar kappa_ = kappa.value();
const scalar E_ = E.value();
const scalar muc_ = muc.value();
const scalar nuc_ = muc_/rhoc.value();
const fvPatchList& patches = mesh.boundary();
@ -11,9 +13,6 @@
if (isA<wallFvPatch>(curPatch))
{
const scalarField& rhow = rho.boundaryField()[patchi];
const scalarField muw(mul.boundaryField()[patchi]);
scalarField& mutw = mut.boundaryField()[patchi];
forAll(curPatch, facei)
@ -22,13 +21,12 @@
scalar yPlus =
Cmu25*y[patchi][facei]*::sqrt(k[faceCelli])
/(muw[facei]/rhow[facei]);
/nuc_;
if (yPlus > 11.6)
{
mutw[facei] =
muw[facei]
*(yPlus*kappa_/::log(E_*yPlus) - 1);
muc_*(yPlus*kappa_/::log(E_*yPlus) - 1);
}
else
{

View File

@ -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
@ -596,7 +596,7 @@ void Foam::fvMatrix<Type>::relax(const scalar alpha)
scalar sumNon = 0.0;
forAll(D, celli)
{
scalar d = (sumOff[celli] - D[celli])/D[celli];
scalar d = (sumOff[celli] - D[celli])/mag(D[celli]);
if (d > 0)
{
@ -621,8 +621,11 @@ void Foam::fvMatrix<Type>::relax(const scalar alpha)
// Ensure the matrix is diagonally dominant...
// (assumes that the central coefficient is positive)
max(D, D, sumOff);
// Assumes that the central coefficient is positive and ensures it is
forAll(D, celli)
{
D[celli] = max(mag(D[celli]), sumOff[celli]);
}
// ... then relax
D /= alpha;

View File

@ -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
@ -171,16 +171,15 @@ LienCubicKE::LienCubicKE
autoCreateEpsilon("epsilon", mesh_)
),
gradU_(fvc::grad(U)),
eta_
(
k_/bound(epsilon_, epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
*sqrt(2.0*magSqr(0.5*(fvc::grad(U) + T(fvc::grad(U)))))
),
ksi_
(
k_/epsilon_
*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))
*sqrt(2.0*magSqr(0.5*(fvc::grad(U) - T(fvc::grad(U)))))
),
Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))),
fEta_(A2_ + pow(eta_, 3.0)),
@ -189,8 +188,8 @@ LienCubicKE::LienCubicKE
(
- 2.0*pow3(Cmu_)*pow4(k_)/pow3(epsilon_)
*(
magSqr(gradU_ + gradU_.T())
- magSqr(gradU_ - gradU_.T())
magSqr(fvc::grad(U) + T(fvc::grad(U)))
- magSqr(fvc::grad(U) - T(fvc::grad(U)))
)
),
@ -217,20 +216,20 @@ LienCubicKE::LienCubicKE
*(
Ctau1_/fEta_
*(
(gradU_ & gradU_)
+ (gradU_ & gradU_)().T()
(fvc::grad(U) & fvc::grad(U))
+ (fvc::grad(U) & fvc::grad(U))().T()
)
+ Ctau2_/fEta_*(gradU_ & gradU_.T())
+ Ctau3_/fEta_*(gradU_.T() & gradU_)
+ Ctau2_/fEta_*(fvc::grad(U) & T(fvc::grad(U)))
+ Ctau3_/fEta_*(T(fvc::grad(U)) & fvc::grad(U))
)
// cubic term C4
- 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0)
*pow(Cmu_, 3.0)
*(
((gradU_ & gradU_) & gradU_.T())
+ ((gradU_ & gradU_.T()) & gradU_.T())
- ((gradU_.T() & gradU_) & gradU_)
- ((gradU_.T() & gradU_.T()) & gradU_)
((fvc::grad(U) & fvc::grad(U)) & T(fvc::grad(U)))
+ ((fvc::grad(U) & T(fvc::grad(U))) & T(fvc::grad(U)))
- ((T(fvc::grad(U)) & fvc::grad(U)) & fvc::grad(U))
- ((T(fvc::grad(U)) & T(fvc::grad(U))) & fvc::grad(U))
)
)
)
@ -261,7 +260,7 @@ tmp<volSymmTensorField> LienCubicKE::R() const
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU_) + nonlinearStress_,
((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)) + nonlinearStress_,
k_.boundaryField().types()
)
);
@ -332,15 +331,16 @@ void LienCubicKE::correct()
return;
}
gradU_ = fvc::grad(U_);
tmp<volTensorField> tgradU = fvc::grad(U_);
const volTensorField& gradU = tgradU();
// generation term
tmp<volScalarField> S2 = symm(gradU_) && gradU_;
tmp<volScalarField> S2 = symm(gradU) && gradU;
volScalarField G
(
"RASModel::G",
Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_)
Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU)
);
// Update epsilon and G at the wall
@ -384,14 +384,14 @@ void LienCubicKE::correct()
// Re-calculate viscosity
eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())));
ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())));
eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU + gradU.T())));
ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU - gradU.T())));
Cmu_ = 2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_));
fEta_ = A2_ + pow(eta_, 3.0);
C5viscosity_ =
- 2.0*pow(Cmu_, 3.0)*pow(k_, 4.0)/pow(epsilon_, 3.0)
*(magSqr(gradU_ + gradU_.T()) - magSqr(gradU_ - gradU_.T()));
*(magSqr(gradU + gradU.T()) - magSqr(gradU - gradU.T()));
nut_ = Cmu_*sqr(k_)/epsilon_ + C5viscosity_;
nut_.correctBoundaryConditions();
@ -403,20 +403,20 @@ void LienCubicKE::correct()
(
Ctau1_/fEta_*
(
(gradU_ & gradU_)
+ (gradU_ & gradU_)().T()
(gradU & gradU)
+ (gradU & gradU)().T()
)
+ Ctau2_/fEta_*(gradU_ & gradU_.T())
+ Ctau3_/fEta_*(gradU_.T() & gradU_)
+ Ctau2_/fEta_*(gradU & gradU.T())
+ Ctau3_/fEta_*(gradU.T() & gradU)
)
// cubic term C4
- 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0)
*pow(Cmu_, 3.0)
*(
((gradU_ & gradU_) & gradU_.T())
+ ((gradU_ & gradU_.T()) & gradU_.T())
- ((gradU_.T() & gradU_) & gradU_)
- ((gradU_.T() & gradU_.T()) & gradU_)
((gradU & gradU) & gradU.T())
+ ((gradU & gradU.T()) & gradU.T())
- ((gradU.T() & gradU) & gradU)
- ((gradU.T() & gradU.T()) & gradU)
)
);
}

View File

@ -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
@ -78,7 +78,6 @@ protected:
volScalarField k_;
volScalarField epsilon_;
volTensorField gradU_;
volScalarField eta_;
volScalarField ksi_;
volScalarField Cmu_;

View File

@ -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
@ -220,16 +220,15 @@ LienCubicKELowRe::LienCubicKELowRe
y_(mesh_),
gradU_(fvc::grad(U)),
eta_
(
k_/bound(epsilon_, epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
*sqrt(2.0*magSqr(0.5*(fvc::grad(U) + T(fvc::grad(U)))))
),
ksi_
(
k_/epsilon_
*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))
*sqrt(2.0*magSqr(0.5*(fvc::grad(U) - T(fvc::grad(U)))))
),
Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))),
fEta_(A2_ + pow3(eta_)),
@ -237,7 +236,10 @@ LienCubicKELowRe::LienCubicKELowRe
C5viscosity_
(
-2.0*pow3(Cmu_)*pow4(k_)/pow3(epsilon_)
*(magSqr(gradU_ + gradU_.T()) - magSqr(gradU_ - gradU_.T()))
*(
magSqr(fvc::grad(U) + T(fvc::grad(U)))
- magSqr(fvc::grad(U) - T(fvc::grad(U)))
)
),
yStar_(sqrt(k_)*y_/nu() + SMALL),
@ -265,27 +267,27 @@ LienCubicKELowRe::LienCubicKELowRe
*(
Ctau1_/fEta_
*(
(gradU_ & gradU_)
+ (gradU_ & gradU_)().T()
(fvc::grad(U) & fvc::grad(U))
+ (fvc::grad(U) & fvc::grad(U))().T()
)
+ Ctau2_/fEta_*(gradU_ & gradU_.T())
+ Ctau3_/fEta_*(gradU_.T() & gradU_)
+ Ctau2_/fEta_*(fvc::grad(U) & T(fvc::grad(U)))
+ Ctau3_/fEta_*(T(fvc::grad(U)) & fvc::grad(U))
)
// cubic term C4
- 20.0*pow4(k_)/pow3(epsilon_)
*pow3(Cmu_)
*(
((gradU_ & gradU_) & gradU_.T())
+ ((gradU_ & gradU_.T()) & gradU_.T())
- ((gradU_.T() & gradU_) & gradU_)
- ((gradU_.T() & gradU_.T()) & gradU_)
((fvc::grad(U) & fvc::grad(U)) & T(fvc::grad(U)))
+ ((fvc::grad(U) & T(fvc::grad(U))) & T(fvc::grad(U)))
- ((T(fvc::grad(U)) & fvc::grad(U)) & fvc::grad(U))
- ((T(fvc::grad(U)) & T(fvc::grad(U))) & fvc::grad(U))
)
// cubic term C5, explicit part
+ min
(
C5viscosity_,
dimensionedScalar("0", C5viscosity_.dimensions(), 0.0)
)*gradU_
)*fvc::grad(U)
)
)
{
@ -325,7 +327,7 @@ tmp<volSymmTensorField> LienCubicKELowRe::R() const
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU_) + nonlinearStress_,
((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)) + nonlinearStress_,
k_.boundaryField().types()
)
);
@ -406,10 +408,11 @@ void LienCubicKELowRe::correct()
y_.correct();
}
gradU_ = fvc::grad(U_);
tmp<volTensorField> tgradU = fvc::grad(U_);
const volTensorField& gradU = tgradU();
// generation term
tmp<volScalarField> S2 = symm(gradU_) && gradU_;
tmp<volScalarField> S2 = symm(gradU) && gradU;
yStar_ = sqrt(k_)*y_/nu() + SMALL;
tmp<volScalarField> Rt = sqr(k_)/(nu()*epsilon_);
@ -427,7 +430,7 @@ void LienCubicKELowRe::correct()
volScalarField G
(
"RASModel::G",
Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_)
Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU)
);
// Dissipation equation
@ -473,14 +476,14 @@ void LienCubicKELowRe::correct()
// Re-calculate viscosity
eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())));
ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())));
eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU + gradU.T())));
ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU - gradU.T())));
Cmu_ = 2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_));
fEta_ = A2_ + pow(eta_, 3.0);
C5viscosity_ =
- 2.0*pow(Cmu_, 3.0)*pow(k_, 4.0)/pow(epsilon_, 3.0)
*(magSqr(gradU_ + gradU_.T()) - magSqr(gradU_ - gradU_.T()));
*(magSqr(gradU + gradU.T()) - magSqr(gradU - gradU.T()));
nut_ =
Cmu_*fMu*sqr(k_)/epsilon_
@ -498,27 +501,27 @@ void LienCubicKELowRe::correct()
*(
Ctau1_/fEta_
*(
(gradU_ & gradU_)
+ (gradU_ & gradU_)().T()
(gradU & gradU)
+ (gradU & gradU)().T()
)
+ Ctau2_/fEta_*(gradU_ & gradU_.T())
+ Ctau3_/fEta_*(gradU_.T() & gradU_)
+ Ctau2_/fEta_*(gradU & gradU.T())
+ Ctau3_/fEta_*(gradU.T() & gradU)
)
// cubic term C4
- 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0)
*pow(Cmu_, 3.0)
*(
((gradU_ & gradU_) & gradU_.T())
+ ((gradU_ & gradU_.T()) & gradU_.T())
- ((gradU_.T() & gradU_) & gradU_)
- ((gradU_.T() & gradU_.T()) & gradU_)
((gradU & gradU) & gradU.T())
+ ((gradU & gradU.T()) & gradU.T())
- ((gradU.T() & gradU) & gradU)
- ((gradU.T() & gradU.T()) & gradU)
)
// cubic term C5, explicit part
+ min
(
C5viscosity_,
dimensionedScalar("0", C5viscosity_.dimensions(), 0.0)
)*gradU_
)*gradU
);
}

View File

@ -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
@ -103,7 +103,6 @@ protected:
wallDist y_;
volTensorField gradU_;
volScalarField eta_;
volScalarField ksi_;
volScalarField Cmu_;

View File

@ -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
@ -190,16 +190,15 @@ NonlinearKEShih::NonlinearKEShih
mesh_
),
gradU_(fvc::grad(U)),
eta_
(
k_/bound(epsilon_, epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
*sqrt(2.0*magSqr(0.5*(fvc::grad(U) + T(fvc::grad(U)))))
),
ksi_
(
k_/epsilon_
*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))
*sqrt(2.0*magSqr(0.5*(fvc::grad(U) - T(fvc::grad(U)))))
),
Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))),
fEta_(A2_ + pow(eta_, 3.0)),
@ -215,11 +214,11 @@ NonlinearKEShih::NonlinearKEShih
*(
Ctau1_/fEta_
*(
(gradU_ & gradU_)
+ (gradU_ & gradU_)().T()
(fvc::grad(U) & fvc::grad(U))
+ (fvc::grad(U) & fvc::grad(U))().T()
)
+ Ctau2_/fEta_*(gradU_ & gradU_.T())
+ Ctau3_/fEta_*(gradU_.T() & gradU_)
+ Ctau2_/fEta_*(fvc::grad(U) & T(fvc::grad(U)))
+ Ctau3_/fEta_*(T(fvc::grad(U)) & fvc::grad(U))
)
)
)
@ -323,16 +322,17 @@ void NonlinearKEShih::correct()
return;
}
gradU_ = fvc::grad(U_);
tmp<volTensorField> tgradU = fvc::grad(U_);
const volTensorField& gradU = tgradU();
// generation term
tmp<volScalarField> S2 = symm(gradU_) && gradU_;
tmp<volScalarField> S2 = symm(gradU) && gradU;
volScalarField G
(
"RASModel::G",
Cmu_*sqr(k_)/epsilon_*S2
- (nonlinearStress_ && gradU_)
- (nonlinearStress_ && gradU)
);
#include "nonLinearWallFunctionsI.H"
@ -375,8 +375,8 @@ void NonlinearKEShih::correct()
// Re-calculate viscosity
eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())));
ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())));
eta_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU + T(gradU))));
ksi_ = k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU - T(gradU))));
Cmu_ = 2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_));
fEta_ = A2_ + pow(eta_, 3.0);
@ -390,11 +390,11 @@ void NonlinearKEShih::correct()
*(
Ctau1_/fEta_
*(
(gradU_ & gradU_)
+ (gradU_ & gradU_)().T()
(gradU & gradU)
+ (gradU & gradU)().T()
)
+ Ctau2_/fEta_*(gradU_ & gradU_.T())
+ Ctau3_/fEta_*(gradU_.T() & gradU_)
+ Ctau2_/fEta_*(gradU & T(gradU))
+ Ctau3_/fEta_*(T(gradU) & gradU)
)
);
}

View File

@ -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
@ -82,7 +82,6 @@ protected:
volScalarField k_;
volScalarField epsilon_;
volTensorField gradU_;
volScalarField eta_;
volScalarField ksi_;
volScalarField Cmu_;

View File

@ -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
@ -104,7 +104,7 @@ Description
*magFaceGradU[facei]
*Cmu25*sqrt(k_[faceCelli])
/(kappa_.value()*y_[patchi][facei])
- (nonlinearStress_[faceCelli] && gradU_[faceCelli]);
- (nonlinearStress_[faceCelli] && gradU[faceCelli]);
}
}
}

View File

@ -23,12 +23,13 @@ boundaryField
inlet
{
type fixedValue;
value uniform (0.0191 0 0);
value $internalField;
}
outlet
{
type zeroGradient;
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
bottomWall

View File

@ -23,12 +23,13 @@ boundaryField
inlet
{
type fixedValue;
value uniform 0.001;
value $internalField;
}
outlet
{
type zeroGradient;
type inletOutlet;
inletValue $internalField;
}
bottomWall

View File

@ -23,12 +23,13 @@ boundaryField
inlet
{
type fixedValue;
value uniform 1.50919e-06;
value $internalField;
}
outlet
{
type zeroGradient;
type inletOutlet;
inletValue $internalField;
}
bottomWall

View File

@ -23,12 +23,13 @@ boundaryField
inlet
{
type fixedValue;
value uniform 0.00015;
value $internalField;
}
outlet
{
type zeroGradient;
type inletOutlet;
inletValue $internalField;
}
bottomWall

View File

@ -22,7 +22,8 @@ boundaryField
{
inlet
{
type zeroGradient;
type buoyantPressure;
value uniform 0;
}
outlet
@ -39,7 +40,8 @@ boundaryField
endWall
{
type zeroGradient;
type buoyantPressure;
value uniform 0;
}
top

View File

@ -63,7 +63,7 @@ boundary
}
bottomWall
{
type patch;
type wall;
faces
(
(0 1 7 6)

View File

@ -31,7 +31,7 @@ FoamFile
}
bottomWall
{
type patch;
type wall;
nFaces 200;
startFace 15804;
}

View File

@ -29,6 +29,8 @@ yieldStressExponent yieldStressExponent [ 0 0 0 0 0 0 0 ] 1050.8;
yieldStressOffset yieldStressOffset [ 0 0 0 0 0 0 0 ] 0;
muMax muMax [ 1 -1 -1 0 0 0 0 ] 10.0;
rhoc rhoc [ 1 -3 0 0 0 0 0 ] 996;
rhod rhod [ 1 -3 0 0 0 0 0 ] 1996;

View File

@ -27,7 +27,7 @@ endTime 6400;
deltaT 0.1;
writeControl runTime;
writeControl adjustableRunTime;
writeInterval 20;
@ -45,4 +45,10 @@ timePrecision 6;
runTimeModifiable yes;
adjustTimeStep on;
maxCo 0.5;
maxDeltaT 1;
// ************************************************************************* //

View File

@ -28,9 +28,9 @@ gradSchemes
divSchemes
{
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,U) Gauss linearUpwind grad(U);
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phiAlpha,Alpha) Gauss limitedLinear01 1;
div(phiVdj,Vdj) Gauss linear;
}

View File

@ -36,14 +36,14 @@ solvers
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-07;
tolerance 1e-8;
relTol 0.1;
}
"(U|Alpha|k|epsilon)Final"
{
$k;
tolerance 1e-07;
tolerance 1e-8;
relTol 0;
}
@ -51,21 +51,21 @@ solvers
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
tolerance 1e-8;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-07;
tolerance 1e-8;
relTol 0;
}
}
PIMPLE
{
nCorrectors 2;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
}
@ -76,6 +76,7 @@ relaxationFactors
}
equations
{
"Alpha.*" 1;
"U.*" 1;
"k.*" 1;
"epsilon.*" 1;

View File

@ -29,6 +29,8 @@ yieldStressExponent yieldStressExponent [ 0 0 0 0 0 0 0 ] 95.25;
yieldStressOffset yieldStressOffset [ 0 0 0 0 0 0 0 ] 0;
muMax muMax [ 1 -1 -1 0 0 0 0 ] 10.0;
rhoc rhoc [ 1 -3 0 0 0 0 0 ] 1000;
rhod rhod [ 1 -3 0 0 0 0 0 ] 1042;

View File

@ -76,6 +76,7 @@ relaxationFactors
}
equations
{
"Alpha.*" 1;
"U.*" 1;
"k.*" 1;
"epsilon.*" 1;

View File

@ -1,3 +1,3 @@
#c++DBUG = -O0 -DFULLDEBUG -g
c++DBUG =
c++OPT = -O3
# -fprefetch-loop-arrays

View File

@ -1,2 +1,3 @@
cDBUG =
cOPT = -O3
# -fprefetch-loop-arrays

View File

@ -1,3 +1,3 @@
c++DBUG =
#c++OPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard
c++OPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=softfp
#c++OPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -fprefetch-loop-arrays -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard
c++OPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -fprefetch-loop-arrays -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=softfp

View File

@ -1,3 +1,3 @@
cDBUG =
#cOPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard
cOPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=softfp
#cOPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -fprefetch-loop-arrays -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard
cOPT = -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -fprefetch-loop-arrays -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=softfp