Merge branch 'master' into dsmc

This commit is contained in:
graham
2009-09-24 09:55:56 +01:00
208 changed files with 74989 additions and 914 deletions

View File

@ -282,13 +282,13 @@ void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
}
// Check if patches of given type name are present
// Check if has cyclic patches
template <class Type>
bool Foam::FaceCellWave<Type>::hasPatchType(const word& nameOfType)
bool Foam::FaceCellWave<Type>::hasCyclicPatch() const
{
forAll(mesh_.boundaryMesh(), patchI)
{
if (mesh_.boundaryMesh()[patchI].type() == nameOfType)
if (isA<cyclicPolyPatch>(mesh_.boundaryMesh()[patchI]))
{
return true;
}
@ -811,7 +811,7 @@ Foam::FaceCellWave<Type>::FaceCellWave
changedCell_(mesh_.nCells(), false),
changedCells_(mesh_.nCells()),
nChangedCells_(0),
hasCyclicPatches_(hasPatchType(cyclicPolyPatch::typeName)),
hasCyclicPatches_(hasCyclicPatch()),
nEvals_(0),
nUnvisitedCells_(mesh_.nCells()),
nUnvisitedFaces_(mesh_.nFaces()),
@ -841,7 +841,7 @@ Foam::FaceCellWave<Type>::FaceCellWave
changedCell_(mesh_.nCells(), false),
changedCells_(mesh_.nCells()),
nChangedCells_(0),
hasCyclicPatches_(hasPatchType(cyclicPolyPatch::typeName)),
hasCyclicPatches_(hasCyclicPatch()),
nEvals_(0),
nUnvisitedCells_(mesh_.nCells()),
nUnvisitedFaces_(mesh_.nFaces()),

View File

@ -184,8 +184,8 @@ class FaceCellWave
//- Debugging: check info on both sides of cyclic
void checkCyclic(const polyPatch& pPatch) const;
//- Has patches of certain type?
bool hasPatchType(const word& nameOfType);
//- Has cyclic patch?
bool hasCyclicPatch() const;
//- Merge received patch data into global data
void mergeFaceInfo

View File

@ -139,10 +139,7 @@ void Foam::IOerror::exit(const int)
if (abort_)
{
Perr<< endl << *this << endl
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
printStack(Perr);
::abort();
abort();
}
if (Pstream::parRun())
@ -155,7 +152,13 @@ void Foam::IOerror::exit(const int)
{
if (throwExceptions_)
{
throw *this;
// Make a copy of the error to throw
IOerror errorException(*this);
// Rewind the message buffer for the next error message
messageStreamPtr_->rewind();
throw errorException;
}
else
{
@ -194,7 +197,13 @@ void Foam::IOerror::abort()
{
if (throwExceptions_)
{
throw *this;
// Make a copy of the error to throw
IOerror errorException(*this);
// Rewind the message buffer for the next error message
messageStreamPtr_->rewind();
throw errorException;
}
else
{
@ -209,7 +218,9 @@ void Foam::IOerror::abort()
Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
{
os << endl << ioErr.message().c_str() << endl << endl;
os << endl
<< ioErr.title().c_str() << endl
<< ioErr.message().c_str() << endl << endl;
os << "file: " << ioErr.ioFileName().c_str();
@ -238,6 +249,6 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Global error definitions
Foam::IOerror Foam::FatalIOError("--> FOAM FATAL IO ERROR : ");
Foam::IOerror Foam::FatalIOError("--> FOAM FATAL IO ERROR: ");
// ************************************************************************* //

View File

@ -105,7 +105,6 @@ Foam::OSstream& Foam::error::operator()
const int sourceFileLineNumber
)
{
messageStreamPtr_->rewind();
functionName_ = functionName;
sourceFileName_ = sourceFileName;
sourceFileLineNumber_ = sourceFileLineNumber;
@ -137,7 +136,6 @@ Foam::error::operator OSstream&()
Perr<< endl
<< "error::operator OSstream&() : error stream has failed"
<< endl;
printStack(Perr);
abort();
}
@ -178,9 +176,6 @@ void Foam::error::exit(const int errNo)
if (abort_)
{
printStack(*this);
Perr<< endl << *this << endl
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
abort();
}
@ -194,7 +189,13 @@ void Foam::error::exit(const int errNo)
{
if (throwExceptions_)
{
throw *this;
// Make a copy of the error to throw
error errorException(*this);
// Rewind the message buffer for the next error message
messageStreamPtr_->rewind();
throw errorException;
}
else
{
@ -216,30 +217,36 @@ void Foam::error::abort()
if (abort_)
{
printStack(*this);
Perr<< endl << *this << endl
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
printStack(Perr);
::abort();
}
if (Pstream::parRun())
{
printStack(*this);
Perr<< endl << *this << endl
<< "\nFOAM parallel run aborting\n" << endl;
printStack(Perr);
Pstream::abort();
}
else
{
if (throwExceptions_)
{
throw *this;
// Make a copy of the error to throw
error errorException(*this);
// Rewind the message buffer for the next error message
messageStreamPtr_->rewind();
throw errorException;
}
else
{
printStack(*this);
Perr<< endl << *this << endl
<< "\nFOAM aborting\n" << endl;
printStack(Perr);
::abort();
}
}
@ -248,7 +255,9 @@ void Foam::error::abort()
Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
{
os << endl << fErr.message().c_str();
os << endl
<< fErr.title().c_str() << endl
<< fErr.message().c_str();
if (error::level >= 2 && fErr.sourceFileLineNumber())
{
@ -265,6 +274,6 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Global error definitions
Foam::error Foam::FatalError("--> FOAM FATAL ERROR : ");
Foam::error Foam::FatalError("--> FOAM FATAL ERROR: ");
// ************************************************************************* //

View File

@ -35,7 +35,6 @@ int Foam::messageStream::level(Foam::debug::debugSwitch("level", 2));
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Construct from components
Foam::messageStream::messageStream
(
const string& title,
@ -50,7 +49,6 @@ Foam::messageStream::messageStream
{}
//- Construct from dictionary
Foam::messageStream::messageStream(const dictionary& dict)
:
title_(dict.lookup("title")),

View File

@ -110,6 +110,7 @@ Foam::scalar Foam::dimensionSet::operator[](const dimensionType type) const
return exponents_[type];
}
Foam::scalar& Foam::dimensionSet::operator[](const dimensionType type)
{
return exponents_[type];
@ -130,6 +131,7 @@ bool Foam::dimensionSet::operator==(const dimensionSet& ds) const
return equall;
}
bool Foam::dimensionSet::operator!=(const dimensionSet& ds) const
{
return !(operator==(ds));
@ -163,6 +165,7 @@ bool Foam::dimensionSet::operator+=(const dimensionSet& ds) const
return true;
}
bool Foam::dimensionSet::operator-=(const dimensionSet& ds) const
{
if (dimensionSet::debug && *this != ds)
@ -176,6 +179,7 @@ bool Foam::dimensionSet::operator-=(const dimensionSet& ds) const
return true;
}
bool Foam::dimensionSet::operator*=(const dimensionSet& ds)
{
reset((*this)*ds);
@ -183,6 +187,7 @@ bool Foam::dimensionSet::operator*=(const dimensionSet& ds)
return true;
}
bool Foam::dimensionSet::operator/=(const dimensionSet& ds)
{
reset((*this)/ds);
@ -206,6 +211,7 @@ Foam::dimensionSet Foam::max(const dimensionSet& ds1, const dimensionSet& ds2)
return ds1;
}
Foam::dimensionSet Foam::min(const dimensionSet& ds1, const dimensionSet& ds2)
{
if (dimensionSet::debug && ds1 != ds2)
@ -256,6 +262,7 @@ Foam::dimensionSet Foam::pow(const dimensionSet& ds, const scalar p)
return dimPow;
}
Foam::dimensionSet Foam::pow
(
const dimensionSet& ds,
@ -283,6 +290,7 @@ Foam::dimensionSet Foam::pow
return dimPow;
}
Foam::dimensionSet Foam::pow
(
const dimensionedScalar& dS,
@ -309,61 +317,79 @@ Foam::dimensionSet Foam::sqr(const dimensionSet& ds)
return pow(ds, 2);
}
Foam::dimensionSet Foam::pow3(const dimensionSet& ds)
{
return pow(ds, 3);
}
Foam::dimensionSet Foam::pow4(const dimensionSet& ds)
{
return pow(ds, 4);
}
Foam::dimensionSet Foam::pow5(const dimensionSet& ds)
{
return pow(ds, 5);
}
Foam::dimensionSet Foam::pow6(const dimensionSet& ds)
{
return pow(ds, 6);
}
Foam::dimensionSet Foam::pow025(const dimensionSet& ds)
{
return sqrt(sqrt(ds));
}
Foam::dimensionSet Foam::sqrt(const dimensionSet& ds)
{
return pow(ds, 0.5);
}
Foam::dimensionSet Foam::magSqr(const dimensionSet& ds)
{
return pow(ds, 2);
}
Foam::dimensionSet Foam::mag(const dimensionSet& ds)
{
return ds;
}
Foam::dimensionSet Foam::sign(const dimensionSet&)
{
return dimless;
}
Foam::dimensionSet Foam::pos(const dimensionSet&)
{
return dimless;
}
Foam::dimensionSet Foam::neg(const dimensionSet&)
{
return dimless;
}
Foam::dimensionSet Foam::inv(const dimensionSet& ds)
{
return dimless/ds;
}
Foam::dimensionSet Foam::trans(const dimensionSet& ds)
{
if (dimensionSet::debug && !ds.dimensionless())
@ -376,6 +402,7 @@ Foam::dimensionSet Foam::trans(const dimensionSet& ds)
return ds;
}
Foam::dimensionSet Foam::transform(const dimensionSet& ds)
{
return ds;
@ -389,6 +416,7 @@ Foam::dimensionSet Foam::operator-(const dimensionSet& ds)
return ds;
}
Foam::dimensionSet Foam::operator+
(
const dimensionSet& ds1,
@ -409,6 +437,7 @@ Foam::dimensionSet Foam::operator+
return dimSum;
}
Foam::dimensionSet Foam::operator-
(
const dimensionSet& ds1,
@ -429,6 +458,7 @@ Foam::dimensionSet Foam::operator-
return dimDifference;
}
Foam::dimensionSet Foam::operator*
(
const dimensionSet& ds1,
@ -445,6 +475,7 @@ Foam::dimensionSet Foam::operator*
return dimProduct;
}
Foam::dimensionSet Foam::operator/
(
const dimensionSet& ds1,
@ -471,6 +502,7 @@ Foam::dimensionSet Foam::operator&
return ds1*ds2;
}
Foam::dimensionSet Foam::operator^
(
const dimensionSet& ds1,
@ -480,6 +512,7 @@ Foam::dimensionSet Foam::operator^
return ds1*ds2;
}
Foam::dimensionSet Foam::operator&&
(
const dimensionSet& ds1,

View File

@ -70,6 +70,7 @@ dimensionSet pow3(const dimensionSet&);
dimensionSet pow4(const dimensionSet&);
dimensionSet pow5(const dimensionSet&);
dimensionSet pow6(const dimensionSet&);
dimensionSet pow025(const dimensionSet&);
dimensionSet sqrt(const dimensionSet&);
dimensionSet magSqr(const dimensionSet&);
@ -226,6 +227,7 @@ public:
friend dimensionSet pow4(const dimensionSet&);
friend dimensionSet pow5(const dimensionSet&);
friend dimensionSet pow6(const dimensionSet&);
friend dimensionSet pow025(const dimensionSet&);
friend dimensionSet sqrt(const dimensionSet&);
friend dimensionSet magSqr(const dimensionSet&);

View File

@ -38,32 +38,38 @@ dimensionedScalar operator+(const dimensionedScalar& ds1, const scalar s2)
return ds1 + dimensionedScalar(s2);
}
dimensionedScalar operator+(const scalar s1, const dimensionedScalar& ds2)
{
return dimensionedScalar(s1) + ds2;
}
dimensionedScalar operator-(const dimensionedScalar& ds1, const scalar s2)
{
return ds1 - dimensionedScalar(s2);
}
dimensionedScalar operator-(const scalar s1, const dimensionedScalar& ds2)
{
return dimensionedScalar(s1) - ds2;
}
dimensionedScalar operator*(const dimensionedScalar& ds1, const scalar s2)
{
return ds1 * dimensionedScalar(s2);
}
dimensionedScalar operator/(const scalar s1, const dimensionedScalar& ds2)
{
return dimensionedScalar(s1)/ds2;
}
dimensionedScalar pow
(
const dimensionedScalar& ds,
@ -78,6 +84,7 @@ dimensionedScalar pow
);
}
dimensionedScalar pow3(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -88,6 +95,7 @@ dimensionedScalar pow3(const dimensionedScalar& ds)
);
}
dimensionedScalar pow4(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -98,6 +106,7 @@ dimensionedScalar pow4(const dimensionedScalar& ds)
);
}
dimensionedScalar pow5(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -108,6 +117,7 @@ dimensionedScalar pow5(const dimensionedScalar& ds)
);
}
dimensionedScalar pow6(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -118,6 +128,18 @@ dimensionedScalar pow6(const dimensionedScalar& ds)
);
}
dimensionedScalar pow025(const dimensionedScalar& ds)
{
return dimensionedScalar
(
"pow025(" + ds.name() + ')',
pow025(ds.dimensions()),
pow025(ds.value())
);
}
dimensionedScalar sqrt(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -128,6 +150,7 @@ dimensionedScalar sqrt(const dimensionedScalar& ds)
);
}
dimensionedScalar cbrt(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -138,6 +161,7 @@ dimensionedScalar cbrt(const dimensionedScalar& ds)
);
}
dimensionedScalar hypot
(
const dimensionedScalar& x,
@ -152,6 +176,7 @@ dimensionedScalar hypot
);
}
dimensionedScalar sign(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -162,6 +187,7 @@ dimensionedScalar sign(const dimensionedScalar& ds)
);
}
dimensionedScalar pos(const dimensionedScalar& ds)
{
return dimensionedScalar
@ -172,6 +198,7 @@ dimensionedScalar pos(const dimensionedScalar& ds)
);
}
dimensionedScalar neg(const dimensionedScalar& ds)
{
return dimensionedScalar

View File

@ -61,6 +61,7 @@ dimensionedScalar pow3(const dimensionedScalar&);
dimensionedScalar pow4(const dimensionedScalar&);
dimensionedScalar pow5(const dimensionedScalar&);
dimensionedScalar pow6(const dimensionedScalar&);
dimensionedScalar pow025(const dimensionedScalar&);
dimensionedScalar sqrt(const dimensionedScalar&);
dimensionedScalar cbrt(const dimensionedScalar&);

View File

@ -376,6 +376,7 @@ UNARY_FUNCTION(scalar, scalar, pow3, pow3)
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)

View File

@ -84,6 +84,7 @@ UNARY_FUNCTION(scalar, scalar, pow3, pow3)
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)

View File

@ -104,6 +104,7 @@ UNARY_FUNCTION(scalar, scalar, pow3)
UNARY_FUNCTION(scalar, scalar, pow4)
UNARY_FUNCTION(scalar, scalar, pow5)
UNARY_FUNCTION(scalar, scalar, pow6)
UNARY_FUNCTION(scalar, scalar, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)

View File

@ -57,6 +57,7 @@ void stabilise
const scalar s
);
template<template<class> class Field>
tmp<FieldField<Field, scalar> > stabilise
(
@ -64,6 +65,7 @@ tmp<FieldField<Field, scalar> > stabilise
const scalar s
);
template<template<class> class Field>
tmp<FieldField<Field, scalar> > stabilise
(
@ -95,6 +97,7 @@ UNARY_FUNCTION(scalar, scalar, pow3)
UNARY_FUNCTION(scalar, scalar, pow4)
UNARY_FUNCTION(scalar, scalar, pow5)
UNARY_FUNCTION(scalar, scalar, pow6)
UNARY_FUNCTION(scalar, scalar, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)

View File

@ -109,6 +109,7 @@ UNARY_FUNCTION(scalar, scalar, pow3)
UNARY_FUNCTION(scalar, scalar, pow4)
UNARY_FUNCTION(scalar, scalar, pow5)
UNARY_FUNCTION(scalar, scalar, pow6)
UNARY_FUNCTION(scalar, scalar, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)

View File

@ -96,6 +96,7 @@ UNARY_FUNCTION(scalar, scalar, pow3)
UNARY_FUNCTION(scalar, scalar, pow4)
UNARY_FUNCTION(scalar, scalar, pow5)
UNARY_FUNCTION(scalar, scalar, pow6)
UNARY_FUNCTION(scalar, scalar, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt)
UNARY_FUNCTION(scalar, scalar, sign)
UNARY_FUNCTION(scalar, scalar, pos)

View File

@ -447,6 +447,7 @@ UNARY_FUNCTION(scalar, scalar, pow3, pow3)
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)

View File

@ -92,6 +92,7 @@ UNARY_FUNCTION(scalar, scalar, pow3, pow3)
UNARY_FUNCTION(scalar, scalar, pow4, pow4)
UNARY_FUNCTION(scalar, scalar, pow5, pow5)
UNARY_FUNCTION(scalar, scalar, pow6, pow6)
UNARY_FUNCTION(scalar, scalar, pow025, pow025)
UNARY_FUNCTION(scalar, scalar, sqrt, sqrt)
UNARY_FUNCTION(scalar, scalar, sign, sign)
UNARY_FUNCTION(scalar, scalar, pos, pos)

View File

@ -47,7 +47,7 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
{
const Patch& patch = patches[patchi];
if (isType<ProcPatch>(patch))
if (isA<ProcPatch>(patch))
{
const ProcPatch& procPatch =
refCast<const ProcPatch>(patch);
@ -69,7 +69,7 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
{
const Patch& patch = patches[patchi];
if (isType<ProcPatch>(patch))
if (isA<ProcPatch>(patch))
{
const ProcPatch& procPatch =
refCast<const ProcPatch>(patch);
@ -116,7 +116,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
forAll(patches, patchi)
{
if (!isType<ProcPatch>(patches[patchi]))
if (!isA<ProcPatch>(patches[patchi]))
{
patchSchedule_[patchEvali].patch = patchi;
patchSchedule_[patchEvali++].init = true;
@ -204,7 +204,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
forAll(patches, patchi)
{
if (!isType<ProcPatch>(patches[patchi]))
if (!isA<ProcPatch>(patches[patchi]))
{
patchSchedule_[patchEvali].patch = patchi;
patchSchedule_[patchEvali++].init = true;
@ -219,7 +219,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
// 2a. initEvaluate
forAll(patches, patchi)
{
if (isType<ProcPatch>(patches[patchi]))
if (isA<ProcPatch>(patches[patchi]))
{
patchSchedule_[patchEvali].patch = patchi;
patchSchedule_[patchEvali++].init = true;
@ -229,7 +229,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
// 2b. evaluate
forAll(patches, patchi)
{
if (isType<ProcPatch>(patches[patchi]))
if (isA<ProcPatch>(patches[patchi]))
{
patchSchedule_[patchEvali].patch = patchi;
patchSchedule_[patchEvali++].init = false;

View File

@ -90,56 +90,67 @@ inline Scalar& setComponent(Scalar& s, const direction)
return s;
}
inline Scalar component(const Scalar s, const direction)
{
return s;
}
inline Scalar sign(const Scalar s)
{
return (s >= 0)? 1: -1;
}
inline Scalar pos(const Scalar s)
{
return (s >= 0)? 1: 0;
}
inline Scalar neg(const Scalar s)
{
return (s < 0)? 1: 0;
}
inline bool equal(const Scalar& s1, const Scalar& s2)
{
return mag(s1 - s2) <= ScalarVSMALL;
}
inline bool notEqual(const Scalar s1, const Scalar s2)
{
return mag(s1 - s2) > ScalarVSMALL;
}
inline Scalar limit(const Scalar s1, const Scalar s2)
{
return (mag(s1) < mag(s2)) ? s1: 0.0;
}
inline Scalar minMod(const Scalar s1, const Scalar s2)
{
return (mag(s1) < mag(s2)) ? s1: s2;
}
inline Scalar magSqr(const Scalar s)
{
return s*s;
}
inline Scalar sqr(const Scalar s)
{
return s*s;
}
inline Scalar sqrtSumSqr(const Scalar a, const Scalar b)
{
Scalar maga = mag(a);
@ -155,61 +166,79 @@ inline Scalar sqrtSumSqr(const Scalar a, const Scalar b)
}
}
inline Scalar pow3(const Scalar s)
{
return s*sqr(s);
}
inline Scalar pow4(const Scalar s)
{
return sqr(sqr(s));
}
inline Scalar pow5(const Scalar s)
{
return s*pow4(s);
}
inline Scalar pow6(const Scalar s)
{
return pow3(sqr(s));
}
inline Scalar pow025(const Scalar s)
{
return sqrt(sqrt(s));
}
inline Scalar inv(const Scalar s)
{
return 1.0/s;
}
inline Scalar dot(const Scalar s1, const Scalar s2)
{
return s1*s2;
}
inline Scalar cmptMultiply(const Scalar s1, const Scalar s2)
{
return s1*s2;
}
inline Scalar cmptDivide(const Scalar s1, const Scalar s2)
{
return s1/s2;
}
inline Scalar cmptMax(const Scalar s)
{
return s;
}
inline Scalar cmptMin(const Scalar s)
{
return s;
}
inline Scalar cmptAv(const Scalar s)
{
return s;
}
inline Scalar cmptMag(const Scalar s)
{
return mag(s);

View File

@ -2661,10 +2661,22 @@ void Foam::autoLayerDriver::addLayers
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
Info<< nl
<< "patch faces layers avg thickness[m]" << nl
<< " near-wall overall" << nl
<< "----- ----- ------ --------- -------" << endl;
// Find maximum length of a patch name, for a nicer output
label maxPatchNameLen = 0;
forAll(meshMover.adaptPatchIDs(), i)
{
label patchI = meshMover.adaptPatchIDs()[i];
word patchName = patches[patchI].name();
maxPatchNameLen = max(maxPatchNameLen,label(patchName.size()));
}
Info<< nl
<< setf(ios_base::left) << setw(maxPatchNameLen) << "patch"
<< setw(0) << " faces layers avg thickness[m]" << nl
<< setf(ios_base::left) << setw(maxPatchNameLen) << " "
<< setw(0) << " near-wall overall" << nl
<< setf(ios_base::left) << setw(maxPatchNameLen) << "-----"
<< setw(0) << " ----- ------ --------- -------" << endl;
forAll(meshMover.adaptPatchIDs(), i)
{
@ -2704,18 +2716,24 @@ void Foam::autoLayerDriver::addLayers
label totNPoints = returnReduce(meshPoints.size(), sumOp<label>());
//reduce(maxThickness, maxOp<scalar>());
//reduce(minThickness, minOp<scalar>());
scalar avgThickness =
returnReduce(sumThickness, sumOp<scalar>())
/ totNPoints;
scalar avgNearWallThickness =
returnReduce(sumNearWallThickness, sumOp<scalar>())
/ totNPoints;
// For empty patches, totNPoints is 0.
scalar avgThickness = 0;
scalar avgNearWallThickness = 0;
Info<< setf(ios_base::left) << setw(19) << patches[patchI].name();
//Sout.unsetf(ios_base::left);
Info<< setprecision(3)
if (totNPoints > 0)
{
//reduce(maxThickness, maxOp<scalar>());
//reduce(minThickness, minOp<scalar>());
avgThickness =
returnReduce(sumThickness, sumOp<scalar>())
/ totNPoints;
avgNearWallThickness =
returnReduce(sumNearWallThickness, sumOp<scalar>())
/ totNPoints;
}
Info<< setf(ios_base::left) << setw(maxPatchNameLen)
<< patches[patchI].name() << setprecision(3)
<< " " << setw(8)
<< returnReduce(patches[patchI].size(), sumOp<scalar>())
<< " " << setw(6) << layerParams.numLayers()[patchI]

View File

@ -158,11 +158,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
forAll(pMesh.boundaryMesh(), patchI)
{
const polyPatch& pPatch = pMesh.boundaryMesh()[patchI];
if
(
pPatch.size()
&& typeid(pPatch) != typeid(processorPolyPatch)
)
if (pPatch.size() && !isA<processorPolyPatch>(pPatch))
{
partsList_.set
(

View File

@ -141,9 +141,18 @@ Foam::labelList Foam::decompositionMethod::decompose
const pointField& coarsePoints
)
{
scalarField coarseWeights(0);
// Decompose based on agglomerated points
labelList coarseDistribution(decompose(coarsePoints));
return decompose(fineToCoarse, coarsePoints, coarseWeights);
// Rework back into decomposition for original mesh_
labelList fineDistribution(fineToCoarse.size());
forAll(fineDistribution, i)
{
fineDistribution[i] = coarseDistribution[fineToCoarse[i]];
}
return fineDistribution;
}

View File

@ -31,6 +31,7 @@ License
#include "fvMeshAdder.H"
#include "faceCoupleInfo.H"
#include "processorFvPatchField.H"
#include "processorFvsPatchField.H"
#include "polyTopoChange.H"
#include "removeCells.H"
#include "polyModifyFace.H"
@ -2124,54 +2125,56 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
// Bit of hack: processorFvPatchField does not get reset since created
// from nothing so explicitly reset.
initPatchFields<volScalarField>
initPatchFields<volScalarField, processorFvPatchField<scalar> >
(
processorFvPatchField<scalar>::typeName,
pTraits<scalar>::zero
);
initPatchFields<volVectorField>
initPatchFields<volVectorField, processorFvPatchField<vector> >
(
processorFvPatchField<vector>::typeName,
pTraits<vector>::zero
);
initPatchFields<volSphericalTensorField>
initPatchFields
<
volSphericalTensorField,
processorFvPatchField<sphericalTensor>
>
(
processorFvPatchField<sphericalTensor>::typeName,
pTraits<sphericalTensor>::zero
);
initPatchFields<volSymmTensorField>
initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor> >
(
processorFvPatchField<symmTensor>::typeName,
pTraits<symmTensor>::zero
);
initPatchFields<volTensorField>
initPatchFields<volTensorField, processorFvPatchField<tensor> >
(
processorFvPatchField<tensor>::typeName,
pTraits<tensor>::zero
);
initPatchFields<surfaceScalarField>
initPatchFields<surfaceScalarField, processorFvsPatchField<scalar> >
(
processorFvPatchField<scalar>::typeName,
pTraits<scalar>::zero
);
initPatchFields<surfaceVectorField>
initPatchFields<surfaceVectorField, processorFvsPatchField<vector> >
(
processorFvPatchField<vector>::typeName,
pTraits<vector>::zero
);
initPatchFields<surfaceSphericalTensorField>
initPatchFields
<
surfaceSphericalTensorField,
processorFvsPatchField<sphericalTensor>
>
(
processorFvPatchField<sphericalTensor>::typeName,
pTraits<sphericalTensor>::zero
);
initPatchFields<surfaceSymmTensorField>
initPatchFields
<
surfaceSymmTensorField,
processorFvsPatchField<symmTensor>
>
(
processorFvPatchField<symmTensor>::typeName,
pTraits<symmTensor>::zero
);
initPatchFields<surfaceTensorField>
initPatchFields<surfaceTensorField, processorFvsPatchField<tensor> >
(
processorFvPatchField<tensor>::typeName,
pTraits<tensor>::zero
);

View File

@ -164,10 +164,9 @@ class fvMeshDistribute
);
//- Init patch fields of certain type
template<class GeoField>
template<class GeoField, class PatchFieldType>
void initPatchFields
(
const word& patchFieldType,
const typename GeoField::value_type& initVal
);

View File

@ -235,10 +235,9 @@ void Foam::fvMeshDistribute::mapBoundaryFields
// Init patch fields of certain type
template<class GeoField>
template<class GeoField, class PatchFieldType>
void Foam::fvMeshDistribute::initPatchFields
(
const word& patchFieldType,
const typename GeoField::value_type& initVal
)
{
@ -264,7 +263,7 @@ void Foam::fvMeshDistribute::initPatchFields
forAll(bfld, patchI)
{
if (bfld[patchI].type() == patchFieldType)
if (isA<PatchFieldType>(bfld[patchI]))
{
bfld[patchI] == initVal;
}

View File

@ -774,7 +774,7 @@ void Foam::addPatchCellLayer::setRefinement
", polyTopoChange&)"
) << "boundary-edge-to-be-extruded:"
<< pp.points()[meshPoints[e[0]]]
<< pp.points()[meshPoints[e[0]]]
<< pp.points()[meshPoints[e[1]]]
<< " has more than two faces using it:" << eFaces
<< abort(FatalError);
}
@ -816,7 +816,7 @@ void Foam::addPatchCellLayer::setRefinement
", polyTopoChange&)"
) << "boundary-edge-to-be-extruded:"
<< pp.points()[meshPoints[e[0]]]
<< pp.points()[meshPoints[e[0]]]
<< pp.points()[meshPoints[e[1]]]
<< " has more than two boundary faces"
<< " using it:"
<< bFaceI << " fc:"

View File

@ -52,7 +52,7 @@ bool Foam::adjustPhi
const fvPatchVectorField& Up = U.boundaryField()[patchi];
const fvsPatchScalarField& phip = phi.boundaryField()[patchi];
if (!isType<processorFvsPatchScalarField>(phip))
if (!isA<processorFvsPatchScalarField>(phip))
{
if
(
@ -128,7 +128,7 @@ bool Foam::adjustPhi
const fvPatchVectorField& Up = U.boundaryField()[patchi];
fvsPatchScalarField& phip = phi.boundaryField()[patchi];
if (!isType<processorFvsPatchScalarField>(phip))
if (!isA<processorFvsPatchScalarField>(phip))
{
if
(

View File

@ -1,4 +1,4 @@
if (!isType<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
if (!isA<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
{
FatalErrorIn("wall-function evaluation")
<< k_.boundaryField()[patchi].type()
@ -8,7 +8,7 @@ if (!isType<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
<< exit(FatalError);
}
if (!isType<zeroGradientFvPatchScalarField>(epsilon_.boundaryField()[patchi]))
if (!isA<zeroGradientFvPatchScalarField>(epsilon_.boundaryField()[patchi]))
{
FatalErrorIn("wall-function evaluation")
<< epsilon_.boundaryField()[patchi].type()

View File

@ -0,0 +1,209 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "PorousZones.H"
#include "Time.H"
#include "volFields.H"
#include "fvm.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class ZoneType>
template<class Type>
void Foam::PorousZones<ZoneType>::modifyDdt(fvMatrix<Type>& m) const
{
forAll(*this, i)
{
this->operator[](i).modifyDdt(m);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ZoneType>
Foam::PorousZones<ZoneType>::PorousZones
(
const fvMesh& mesh
)
:
IOPtrList<ZoneType>
(
IOobject
(
"porousZones",
mesh.time().constant(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
typename ZoneType::iNew(mesh)
),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ZoneType>
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::PorousZones<ZoneType>::ddt
(
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tres = fvm::ddt(vf);
modifyDdt(tres());
return tres;
}
template<class ZoneType>
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::PorousZones<ZoneType>::ddt
(
const oneField&,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tres = fvm::ddt(vf);
modifyDdt(tres());
return tres;
}
template<class ZoneType>
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::PorousZones<ZoneType>::ddt
(
const dimensionedScalar& rho,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tres = fvm::ddt(rho,vf);
modifyDdt(tres());
return tres;
}
template<class ZoneType>
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::PorousZones<ZoneType>::ddt
(
const volScalarField& rho,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tres = fvm::ddt(rho,vf);
modifyDdt(tres());
return tres;
}
template<class ZoneType>
void Foam::PorousZones<ZoneType>::addResistance(fvVectorMatrix& UEqn) const
{
forAll(*this, i)
{
this->operator[](i).addResistance(UEqn);
}
}
template<class ZoneType>
void Foam::PorousZones<ZoneType>::addResistance
(
const fvVectorMatrix& UEqn,
volTensorField& AU
) const
{
// addResistance for each zone, delaying the correction of the
// precessor BCs of AU
forAll(*this, i)
{
this->operator[](i).addResistance(UEqn, AU, false);
}
// Correct the boundary conditions of the tensorial diagonal to ensure
// processor bounaries are correctly handled when AU^-1 is interpolated
// for the pressure equation.
AU.correctBoundaryConditions();
}
template<class ZoneType>
bool Foam::PorousZones<ZoneType>::readData(Istream& is)
{
this->clear();
IOPtrList<ZoneType> newLst
(
IOobject
(
"porousZones",
mesh_.time().constant(),
mesh_,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // Don't re-register new zones with objectRegistry
),
typename ZoneType::iNew(mesh_)
);
transfer(newLst);
return is.good();
}
template<class ZoneType>
bool Foam::PorousZones<ZoneType>::writeData(Ostream& os, bool subDict) const
{
// Write size of list
os << nl << this->size();
// Write beginning of contents
os << nl << token::BEGIN_LIST;
// Write list contents
forAll(*this, i)
{
os << nl;
this->operator[](i).writeDict(os, subDict);
}
// Write end of contents
os << token::END_LIST << nl;
// Check state of IOstream
return os.good();
}
// ************************************************************************* //

View File

@ -0,0 +1,162 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::PorousZones<ZoneType>
Description
A centralized ZoneType collection.
Container class for a set of ZoneType with the ZoneType member
functions implemented to loop over the functions for each ZoneType.
SourceFiles
PorousZones.C
\*---------------------------------------------------------------------------*/
#ifndef PorousZones_H
#define PorousZones_H
#include "IOPtrList.H"
#include "volFieldsFwd.H"
#include "fvMatricesFwd.H"
#include "dimensionedScalarFwd.H"
#include "oneField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
class fvMesh;
/*---------------------------------------------------------------------------*\
Class PorousZones Declaration
\*---------------------------------------------------------------------------*/
template<class ZoneType>
class PorousZones
:
public IOPtrList<ZoneType>
{
// Private data
//- Reference to the finite volume mesh this zone is part of
const fvMesh& mesh_;
// Private Member Functions
//- Disallow default bitwise copy construct
PorousZones(const PorousZones<ZoneType>&);
//- Disallow default bitwise assignment
void operator=(const PorousZones<ZoneType>&);
//- modify time derivative elements
template<class Type>
void modifyDdt(fvMatrix<Type>&) const;
public:
// Constructors
//- Construct from fvMesh
// with automatically constructed coordinate systems list
PorousZones(const fvMesh&);
// Member Functions
//- mirror fvm::ddt with porosity
template<class Type>
tmp<fvMatrix<Type> > ddt
(
GeometricField<Type, fvPatchField, volMesh>&
);
//- mirror fvm::ddt with porosity
template<class Type>
tmp<fvMatrix<Type> > ddt
(
const oneField&,
GeometricField<Type, fvPatchField, volMesh>&
);
//- mirror fvm::ddt with porosity
template<class Type>
tmp<fvMatrix<Type> > ddt
(
const dimensionedScalar&,
GeometricField<Type, fvPatchField, volMesh>&
);
//- mirror fvm::ddt with porosity
template<class Type>
tmp<fvMatrix<Type> > ddt
(
const volScalarField&,
GeometricField<Type, fvPatchField, volMesh>&
);
//- Add the viscous and inertial resistance force contribution
// to the momentum equation
void addResistance(fvVectorMatrix& UEqn) const;
//- Add the viscous and inertial resistance force contribution
// to the tensorial diagonal
void addResistance
(
const fvVectorMatrix& UEqn,
volTensorField& AU
) const;
//- read modified data
virtual bool readData(Istream&);
//- write data
bool writeData(Ostream&, bool subDict = true) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "PorousZones.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -198,7 +198,6 @@ public:
return autoPtr<porousZone>(NULL);
}
//- Return pointer to new porousZone created on freestore from Istream
class iNew
{
@ -222,6 +221,11 @@ public:
};
//- Destructor
virtual ~porousZone()
{}
// Member Functions
// Access
@ -232,6 +236,12 @@ public:
return name_;
}
//- Return mesh
const fvMesh& mesh() const
{
return mesh_;
}
//- cellZone number
label zoneId() const
{
@ -275,7 +285,7 @@ public:
}
//- modify time derivative elements according to porosity
//- Modify time derivative elements according to porosity
template<class Type>
void modifyDdt(fvMatrix<Type>&) const;
@ -294,7 +304,7 @@ public:
) const;
//- Write the porousZone dictionary
void writeDict(Ostream&, bool subDict = true) const;
virtual void writeDict(Ostream&, bool subDict = true) const;
// Ostream Operator

View File

@ -25,8 +25,6 @@ License
\*---------------------------------------------------------------------------*/
#include "porousZones.H"
#include "Time.H"
#include "volFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -35,105 +33,4 @@ namespace Foam
defineTemplateTypeNameAndDebug(IOPtrList<porousZone>, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::porousZones::porousZones
(
const fvMesh& mesh
)
:
IOPtrList<porousZone>
(
IOobject
(
"porousZones",
mesh.time().constant(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
porousZone::iNew(mesh)
),
mesh_(mesh)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::porousZones::addResistance(fvVectorMatrix& UEqn) const
{
forAll(*this, i)
{
operator[](i).addResistance(UEqn);
}
}
void Foam::porousZones::addResistance
(
const fvVectorMatrix& UEqn,
volTensorField& AU
) const
{
// addResistance for each zone, delaying the correction of the
// precessor BCs of AU
forAll(*this, i)
{
operator[](i).addResistance(UEqn, AU, false);
}
// Correct the boundary conditions of the tensorial diagonal to ensure
// processor bounaries are correctly handled when AU^-1 is interpolated
// for the pressure equation.
AU.correctBoundaryConditions();
}
bool Foam::porousZones::readData(Istream& is)
{
clear();
IOPtrList<porousZone> newLst
(
IOobject
(
"porousZones",
mesh_.time().constant(),
mesh_,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false // Don't re-register new zones with objectRegistry
),
porousZone::iNew(mesh_)
);
transfer(newLst);
return is.good();
}
bool Foam::porousZones::writeData(Ostream& os, bool subDict) const
{
// Write size of list
os << nl << size();
// Write beginning of contents
os << nl << token::BEGIN_LIST;
// Write list contents
forAll(*this, i)
{
os << nl;
operator[](i).writeDict(os, subDict);
}
// Write end of contents
os << token::END_LIST << nl;
// Check state of IOstream
return os.good();
}
// ************************************************************************* //

View File

@ -22,152 +22,23 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Typedef
Foam::porousZones
Description
A centralized porousZone collection.
Container class for a set of porousZones with the porousZone member
functions implemented to loop over the functions for each porousZone.
The input file @c constant/porousZone is implemented as
IOPtrList\<porousZone\> and contains the following type of data:
@verbatim
1
(
cat1
{
coordinateSystem system_10;
porosity 0.781;
Darcy
{
d d [0 -2 0 0 0] (-1000 -1000 0.50753e+08);
f f [0 -1 0 0 0] (-1000 -1000 12.83);
}
}
)
@endverbatim
SourceFiles
porousZones.C
\*---------------------------------------------------------------------------*/
#ifndef porousZones_H
#define porousZones_H
#include "PorousZones.H"
#include "porousZone.H"
#include "IOPtrList.H"
#include "volFieldsFwd.H"
#include "fvMatrix.H"
#include "oneField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class porousZones Declaration
\*---------------------------------------------------------------------------*/
class porousZones
:
public IOPtrList<porousZone>
{
// Private data
//- Reference to the finite volume mesh this zone is part of
const fvMesh& mesh_;
// Private Member Functions
//- Disallow default bitwise copy construct
porousZones(const porousZones&);
//- Disallow default bitwise assignment
void operator=(const porousZones&);
//- modify time derivative elements
template<class Type>
void modifyDdt(fvMatrix<Type>&) const;
public:
// Constructors
//- Construct from fvMesh
// with automatically constructed coordinate systems list
porousZones(const fvMesh&);
// Member Functions
//- mirror fvm::ddt with porosity
template<class Type>
tmp<fvMatrix<Type> > ddt
(
GeometricField<Type, fvPatchField, volMesh>&
);
//- mirror fvm::ddt with porosity
template<class Type>
tmp<fvMatrix<Type> > ddt
(
const oneField&,
GeometricField<Type, fvPatchField, volMesh>&
);
//- mirror fvm::ddt with porosity
template<class Type>
tmp<fvMatrix<Type> > ddt
(
const dimensionedScalar&,
GeometricField<Type, fvPatchField, volMesh>&
);
//- mirror fvm::ddt with porosity
template<class Type>
tmp<fvMatrix<Type> > ddt
(
const volScalarField&,
GeometricField<Type, fvPatchField, volMesh>&
);
//- Add the viscous and inertial resistance force contribution
// to the momentum equation
void addResistance(fvVectorMatrix& UEqn) const;
//- Add the viscous and inertial resistance force contribution
// to the tensorial diagonal
void addResistance
(
const fvVectorMatrix& UEqn,
volTensorField& AU
) const;
//- read modified data
virtual bool readData(Istream&);
//- write data
bool writeData(Ostream&, bool subDict = true) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "porousZonesTemplates.C"
#endif
typedef PorousZones<porousZone> porousZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -29,19 +29,18 @@ License
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField);
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//- Specialisation of the jump-condition for the pressure
template<>
void fanFvPatchField<scalar>::updateCoeffs()
void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
{
if (updated())
{
@ -58,27 +57,33 @@ void fanFvPatchField<scalar>::updateCoeffs()
const fvsPatchField<scalar>& phip =
patch().patchField<surfaceScalarField, scalar>(phi);
scalarField Un =
scalarField Un = max
(
scalarField::subField(phip, size()/2)
/scalarField::subField(patch().magSf(), size()/2);
/scalarField::subField(patch().magSf(), size()/2),
scalar(0)
);
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
Un /= patch().lookupPatchField<volScalarField, scalar>("rho");
Un /=
scalarField::subField
(
patch().lookupPatchField<volScalarField, scalar>("rho"),
size()/2
);
}
for(label i=1; i<f_.size(); i++)
{
jump_ += f_[i]*pow(Un, i);
}
jump_ = max(jump_, scalar(0));
}
jumpCyclicFvPatchField<scalar>::updateCoeffs();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -111,7 +111,7 @@ void Foam::fvMeshSubset::doCoupledPatches
{
const polyPatch& pp = oldPatches[oldPatchI];
if (typeid(pp) == typeid(processorPolyPatch))
if (isA<processorPolyPatch>(pp))
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(pp);
@ -133,7 +133,7 @@ void Foam::fvMeshSubset::doCoupledPatches
{
const polyPatch& pp = oldPatches[oldPatchI];
if (typeid(pp) == typeid(processorPolyPatch))
if (isA<processorPolyPatch>(pp))
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(pp);
@ -171,7 +171,7 @@ void Foam::fvMeshSubset::doCoupledPatches
{
const polyPatch& pp = oldPatches[oldPatchI];
if (typeid(pp) == typeid(cyclicPolyPatch))
if (isA<cyclicPolyPatch>(pp))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(pp);

View File

@ -36,7 +36,7 @@ SourceFiles
#ifndef directMappedWallFvPatch_H
#define directMappedWallFvPatch_H
#include "fvPatch.H"
#include "wallFvPatch.H"
#include "directMappedWallPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,12 +45,12 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class directMappedWallFvPatch Declaration
Class directMappedWallFvPatch Declaration
\*---------------------------------------------------------------------------*/
class directMappedWallFvPatch
:
public fvPatch
public wallFvPatch
{
public:
@ -68,7 +68,7 @@ public:
const fvBoundaryMesh& bm
)
:
fvPatch(patch, bm)
wallFvPatch(patch, bm)
{}
};

View File

@ -37,13 +37,7 @@ void Foam::nearWallDist::doAll()
cellDistFuncs wallUtils(mesh_);
// Get patch ids of walls
labelHashSet wallPatchIDs
(
wallUtils.getPatchIDs
(
wallPolyPatch::typeName
)
);
labelHashSet wallPatchIDs(wallUtils.getPatchIDs<wallPolyPatch>());
// Size neighbours array for maximum possible
@ -60,7 +54,7 @@ void Foam::nearWallDist::doAll()
const fvPatch& patch = mesh_.boundary()[patchI];
if (patch.type() == wallFvPatch::typeName)
if (isA<wallFvPatch>(patch))
{
const polyPatch& pPatch = patch.patch();

View File

@ -41,7 +41,7 @@ void Foam::nearWallDistNoSearch::doAll()
{
fvPatchScalarField& ypatch = operator[](patchI);
if (patches[patchI].type() == wallFvPatch::typeName)
if (isA<wallFvPatch>(patches[patchI]))
{
const unallocLabelList& faceCells = patches[patchI].faceCells();

View File

@ -60,7 +60,7 @@ void Foam::reflectionVectors::correct()
forAll(patches, patchi)
{
// find the nearest face for every cell
if (patches[patchi].type() == wallFvPatch::typeName)
if (isA<wallFvPatch>(patches[patchi]))
{
n_.boundaryField()[patchi] =
mesh.Sf().boundaryField()[patchi]

View File

@ -68,7 +68,7 @@ Foam::wallDist::~wallDist()
void Foam::wallDist::correct()
{
// Get patchids of walls
labelHashSet wallPatchIDs(getPatchIDs(wallPolyPatch::typeName));
labelHashSet wallPatchIDs(getPatchIDs<wallPolyPatch>());
// Calculate distance starting from wallPatch faces.
patchWave wave(cellDistFuncs::mesh(), wallPatchIDs, correctWalls_);
@ -79,7 +79,7 @@ void Foam::wallDist::correct()
// Transfer values on patches into boundaryField of *this
forAll(boundaryField(), patchI)
{
if (boundaryField()[patchI].type() != emptyFvPatchScalarField::typeName)
if (!isA<emptyFvPatchScalarField>(boundaryField()[patchI]))
{
scalarField& waveFld = wave.patchDistance()[patchI];

View File

@ -80,7 +80,7 @@ void Foam::wallDistData<TransferType>::correct()
//
// Get patchids of walls
labelHashSet wallPatchIDs(getPatchIDs(wallPolyPatch::typeName));
labelHashSet wallPatchIDs(getPatchIDs<wallPolyPatch>());
// Collect pointers to data on patches
UPtrList<Field<Type> > patchData(mesh.boundaryMesh().size());
@ -109,7 +109,7 @@ void Foam::wallDistData<TransferType>::correct()
{
scalarField& waveFld = wave.patchDistance()[patchI];
if (boundaryField()[patchI].type() != emptyFvPatchScalarField::typeName)
if (!isA<emptyFvPatchScalarField>(boundaryField()[patchI]))
{
boundaryField()[patchI].transfer(waveFld);

View File

@ -367,7 +367,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField
new scalarField
(
this->size(),
fieldToken.scalarToken()
fieldToken.number()
)
);
}

View File

@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "polyMesh.H"
#include "wallPolyPatch.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -46,21 +47,25 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda
Sf /= mag(Sf);
vector Cf = mesh.faceCentres()[facei];
// move reference point for wall
// patch interaction
if (!cloud_.internalFace(facei))
{
const vector& C = mesh.cellCentres()[celli_];
scalar CCf = mag((C - Cf) & Sf);
// check if distance between cell centre and face centre
// is larger than wallImpactDistance
if
(
CCf
> static_cast<const ParticleType&>(*this).wallImpactDistance(Sf)
)
label patchi = patch(facei);
const polyPatch& patch = mesh.boundaryMesh()[patchi];
// move reference point for wall
if (isA<wallPolyPatch>(patch))
{
Cf -= static_cast<const ParticleType&>(*this)
.wallImpactDistance(Sf)*Sf;
const vector& C = mesh.cellCentres()[celli_];
scalar CCf = mag((C - Cf) & Sf);
// check if distance between cell centre and face centre
// is larger than wallImpactDistance
const ParticleType& p =
static_cast<const ParticleType&>(*this);
if (CCf > p.wallImpactDistance(Sf))
{
Cf -=p.wallImpactDistance(Sf)*Sf;
}
}
}
@ -190,21 +195,24 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda
Sf /= mag(Sf);
vector Cf = mesh.faceCentres()[facei];
// move reference point for wall
// patch interaction
if (!cloud_.internalFace(facei))
{
const vector& C = mesh.cellCentres()[celli_];
scalar CCf = mag((C - Cf) & Sf);
// check if distance between cell centre and face centre
// is larger than wallImpactDistance
if
(
CCf
> static_cast<const ParticleType&>(*this).wallImpactDistance(Sf)
)
label patchi = patch(facei);
const polyPatch& patch = mesh.boundaryMesh()[patchi];
// move reference point for wall
if (isA<wallPolyPatch>(patch))
{
Cf -= static_cast<const ParticleType&>(*this)
.wallImpactDistance(Sf)*Sf;
const vector& C = mesh.cellCentres()[celli_];
scalar CCf = mag((C - Cf) & Sf);
// check if distance between cell centre and face centre
// is larger than wallImpactDistance
const ParticleType& p = static_cast<const ParticleType&>(*this);
if (CCf > p.wallImpactDistance(Sf))
{
Cf -=p.wallImpactDistance(Sf)*Sf;
}
}
}

View File

@ -1,4 +1,4 @@
if (isType<wallPolyPatch>(pbMesh[patch(face())]))
if (isA<wallPolyPatch>(pbMesh[patch(face())]))
{
keepParcel = sDB.wall().wallTreatment(*this, face());
@ -12,7 +12,7 @@ if (isType<wallPolyPatch>(pbMesh[patch(face())]))
U() = (magUs/magV1)*v1*n() + vs*sDB.axisOfSymmetry();
}
}
else if (isType<wedgePolyPatch>(pbMesh[patch(face())]))
else if (isA<wedgePolyPatch>(pbMesh[patch(face())]))
{
// check if parcel is trying to move out of the domain
label patchi = patch(face());
@ -27,7 +27,7 @@ else if (isType<wedgePolyPatch>(pbMesh[patch(face())]))
U() -= 2.0*Un2*n();
}
}
else if (isType<symmetryPolyPatch>(pbMesh[patch(face())]))
else if (isA<symmetryPolyPatch>(pbMesh[patch(face())]))
{
// check if parcel is trying to move out of the domain
label patchi = patch(face());

View File

@ -314,7 +314,7 @@ bool Foam::parcel::move(spray& sDB)
{
if (face() > -1)
{
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
if (isA<processorPolyPatch>(pbMesh[patch(face())]))
{
switchProcessor = true;
}

View File

@ -242,11 +242,11 @@ Foam::spray::spray
// check for the type of boundary condition
forAll(bMesh, patchi)
{
if (isType<symmetryPolyPatch>(bMesh[patchi]))
if (isA<symmetryPolyPatch>(bMesh[patchi]))
{
symPlaneExist = true;
}
else if (isType<wedgePolyPatch>(bMesh[patchi]))
else if (isA<wedgePolyPatch>(bMesh[patchi]))
{
wedgeExist = true;
patches[n++] = patchi;

View File

@ -82,7 +82,7 @@ bool reflectParcel::wallTreatment
const polyMesh& mesh = spray_.mesh();
if (isType<wallPolyPatch>(mesh_.boundaryMesh()[patchi]))
if (isA<wallPolyPatch>(mesh_.boundaryMesh()[patchi]))
{
// wallNormal defined to point outwards of domain
vector Sf = mesh_.Sf().boundaryField()[patchi][facei];

View File

@ -60,7 +60,7 @@ bool Foam::DsmcParcel<ParcelType>::move
if (p.onBoundary() && td.keepParticle)
{
if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())]))
if (isA<processorPolyPatch>(pbMesh[p.patch(p.face())]))
{
td.switchProcessor = true;
}

View File

@ -52,7 +52,7 @@ Foam::FreeStream<CloudType>::FreeStream
{
const polyPatch& patch = cloud.mesh().boundaryMesh()[p];
if (patch.type() == polyPatch::typeName)
if (isType<polyPatch>(patch))
{
patches.append(p);
}

View File

@ -263,7 +263,7 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
if (p.onBoundary() && td.keepParticle)
{
if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())]))
if (isA<processorPolyPatch>(pbMesh[p.patch(p.face())]))
{
td.switchProcessor = true;
}

View File

@ -26,7 +26,8 @@ Class
Foam::particleForces
Description
Particle forces
Provides a mechanism to calculate particle forces
Note: forces are force per unit mass (accelerations)
SourceFiles
particleForces.C

View File

@ -367,7 +367,7 @@ void Foam::referredCellList::buildReferredCellList
// boundaries. Separate treatment allows the serial version to run
// transparently.
if (mesh.boundaryMesh()[patchI].type() == "cyclic")
if (isA<cyclicPolyPatch>(mesh.boundaryMesh()[patchI]))
{
const cyclicPolyPatch& patch = refCast<const cyclicPolyPatch>
(

View File

@ -84,7 +84,7 @@ bool Foam::solidParticle::move(solidParticle::trackData& td)
if (onBoundary() && td.keepParticle)
{
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
if (isA<processorPolyPatch>(pbMesh[patch(face())]))
{
td.switchProcessor = true;
}

View File

@ -104,27 +104,6 @@ Foam::labelHashSet Foam::cellDistFuncs::getPatchIDs
}
// Get patch ids of patches of certain type (e.g. 'polyProcessorPatch')
Foam::labelHashSet Foam::cellDistFuncs::getPatchIDs(const word& wantedType)
const
{
const polyBoundaryMesh& bMesh = mesh().boundaryMesh();
labelHashSet patchIDs(bMesh.size());
forAll(bMesh, patchI)
{
const polyPatch& patch = bMesh[patchI];
if (patch.type() == wantedType)
{
patchIDs.insert(patchI);
}
}
return patchIDs;
}
// Return smallest true distance from p to any of wallFaces.
// Note that even if normal hits face we still check other faces.
// Note that wallFaces is untruncated and we explicitly pass in size.

View File

@ -30,6 +30,7 @@ Description
SourceFiles
cellDistFuncs.C
cellDistFuncsTemplates.C
\*---------------------------------------------------------------------------*/
@ -101,8 +102,10 @@ public:
//- Get patchIDs of named patches
labelHashSet getPatchIDs(const wordList&) const;
//- Get patchIDs of certain type (e.g. 'processorPolyPatch')
labelHashSet getPatchIDs(const word&) const;
//- Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
// Uses isA, not isType
template<class Type>
labelHashSet getPatchIDs() const;
//- Calculate smallest true distance (and face index)
// from pt to faces wallFaces.
@ -159,6 +162,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "cellDistFuncsTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "cellDistFuncs.H"
#include "polyMesh.H"
#include "polyBoundaryMesh.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::labelHashSet Foam::cellDistFuncs::getPatchIDs() const
{
const polyBoundaryMesh& bMesh = mesh().boundaryMesh();
labelHashSet patchIDs(bMesh.size());
forAll(bMesh, patchI)
{
if (isA<Type>(bMesh[patchI]))
{
patchIDs.insert(patchI);
}
}
return patchIDs;
}
// ************************************************************************* //

View File

@ -36,7 +36,7 @@ SourceFiles
#ifndef directMappedWallPointPatch_H
#define directMappedWallPointPatch_H
#include "facePointPatch.H"
#include "wallPointPatch.H"
#include "directMappedWallPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,7 +50,7 @@ namespace Foam
class directMappedWallPointPatch
:
public facePointPatch
public wallPointPatch
{
public:
@ -68,7 +68,7 @@ public:
const pointBoundaryMesh& bm
)
:
facePointPatch(patch, bm)
wallPointPatch(patch, bm)
{}
};

View File

@ -366,14 +366,24 @@ void Foam::directMappedPatchBase::calcMapping() const
if
(
offset_ == vector::zero
&& mode_ == NEARESTPATCHFACE
&& sampleRegion_ == patch_.boundaryMesh().mesh().name()
&& samplePatch_ == patch_.name()
)
{
FatalErrorIn("directMappedPatchBase::calcMapping() const")
WarningIn("directMappedPatchBase::calcMapping() const")
<< "Invalid offset " << offset_ << endl
<< "Offset is the vector added to the patch face centres to"
<< " find the cell supplying the data."
<< exit(FatalError);
<< " find the patch face supplying the data." << endl
<< "Setting it to " << offset_
<< " on the same patch, on the same region"
<< " will find the faces themselves which does not make sense"
<< " for anything but testing." << endl
<< "patch_:" << patch_.name() << endl
<< "sampleRegion_:" << sampleRegion_ << endl
<< "mode_:" << sampleModeNames_[mode_] << endl
<< "samplePatch_:" << samplePatch_ << endl
<< "offset_:" << offset_ << endl;
}
@ -422,7 +432,7 @@ void Foam::directMappedPatchBase::calcMapping() const
+ "_directMapped.obj"
);
Pout<< "Dumping mapping as lines from patch faceCentres to"
<< " sampled cellCentres to file " << str.name() << endl;
<< " sampled cell/faceCentres to file " << str.name() << endl;
label vertI = 0;

View File

@ -113,7 +113,7 @@ void faceSet::sync(const polyMesh& mesh)
{
const polyPatch& pp = patches[patchI];
if (isType<processorPolyPatch>(pp))
if (isA<processorPolyPatch>(pp))
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(pp);
@ -145,7 +145,7 @@ void faceSet::sync(const polyMesh& mesh)
{
const polyPatch& pp = patches[patchI];
if (isType<processorPolyPatch>(pp))
if (isA<processorPolyPatch>(pp))
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(pp);
@ -174,7 +174,7 @@ void faceSet::sync(const polyMesh& mesh)
{
const polyPatch& pp = patches[patchI];
if (typeid(pp) == typeid(cyclicPolyPatch))
if (isA<cyclicPolyPatch>(pp))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(pp);

View File

@ -100,7 +100,7 @@ meshToMesh::meshToMesh
forAll (toMesh_.boundaryMesh(), patchi)
{
// Add the processor patches in the toMesh to the cuttingPatches list
if (toMesh_.boundaryMesh()[patchi].type() == processorFvPatch::typeName)
if (isA<processorPolyPatch>(toMesh_.boundaryMesh()[patchi]))
{
cuttingPatches_.insert
(

View File

@ -179,8 +179,8 @@ void Foam::thresholdCellFaces::calculate
if
(
isType<emptyPolyPatch>(p)
|| (Pstream::parRun() && isType<processorPolyPatch>(p))
isA<emptyPolyPatch>(p)
|| (Pstream::parRun() && isA<processorPolyPatch>(p))
)
{
continue;

View File

@ -16,5 +16,6 @@ wmake libso chemistryModel
wmake libso pdfs
wmake libso radiation
wmake libso barotropicCompressibilityModel
wmake libso thermalPorousZone
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,4 @@
thermalPorousZone/thermalPorousZone.C
thermalPorousZone/thermalPorousZones.C
LIB = $(FOAM_LIBBIN)/libthermalPorousZone

View File

@ -0,0 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
LIB_LIBS = \
-lbasicThermophysicalModels \
-lmeshTools \
-lfiniteVolume

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "thermalPorousZone.H"
#include "fvMesh.H"
#include "fvMatrices.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::thermalPorousZone::thermalPorousZone
(
const word& name,
const fvMesh& mesh,
const dictionary& dict
)
:
porousZone(name, mesh, dict),
T_("T", dimTemperature, -GREAT)
{
if (const dictionary* dictPtr = dict.subDictPtr("thermalModel"))
{
word thermalModel(dictPtr->lookup("type"));
if (thermalModel == "fixedTemperature")
{
dictPtr->lookup("T") >> T_;
}
else
{
FatalIOErrorIn
(
"thermalPorousZone::thermalPorousZone"
"("
"const word& name, "
"const fvMesh& mesh, "
"const dictionary& dict"
")",
*dictPtr
) << "thermalModel " << thermalModel << " is not supported" << nl
<< " Supported thermalModels are: fixedTemperature"
<< exit(FatalIOError);
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::thermalPorousZone::addEnthalpySource
(
const basicThermo& thermo,
const volScalarField& rho,
fvScalarMatrix& hEqn
) const
{
if (zoneId() == -1 || T_.value() < 0.0)
{
return;
}
const labelList& cells = mesh().cellZones()[zoneId()];
const scalarField& V = mesh().V();
scalarField& hDiag = hEqn.diag();
scalarField& hSource = hEqn.source();
scalarField hZone = thermo.h(scalarField(cells.size(), T_.value()), cells);
scalar rate = 1e6;
forAll (cells, i)
{
hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*hZone[i];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,161 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::thermalPorousZone
Description
Porous zone definition based on cell zones including terms for energy
equations.
See Also
porousZone, thermalPorousZones and coordinateSystems
SourceFiles
thermalPorousZone.C
thermalPorousZoneTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef thermalPorousZone_H
#define thermalPorousZone_H
#include "porousZone.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class fvMesh;
class basicThermo;
/*---------------------------------------------------------------------------*\
Class thermalPorousZone Declaration
\*---------------------------------------------------------------------------*/
class thermalPorousZone
:
public porousZone
{
// Private data
//- Temperature in the porous-zone
dimensionedScalar T_;
//- Disallow default bitwise copy construct
thermalPorousZone(const thermalPorousZone&);
//- Disallow default bitwise assignment
void operator=(const thermalPorousZone&);
public:
// Constructors
//- Construct from components
thermalPorousZone(const word& name, const fvMesh&, const dictionary&);
//- Return clone
autoPtr<thermalPorousZone> clone() const
{
notImplemented("autoPtr<thermalPorousZone> clone() const");
return autoPtr<thermalPorousZone>(NULL);
}
//- Return pointer to new thermalPorousZone
// created on freestore from Istream
class iNew
{
//- Reference to the finite volume mesh this zone is part of
const fvMesh& mesh_;
public:
iNew(const fvMesh& mesh)
:
mesh_(mesh)
{}
autoPtr<thermalPorousZone> operator()(Istream& is) const
{
word name(is);
dictionary dict(is);
return autoPtr<thermalPorousZone>
(
new thermalPorousZone(name, mesh_, dict)
);
}
};
//- Destructor
virtual ~thermalPorousZone()
{}
// Member Functions
// Access
//- Return the temperature in the porous-zone
const dimensionedScalar& T() const
{
return T_;
}
//- Edit access to the temperature in the porous-zone
dimensionedScalar& T()
{
return T_;
}
//- Add the thermal source to the enthalpy equation
void addEnthalpySource
(
const basicThermo& thermo,
const volScalarField& rho,
fvScalarMatrix& hEqn
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
//# include "thermalPorousZoneTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "porousZone.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class RhoFieldType>
void Foam::porousZone::addPowerLawResistance
(
scalarField& Udiag,
const labelList& cells,
const scalarField& V,
const RhoFieldType& rho,
const vectorField& U
) const
{
const scalar C0 = C0_;
const scalar C1m1b2 = (C1_ - 1.0)/2.0;
forAll (cells, i)
{
Udiag[cells[i]] +=
V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2);
}
}
template<class RhoFieldType>
void Foam::porousZone::addViscousInertialResistance
(
scalarField& Udiag,
vectorField& Usource,
const labelList& cells,
const scalarField& V,
const RhoFieldType& rho,
const scalarField& mu,
const vectorField& U
) const
{
const tensor& D = D_.value();
const tensor& F = F_.value();
forAll (cells, i)
{
tensor dragCoeff = mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
scalar isoDragCoeff = tr(dragCoeff);
Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
Usource[cells[i]] -=
V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
}
}
// ************************************************************************* //

View File

@ -22,79 +22,43 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*----------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
#include "porousZones.H"
#include "thermalPorousZones.H"
#include "volFields.H"
#include "fvMatrix.H"
#include "fvm.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class Type>
void Foam::porousZones::modifyDdt(fvMatrix<Type>& m) const
namespace Foam
{
defineTemplateTypeNameAndDebug(IOPtrList<thermalPorousZone>, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::thermalPorousZones::thermalPorousZones
(
const fvMesh& mesh
)
:
PorousZones<thermalPorousZone>(mesh)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::thermalPorousZones::addEnthalpySource
(
const basicThermo& thermo,
const volScalarField& rho,
fvScalarMatrix& hEqn
) const
{
forAll(*this, i)
{
operator[](i).modifyDdt(m);
operator[](i).addEnthalpySource(thermo, rho, hEqn);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::porousZones::ddt
(
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tres = fvm::ddt(vf);
modifyDdt(tres());
return tres;
}
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::porousZones::ddt
(
const oneField&,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tres = fvm::ddt(vf);
modifyDdt(tres());
return tres;
}
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::porousZones::ddt
(
const dimensionedScalar& rho,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tres = fvm::ddt(rho,vf);
modifyDdt(tres());
return tres;
}
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::porousZones::ddt
(
const volScalarField& rho,
GeometricField<Type, fvPatchField, volMesh>& vf
)
{
tmp<fvMatrix<Type> > tres = fvm::ddt(rho,vf);
modifyDdt(tres());
return tres;
}
// ************************************************************************* //

View File

@ -0,0 +1,109 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::thermalPorousZones
Description
A centralized thermalPorousZone collection.
Container class for a set of thermalPorousZones with the thermalPorousZone
member functions implemented to loop over the functions for each
thermalPorousZone.
The input file @c constant/thermalPorousZone is implemented as
IOPtrList\<thermalPorousZone\> and contains the following type of data:
@verbatim
1
(
cat1
{
coordinateSystem system_10;
porosity 0.781;
Darcy
{
d d [0 -2 0 0 0] (-1000 -1000 0.50753e+08);
f f [0 -1 0 0 0] (-1000 -1000 12.83);
}
Temperature [0 0 1 0 0] 600;
}
)
@endverbatim
SourceFiles
thermalPorousZones.C
\*---------------------------------------------------------------------------*/
#ifndef thermalPorousZones_H
#define thermalPorousZones_H
#include "PorousZones.H"
#include "thermalPorousZone.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class thermalPorousZones Declaration
\*---------------------------------------------------------------------------*/
class thermalPorousZones
:
public PorousZones<thermalPorousZone>
{
public:
// Constructors
//- Construct from fvMesh
thermalPorousZones(const fvMesh&);
// Member Functions
//- Add the thermal source to the enthalpy equation
void addEnthalpySource
(
const basicThermo& thermo,
const volScalarField& rho,
fvScalarMatrix& hEqn
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -175,7 +175,7 @@ void Foam::linearValveFvMesh::makeSlidersDead()
// Enable layering
forAll (topoChanges, modI)
{
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
if (isA<slidingInterface>(topoChanges[modI]))
{
topoChanges[modI].disable();
}
@ -197,7 +197,7 @@ void Foam::linearValveFvMesh::makeSlidersLive()
// Enable sliding interface
forAll (topoChanges, modI)
{
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
if (isA<slidingInterface>(topoChanges[modI]))
{
topoChanges[modI].enable();
}
@ -220,7 +220,7 @@ bool Foam::linearValveFvMesh::attached() const
forAll (topoChanges, modI)
{
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
if (isA<slidingInterface>(topoChanges[modI]))
{
result =
result
@ -231,7 +231,7 @@ bool Foam::linearValveFvMesh::attached() const
// Check thal all sliders are in sync (debug only)
forAll (topoChanges, modI)
{
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
if (isA<slidingInterface>(topoChanges[modI]))
{
if
(

View File

@ -219,11 +219,11 @@ void Foam::linearValveLayersFvMesh::makeLayersLive()
// Enable layering
forAll (topoChanges, modI)
{
if (typeid(topoChanges[modI]) == typeid(layerAdditionRemoval))
if (isA<layerAdditionRemoval>(topoChanges[modI]))
{
topoChanges[modI].enable();
}
else if (typeid(topoChanges[modI]) == typeid(slidingInterface))
else if (isA<slidingInterface>(topoChanges[modI]))
{
topoChanges[modI].disable();
}
@ -245,11 +245,11 @@ void Foam::linearValveLayersFvMesh::makeSlidersLive()
// Enable sliding interface
forAll (topoChanges, modI)
{
if (typeid(topoChanges[modI]) == typeid(layerAdditionRemoval))
if (isA<layerAdditionRemoval>(topoChanges[modI]))
{
topoChanges[modI].disable();
}
else if (typeid(topoChanges[modI]) == typeid(slidingInterface))
else if (isA<slidingInterface>(topoChanges[modI]))
{
topoChanges[modI].enable();
}
@ -272,7 +272,7 @@ bool Foam::linearValveLayersFvMesh::attached() const
forAll (topoChanges, modI)
{
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
if (isA<slidingInterface>(topoChanges[modI]))
{
result =
result
@ -283,7 +283,7 @@ bool Foam::linearValveLayersFvMesh::attached() const
// Check thal all sliders are in sync (debug only)
forAll (topoChanges, modI)
{
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
if (isA<slidingInterface>(topoChanges[modI]))
{
if
(

View File

@ -46,6 +46,11 @@ bool triSurface::stitchTriangles
pointField newPoints;
bool hasMerged = mergePoints(rawPoints, tol, verbose, pointMap, newPoints);
pointField& ps = storedPoints();
// Set the coordinates to the merged ones
ps = newPoints;
if (hasMerged)
{
if (verbose)
@ -54,11 +59,6 @@ bool triSurface::stitchTriangles
<< " points down to " << newPoints.size() << endl;
}
pointField& ps = storedPoints();
// Set the coordinates to the merged ones
ps = newPoints;
// Reset the triangle point labels to the unique points array
label newTriangleI = 0;
forAll(*this, i)

View File

@ -71,7 +71,7 @@ void vanDriestDelta::calcDelta()
const fvPatchList& patches = mesh_.boundary();
forAll(patches, patchi)
{
if (isType<wallFvPatch>(patches[patchi]))
if (isA<wallFvPatch>(patches[patchi]))
{
const fvPatchVectorField& Uw = U.boundaryField()[patchi];
const scalarField& rhow = rho.boundaryField()[patchi];

View File

@ -370,7 +370,7 @@ void LRR::correct()
{
const fvPatch& curPatch = patches[patchi];
if (typeid(curPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -432,7 +432,7 @@ void LRR::correct()
{
const fvPatch& curPatch = patches[patchi];
if (typeid(curPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(curPatch))
{
symmTensorField& Rw = R_.boundaryField()[patchi];

View File

@ -408,7 +408,7 @@ void LaunderGibsonRSTM::correct()
{
const fvPatch& curPatch = patches[patchi];
if (typeid(curPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -478,7 +478,7 @@ void LaunderGibsonRSTM::correct()
{
const fvPatch& curPatch = patches[patchi];
if (typeid(curPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(curPatch))
{
symmTensorField& Rw = R_.boundaryField()[patchi];

View File

@ -142,7 +142,7 @@ LaunderSharmaKE::LaunderSharmaKE
"k",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_
@ -155,7 +155,7 @@ LaunderSharmaKE::LaunderSharmaKE
"epsilon",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_

View File

@ -37,6 +37,8 @@ $(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C
derivedFvPatchFields/turbulentTemperatureCoupledBaffle/regionProperties.C
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C

View File

@ -7,4 +7,6 @@ EXE_INC = \
LIB_LIBS = \
-lcompressibleTurbulenceModel \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lspecie \
-lmeshTools

View File

@ -174,9 +174,9 @@ tmp<scalarField> RASModel::yPlus(const label patchNo, const scalar Cmu) const
tmp<scalarField> tYp(new scalarField(curPatch.size()));
scalarField& Yp = tYp();
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
Yp = pow(Cmu, 0.25)
Yp = pow025(Cmu)
*y_[patchNo]
*sqrt(k()().boundaryField()[patchNo].patchInternalField())
/(

View File

@ -73,7 +73,7 @@ tmp<volScalarField> autoCreateAlphat
forAll(bm, patchI)
{
if (isType<wallFvPatch>(bm[patchI]))
if (isA<wallFvPatch>(bm[patchI]))
{
alphatBoundaryTypes[patchI] =
RASModels::alphatWallFunctionFvPatchScalarField::typeName;
@ -143,7 +143,7 @@ tmp<volScalarField> autoCreateMut
forAll(bm, patchI)
{
if (isType<wallFvPatch>(bm[patchI]))
if (isA<wallFvPatch>(bm[patchI]))
{
mutBoundaryTypes[patchI] =
RASModels::mutkWallFunctionFvPatchScalarField::typeName;

View File

@ -28,7 +28,7 @@ License
#include "Time.H"
#include "OSspecific.H"
#include "wallPolyPatch.H"
#include "wallFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -111,7 +111,7 @@ autoCreateWallFunctionField
forAll(newPatchFields, patchI)
{
if (isType<wallPolyPatch>(mesh.boundaryMesh()[patchI]))
if (isA<wallFvPatch>(mesh.boundary()[patchI]))
{
newPatchFields.set
(

View File

@ -27,7 +27,6 @@ License
#include "turbulentMixingLengthFrequencyInletFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "surfaceFields.H"
#include "volFields.H"
#include "RASModel.H"
@ -118,7 +117,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
const scalar Cmu =
rasModel.coeffDict().lookupOrDefault<scalar>("Cmu", 0.09);
const scalar Cmu25 = pow(Cmu, 0.25);
const scalar Cmu25 = pow025(Cmu);
const fvPatchField<scalar>& kp =
patch().lookupPatchField<volScalarField, scalar>(kName_);

View File

@ -0,0 +1,69 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "regionProperties.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::regionProperties::regionProperties(const Time& runTime)
:
IOdictionary
(
IOobject
(
"regionProperties",
runTime.time().constant(),
runTime.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
fluidRegionNames_(lookup("fluidRegionNames")),
solidRegionNames_(lookup("solidRegionNames"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::regionProperties::~regionProperties()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::List<Foam::word>& Foam::regionProperties::fluidRegionNames() const
{
return fluidRegionNames_;
}
const Foam::List<Foam::word>& Foam::regionProperties::solidRegionNames() const
{
return solidRegionNames_;
}
// ************************************************************************* //

View File

@ -0,0 +1,106 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
regionProperties
Description
Simple class to hold region information for coupled region simulations
SourceFiles
regionProperties.C
\*---------------------------------------------------------------------------*/
#ifndef regionProperties_H
#define regionProperties_H
#include "IOdictionary.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class regionProperties Declaration
\*---------------------------------------------------------------------------*/
class regionProperties
:
public IOdictionary
{
// Private data
//- List of the fluid region names
List<word> fluidRegionNames_;
//- List of the solid region names
List<word> solidRegionNames_;
// Private Member Functions
//- Disallow default bitwise copy construct
regionProperties(const regionProperties&);
//- Disallow default bitwise assignment
void operator=(const regionProperties&);
public:
// Constructors
//- Construct from components
regionProperties(const Time& runTime);
// Destructor
~regionProperties();
// Member Functions
// Access
//- Return const reference to the list of fluid region names
const List<word>& fluidRegionNames() const;
//- Return const reference to the list of solid region names
const List<word>& solidRegionNames() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,430 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "turbulentTemperatureCoupledBaffleFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "directMappedPatchBase.H"
#include "regionProperties.H"
#include "basicThermo.H"
#include "RASModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool turbulentTemperatureCoupledBaffleFvPatchScalarField::interfaceOwner
(
const polyMesh& nbrRegion,
const polyPatch& nbrPatch
) const
{
const fvMesh& myRegion = patch().boundaryMesh().mesh();
if (nbrRegion.name() == myRegion.name())
{
return patch().index() < nbrPatch.index();
}
else
{
const regionProperties& props =
myRegion.objectRegistry::parent().lookupObject<regionProperties>
(
"regionProperties"
);
label myIndex = findIndex(props.fluidRegionNames(), myRegion.name());
if (myIndex == -1)
{
label i = findIndex(props.solidRegionNames(), myRegion.name());
if (i == -1)
{
FatalErrorIn
(
"turbulentTemperatureCoupledBaffleFvPatchScalarField"
"::interfaceOwner(const polyMesh&"
", const polyPatch&)const"
) << "Cannot find region " << myRegion.name()
<< " neither in fluids " << props.fluidRegionNames()
<< " nor in solids " << props.solidRegionNames()
<< exit(FatalError);
}
myIndex = props.fluidRegionNames().size() + i;
}
label nbrIndex = findIndex
(
props.fluidRegionNames(),
nbrRegion.name()
);
if (nbrIndex == -1)
{
label i = findIndex(props.solidRegionNames(), nbrRegion.name());
if (i == -1)
{
FatalErrorIn
(
"coupleManager::interfaceOwner"
"(const polyMesh&, const polyPatch&) const"
) << "Cannot find region " << nbrRegion.name()
<< " neither in fluids " << props.fluidRegionNames()
<< " nor in solids " << props.solidRegionNames()
<< exit(FatalError);
}
nbrIndex = props.fluidRegionNames().size() + i;
}
return myIndex < nbrIndex;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
turbulentTemperatureCoupledBaffleFvPatchScalarField::
turbulentTemperatureCoupledBaffleFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(p, iF),
neighbourFieldName_("undefined-neighbourFieldName"),
KName_("undefined-K")
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->valueFraction() = 1.0;
this->fixesValue_ = true;
}
turbulentTemperatureCoupledBaffleFvPatchScalarField::
turbulentTemperatureCoupledBaffleFvPatchScalarField
(
const turbulentTemperatureCoupledBaffleFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mixedFvPatchScalarField(ptf, p, iF, mapper),
neighbourFieldName_(ptf.neighbourFieldName_),
KName_(ptf.KName_),
fixesValue_(ptf.fixesValue_)
{}
turbulentTemperatureCoupledBaffleFvPatchScalarField::
turbulentTemperatureCoupledBaffleFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mixedFvPatchScalarField(p, iF),
neighbourFieldName_(dict.lookup("neighbourFieldName")),
KName_(dict.lookup("K"))
{
if (!isA<directMappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
"turbulentTemperatureCoupledBaffleFvPatchScalarField::"
"turbulentTemperatureCoupledBaffleFvPatchScalarField\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<scalar, volMesh>& iF,\n"
" const dictionary& dict\n"
")\n"
) << "\n patch type '" << p.type()
<< "' not type '" << directMappedPatchBase::typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << dimensionedInternalField().name()
<< " in file " << dimensionedInternalField().objectPath()
<< exit(FatalError);
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue"))
{
// Full restart
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
fixesValue_ = readBool(dict.lookup("fixesValue"));
}
else
{
// Start from user entered data. Assume fixedValue.
refValue() = *this;
refGrad() = 0.0;
valueFraction() = 1.0;
fixesValue_ = true;
}
}
turbulentTemperatureCoupledBaffleFvPatchScalarField::
turbulentTemperatureCoupledBaffleFvPatchScalarField
(
const turbulentTemperatureCoupledBaffleFvPatchScalarField& wtcsf,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(wtcsf, iF),
neighbourFieldName_(wtcsf.neighbourFieldName_),
KName_(wtcsf.KName_),
fixesValue_(wtcsf.fixesValue_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField>
turbulentTemperatureCoupledBaffleFvPatchScalarField::K() const
{
if (KName_ == "none")
{
const compressible::RASModel& model =
db().lookupObject<compressible::RASModel>("RASProperties");
tmp<volScalarField> talpha = model.alphaEff();
const basicThermo& thermo =
db().lookupObject<basicThermo>("thermophysicalProperties");
return
talpha().boundaryField()[patch().index()]
*thermo.rho()().boundaryField()[patch().index()]
*thermo.Cp()().boundaryField()[patch().index()];
}
else
{
return patch().lookupPatchField<volScalarField, scalar>(KName_);
}
}
void turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
// Get the coupling information from the directMappedPatchBase
const directMappedPatchBase& mpp = refCast<const directMappedPatchBase>
(
patch().patch()
);
const polyMesh& nbrMesh = mpp.sampleMesh();
const fvPatch& nbrPatch = refCast<const fvMesh>
(
nbrMesh
).boundary()[mpp.samplePolyPatch().index()];
// Force recalculation of mapping and schedule
const mapDistribute& distMap = mpp.map();
(void)distMap.schedule();
tmp<scalarField> intFld = patchInternalField();
if (interfaceOwner(nbrMesh, nbrPatch.patch()))
{
// Note: other side information could be cached - it only needs
// to be updated the first time round the iteration (i.e. when
// switching regions) but unfortunately we don't have this information.
// Calculate the temperature by harmonic averaging
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const turbulentTemperatureCoupledBaffleFvPatchScalarField& nbrField =
refCast<const turbulentTemperatureCoupledBaffleFvPatchScalarField>
(
nbrPatch.lookupPatchField<volScalarField, scalar>
(
neighbourFieldName_
)
);
// Swap to obtain full local values of neighbour internal field
scalarField nbrIntFld = nbrField.patchInternalField();
mapDistribute::distribute
(
Pstream::defaultCommsType,
distMap.schedule(),
distMap.constructSize(),
distMap.subMap(), // what to send
distMap.constructMap(), // what to receive
nbrIntFld
);
// Swap to obtain full local values of neighbour K*delta
scalarField nbrKDelta = nbrField.K()*nbrPatch.deltaCoeffs();
mapDistribute::distribute
(
Pstream::defaultCommsType,
distMap.schedule(),
distMap.constructSize(),
distMap.subMap(), // what to send
distMap.constructMap(), // what to receive
nbrKDelta
);
tmp<scalarField> myKDelta = K()*patch().deltaCoeffs();
// Calculate common wall temperature. Reuse *this to store common value.
scalarField Twall
(
(myKDelta()*intFld() + nbrKDelta*nbrIntFld)
/ (myKDelta() + nbrKDelta)
);
// Assign to me
fvPatchScalarField::operator=(Twall);
// Distribute back and assign to neighbour
mapDistribute::distribute
(
Pstream::defaultCommsType,
distMap.schedule(),
nbrField.size(),
distMap.constructMap(), // reverse : what to send
distMap.subMap(),
Twall
);
const_cast<turbulentTemperatureCoupledBaffleFvPatchScalarField&>
(
nbrField
).fvPatchScalarField::operator=(Twall);
}
// Switch between fixed value (of harmonic avg) or gradient
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
label nFixed = 0;
// Like snGrad but bypass switching on refValue/refGrad.
tmp<scalarField> normalGradient = (*this-intFld())*patch().deltaCoeffs();
if (debug)
{
scalar Q = gSum(K()*patch().magSf()*normalGradient());
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->dimensionedInternalField().name() << " -> "
<< nbrMesh.name() << ':'
<< nbrPatch.name() << ':'
<< this->dimensionedInternalField().name() << " :"
<< " heatFlux:" << Q
<< " walltemperature "
<< " min:" << gMin(*this)
<< " max:" << gMax(*this)
<< " avg:" << gAverage(*this)
<< endl;
}
forAll(*this, i)
{
// if outgoing flux use fixed value.
if (normalGradient()[i] < 0.0)
{
this->refValue()[i] = operator[](i);
this->refGrad()[i] = 0.0; // not used
this->valueFraction()[i] = 1.0;
nFixed++;
}
else
{
this->refValue()[i] = 0.0; // not used
this->refGrad()[i] = normalGradient()[i];
this->valueFraction()[i] = 0.0;
}
}
reduce(nFixed, sumOp<label>());
fixesValue_ = (nFixed > 0);
if (debug)
{
label nTotSize = returnReduce(this->size(), sumOp<label>());
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->dimensionedInternalField().name() << " -> "
<< nbrMesh.name() << ':'
<< nbrPatch.name() << ':'
<< this->dimensionedInternalField().name() << " :"
<< " patch:" << patch().name()
<< " out of:" << nTotSize
<< " fixedBC:" << nFixed
<< " gradient:" << nTotSize-nFixed << endl;
}
mixedFvPatchScalarField::updateCoeffs();
}
void turbulentTemperatureCoupledBaffleFvPatchScalarField::write
(
Ostream& os
) const
{
mixedFvPatchScalarField::write(os);
os.writeKeyword("neighbourFieldName")<< neighbourFieldName_
<< token::END_STATEMENT << nl;
os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl;
os.writeKeyword("fixesValue") << fixesValue_ << token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
turbulentTemperatureCoupledBaffleFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,200 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::compressible::turbulentTemperatureCoupledBaffleFvPatchScalarField
Description
Mixed boundary condition for temperature, to be used for heat-transfer
on back-to-back baffles.
If my temperature is T1, neighbour is T2:
T1 > T2: my side becomes fixedValue T2 bc, other side becomes fixedGradient.
Example usage:
myInterfacePatchName
{
type turbulentTemperatureCoupledBaffle;
neighbourFieldName T;
K K; // or none
value uniform 300;
}
Needs to be on underlying directMapped(Wall)FvPatch.
Note: if K is "none" looks up RASModel and basicThermo, otherwise expects
the solver to calculate a 'K' field.
Note: runs in parallel with arbitrary decomposition. Uses directMapped
functionality to calculate exchange.
Note: lags interface data so both sides use same data.
- problem: schedule to calculate average would interfere
with standard processor swaps.
- so: updateCoeffs sets both to same Twall. Only need to do
this for last outer iteration but don't have access to this.
SourceFiles
turbulentTemperatureCoupledBaffleFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef turbulentTemperatureCoupledBaffleFvPatchScalarField_H
#define turbulentTemperatureCoupledBaffleFvPatchScalarField_H
//#include "fvPatchFields.H"
#include "mixedFvPatchFields.H"
//#include "fvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class turbulentTemperatureCoupledBaffleFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class turbulentTemperatureCoupledBaffleFvPatchScalarField
:
public mixedFvPatchScalarField
{
// Private data
//- Name of field on the neighbour region
const word neighbourFieldName_;
//- Name of thermal conductivity field
const word KName_;
bool fixesValue_;
// Private Member Functions
//- Am I or neighbour owner of interface
bool interfaceOwner(const polyMesh&, const polyPatch&) const;
public:
//- Runtime type information
TypeName("compressible::turbulentTemperatureCoupledBaffle");
// Constructors
//- Construct from patch and internal field
turbulentTemperatureCoupledBaffleFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
turbulentTemperatureCoupledBaffleFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// turbulentTemperatureCoupledBaffleFvPatchScalarField onto a new patch
turbulentTemperatureCoupledBaffleFvPatchScalarField
(
const turbulentTemperatureCoupledBaffleFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureCoupledBaffleFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
turbulentTemperatureCoupledBaffleFvPatchScalarField
(
const turbulentTemperatureCoupledBaffleFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureCoupledBaffleFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
//- Get corresponding K field
tmp<scalarField> K() const;
//- Return true if this patch field fixes a value.
// Needed to check if a level has to be specified while solving
// Poissons equations.
virtual bool fixesValue() const
{
return fixesValue_;
}
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -204,7 +204,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar Cmu25 = pow(Cmu_, 0.25);
const scalar Cmu25 = pow025(Cmu_);
const scalarField& y = rasModel.y()[patchI];

View File

@ -188,7 +188,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs()
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar Cmu25 = pow(Cmu_, 0.25);
const scalar Cmu25 = pow025(Cmu_);
const scalar Cmu75 = pow(Cmu_, 0.75);
const scalarField& y = rasModel.y()[patchI];

View File

@ -75,7 +75,7 @@ tmp<scalarField> mutkRoughWallFunctionFvPatchScalarField::calcMut() const
const volScalarField& k = tk();
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
const scalar Cmu25 = pow(Cmu_, 0.25);
const scalar Cmu25 = pow025(Cmu_);
tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
scalarField& mutw = tmutw();

View File

@ -83,7 +83,7 @@ tmp<scalarField> mutkWallFunctionFvPatchScalarField::calcMut() const
const volScalarField& k = tk();
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
const scalar Cmu25 = pow(Cmu_, 0.25);
const scalar Cmu25 = pow025(Cmu_);
tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
scalarField& mutw = tmutw();
@ -215,7 +215,7 @@ tmp<scalarField> mutkWallFunctionFvPatchScalarField::yPlus() const
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
return pow(Cmu_, 0.25)*y*sqrt(kwc)/(muw/rhow);
return pow025(Cmu_)*y*sqrt(kwc)/(muw/rhow);
}

View File

@ -187,7 +187,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patch().index()];
const scalar Cmu25 = pow(Cmu_, 0.25);
const scalar Cmu25 = pow025(Cmu_);
volScalarField& G = const_cast<volScalarField&>
(db().lookupObject<volScalarField>(GName_));

View File

@ -346,7 +346,7 @@ 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 L = sqrt(k_)/(pow025(Cmu_)*(omega_ + omegaSmall_));
volScalarField CDkOmega =
(2.0*alphaOmega2_)*(gradK & gradOmega)/(omega_ + omegaSmall_);
volScalarField F1 = this->F1(CDkOmega);

View File

@ -70,7 +70,7 @@ void vanDriestDelta::calcDelta()
const fvPatchList& patches = mesh_.boundary();
forAll(patches, patchi)
{
if (isType<wallFvPatch>(patches[patchi]))
if (isA<wallFvPatch>(patches[patchi]))
{
const fvPatchVectorField& Uw = U.boundaryField()[patchi];
const scalarField& nuw = nu.boundaryField()[patchi];

View File

@ -331,7 +331,7 @@ void LRR::correct()
{
const fvPatch& curPatch = patches[patchi];
if (typeid(curPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -390,7 +390,7 @@ void LRR::correct()
{
const fvPatch& curPatch = patches[patchi];
if (typeid(curPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(curPatch))
{
symmTensorField& Rw = R_.boundaryField()[patchi];

View File

@ -373,7 +373,7 @@ void LaunderGibsonRSTM::correct()
{
const fvPatch& curPatch = patches[patchi];
if (typeid(curPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -441,7 +441,7 @@ void LaunderGibsonRSTM::correct()
{
const fvPatch& curPatch = patches[patchi];
if (typeid(curPatch) == typeid(wallFvPatch))
if (isA<wallFvPatch>(curPatch))
{
symmTensorField& Rw = R_.boundaryField()[patchi];

View File

@ -14,7 +14,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -29,7 +29,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -58,7 +58,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{

View File

@ -14,7 +14,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -29,7 +29,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
@ -58,7 +58,7 @@
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{

View File

@ -169,9 +169,9 @@ tmp<scalarField> RASModel::yPlus(const label patchNo, const scalar Cmu) const
tmp<scalarField> tYp(new scalarField(curPatch.size()));
scalarField& Yp = tYp();
if (isType<wallFvPatch>(curPatch))
if (isA<wallFvPatch>(curPatch))
{
Yp = pow(Cmu, 0.25)
Yp = pow025(Cmu)
*y_[patchNo]
*sqrt(k()().boundaryField()[patchNo].patchInternalField())
/nu().boundaryField()[patchNo];

View File

@ -26,7 +26,6 @@ License
#include "SpalartAllmaras.H"
#include "addToRunTimeSelectionTable.H"
#include "wallDist.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -72,7 +72,7 @@ tmp<volScalarField> autoCreateNut
forAll(bm, patchI)
{
if (isType<wallFvPatch>(bm[patchI]))
if (isA<wallFvPatch>(bm[patchI]))
{
nutBoundaryTypes[patchI] =
RASModels::nutkWallFunctionFvPatchScalarField::typeName;

Some files were not shown because too many files have changed in this diff Show More