Merge commit 'OpenCFD/master' into olesenm

This commit is contained in:
Mark Olesen
2009-02-02 16:58:00 +01:00
61 changed files with 1201 additions and 80 deletions

View File

@ -48,6 +48,9 @@ int main(int argc, char *argv[])
# include "readEnvironmentalProperties.H"
# include "createFields.H"
# include "initContinuityErrs.H"
# include "readTimeControls.H"
# include "compressibleCourantNo.H"
# include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,11 +58,13 @@ int main(int argc, char *argv[])
while (runTime.run())
{
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "compressibleCourantNo.H"
//# include "setDeltaT.H"
# include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "rhoEqn.H"

View File

@ -52,8 +52,9 @@
)
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt = fvc::ddt(p);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());

View File

@ -5,9 +5,7 @@
+ fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
dpdt
+ fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
- p*fvc::div(phi/fvc::interpolate(rho))
DpDt
);
hEqn.relax();

View File

@ -40,7 +40,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
}
p == pd + rho*gh + pRef;
dpdt = fvc::ddt(p);
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"

View File

@ -177,6 +177,25 @@ surfaces
interpolate false;
regularise false; // do not simplify
}
triangleCut
{
// Cutingplaneusing iso surface
type cuttingPlane;
planeType pointAndNormal;
pointAndNormalDict
{
basePoint (0.4 0 0.4);
normalVector (1 0.2 0.2);
}
interpolate true;
//zone ABC; // Optional: zone only
//exposedPatchName fixedWalls; // Optional: zone only
// regularise false; // Optional: do not simplify
}
);

View File

@ -172,6 +172,17 @@ Linux)
esac
;;
SunOS)
WM_ARCH=SunOS64
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
export WM_MPLIB=FJMPI
;;
*) # an unsupported operating system
cat <<USAGE

View File

@ -149,7 +149,7 @@ case Linux:
setenv WM_ARCH linuxIA64
setenv WM_COMPILER I64
breaksw
mips64)
case mips64:
setenv WM_ARCH SiCortex64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
@ -165,6 +165,17 @@ case Linux:
endsw
breaksw
case SunOS:
setenv WM_ARCH SunOS64
setenv WM_COMPILER_LIB_ARCH 64
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-mabi=64 -fPIC'
setenv WM_CXXFLAGS '-mabi=64 -fPIC'
setenv WM_LDFLAGS '-mabi=64 -G0'
setenv WM_MPLIB FJMPI
breaksw
default:
echo
echo "Your '$WM_ARCH' operating system is not supported by this release"

View File

@ -222,6 +222,15 @@ case MPI:
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
breaksw
case FJMPI:
setenv MPI_ARCH_PATH /opt/FJSVmpi2
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
_foamAddLib /opt/FSUNf90/lib/sparcv9
_foamAddLib /opt/FJSVpnidt/lib
breaksw
default:
setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
breaksw

View File

@ -249,6 +249,16 @@ MPI)
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
;;
FJMPI)
export MPI_ARCH_PATH=/opt/FJSVmpi2
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib/sparcv9
_foamAddLib /opt/FSUNf90/lib/sparcv9
_foamAddLib /opt/FJSVpnidt/lib
;;
*)
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/dummy
;;

View File

@ -8,7 +8,11 @@ fileStat.C
Unix.C
cpuTime/cpuTime.C
clockTime/clockTime.C
#ifndef SunOS64
printStack.C
/*dummyPrintStack.C*/
#else
dummyPrintStack.C
#endif
LIB = $(FOAM_LIBBIN)/libOSspecific

View File

@ -29,6 +29,7 @@ sampledSurface/isoSurface/sampledIsoSurface.C
sampledSurface/isoSurface/isoSurfaceCell.C
sampledSurface/isoSurface/sampledIsoSurfaceCell.C
sampledSurface/distanceSurface/distanceSurface.C
sampledSurface/sampledCuttingPlane/sampledCuttingPlane.C
sampledSurface/sampledSurface/sampledSurface.C
sampledSurface/sampledSurfaces/sampledSurfaces.C
sampledSurface/sampledSurfacesFunctionObject/sampledSurfacesFunctionObject.C

View File

@ -0,0 +1,420 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "sampledCuttingPlane.H"
#include "dictionary.H"
#include "volFields.H"
#include "volPointInterpolation.H"
#include "addToRunTimeSelectionTable.H"
#include "fvMesh.H"
#include "isoSurface.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(sampledCuttingPlane, 0);
addNamedToRunTimeSelectionTable(sampledSurface, sampledCuttingPlane, word, cuttingPlane);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::sampledCuttingPlane::createGeometry()
{
if (debug)
{
Pout<< "sampledCuttingPlane::createGeometry :updating geometry."
<< endl;
}
// Clear any stored topologies
facesPtr_.clear();
isoSurfPtr_.ptr();
pointDistance_.clear();
cellDistancePtr_.clear();
// Get any subMesh
if (zoneID_.index() != -1 && !subMeshPtr_.valid())
{
const polyBoundaryMesh& patches = mesh().boundaryMesh();
// Patch to put exposed internal faces into
label exposedPatchI = patches.findPatchID(exposedPatchName_);
if (debug)
{
Info<< "Allocating subset of size "
<< mesh().cellZones()[zoneID_.index()].size()
<< " with exposed faces into patch "
<< patches[exposedPatchI].name() << endl;
}
subMeshPtr_.reset
(
new fvMeshSubset(static_cast<const fvMesh&>(mesh()))
);
subMeshPtr_().setLargeCellSubset
(
labelHashSet(mesh().cellZones()[zoneID_.index()]),
exposedPatchI
);
}
// Select either the submesh or the underlying mesh
const fvMesh& fvm =
(
subMeshPtr_.valid()
? subMeshPtr_().subMesh()
: static_cast<const fvMesh&>(mesh())
);
// Distance to cell centres
// ~~~~~~~~~~~~~~~~~~~~~~~~
cellDistancePtr_.reset
(
new volScalarField
(
IOobject
(
"cellDistance",
fvm.time().timeName(),
fvm.time(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
fvm,
dimensionedScalar("zero", dimLength, 0)
)
);
volScalarField& cellDistance = cellDistancePtr_();
// Internal field
{
const pointField& cc = fvm.C();
scalarField& fld = cellDistance.internalField();
forAll(cc, i)
{
// Signed distance
fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
}
}
// Patch fields
{
forAll(fvm.C().boundaryField(), patchI)
{
const pointField& cc = fvm.C().boundaryField()[patchI];
fvPatchScalarField& fld = cellDistance.boundaryField()[patchI];
forAll(fld, i)
{
fld[i] = (cc[i] - plane_.refPoint()) & plane_.normal();
}
}
}
// On processor patches the mesh.C() will already be the cell centre
// on the opposite side so no need to swap cellDistance.
// Distance to points
pointDistance_.setSize(fvm.nPoints());
{
const pointField& pts = fvm.points();
forAll(pointDistance_, i)
{
pointDistance_[i] = (pts[i] - plane_.refPoint()) & plane_.normal();
}
}
if (debug)
{
Pout<< "Writing cell distance:" << cellDistance.objectPath() << endl;
cellDistance.write();
pointScalarField pDist
(
IOobject
(
"pointDistance",
fvm.time().timeName(),
fvm.time(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
pointMesh::New(fvm),
dimensionedScalar("zero", dimLength, 0)
);
pDist.internalField() = pointDistance_;
Pout<< "Writing point distance:" << pDist.objectPath() << endl;
pDist.write();
}
//- Direct from cell field and point field.
isoSurfPtr_.reset
(
new isoSurface
(
cellDistance,
pointDistance_,
0.0,
regularise_
)
);
if (debug)
{
print(Pout);
Pout<< endl;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::sampledCuttingPlane::sampledCuttingPlane
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
)
:
sampledSurface(name, mesh, dict),
plane_(dict),
mergeTol_(dict.lookupOrDefault("mergeTol", 1E-6)),
regularise_(dict.lookupOrDefault("regularise", true)),
zoneID_(dict.lookupOrDefault("zone", word::null), mesh.cellZones()),
exposedPatchName_(word::null),
needsUpdate_(true),
subMeshPtr_(NULL),
cellDistancePtr_(NULL),
isoSurfPtr_(NULL),
facesPtr_(NULL)
{
if (zoneID_.index() != -1)
{
dict.lookup("exposedPatchName") >> exposedPatchName_;
if (mesh.boundaryMesh().findPatchID(exposedPatchName_) == -1)
{
FatalErrorIn
(
"sampledCuttingPlane::sampledCuttingPlane"
"(const word&, const polyMesh&, const dictionary&)"
) << "Cannot find patch " << exposedPatchName_
<< " in which to put exposed faces." << endl
<< "Valid patches are " << mesh.boundaryMesh().names()
<< exit(FatalError);
}
if (debug && zoneID_.index() != -1)
{
Info<< "Restricting to cellZone " << zoneID_.name()
<< " with exposed internal faces into patch "
<< exposedPatchName_ << endl;
}
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sampledCuttingPlane::~sampledCuttingPlane()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::sampledCuttingPlane::needsUpdate() const
{
return needsUpdate_;
}
bool Foam::sampledCuttingPlane::expire()
{
if (debug)
{
Pout<< "sampledCuttingPlane::expire :"
<< " have-facesPtr_:" << facesPtr_.valid()
<< " needsUpdate_:" << needsUpdate_ << endl;
}
// Clear any stored topologies
facesPtr_.clear();
// already marked as expired
if (needsUpdate_)
{
return false;
}
needsUpdate_ = true;
return true;
}
bool Foam::sampledCuttingPlane::update()
{
if (debug)
{
Pout<< "sampledCuttingPlane::update :"
<< " have-facesPtr_:" << facesPtr_.valid()
<< " needsUpdate_:" << needsUpdate_ << endl;
}
if (!needsUpdate_)
{
return false;
}
createGeometry();
needsUpdate_ = false;
return true;
}
Foam::tmp<Foam::scalarField>
Foam::sampledCuttingPlane::sample
(
const volScalarField& vField
) const
{
return sampleField(vField);
}
Foam::tmp<Foam::vectorField>
Foam::sampledCuttingPlane::sample
(
const volVectorField& vField
) const
{
return sampleField(vField);
}
Foam::tmp<Foam::sphericalTensorField>
Foam::sampledCuttingPlane::sample
(
const volSphericalTensorField& vField
) const
{
return sampleField(vField);
}
Foam::tmp<Foam::symmTensorField>
Foam::sampledCuttingPlane::sample
(
const volSymmTensorField& vField
) const
{
return sampleField(vField);
}
Foam::tmp<Foam::tensorField>
Foam::sampledCuttingPlane::sample
(
const volTensorField& vField
) const
{
return sampleField(vField);
}
Foam::tmp<Foam::scalarField>
Foam::sampledCuttingPlane::interpolate
(
const interpolation<scalar>& interpolator
) const
{
return interpolateField(interpolator);
}
Foam::tmp<Foam::vectorField>
Foam::sampledCuttingPlane::interpolate
(
const interpolation<vector>& interpolator
) const
{
return interpolateField(interpolator);
}
Foam::tmp<Foam::sphericalTensorField>
Foam::sampledCuttingPlane::interpolate
(
const interpolation<sphericalTensor>& interpolator
) const
{
return interpolateField(interpolator);
}
Foam::tmp<Foam::symmTensorField>
Foam::sampledCuttingPlane::interpolate
(
const interpolation<symmTensor>& interpolator
) const
{
return interpolateField(interpolator);
}
Foam::tmp<Foam::tensorField>
Foam::sampledCuttingPlane::interpolate
(
const interpolation<tensor>& interpolator
) const
{
return interpolateField(interpolator);
}
void Foam::sampledCuttingPlane::print(Ostream& os) const
{
os << "sampledCuttingPlane: " << name() << " :"
<< " plane:" << plane_
<< " faces:" << faces().size()
<< " points:" << points().size();
}
// ************************************************************************* //

View File

@ -0,0 +1,258 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::sampledCuttingPlane
Description
A sampledSurface defined by a plane
SourceFiles
sampledCuttingPlane.C
\*---------------------------------------------------------------------------*/
#ifndef sampledCuttingPlane_H
#define sampledCuttingPlane_H
#include "sampledSurface.H"
#include "isoSurface.H"
#include "plane.H"
#include "ZoneIDs.H"
#include "fvMeshSubset.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class sampledCuttingPlane Declaration
\*---------------------------------------------------------------------------*/
class sampledCuttingPlane
:
public sampledSurface
{
// Private data
//- Plane
const plane plane_;
//- Merge tolerance
const scalar mergeTol_;
//- Whether to coarsen
const Switch regularise_;
//- zone name/index (if restricted to zones)
mutable cellZoneID zoneID_;
//- for zones: patch to put exposed faces into
mutable word exposedPatchName_;
//- Track if the surface needs an update
mutable bool needsUpdate_;
//- Optional subsetted mesh
autoPtr<fvMeshSubset> subMeshPtr_;
//- Distance to cell centres
autoPtr<volScalarField> cellDistancePtr_;
//- Distance to points
scalarField pointDistance_;
//- Constructed iso surface
autoPtr<isoSurface> isoSurfPtr_;
//- triangles converted to faceList
mutable autoPtr<faceList> facesPtr_;
// Private Member Functions
//- Create iso surface
void createGeometry();
//- sample field on faces
template <class Type>
tmp<Field<Type> > sampleField
(
const GeometricField<Type, fvPatchField, volMesh>& vField
) const;
template <class Type>
tmp<Field<Type> >
interpolateField(const interpolation<Type>&) const;
public:
//- Runtime type information
TypeName("sampledCuttingPlane");
// Constructors
//- Construct from dictionary
sampledCuttingPlane
(
const word& name,
const polyMesh& mesh,
const dictionary& dict
);
// Destructor
virtual ~sampledCuttingPlane();
// Member Functions
//- Does the surface need an update?
virtual bool needsUpdate() const;
//- Mark the surface as needing an update.
// May also free up unneeded data.
// Return false if surface was already marked as expired.
virtual bool expire();
//- Update the surface as required.
// Do nothing (and return false) if no update was needed
virtual bool update();
//- Points of surface
virtual const pointField& points() const
{
return surface().points();
}
//- Faces of surface
virtual const faceList& faces() const
{
if (facesPtr_.empty())
{
const triSurface& s = surface();
facesPtr_.reset(new faceList(s.size()));
forAll(s, i)
{
facesPtr_()[i] = s[i].triFaceFace();
}
}
return facesPtr_;
}
const isoSurface& surface() const
{
return isoSurfPtr_();
}
//- sample field on surface
virtual tmp<scalarField> sample
(
const volScalarField&
) const;
//- sample field on surface
virtual tmp<vectorField> sample
(
const volVectorField&
) const;
//- sample field on surface
virtual tmp<sphericalTensorField> sample
(
const volSphericalTensorField&
) const;
//- sample field on surface
virtual tmp<symmTensorField> sample
(
const volSymmTensorField&
) const;
//- sample field on surface
virtual tmp<tensorField> sample
(
const volTensorField&
) const;
//- interpolate field on surface
virtual tmp<scalarField> interpolate
(
const interpolation<scalar>&
) const;
//- interpolate field on surface
virtual tmp<vectorField> interpolate
(
const interpolation<vector>&
) const;
//- interpolate field on surface
virtual tmp<sphericalTensorField> interpolate
(
const interpolation<sphericalTensor>&
) const;
//- interpolate field on surface
virtual tmp<symmTensorField> interpolate
(
const interpolation<symmTensor>&
) const;
//- interpolate field on surface
virtual tmp<tensorField> interpolate
(
const interpolation<tensor>&
) const;
//- Write
virtual void print(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "sampledCuttingPlaneTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "volPointInterpolation.H"
#include "sampledCuttingPlane.H"
#include "isoSurface.H"
#include "volFieldsFwd.H"
#include "pointFields.H"
#include "volPointInterpolation.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template <class Type>
Foam::tmp<Foam::Field<Type> >
Foam::sampledCuttingPlane::sampleField
(
const GeometricField<Type, fvPatchField, volMesh>& vField
) const
{
return tmp<Field<Type> >(new Field<Type>(vField, surface().meshCells()));
}
template <class Type>
Foam::tmp<Foam::Field<Type> >
Foam::sampledCuttingPlane::interpolateField
(
const interpolation<Type>& interpolator
) const
{
// Get fields to sample. Assume volPointInterpolation!
const GeometricField<Type, fvPatchField, volMesh>& volFld =
interpolator.psi();
if (subMeshPtr_.valid())
{
tmp<GeometricField<Type, fvPatchField, volMesh> > tvolSubFld =
subMeshPtr_().interpolate(volFld);
const GeometricField<Type, fvPatchField, volMesh>& volSubFld =
tvolSubFld();
tmp<GeometricField<Type, pointPatchField, pointMesh> > tpointSubFld =
volPointInterpolation::New(volSubFld.mesh()).interpolate(volSubFld);
// Sample.
return surface().interpolate
(
cellDistancePtr_(),
pointDistance_,
volSubFld,
tpointSubFld()
);
}
else
{
tmp<GeometricField<Type, pointPatchField, pointMesh> > tpointFld
(
volPointInterpolation::New(volFld.mesh()).interpolate(volFld)
);
// Sample.
return surface().interpolate
(
cellDistancePtr_(),
pointDistance_,
volFld,
tpointFld()
);
}
}
// ************************************************************************* //

View File

@ -41,6 +41,16 @@ namespace LESModels
defineTypeNameAndDebug(DeardorffDiffStress, 0);
addToRunTimeSelectionTable(LESModel, DeardorffDiffStress, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void DeardorffDiffStress::updateSubGridScaleFields(const volScalarField& K)
{
muSgs_ = ck_*rho()*sqrt(K)*delta();
muSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
DeardorffDiffStress::DeardorffDiffStress
@ -73,6 +83,8 @@ DeardorffDiffStress::DeardorffDiffStress
)
)
{
updateSubGridScaleFields(0.5*tr(B_));
printCoeffs();
}
@ -119,8 +131,7 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
K = 0.5*tr(B_);
bound(K, k0());
muSgs_ = ck_*rho()*sqrt(K)*delta();
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields(K);
}

View File

@ -81,6 +81,9 @@ class DeardorffDiffStress
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volScalarField& K);
// Disallow default bitwise copy construct and assignment
DeardorffDiffStress(const DeardorffDiffStress&);
DeardorffDiffStress& operator=(const DeardorffDiffStress&);

View File

@ -41,6 +41,24 @@ namespace LESModels
defineTypeNameAndDebug(Smagorinsky, 0);
addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU)
{
volSymmTensorField D = symm(gradU);
volScalarField a = ce_/delta();
volScalarField b = (2.0/3.0)*tr(D);
volScalarField c = 2*ck_*delta()*(dev(D) && D);
k_ = sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a));
muSgs_ = ck_*rho()*delta()*sqrt(k_);
muSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Smagorinsky::Smagorinsky
@ -64,6 +82,8 @@ Smagorinsky::Smagorinsky
)
)
{
updateSubGridScaleFields(fvc::grad(U));
printCoeffs();
}
@ -73,17 +93,7 @@ Smagorinsky::Smagorinsky
void Smagorinsky::correct(const tmp<volTensorField>& gradU)
{
GenEddyVisc::correct(gradU);
volSymmTensorField D = symm(gradU);
volScalarField a = ce_/delta();
volScalarField b = (2.0/3.0)*tr(D);
volScalarField c = 2*ck_*delta()*(dev(D) && D);
k_ = sqr((-b + sqrt(sqr(b) + 4*a*c))/(2*a));
muSgs_ = ck_*rho()*delta()*sqrt(k_);
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields(gradU());
}

View File

@ -76,6 +76,9 @@ class Smagorinsky
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volTensorField& gradU);
// Disallow default bitwise copy construct and assignment
Smagorinsky(const Smagorinsky&);
Smagorinsky& operator=(const Smagorinsky&);

View File

@ -45,6 +45,13 @@ addToRunTimeSelectionTable(LESModel, SpalartAllmaras, dictionary);
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void SpalartAllmaras::updateSubGridScaleFields()
{
muSgs_.internalField() = rho()*fv1()*nuTilda_.internalField();
muSgs_.correctBoundaryConditions();
}
tmp<volScalarField> SpalartAllmaras::fv1() const
{
volScalarField chi3 = pow3(rho()*nuTilda_/mu());
@ -223,6 +230,8 @@ SpalartAllmaras::SpalartAllmaras
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -286,10 +295,9 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& tgradU)
);
bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0));
nuTilda_.correctBoundaryConditions();
muSgs_.internalField() = rho()*fv1()*nuTilda_.internalField();
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -49,7 +49,7 @@ namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class SpalartAllmaras Declaration
Class SpalartAllmaras Declaration
\*---------------------------------------------------------------------------*/
class SpalartAllmaras
@ -74,6 +74,9 @@ class SpalartAllmaras
// Private member functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
tmp<volScalarField> fv1() const;
tmp<volScalarField> fv2() const;
tmp<volScalarField> fv3() const;

View File

@ -43,6 +43,13 @@ addToRunTimeSelectionTable(LESModel, dynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D)
{
muSgs_ = ck_(D)*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions();
}
dimensionedScalar dynOneEqEddy::ck_(const volSymmTensorField& D) const
{
volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U())));
@ -90,6 +97,8 @@ dynOneEqEddy::dynOneEqEddy
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
updateSubGridScaleFields(dev(symm(fvc::grad(U))));
printCoeffs();
}
@ -119,8 +128,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
bound(k_, dimensionedScalar("0", k_.dimensions(), 1.0e-10));
muSgs_ = ck_(D)*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields(D);
}

View File

@ -82,6 +82,9 @@ class dynOneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volSymmTensorField& D);
//- Calculate ck, ce by filtering the velocity field U.
dimensionedScalar ck_(const volSymmTensorField& D) const;
dimensionedScalar ce_(const volSymmTensorField& D) const;

View File

@ -41,6 +41,19 @@ namespace LESModels
defineTypeNameAndDebug(lowReOneEqEddy, 0);
addToRunTimeSelectionTable(LESModel, lowReOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void lowReOneEqEddy::updateSubGridScaleFields()
{
// High Re eddy viscosity
muSgs_ = ck_*rho()*sqrt(k_)*delta();
// low Re no corrected eddy viscosity
muSgs_ -= (mu()/beta_)*(scalar(1) - exp(-beta_*muSgs_/mu()));
muSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
lowReOneEqEddy::lowReOneEqEddy
@ -73,6 +86,8 @@ lowReOneEqEddy::lowReOneEqEddy
)
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -101,13 +116,7 @@ void lowReOneEqEddy::correct(const tmp<volTensorField>& tgradU)
bound(k_, k0());
// High Re eddy viscosity
muSgs_ = ck_*rho()*sqrt(k_)*delta();
// low Re no corrected eddy viscosity
muSgs_ -= (mu()/beta_)*(scalar(1) - exp(-beta_*muSgs_/mu()));
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -77,6 +77,9 @@ class lowReOneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
// Disallow default bitwise copy construct and assignment
lowReOneEqEddy(const lowReOneEqEddy&);
lowReOneEqEddy& operator=(const lowReOneEqEddy&);

View File

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(oneEqEddy, 0);
addToRunTimeSelectionTable(LESModel, oneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void oneEqEddy::updateSubGridScaleFields()
{
muSgs_ = ck_*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
oneEqEddy::oneEqEddy
@ -64,6 +73,8 @@ oneEqEddy::oneEqEddy
)
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -95,8 +106,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& tgradU)
bound(k_, k0());
muSgs_ = ck_*rho()*sqrt(k_)*delta();
muSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -80,6 +80,9 @@ class oneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
// Disallow default bitwise copy construct and assignment
oneEqEddy(const oneEqEddy&);
oneEqEddy& operator=(const oneEqEddy&);

View File

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(DeardorffDiffStress, 0);
addToRunTimeSelectionTable(LESModel, DeardorffDiffStress, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void DeardorffDiffStress::updateSubGridScaleFields(const volScalarField& K)
{
nuSgs_ = ck_*sqrt(K)*delta();
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
DeardorffDiffStress::DeardorffDiffStress
@ -72,6 +81,8 @@ DeardorffDiffStress::DeardorffDiffStress
)
)
{
updateSubGridScaleFields(0.5*tr(B_));
printCoeffs();
}
@ -121,8 +132,7 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
K = 0.5*tr(B_);
bound(K, k0());
nuSgs_ = ck_*sqrt(K)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(K);
}

View File

@ -81,6 +81,9 @@ class DeardorffDiffStress
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volScalarField& K);
// Disallow default bitwise copy construct and assignment
DeardorffDiffStress(const DeardorffDiffStress&);
DeardorffDiffStress& operator=(const DeardorffDiffStress&);

View File

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(LRRDiffStress, 0);
addToRunTimeSelectionTable(LESModel, LRRDiffStress, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void LRRDiffStress::updateSubGridScaleFields(const volScalarField& K)
{
nuSgs_ = ck_*sqrt(K)*delta();
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
LRRDiffStress::LRRDiffStress
@ -81,6 +90,8 @@ LRRDiffStress::LRRDiffStress
)
)
{
updateSubGridScaleFields(0.5*tr(B_));
printCoeffs();
}
@ -131,8 +142,7 @@ void LRRDiffStress::correct(const tmp<volTensorField>& tgradU)
K = 0.5*tr(B_);
bound(K, k0());
nuSgs_ = ck_*sqrt(K)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(K);
}

View File

@ -80,6 +80,9 @@ class LRRDiffStress
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volScalarField& K);
// Disallow default bitwise copy construct and assignment
LRRDiffStress(const LRRDiffStress&);
LRRDiffStress& operator=(const LRRDiffStress&);

View File

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(Smagorinsky, 0);
addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Smagorinsky::updateSubGridScaleFields(const volTensorField& gradU)
{
nuSgs_ = ck_*delta()*sqrt(k(gradU));
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Smagorinsky::Smagorinsky
@ -62,7 +71,9 @@ Smagorinsky::Smagorinsky
0.094
)
)
{}
{
updateSubGridScaleFields(fvc::grad(U));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -70,9 +81,7 @@ Smagorinsky::Smagorinsky
void Smagorinsky::correct(const tmp<volTensorField>& gradU)
{
GenEddyVisc::correct(gradU);
nuSgs_ = ck_*delta()*sqrt(k(gradU));
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(gradU());
}

View File

@ -77,6 +77,9 @@ class Smagorinsky
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volTensorField& gradU);
// Disallow default bitwise copy construct and assignment
Smagorinsky(const Smagorinsky&);
Smagorinsky& operator=(const Smagorinsky&);

View File

@ -41,6 +41,15 @@ namespace LESModels
defineTypeNameAndDebug(SpalartAllmaras, 0);
addToRunTimeSelectionTable(LESModel, SpalartAllmaras, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void SpalartAllmaras::updateSubGridScaleFields()
{
nuSgs_.internalField() = fv1()*nuTilda_.internalField();
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
tmp<volScalarField> SpalartAllmaras::fv1() const
@ -265,7 +274,10 @@ SpalartAllmaras::SpalartAllmaras
),
mesh_
)
{}
{
updateSubGridScaleFields();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -305,8 +317,7 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU)
bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0));
nuTilda_.correctBoundaryConditions();
nuSgs_.internalField() = fv1()*nuTilda_.internalField();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -59,6 +59,9 @@ class SpalartAllmaras
{
// Private member functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
// Disallow default bitwise copy construct and assignment
SpalartAllmaras(const SpalartAllmaras&);
SpalartAllmaras& operator=(const SpalartAllmaras&);

View File

@ -44,7 +44,7 @@ void Foam::IDDESDelta::calcDelta()
const Vector<label>& directions = mesh().directions();
label nD = (directions.nComponents + cmptSum(directions))/2;
// - Init hwn as wall distant.
// initialise hwn as wall distance
volScalarField hwn = wallDist(mesh()).y();
scalar deltamaxTmp = 0.;

View File

@ -113,7 +113,7 @@ tmp<fvVectorMatrix> dynMixedSmagorinsky::divDevBeff(volVectorField& U) const
void dynMixedSmagorinsky::correct(const tmp<volTensorField>& gradU)
{
scaleSimilarity::correct(gradU);
dynSmagorinsky::correct(gradU);
dynSmagorinsky::correct(gradU());
}

View File

@ -43,6 +43,13 @@ addToRunTimeSelectionTable(LESModel, dynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void dynOneEqEddy::updateSubGridScaleFields(const volSymmTensorField& D)
{
nuSgs_ = ck(D)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
}
dimensionedScalar dynOneEqEddy::ck(const volSymmTensorField& D) const
{
volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U())));
@ -120,6 +127,8 @@ dynOneEqEddy::dynOneEqEddy
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
updateSubGridScaleFields(symm(fvc::grad(U)));
printCoeffs();
}
@ -155,8 +164,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& gradU)
bound(k_, k0());
nuSgs_ = ck(D)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(D);
}

View File

@ -87,6 +87,9 @@ class dynOneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volSymmTensorField& D);
//- Calculate ck, ce by filtering the velocity field U.
dimensionedScalar ck(const volSymmTensorField& D) const;
dimensionedScalar ce(const volSymmTensorField& D) const;

View File

@ -43,6 +43,13 @@ addToRunTimeSelectionTable(LESModel, dynSmagorinsky, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void dynSmagorinsky::updateSubGridScaleFields(const volSymmTensorField& D)
{
nuSgs_ = cD(D)*sqr(delta())*sqrt(magSqr(D));
nuSgs_.correctBoundaryConditions();
}
dimensionedScalar dynSmagorinsky::cD(const volSymmTensorField& D) const
{
volSymmTensorField LL = dev(filter_(sqr(U())) - (sqr(filter_(U()))));
@ -111,6 +118,8 @@ dynSmagorinsky::dynSmagorinsky
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
updateSubGridScaleFields(dev(symm(fvc::grad(U))));
printCoeffs();
}
@ -128,12 +137,10 @@ void dynSmagorinsky::correct(const tmp<volTensorField>& gradU)
LESModel::correct(gradU);
volSymmTensorField D = dev(symm(gradU));
volScalarField magSqrD = magSqr(D);
k_ = cI(D)*sqr(delta())*magSqrD;
k_ = cI(D)*sqr(delta())*magSqr(D);
nuSgs_ = cD(D)*sqr(delta())*sqrt(magSqrD);
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(D);
}

View File

@ -96,6 +96,9 @@ class dynSmagorinsky
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volSymmTensorField& D);
//- Calculate coefficients cD, cI from filtering velocity field
dimensionedScalar cD(const volSymmTensorField& D) const;
dimensionedScalar cI(const volSymmTensorField& D) const;

View File

@ -44,6 +44,13 @@ addToRunTimeSelectionTable(LESModel, kOmegaSSTSAS, dictionary);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void kOmegaSSTSAS::updateSubGridScaleFields(const volScalarField& S2)
{
nuSgs_ == a1_*k_/max(a1_*omega_, F2()*sqrt(S2));
nuSgs_.correctBoundaryConditions();
}
tmp<volScalarField> kOmegaSSTSAS::F1(const volScalarField& CDkOmega) const
{
volScalarField CDkOmegaPlus = max
@ -304,6 +311,8 @@ kOmegaSSTSAS::kOmegaSSTSAS
mesh_
)
{
updateSubGridScaleFields(magSqr(symm(fvc::grad(U))));
printCoeffs();
}
@ -325,7 +334,8 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
volVectorField gradK = fvc::grad(k_);
volVectorField gradOmega = fvc::grad(omega_);
volScalarField L = sqrt(k_)/(pow(Cmu_, 0.25)*(omega_ + omegaSmall_));
volScalarField CDkOmega = (2.0*alphaOmega2_)*(gradK & gradOmega)/(omega_ + omegaSmall_);
volScalarField CDkOmega =
(2.0*alphaOmega2_)*(gradK & gradOmega)/(omega_ + omegaSmall_);
volScalarField F1 = this->F1(CDkOmega);
volScalarField G = nuSgs_*2.0*S2;
@ -375,7 +385,8 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
*max
(
dimensionedScalar("zero",dimensionSet(0, 0 , -2, 0, 0),0. ),
zetaTilda2_*kappa_*S2*(L/Lvk2(S2))- 2.0/alphaPhi_*k_*grad_omega_k
zetaTilda2_*kappa_*S2*(L/Lvk2(S2))
- 2.0/alphaPhi_*k_*grad_omega_k
)
);
@ -384,9 +395,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
}
bound(omega_, omega0_);
// Re-calculate viscosity
nuSgs_ == a1_*k_/max(a1_*omega_, F2()*sqrt(S2));
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(S2);
}

View File

@ -62,6 +62,9 @@ class kOmegaSSTSAS
{
// Private member functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volScalarField& D);
// Disallow default bitwise copy construct and assignment
kOmegaSSTSAS(const kOmegaSSTSAS&);
kOmegaSSTSAS& operator=(const kOmegaSSTSAS&);
@ -237,7 +240,8 @@ public:
// i.e. the additional term in the filtered NSE.
virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const;
//- Solve the turbulence equations (k-w) and correct the turbulence viscosity
//- Solve the turbulence equations (k-w) and correct the turbulence
// viscosity
virtual void correct(const tmp<volTensorField>& gradU);
//- Read turbulenceProperties dictionary

View File

@ -43,6 +43,17 @@ addToRunTimeSelectionTable(LESModel, locDynOneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void locDynOneEqEddy::updateSubGridScaleFields
(
const volSymmTensorField& D,
const volScalarField& KK
)
{
nuSgs_ = ck(D, KK)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
}
volScalarField locDynOneEqEddy::ck
(
const volSymmTensorField& D,
@ -108,6 +119,9 @@ locDynOneEqEddy::locDynOneEqEddy
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
volScalarField KK = 0.5*(filter_(magSqr(U)) - magSqr(filter_(U)));
updateSubGridScaleFields(symm(fvc::grad(U)), KK);
printCoeffs();
}
@ -146,8 +160,7 @@ void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU)
bound(k_, k0());
nuSgs_ = ck(D, KK)*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(D, KK);
}

View File

@ -96,6 +96,13 @@ class locDynOneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields
(
const volSymmTensorField& D,
const volScalarField& KK
);
//- Calculate ck, ce by filtering the velocity field U.
volScalarField ck
(

View File

@ -41,6 +41,16 @@ namespace LESModels
defineTypeNameAndDebug(oneEqEddy, 0);
addToRunTimeSelectionTable(LESModel, oneEqEddy, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void oneEqEddy::updateSubGridScaleFields()
{
nuSgs_ = ck_*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
oneEqEddy::oneEqEddy
@ -76,6 +86,8 @@ oneEqEddy::oneEqEddy
)
)
{
updateSubGridScaleFields();
printCoeffs();
}
@ -103,8 +115,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& gradU)
bound(k_, k0());
nuSgs_ = ck_*sqrt(k_)*delta();
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields();
}

View File

@ -83,6 +83,9 @@ class oneEqEddy
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields();
// Disallow default bitwise copy construct and assignment
oneEqEddy(const oneEqEddy&);
oneEqEddy& operator=(const oneEqEddy&);

View File

@ -41,6 +41,25 @@ namespace LESModels
defineTypeNameAndDebug(spectEddyVisc, 0);
addToRunTimeSelectionTable(LESModel, spectEddyVisc, dictionary);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void spectEddyVisc::updateSubGridScaleFields(const volTensorField& gradU)
{
volScalarField Re = sqr(delta())*mag(symm(gradU))/nu();
for (label i=0; i<5; i++)
{
nuSgs_ =
nu()
/(
scalar(1)
- exp(-cB_*pow(nu()/(nuSgs_ + nu()), 1.0/3.0)*pow(Re, -2.0/3.0))
);
}
nuSgs_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
spectEddyVisc::spectEddyVisc
@ -101,6 +120,8 @@ spectEddyVisc::spectEddyVisc
)
{
printCoeffs();
updateSubGridScaleFields(fvc::grad(U));
}
@ -121,20 +142,7 @@ tmp<volScalarField> spectEddyVisc::k() const
void spectEddyVisc::correct(const tmp<volTensorField>& gradU)
{
GenEddyVisc::correct(gradU);
volScalarField Re = sqr(delta())*mag(symm(gradU))/nu();
for (label i=0; i<5; i++)
{
nuSgs_ =
nu()
/(
scalar(1)
- exp(-cB_*pow(nu()/(nuSgs_ + nu()), 1.0/3.0)*pow(Re, -2.0/3.0))
);
}
nuSgs_.correctBoundaryConditions();
updateSubGridScaleFields(gradU());
}

View File

@ -85,6 +85,9 @@ class spectEddyVisc
// Private Member Functions
//- Update sub-grid scale fields
void updateSubGridScaleFields(const volTensorField& gradU);
// Disallow default bitwise copy construct and assignment
spectEddyVisc(const spectEddyVisc&);
spectEddyVisc& operator=(const spectEddyVisc&);

3
wmake/rules/SunOS64Gcc/X Normal file
View File

@ -0,0 +1,3 @@
XFLAGS =
XINC = $(XFLAGS) -I/usr/X11R6/include
XLIBS = -L/usr/X11R6/lib64 -lXext -lX11

16
wmake/rules/SunOS64Gcc/c Normal file
View File

@ -0,0 +1,16 @@
.SUFFIXES: .c .h
cWARN = -Wall
cc = gcc -m64
include $(RULES)/c$(WM_COMPILE_OPTION)
cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
LINK_LIBS = $(cDBUG)
LINKLIBSO = $(cc) -shared
LINKEXE = $(cc) -Xlinker -z -Xlinker nodefs

View File

@ -0,0 +1,21 @@
.SUFFIXES: .C .cxx .cc .cpp
c++WARN = -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast
CC = g++ -m64
include $(RULES)/c++$(WM_COMPILE_OPTION)
ptFLAGS = -DNoRepository -ftemplate-depth-40
c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
cxxtoo = $(Ctoo)
cctoo = $(Ctoo)
cpptoo = $(Ctoo)
LINK_LIBS = $(c++DBUG)
LINKLIBSO = $(CC) $(c++FLAGS) -shared
LINKEXE = $(CC) $(c++FLAGS)

View File

@ -0,0 +1,2 @@
c++DBUG = -ggdb3 -DFULLDEBUG
c++OPT = -O0 -fdefault-inline

View File

@ -0,0 +1,2 @@
c++DBUG =
c++OPT = -O3

View File

@ -0,0 +1,2 @@
c++DBUG = -pg
c++OPT = -O2

View File

@ -0,0 +1,2 @@
cDBUG = -ggdb -DFULLDEBUG
cOPT = -O1 -fdefault-inline -finline-functions

View File

@ -0,0 +1,2 @@
cDBUG =
cOPT = -O3 -fno-gcse

View File

@ -0,0 +1,2 @@
cDBUG = -pg
cOPT = -O2

View File

@ -0,0 +1,11 @@
CPP = /lib/cpp $(GFLAGS)
LD = ld -64
PROJECT_LIBS = -l$(WM_PROJECT) -liberty -lnsl -lsocket -L$(FOAM_LIBBIN)/dummy -lPstream
include $(GENERAL_RULES)/standard
include $(RULES)/X
include $(RULES)/c
include $(RULES)/c++
include $(GENERAL_RULES)/cint

View File

@ -0,0 +1,3 @@
PFLAGS =
PINC =
PLIBS =

View File

@ -0,0 +1,3 @@
PFLAGS =
PINC = -I$(MPI_ARCH_PATH)/include/sparcv9/mpi -DMPIPP_H
PLIBS = -L$(MPI_ARCH_PATH)/lib/sparcv9 -lmpi_f -L/opt/FSUNf90/lib/sparcv9 -lfjgmp64 -L/opt/FJSVpnidt/lib -lfjidt -ljrm -lfj90i -lfj90f -lfj90fmt -lelf

View File

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi