Commit 76381a7b authored by Andrew Heather's avatar Andrew Heather
Browse files
parents e2f2bd1f 44faceb7
......@@ -30,7 +30,8 @@ License
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
Foam::volScalarField&
Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
{
const scalar minVsf = min(vsf).value();
......@@ -55,6 +56,8 @@ void Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
vsf.boundaryField() = max(vsf.boundaryField(), lowerBound.value());
}
return vsf;
}
......
......@@ -50,8 +50,9 @@ namespace Foam
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
//- Bound the given scalar field if it has gone unbounded.
// Return the bounded field.
// Used extensively in RAS and LES turbulence models.
void bound(volScalarField&, const dimensionedScalar& lowerBound);
volScalarField& bound(volScalarField&, const dimensionedScalar& lowerBound);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -83,7 +83,7 @@ LESModel::LESModel
delta_(LESdelta::New("delta", U.mesh(), *this))
{
readIfPresent("kMin", kMin_);
kMin_.readIfPresent(*this);
// Force the construction of the mesh deltaCoeffs which may be needed
// for the construction of the derived models and BCs
......
......@@ -87,6 +87,10 @@ RASModel::RASModel
y_(mesh_)
{
kMin_.readIfPresent(*this);
epsilonMin_.readIfPresent(*this);
omegaMin_.readIfPresent(*this);
// Force the construction of the mesh deltaCoeffs which may be needed
// for the construction of the derived models and BCs
mesh_.deltaCoeffs();
......
......@@ -81,7 +81,7 @@ LESModel::LESModel
kMin_("kMin", sqr(dimVelocity), SMALL),
delta_(LESdelta::New("delta", U.mesh(), *this))
{
readIfPresent("kMin", kMin_);
kMin_.readIfPresent(*this);
// Force the construction of the mesh deltaCoeffs which may be needed
// for the construction of the derived models and BCs
......
......@@ -323,6 +323,8 @@ kOmegaSSTSAS::kOmegaSSTSAS
mesh_
)
{
omegaMin_.readIfPresent(*this);
bound(k_, kMin_);
bound(omega_, omegaMin_);
......@@ -458,6 +460,8 @@ bool kOmegaSSTSAS::read()
zetaTilda2_.readIfPresent(coeffDict());
FSAS_.readIfPresent(coeffDict());
omegaMin_.readIfPresent(*this);
return true;
}
else
......
......@@ -119,7 +119,7 @@ LamBremhorstKE::LamBremhorstKE
y_(mesh_),
Rt_(sqr(k_)/(nu()*epsilon_)),
Rt_(sqr(k_)/(nu()*bound(epsilon_, epsilonMin_))),
fMu_
(
......@@ -141,7 +141,7 @@ LamBremhorstKE::LamBremhorstKE
)
{
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
// already bounded: bound(epsilon_, epsilonMin_);
nut_ = Cmu_*fMu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
......
......@@ -173,12 +173,12 @@ LienCubicKE::LienCubicKE
gradU_(fvc::grad(U)),
eta_
(
k_/(epsilon_ + epsilonMin_)
k_/bound(epsilon_, epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
),
ksi_
(
k_/(epsilon_ + epsilonMin_)
k_/epsilon_
*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))
),
Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))),
......@@ -235,7 +235,7 @@ LienCubicKE::LienCubicKE
)
{
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
// already bounded: bound(epsilon_, epsilonMin_);
nut_ = Cmu_*sqr(k_)/epsilon_ + C5viscosity_;
nut_.correctBoundaryConditions();
......
......@@ -222,12 +222,12 @@ LienCubicKELowRe::LienCubicKELowRe
gradU_(fvc::grad(U)),
eta_
(
k_/(epsilon_ + epsilonMin_)
k_/bound(epsilon_, epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
),
ksi_
(
k_/(epsilon_ + epsilonMin_)
k_/epsilon_
*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))
),
Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))),
......@@ -235,7 +235,7 @@ LienCubicKELowRe::LienCubicKELowRe
C5viscosity_
(
-2.0*pow3(Cmu_)*pow4(k_)/pow3(epsilon_ + epsilonMin_)
-2.0*pow3(Cmu_)*pow4(k_)/pow3(epsilon_)
*(magSqr(gradU_ + gradU_.T()) - magSqr(gradU_ - gradU_.T()))
),
......@@ -260,7 +260,7 @@ LienCubicKELowRe::LienCubicKELowRe
symm
(
// quadratic terms
pow3(k_)/sqr(epsilon_ + epsilonMin_)
pow3(k_)/sqr(epsilon_)
*(
Ctau1_/fEta_
*(
......@@ -271,7 +271,7 @@ LienCubicKELowRe::LienCubicKELowRe
+ Ctau3_/fEta_*(gradU_.T() & gradU_)
)
// cubic term C4
- 20.0*pow4(k_)/pow3(epsilon_ + epsilonMin_)
- 20.0*pow4(k_)/pow3(epsilon_)
*pow3(Cmu_)
*(
((gradU_ & gradU_) & gradU_.T())
......@@ -289,7 +289,7 @@ LienCubicKELowRe::LienCubicKELowRe
)
{
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
// already bounded: bound(epsilon_, epsilonMin_);
nut_ = Cmu_
* (scalar(1) - exp(-Am_*yStar_))
......
......@@ -192,25 +192,25 @@ NonlinearKEShih::NonlinearKEShih
gradU_(fvc::grad(U)),
eta_
(
k_/(epsilon_ + epsilonMin_)
k_/bound(epsilon_, epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
),
ksi_
(
k_/(epsilon_+ epsilonMin_)
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)),
nut_("nut", Cmu_*sqr(k_)/(epsilon_ + epsilonMin_)),
nut_("nut", Cmu_*sqr(k_)/epsilon_),
nonlinearStress_
(
"nonlinearStress",
symm
(
pow3(k_)/sqr(epsilon_ + epsilonMin_)
pow3(k_)/sqr(epsilon_)
*(
Ctau1_/fEta_
*(
......@@ -224,7 +224,7 @@ NonlinearKEShih::NonlinearKEShih
)
{
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
// already bounded: bound(epsilon_, epsilonMin_);
#include "wallNonlinearViscosityI.H"
......
......@@ -86,6 +86,10 @@ RASModel::RASModel
y_(mesh_)
{
kMin_.readIfPresent(*this);
epsilonMin_.readIfPresent(*this);
omegaMin_.readIfPresent(*this);
// Force the construction of the mesh deltaCoeffs which may be needed
// for the construction of the derived models and BCs
mesh_.deltaCoeffs();
......
......@@ -179,7 +179,7 @@ qZeta::qZeta
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
epsilon_/(2.0*q_),
epsilon_/(2.0*bound(q_, qMin_)),
epsilon_.boundaryField().types()
),
......@@ -198,7 +198,7 @@ qZeta::qZeta
{
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
bound(q_, qMin_);
// already bounded: bound(q_, qMin_);
bound(zeta_, zetaMin_);
nut_ = Cmu_*fMu()*sqr(k_)/epsilon_;
......
# X11 includes and libraries in the standard location
#
XFLAGS =
XINC = $(XFLAGS) -I/usr/include/X11
XLIBS = -lXext -lX11
.SUFFIXES: .l
ltoo = flex $$SOURCE ; mv lex.yy.c $*.c ; $(cc) $(cFLAGS) -c $*.c -o $@
ltoo = flex -o $*.c $$SOURCE ; $(cc) $(cFLAGS) -c $*.c -o $@
.l.dep:
$(MAKE_DEP)
.SUFFIXES: .L
Ltoo = flex -+ -f $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
Ltoo = flex -+ -o $*.C -f $$SOURCE ; $(CC) $(c++FLAGS) -c $*.C -o $@
.L.dep:
$(MAKE_DEP)
.SUFFIXES: .L
Ltoo = flex++ $$SOURCE ; mv lex.yy.cc $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
.L.dep:
$(MAKE_DEP)
AR = ar
ARFLAGS = cr
RANLIB = ranlib
CPP = cpp
LD = ld
GFLAGS = -D$(WM_ARCH) -DWM_$(WM_PRECISION_OPTION)
......
PFLAGS =
PFLAGS = -DMPICH_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpich -lrt
Supports Markdown
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