Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2012-10-26 15:36:43 +01:00
72 changed files with 2705 additions and 387 deletions

View File

@ -245,6 +245,10 @@ snapControls
//- Use castellatedMeshControls::features (default = true)
explicitFeatureSnap true;
//- Detect features between multiple surfaces
// (only for explicitFeatureSnap, default = false)
multiRegionFeatureSnap false;
}
// Settings for the layer addition.

View File

@ -60,7 +60,6 @@ EXE_LIBS = \
-lsurfaceFilmModels \
-lsurfMesh \
-lsystemCall \
-lthermalPorousZone \
-lthermophysicalFunctions \
-ltopoChangerFvMesh \
-ltriSurface \

View File

@ -25,7 +25,8 @@ Application
surfaceFeatureExtract
Description
Extracts and writes surface features to file
Extracts and writes surface features to file. All but the basic feature
extraction is WIP.
\*---------------------------------------------------------------------------*/
@ -472,6 +473,176 @@ void unmarkBaffles
}
//- Divide into multiple normal bins
// - return REGION if != 2 normals
// - return REGION if 2 normals that make feature angle
// - otherwise return NONE and set normals,bins
surfaceFeatures::edgeStatus checkFlatRegionEdge
(
const triSurface& surf,
const scalar tol,
const scalar includedAngle,
const label edgeI
)
{
const edge& e = surf.edges()[edgeI];
const labelList& eFaces = surf.edgeFaces()[edgeI];
// Bin according to normal
DynamicList<Foam::vector> normals(2);
DynamicList<labelList> bins(2);
forAll(eFaces, eFaceI)
{
const Foam::vector& n = surf.faceNormals()[eFaces[eFaceI]];
// Find the normal in normals
label index = -1;
forAll(normals, normalI)
{
if (mag(n&normals[normalI]) > (1-tol))
{
index = normalI;
break;
}
}
if (index != -1)
{
bins[index].append(eFaceI);
}
else if (normals.size() >= 2)
{
// Would be third normal. Mark as feature.
//Pout<< "** at edge:" << surf.localPoints()[e[0]]
// << surf.localPoints()[e[1]]
// << " have normals:" << normals
// << " and " << n << endl;
return surfaceFeatures::REGION;
}
else
{
normals.append(n);
bins.append(labelList(1, eFaceI));
}
}
// Check resulting number of bins
if (bins.size() == 1)
{
// Note: should check here whether they are two sets of faces
// that are planar or indeed 4 faces al coming together at an edge.
//Pout<< "** at edge:"
// << surf.localPoints()[e[0]]
// << surf.localPoints()[e[1]]
// << " have single normal:" << normals[0]
// << endl;
return surfaceFeatures::NONE;
}
else
{
// Two bins. Check if normals make an angle
//Pout<< "** at edge:"
// << surf.localPoints()[e[0]]
// << surf.localPoints()[e[1]] << nl
// << " normals:" << normals << nl
// << " bins :" << bins << nl
// << endl;
if (includedAngle >= 0)
{
scalar minCos = Foam::cos(degToRad(180.0 - includedAngle));
forAll(eFaces, i)
{
const Foam::vector& ni = surf.faceNormals()[eFaces[i]];
for (label j=i+1; j<eFaces.size(); j++)
{
const Foam::vector& nj = surf.faceNormals()[eFaces[j]];
if (mag(ni & nj) < minCos)
{
//Pout<< "have sharp feature between normal:" << ni
// << " and " << nj << endl;
// Is feature. Keep as region or convert to
// feature angle? For now keep as region.
return surfaceFeatures::REGION;
}
}
}
}
// So now we have two normals bins but need to make sure both
// bins have the same regions in it.
// 1. store + or - region number depending
// on orientation of triangle in bins[0]
const labelList& bin0 = bins[0];
labelList regionAndNormal(bin0.size());
forAll(bin0, i)
{
const labelledTri& t = surf.localFaces()[eFaces[bin0[i]]];
int dir = t.edgeDirection(e);
if (dir > 0)
{
regionAndNormal[i] = t.region()+1;
}
else if (dir == 0)
{
FatalErrorIn("problem.")
<< exit(FatalError);
}
else
{
regionAndNormal[i] = -(t.region()+1);
}
}
// 2. check against bin1
const labelList& bin1 = bins[1];
labelList regionAndNormal1(bin1.size());
forAll(bin1, i)
{
const labelledTri& t = surf.localFaces()[eFaces[bin1[i]]];
int dir = t.edgeDirection(e);
label myRegionAndNormal;
if (dir > 0)
{
myRegionAndNormal = t.region()+1;
}
else
{
myRegionAndNormal = -(t.region()+1);
}
regionAndNormal1[i] = myRegionAndNormal;
label index = findIndex(regionAndNormal, -myRegionAndNormal);
if (index == -1)
{
// Not found.
//Pout<< "cannot find region " << myRegionAndNormal
// << " in regions " << regionAndNormal << endl;
return surfaceFeatures::REGION;
}
}
// Passed all checks, two normal bins with the same contents.
//Pout<< "regionAndNormal:" << regionAndNormal << endl;
//Pout<< "myRegionAndNormal:" << regionAndNormal1 << endl;
return surfaceFeatures::NONE;
}
}
void writeStats(const extendedFeatureEdgeMesh& fem, Ostream& os)
{
os << " points : " << fem.points().size() << nl
@ -610,6 +781,8 @@ int main(int argc, char *argv[])
surfaceFeatures set(surf);
scalar includedAngle = -1;
if (extractionMethod == "extractFromFile")
{
const fileName featureEdgeFile =
@ -630,14 +803,13 @@ int main(int argc, char *argv[])
}
else if (extractionMethod == "extractFromSurface")
{
const scalar includedAngle =
readScalar
includedAngle = readScalar
(
surfaceDict.subDict("extractFromSurfaceCoeffs").lookup
(
surfaceDict.subDict("extractFromSurfaceCoeffs").lookup
(
"includedAngle"
)
);
"includedAngle"
)
);
Info<< nl << "Constructing feature set from included angle "
<< includedAngle << endl;
@ -727,13 +899,27 @@ int main(int argc, char *argv[])
if (!nonManifoldEdges)
{
Info<< "Removing all non-manifold edges"
<< " (edges with > 2 connected faces)" << endl;
<< " (edges with > 2 connected faces) unless they"
<< " cross multiple regions" << endl;
forAll(edgeStat, edgeI)
{
if (surf.edgeFaces()[edgeI].size() > 2)
const labelList& eFaces = surf.edgeFaces()[edgeI];
if
(
eFaces.size() > 2
&& edgeStat[edgeI] == surfaceFeatures::REGION
&& (eFaces.size() % 2) == 0
)
{
edgeStat[edgeI] = surfaceFeatures::NONE;
edgeStat[edgeI] = checkFlatRegionEdge
(
surf,
1e-5, //tol,
includedAngle,
edgeI
);
}
}
}

View File

@ -69,7 +69,8 @@ surface2.nas
// Keep edges outside the box:
outsideBox (0 0 0)(1 1 1);
// Keep nonManifold edges (edges with >2 connected faces)
// Keep nonManifold edges (edges with >2 connected faces where
// the faces form more than two different normal planes)
nonManifoldEdges yes;
// Keep open edges (edges with 1 connected face)

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -44,7 +44,7 @@ runApplication()
echo "$APP_NAME already run on $PWD: remove log file to re-run"
else
echo "Running $APP_RUN on $PWD"
$APP_RUN $* > log.$APP_NAME 2>&1
$APP_RUN "$@" > log.$APP_NAME 2>&1
fi
}
@ -65,9 +65,9 @@ runParallel()
#if [ "$WM_SCHEDULER" ]
#then
# echo "$PWD: $WM_SCHEDULER -np $nProcs" 1>&2
# $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )"
# $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null > log.$APP_NAME 2>&1 )"
#else
( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )
( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null > log.$APP_NAME 2>&1 )
#fi
fi
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -80,12 +80,18 @@ void Foam::regExp::set(const char* pattern, const bool ignoreCase) const
cflags |= REG_ICASE;
}
if (regcomp(preg_, pattern, cflags) != 0)
int err = regcomp(preg_, pattern, cflags);
if (err != 0)
{
char errbuf[200];
regerror(err, preg_, errbuf, sizeof(errbuf));
FatalErrorIn
(
"regExp::set(const char*)"
) << "Failed to compile regular expression '" << pattern << "'"
<< nl << errbuf
<< exit(FatalError);
}
}

View File

@ -266,7 +266,7 @@ Foam::Istream& Foam::ISstream::read(token& t)
else
{
t = sPtr;
t.type() = token::STRING;
t.type() = token::VARIABLE;
}
return *this;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -77,6 +77,7 @@ public:
PUNCTUATION,
WORD,
VARIABLE,
STRING,
VERBATIMSTRING,
LABEL,
@ -331,6 +332,8 @@ public:
inline bool isWord() const;
inline const word& wordToken() const;
inline bool isVariable() const;
inline bool isString() const;
inline const string& stringToken() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,7 +39,7 @@ inline void token::clear()
{
delete wordTokenPtr_;
}
else if (type_ == STRING || type_ == VERBATIMSTRING)
else if (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING)
{
delete stringTokenPtr_;
}
@ -88,6 +88,7 @@ inline token::token(const token& t)
break;
case STRING:
case VARIABLE:
case VERBATIMSTRING:
stringTokenPtr_ = new string(*t.stringTokenPtr_);
break;
@ -235,14 +236,19 @@ inline const word& token::wordToken() const
}
}
inline bool token::isVariable() const
{
return (type_ == VARIABLE);
}
inline bool token::isString() const
{
return (type_ == STRING || type_ == VERBATIMSTRING);
return (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING);
}
inline const string& token::stringToken() const
{
if (type_ == STRING || type_ == VERBATIMSTRING)
if (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING)
{
return *stringTokenPtr_;
}
@ -411,6 +417,7 @@ inline void token::operator=(const token& t)
break;
case STRING:
case VARIABLE:
case VERBATIMSTRING:
stringTokenPtr_ = new string(*t.stringTokenPtr_);
break;
@ -518,6 +525,7 @@ inline bool token::operator==(const token& t) const
return *wordTokenPtr_ == *t.wordTokenPtr_;
case STRING:
case VARIABLE:
case VERBATIMSTRING:
return *stringTokenPtr_ == *t.stringTokenPtr_;
@ -552,7 +560,11 @@ inline bool token::operator==(const word& w) const
inline bool token::operator==(const string& s) const
{
return ((type_ == STRING || type_ == VERBATIMSTRING) && stringToken() == s);
return
(
(type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING)
&& stringToken() == s
);
}
inline bool token::operator==(const label l) const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,6 +74,11 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const token& t)
os << *t.stringTokenPtr_;
break;
case token::VARIABLE:
// Write variable as word so without ""
os.writeQuoted(*t.stringTokenPtr_, false);
break;
case token::LABEL:
os << t.labelToken_;
break;
@ -157,6 +162,10 @@ ostream& Foam::operator<<(ostream& os, const InfoProxy<token>& ip)
os << " the string " << t.stringToken();
break;
case token::VARIABLE:
os << " the variable " << t.stringToken();
break;
case token::VERBATIMSTRING:
os << " the verbatim string " << t.stringToken();
break;
@ -231,6 +240,10 @@ Ostream& operator<<(Ostream& os, const InfoProxy<token>& ip)
os << " the string " << t.stringToken();
break;
case token::VARIABLE:
os << " the variable " << t.stringToken();
break;
case token::VERBATIMSTRING:
os << " the verbatim string " << t.stringToken();
break;

View File

@ -55,7 +55,7 @@ void Foam::primitiveEntry::append
newElmt(tokenIndex()++) = currToken;
}
}
else if (currToken.isString())
else if (currToken.isVariable())
{
const string& w = currToken.stringToken();

View File

@ -125,7 +125,7 @@ public:
//- Construct from dictionary - note table is not populated
TableBase(const word& name, const dictionary& dict);
//- Copy constructor
//- Copy constructor. Note: steals interpolator, tableSamples
TableBase(const TableBase<Type>& tbl);

View File

@ -3,7 +3,7 @@ basicSource/basicSourceIO.C
basicSource/basicSourceList.C
basicSource/IObasicSourceList.C
general/explicitSource/explicitSource.C
general/semiImplicitSource/semiImplicitSource.C
general/explicitSetValue/explicitSetValue.C
general/codedSource/codedSource.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,15 +23,16 @@ License
\*---------------------------------------------------------------------------*/
#include "ExplicitSource.H"
#include "SemiImplicitSource.H"
#include "fvMesh.H"
#include "fvMatrices.H"
#include "DimensionedField.H"
#include "fvmSup.H"
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
template<class Type>
const Foam::wordList Foam::ExplicitSource<Type>::
const Foam::wordList Foam::SemiImplicitSource<Type>::
volumeModeTypeNames_
(
IStringStream("(absolute specific)")()
@ -41,8 +42,8 @@ volumeModeTypeNames_
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
typename Foam::ExplicitSource<Type>::volumeModeType
Foam::ExplicitSource<Type>::wordToVolumeModeType
typename Foam::SemiImplicitSource<Type>::volumeModeType
Foam::SemiImplicitSource<Type>::wordToVolumeModeType
(
const word& vmtName
) const
@ -57,8 +58,8 @@ Foam::ExplicitSource<Type>::wordToVolumeModeType
FatalErrorIn
(
"ExplicitSource<Type>::volumeModeType"
"ExplicitSource<Type>::wordToVolumeModeType(const word&)"
"SemiImplicitSource<Type>::volumeModeType"
"SemiImplicitSource<Type>::wordToVolumeModeType(const word&)"
) << "Unknown volumeMode type " << vmtName
<< ". Valid volumeMode types are:" << nl << volumeModeTypeNames_
<< exit(FatalError);
@ -68,7 +69,7 @@ Foam::ExplicitSource<Type>::wordToVolumeModeType
template<class Type>
Foam::word Foam::ExplicitSource<Type>::volumeModeTypeToWord
Foam::word Foam::SemiImplicitSource<Type>::volumeModeTypeToWord
(
const volumeModeType& vmtType
) const
@ -85,7 +86,7 @@ Foam::word Foam::ExplicitSource<Type>::volumeModeTypeToWord
template<class Type>
void Foam::ExplicitSource<Type>::setFieldData(const dictionary& dict)
void Foam::SemiImplicitSource<Type>::setFieldData(const dictionary& dict)
{
fieldNames_.setSize(dict.toc().size());
injectionRate_.setSize(fieldNames_.size());
@ -111,7 +112,7 @@ void Foam::ExplicitSource<Type>::setFieldData(const dictionary& dict)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::ExplicitSource<Type>::ExplicitSource
Foam::SemiImplicitSource<Type>::SemiImplicitSource
(
const word& name,
const word& modelType,
@ -131,7 +132,7 @@ Foam::ExplicitSource<Type>::ExplicitSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::ExplicitSource<Type>::addSup
void Foam::SemiImplicitSource<Type>::addSup
(
fvMatrix<Type>& eqn,
const label fieldI
@ -139,15 +140,17 @@ void Foam::ExplicitSource<Type>::addSup
{
if (debug)
{
Info<< "ExplicitSource<"<< pTraits<Type>::typeName
Info<< "SemiImplicitSource<" << pTraits<Type>::typeName
<< ">::addSup for source " << name_ << endl;
}
const GeometricField<Type, fvPatchField, volMesh>& psi = eqn.psi();
DimensionedField<Type, volMesh> Su
(
IOobject
(
name_ + fieldNames_[fieldI] + "Sup",
name_ + fieldNames_[fieldI] + "Su",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
@ -163,9 +166,31 @@ void Foam::ExplicitSource<Type>::addSup
false
);
UIndirectList<Type>(Su, cells_) = injectionRate_[fieldI]/VDash_;
UIndirectList<Type>(Su, cells_) = injectionRate_[fieldI].first()/VDash_;
eqn += Su;
DimensionedField<scalar, volMesh> Sp
(
IOobject
(
name_ + fieldNames_[fieldI] + "Sp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensioned<scalar>
(
"zero",
Su.dimensions()/psi.dimensions(),
0.0
),
false
);
UIndirectList<scalar>(Sp, cells_) = injectionRate_[fieldI].second()/VDash_;
eqn += Su + fvm::Sp(Sp, psi);
}

View File

@ -22,21 +22,33 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::ExplicitSource
Foam::SemiImplicitSource
Description
Explicit source
Semi-implicit source, described using an input dictionary. The injection
rate coefficients are specified as pairs of Su-Sp coefficients, i.e.
Sources described by:
\f[
S(x) = S_u + S_p x
\f]
where
\vartable
S(x) | net source for field 'x'
S_u | explicit source contribution
S_p | linearised implicit contribution
\endvartable
Example of the source specification:
\verbatim
<Type>ExplicitSourceCoeffs
<Type>SemiImplicitSourceCoeffs
{
volumeMode absolute; // specific
injectionRate
injectionRateSuSp
{
k 30.7;
epsilon 1.5;
k (30.7 0);
epsilon (1.5 0);
}
}
\verbatim
@ -49,12 +61,12 @@ SeeAlso
Foam::basicSource
SourceFiles
ExplicitSource.C
SemiImplicitSource.C
\*---------------------------------------------------------------------------*/
#ifndef ExplicitSource_H
#define ExplicitSource_H
#ifndef SemiImplicitSource_H
#define SemiImplicitSource_H
#include "Tuple2.H"
#include "basicSource.H"
@ -69,7 +81,7 @@ namespace Foam
class fvMesh;
template<class Type>
class ExplicitSource;
class SemiImplicitSource;
// Forward declaration of friend functions
@ -77,15 +89,15 @@ template<class Type>
Ostream& operator<<
(
Ostream&,
const ExplicitSource<Type>&
const SemiImplicitSource<Type>&
);
/*---------------------------------------------------------------------------*\
Class ExplicitSource Declaration
Class SemiImplicitSource Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class ExplicitSource
class SemiImplicitSource
:
public basicSource
{
@ -115,7 +127,7 @@ protected:
scalar VDash_;
//- Source field values
List<Type> injectionRate_;
List<Tuple2<Type, scalar> > injectionRate_;
// Protected functions
@ -133,13 +145,13 @@ protected:
public:
//- Runtime type information
TypeName("ExplicitSource");
TypeName("SemiImplicitSource");
// Constructors
//- Construct from components
ExplicitSource
SemiImplicitSource
(
const word& name,
const word& modelType,
@ -156,7 +168,7 @@ public:
inline const volumeModeType& volumeMode() const;
//- Return const access to the source field values
inline const List<Type>& injectionRate() const;
inline const List<Tuple2<Type, scalar> >& injectionRate() const;
// Edit
@ -165,7 +177,7 @@ public:
inline volumeModeType& volumeMode();
//- Return access to the source field values
inline List<Type>& injectionRate();
inline List<Tuple2<Type, scalar> >& injectionRate();
// Evaluation
@ -191,13 +203,13 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "ExplicitSource.C"
# include "ExplicitSourceIO.C"
# include "SemiImplicitSource.C"
# include "SemiImplicitSourceIO.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "ExplicitSourceI.H"
#include "SemiImplicitSourceI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,35 +23,37 @@ License
\*---------------------------------------------------------------------------*/
#include "ExplicitSource.H"
#include "SemiImplicitSource.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
inline const typename Foam::ExplicitSource<Type>::volumeModeType&
Foam::ExplicitSource<Type>::volumeMode() const
inline const typename Foam::SemiImplicitSource<Type>::volumeModeType&
Foam::SemiImplicitSource<Type>::volumeMode() const
{
return volumeMode_;
}
template<class Type>
inline const Foam::List<Type>& Foam::ExplicitSource<Type>::injectionRate() const
inline const Foam::List<Foam::Tuple2<Type, Foam::scalar> >&
Foam::SemiImplicitSource<Type>::injectionRate() const
{
return injectionRate_;
}
template<class Type>
inline typename Foam::ExplicitSource<Type>::volumeModeType&
Foam::ExplicitSource<Type>::volumeMode()
inline typename Foam::SemiImplicitSource<Type>::volumeModeType&
Foam::SemiImplicitSource<Type>::volumeMode()
{
return volumeMode_;
}
template<class Type>
inline Foam::List<Type>& Foam::ExplicitSource<Type>::injectionRate()
inline Foam::List<Foam::Tuple2<Type,
Foam::scalar> >& Foam::SemiImplicitSource<Type>::injectionRate()
{
return injectionRate_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,12 +23,12 @@ License
\*---------------------------------------------------------------------------*/
#include "ExplicitSource.H"
#include "SemiImplicitSource.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::ExplicitSource<Type>::writeData(Ostream& os) const
void Foam::SemiImplicitSource<Type>::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
@ -36,12 +36,12 @@ void Foam::ExplicitSource<Type>::writeData(Ostream& os) const
template<class Type>
bool Foam::ExplicitSource<Type>::read(const dictionary& dict)
bool Foam::SemiImplicitSource<Type>::read(const dictionary& dict)
{
if (basicSource::read(dict))
{
volumeMode_ = wordToVolumeModeType(coeffs_.lookup("volumeMode"));
setFieldData(coeffs_.subDict("injectionRate"));
setFieldData(coeffs_.subDict("injectionRateSuSp"));
return true;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,17 +24,17 @@ License
\*---------------------------------------------------------------------------*/
#include "makeBasicSource.H"
#include "ExplicitSource.H"
#include "SemiImplicitSource.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeBasicSource(ExplicitSource, scalar);
makeBasicSource(ExplicitSource, vector);
makeBasicSource(ExplicitSource, sphericalTensor);
makeBasicSource(ExplicitSource, symmTensor);
makeBasicSource(ExplicitSource, tensor);
makeBasicSource(SemiImplicitSource, scalar);
makeBasicSource(SemiImplicitSource, vector);
makeBasicSource(SemiImplicitSource, sphericalTensor);
makeBasicSource(SemiImplicitSource, symmTensor);
makeBasicSource(SemiImplicitSource, tensor);
}

View File

@ -102,6 +102,7 @@ $(constraintFvPatchFields)/cyclicAMI/cyclicAMIFvPatchFields.C
$(constraintFvPatchFields)/cyclicSlip/cyclicSlipFvPatchFields.C
$(constraintFvPatchFields)/empty/emptyFvPatchFields.C
$(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C
$(constraintFvPatchFields)/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C
$(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.C
$(constraintFvPatchFields)/processor/processorFvPatchFields.C
$(constraintFvPatchFields)/processor/processorFvPatchScalarField.C
@ -114,66 +115,69 @@ derivedFvPatchFields = $(fvPatchFields)/derived
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
$(derivedFvPatchFields)/codedMixed/codedMixedFvPatchFields.C
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C
$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C
$(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C
$(derivedFvPatchFields)/codedMixed/codedMixedFvPatchFields.C
$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/fan/fanFvPatchFields.C
$(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/fixedJump/fixedJumpFvPatchFields.C
$(derivedFvPatchFields)/fixedJumpAMI/fixedJumpAMIFvPatchFields.C
$(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
$(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C
$(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/freestream/freestreamFvPatchFields.C
$(derivedFvPatchFields)/freestreamPressure/freestreamPressureFvPatchScalarField.C
$(derivedFvPatchFields)/inletOutlet/inletOutletFvPatchFields.C
$(derivedFvPatchFields)/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C
$(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C
$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C
$(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C
$(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C
$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C
$(derivedFvPatchFields)/partialSlip/partialSlipFvPatchFields.C
$(derivedFvPatchFields)/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C
$(derivedFvPatchFields)/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/slip/slipFvPatchFields.C
$(derivedFvPatchFields)/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C
$(derivedFvPatchFields)/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C
$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/syringePressure/syringePressureFvPatchScalarField.C
$(derivedFvPatchFields)/timeVaryingMappedFixedValue/AverageIOFields.C
$(derivedFvPatchFields)/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/totalPressure/totalPressureFvPatchScalarField.C
$(derivedFvPatchFields)/totalTemperature/totalTemperatureFvPatchScalarField.C
$(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C
$(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
$(derivedFvPatchFields)/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C
$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C
$(derivedFvPatchFields)/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
$(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C
$(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C
$(derivedFvPatchFields)/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C
$(derivedFvPatchFields)/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C
$(derivedFvPatchFields)/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/temperatureJump/temperatureJumpFvPatchScalarField.C
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C
fvsPatchFields = fields/fvsPatchFields
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C

View File

@ -77,7 +77,6 @@ jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
const jumpCyclicFvPatchField<Type>& ptf
)
:
cyclicLduInterfaceField(),
cyclicFvPatchField<Type>(ptf)
{}
@ -105,12 +104,11 @@ tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
Field<Type>& pnf = tpnf();
tmp<Field<scalar> > tjf = jump();
Field<Type> jf(this->jump());
if (!this->cyclicPatch().owner())
{
tjf = -tjf;
jf *= -1.0;
}
const Field<scalar>& jf = tjf();
if (this->doTransform())
{
@ -149,14 +147,15 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
const labelUList& nbrFaceCells =
this->cyclicPatch().neighbFvPatch().faceCells();
if (&psiInternal == &this->internalField())
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<scalar> > tjf = jump()().component(cmpt);
Field<scalar> jf(this->jump()().component(cmpt));
if (!this->cyclicPatch().owner())
{
tjf = -tjf;
jf *= -1.0;
}
const Field<scalar>& jf = tjf();
forAll(*this, facei)
{
@ -197,14 +196,15 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
const labelUList& nbrFaceCells =
this->cyclicPatch().neighbFvPatch().faceCells();
if (&psiInternal == &this->internalField())
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<Type> > tjf = jump();
Field<Type> jf(this->jump());
if (!this->cyclicPatch().owner())
{
tjf = -tjf;
jf *= -1.0;
}
const Field<Type>& jf = tjf();
forAll(*this, facei)
{

View File

@ -0,0 +1,201 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "jumpCyclicAMIFvPatchField.H"
#include "transformField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
cyclicAMIFvPatchField<Type>(p, iF)
{}
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
cyclicAMIFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
cyclicAMIFvPatchField<Type>(p, iF, dict)
{
// Call this evaluation in derived classes
//this->evaluate(Pstream::blocking);
}
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>& ptf
)
:
cyclicAMIFvPatchField<Type>(ptf)
{}
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
cyclicAMIFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::jumpCyclicAMIFvPatchField<Type>::patchNeighbourField() const
{
const Field<Type>& iField = this->internalField();
const labelUList& nbrFaceCells =
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
Field<Type> pnf(iField, nbrFaceCells);
tmp<Field<Type> > tpnf
(
new Field<Type>(this->cyclicAMIPatch().interpolate(pnf))
);
if (this->doTransform())
{
tpnf = transform(this->forwardT(), tpnf);
}
tmp<Field<Type> > tjf = jump();
if (!this->cyclicAMIPatch().owner())
{
tjf = -tjf;
}
return tpnf - tjf;
}
template<class Type>
void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
(
scalarField& result,
const scalarField& psiInternal,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes
) const
{
const labelUList& nbrFaceCells =
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
scalarField pnf(psiInternal, nbrFaceCells);
pnf = this->cyclicAMIPatch().interpolate(pnf);
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<scalar> > tjf = jump()().component(cmpt);
if (!this->cyclicAMIPatch().owner())
{
tjf = -tjf;
}
pnf -= tjf;
}
// Transform according to the transformation tensors
this->transformCoupleField(pnf, cmpt);
// Multiply the field by coefficients and add into the result
const labelUList& faceCells = this->cyclicAMIPatch().faceCells();
forAll(faceCells, elemI)
{
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
}
}
template<class Type>
void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
(
Field<Type>& result,
const Field<Type>& psiInternal,
const scalarField& coeffs,
const Pstream::commsTypes
) const
{
const labelUList& nbrFaceCells =
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
Field<Type> pnf(psiInternal, nbrFaceCells);
pnf = this->cyclicAMIPatch().interpolate(pnf);
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<Type> > tjf = jump();
if (!this->cyclicAMIPatch().owner())
{
tjf = -tjf;
}
pnf -= tjf;
}
// Transform according to the transformation tensors
this->transformCoupleField(pnf);
// Multiply the field by coefficients and add into the result
const labelUList& faceCells = this->cyclicAMIPatch().faceCells();
forAll(faceCells, elemI)
{
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,165 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::jumpCyclicAMIFvPatchField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a base class that enforces a cyclic
condition with a specified 'jump' (or offset) between a pair of boundaries,
whereby communication between the patches is performed using an arbitrary
mesh interface (AMI) interpolation.
SeeAlso
Foam::cyclicAMIFvPatchField
SourceFiles
jumpCyclicAMIFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef jumpCyclicAMIFvPatchField_H
#define jumpCyclicAMIFvPatchField_H
#include "cyclicAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class jumpCyclicAMIFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class jumpCyclicAMIFvPatchField
:
public cyclicAMIFvPatchField<Type>
{
public:
//- Runtime type information
TypeName("jumpCyclicAMI");
// Constructors
//- Construct from patch and internal field
jumpCyclicAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
jumpCyclicAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given jumpCyclicAMIFvPatchField onto a
// new patch
jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>&
);
//- Construct as copy setting internal field reference
jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
// Member functions
// Access
//- Return the interface type
virtual const word& interfaceFieldType() const
{
return cyclicAMIFvPatchField<Type>::type();
}
//- Return the "jump" across the patch as a "half" field
virtual tmp<Field<Type> > jump() const = 0;
// Evaluation functions
//- Return neighbour coupled given internal cell data
tmp<Field<Type> > patchNeighbourField() const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
scalarField& result,
const scalarField& psiInternal,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
Field<Type>&,
const Field<Type>&,
const scalarField&,
const Pstream::commsTypes commsType
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "jumpCyclicAMIFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "jumpCyclicAMIFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFieldsTypeName(jumpCyclicAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef jumpCyclicAMIFvPatchFields_H
#define jumpCyclicAMIFvPatchFields_H
#include "jumpCyclicAMIFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(jumpCyclicAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef jumpCyclicAMIFvPatchFieldsFwd_H
#define jumpCyclicAMIFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class jumpCyclicAMIFvPatchField;
makePatchTypeFieldTypedefs(jumpCyclicAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -34,8 +34,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpFvPatchField<Type>(p, iF),
jumpTable_(0)
uniformJumpFvPatchField<Type>(p, iF)
{}
@ -48,8 +47,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const fvPatchFieldMapper& mapper
)
:
fixedJumpFvPatchField<Type>(ptf, p, iF, mapper),
jumpTable_(ptf.jumpTable_().clone().ptr())
uniformJumpFvPatchField<Type>(ptf, p, iF, mapper)
{}
@ -61,8 +59,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const dictionary& dict
)
:
fixedJumpFvPatchField<Type>(p, iF),
jumpTable_(DataEntry<Type>::New("jumpTable", dict))
uniformJumpFvPatchField<Type>(p, iF, dict)
{}
@ -72,9 +69,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const fanFvPatchField<Type>& ptf
)
:
cyclicLduInterfaceField(),
fixedJumpFvPatchField<Type>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
uniformJumpFvPatchField<Type>(ptf)
{}
@ -85,25 +80,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpFvPatchField<Type>(ptf, iF),
jumpTable_(ptf.jumpTable_().clone().ptr())
uniformJumpFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::fanFvPatchField<Type>::write(Ostream& os) const
{
fixedJumpFvPatchField<Type>::write(os);
if (this->cyclicPatch().owner())
{
jumpTable_->writeData(os);
}
this->writeEntry("value", os);
}
// ************************************************************************* //

View File

@ -83,7 +83,7 @@ SourceFiles
#ifndef fanFvPatchField_H
#define fanFvPatchField_H
#include "fixedJumpFvPatchField.H"
#include "uniformJumpFvPatchField.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -98,13 +98,8 @@ namespace Foam
template<class Type>
class fanFvPatchField
:
public fixedJumpFvPatchField<Type>
public uniformJumpFvPatchField<Type>
{
// Private data
//- Interpolation table
autoPtr<DataEntry<Type> > jumpTable_;
public:
@ -179,10 +174,6 @@ public:
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};

View File

@ -53,8 +53,7 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
const dictionary& dict
)
:
fixedJumpFvPatchField<scalar>(p, iF),
jumpTable_(new DataEntry<scalar>("jumpTable"))
uniformJumpFvPatchField<scalar>(p, iF)
{
if (this->cyclicPatch().owner())
{
@ -83,7 +82,7 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
}
}
jumpTable_.reset
this->jumpTable_.reset
(
new polynomial("jumpTable", coeffs)
);
@ -91,10 +90,14 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
else
{
// Generic input constructed from dictionary
jumpTable_ = DataEntry<scalar>::New("jumpTable", dict);
this->jumpTable_ = DataEntry<scalar>::New("jumpTable", dict);
}
}
else
{
// Dummy jump table
this->jumpTable_.reset(new DataEntry<scalar>("jumpTable"));
}
if (dict.found("value"))
{
@ -136,10 +139,10 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
Un /= patch().lookupPatchField<volScalarField, scalar>("rho");
}
jump_ = jumpTable_->value(Un);
this->jump_ = this->jumpTable_->value(Un);
}
fixedJumpFvPatchField<scalar>::updateCoeffs();
uniformJumpFvPatchField<scalar>::updateCoeffs();
}

View File

@ -72,7 +72,6 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
const fixedJumpFvPatchField<Type>& ptf
)
:
cyclicLduInterfaceField(),
jumpCyclicFvPatchField<Type>(ptf),
jump_(ptf.jump_)
{}
@ -92,6 +91,23 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::fixedJumpFvPatchField<Type>::jump() const
{
if (this->cyclicPatch().owner())
{
return jump_;
}
else
{
return refCast<const fixedJumpFvPatchField<Type> >
(
this->neighbourPatchField()
).jump();
}
}
template<class Type>
void Foam::fixedJumpFvPatchField<Type>::autoMap
(
@ -124,6 +140,7 @@ void Foam::fixedJumpFvPatchField<Type>::write(Ostream& os) const
fvPatchField<Type>::write(os);
os.writeKeyword("patchType") << "cyclic" << token::END_STATEMENT << nl;
jump_.writeEntry("jump", os);
this->writeEntry("value", os);
}

View File

@ -28,14 +28,37 @@ Group
grpCoupledBoundaryConditions
Description
Base class for "jump" of a field<type>
This boundary condition provides a jump condition, using the \c cyclic
condition as a base.
The jump is specified as a fixed value field, applied as an offset to the
'owner' patch.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclic| yes |
jump | current jump value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedJump;
patchType cyclic;
jump uniform 10;
}
\endverbatim
The above example shows the use of a fixed jump of '10'.
Note
not used directly
The underlying \c patchType should be set to \c cyclic
SeeAlso
Foam::fanFvPatchScalarField
Foam::fanPressureFvPatchScalarField
Foam::jumpCyclicFvPatchField
SourceFiles
fixedJumpFvPatchField.C
@ -72,6 +95,9 @@ protected:
public:
//- Runtime type information
TypeName("fixedJump");
// Constructors
//- Construct from patch and internal field
@ -138,21 +164,8 @@ public:
// Access
//- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const
{
if (this->cyclicPatch().owner())
{
return jump_;
}
else
{
return refCast<const fixedJumpFvPatchField<Type> >
(
this->neighbourPatchField()
).jump();
}
}
//- Return the "jump" across the patch
virtual tmp<Field<Type> > jump() const;
// Mapping functions

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedJumpFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpFvPatchFields_H
#define fixedJumpFvPatchFields_H
#include "fixedJumpFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpFvPatchFieldsFwd_H
#define fixedJumpFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedJumpFvPatchField;
makePatchTypeFieldTypedefs(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedJumpAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
jumpCyclicAMIFvPatchField<Type>(p, iF),
jump_(this->size(), pTraits<Type>::zero)
{}
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
jumpCyclicAMIFvPatchField<Type>(ptf, p, iF, mapper),
jump_(ptf.jump_, mapper)
{}
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
jumpCyclicAMIFvPatchField<Type>(p, iF),
jump_("jump", dict, p.size())
{}
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>& ptf
)
:
jumpCyclicAMIFvPatchField<Type>(ptf),
jump_(ptf.jump_)
{}
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
jumpCyclicAMIFvPatchField<Type>(ptf, iF),
jump_(ptf.jump_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::fixedJumpAMIFvPatchField<Type>::jump() const
{
if (this->cyclicAMIPatch().owner())
{
return jump_;
}
else
{
const fixedJumpAMIFvPatchField& nbrPatch =
refCast<const fixedJumpAMIFvPatchField<Type> >
(
this->neighbourPatchField()
);
return this->cyclicAMIPatch().interpolate(nbrPatch.jump());
}
}
template<class Type>
void Foam::fixedJumpAMIFvPatchField<Type>::autoMap
(
const fvPatchFieldMapper& m
)
{
jumpCyclicAMIFvPatchField<Type>::autoMap(m);
jump_.autoMap(m);
}
template<class Type>
void Foam::fixedJumpAMIFvPatchField<Type>::rmap
(
const fvPatchField<Type>& ptf,
const labelList& addr
)
{
jumpCyclicAMIFvPatchField<Type>::rmap(ptf, addr);
const fixedJumpAMIFvPatchField<Type>& tiptf =
refCast<const fixedJumpAMIFvPatchField<Type> >(ptf);
jump_.rmap(tiptf.jump_, addr);
}
template<class Type>
void Foam::fixedJumpAMIFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
os.writeKeyword("patchType") << "cyclicAMI" << token::END_STATEMENT << nl;
jump_.writeEntry("jump", os);
this->writeEntry("value", os);
}
// ************************************************************************* //

View File

@ -0,0 +1,200 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::fixedJumpAMIFvPatchField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a jump condition, across non-conformal
cyclic path-pairs, employing an arbitraryMeshInterface (AMI).
The jump is specified as a fixed value field, applied as an offset to the
'owner' patch.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclic| yes |
jump | current jump value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedJumpAMI;
patchType cyclic;
jump uniform 10;
}
\endverbatim
The above example shows the use of a fixed jump of '10'.
Note
The underlying \c patchType should be set to \c cyclicAMI
SeeAlso
Foam::jumpCyclicAMIFvPatchField
SourceFiles
fixedJumpAMIFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpAMIFvPatchField_H
#define fixedJumpAMIFvPatchField_H
#include "jumpCyclicAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedJumpAMIFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class fixedJumpAMIFvPatchField
:
public jumpCyclicAMIFvPatchField<Type>
{
protected:
// Protected data
//- "jump" field
Field<Type> jump_;
public:
//- Runtime type information
TypeName("fixedJumpAMI");
// Constructors
//- Construct from patch and internal field
fixedJumpAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
fixedJumpAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given fixedJumpAMIFvPatchField onto a
// new patch
fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new fixedJumpAMIFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new fixedJumpAMIFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
//- Return the "jump" across the patch
virtual tmp<Field<Type> > jump() const;
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap(const fvPatchField<Type>&, const labelList&);
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "fixedJumpAMIFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedJumpAMIFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(fixedJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpAMIFvPatchFields_H
#define fixedJumpAMIFvPatchFields_H
#include "fixedJumpAMIFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(fixedJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpAMIFvPatchFieldsFwd_H
#define fixedJumpAMIFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedJumpAMIFvPatchField;
makePatchTypeFieldTypedefs(fixedJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,140 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformJumpFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpFvPatchField<Type>(p, iF),
jumpTable_(0)
{}
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedJumpFvPatchField<Type>(ptf, p, iF, mapper),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
fixedJumpFvPatchField<Type>(p, iF),
jumpTable_(new DataEntry<Type>("jumpTable"))
{
if (this->cyclicPatch().owner())
{
jumpTable_ = DataEntry<Type>::New("jumpTable", dict);
}
if (dict.found("value"))
{
fvPatchField<Type>::operator=
(
Field<Type>("value", dict, p.size())
);
}
}
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>& ptf
)
:
fixedJumpFvPatchField<Type>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpFvPatchField<Type>(ptf, iF),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::uniformJumpFvPatchField<Type>::jump() const
{
if (this->cyclicPatch().owner())
{
const Type value = jumpTable_->value(this->db().time().value());
return tmp<Field<Type> >(new Field<Type>(this->patch().size(), value));
}
else
{
const uniformJumpFvPatchField& nbrPatch =
refCast<const uniformJumpFvPatchField<Type> >
(
this->neighbourPatchField()
);
return nbrPatch.jump();
}
}
template<class Type>
void Foam::uniformJumpFvPatchField<Type>::write(Ostream& os) const
{
fixedJumpFvPatchField<Type>::write(os);
if (this->cyclicPatch().owner())
{
jumpTable_->writeData(os);
}
}
// ************************************************************************* //

View File

@ -22,53 +22,53 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::temperatureJumpFvPatchScalarField
Foam::uniformJumpFvPatchField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a temperature jump condition across a
coupled pair of cyclic patches.
The jump is specified as a \c DataEntry type, to enable the use of, e.g.
contant, polynomial, table values.
This boundary condition provides a jump condition, using the \c cyclic
condition as a base. The jump is specified as a time-varying uniform
value across the patch.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclic| yes |
jump | current jump value | yes |
jumpTable | jump data, e.g. \c csvFile | yes |
jumpTable | jump value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type temperatureJump;
type uniformJump;
patchType cyclic;
jumpTable constant 100;
value uniform 300;
jumpTable constant 10;
}
\endverbatim
The above example shows the use of a constant jump condition.
The above example shows the use of a fixed jump of '10'.
Note
The underlying \c patchType should be set to \c cyclic
The uniformValue entry is a DataEntry type, able to describe time
varying functions. The example above gives the usage for supplying a
constant value.
The underlying \c patchType should be set to \c cyclic
SeeAlso
Foam::fixedJumpFvPatchField
SourceFiles
temperatureJumpFvPatchScalarField.C
uniformJumpFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef temperatureJumpFvPatchScalarField_H
#define temperatureJumpFvPatchScalarField_H
#ifndef uniformJumpFvPatchField_H
#define uniformJumpFvPatchField_H
#include "fixedJumpFvPatchField.H"
#include "DataEntry.H"
@ -79,109 +79,115 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class temperatureJumpFvPatchScalarField Declaration
Class uniformJumpFvPatchField Declaration
\*---------------------------------------------------------------------------*/
class temperatureJumpFvPatchScalarField
template<class Type>
class uniformJumpFvPatchField
:
public fixedJumpFvPatchField<scalar>
public fixedJumpFvPatchField<Type>
{
// Private data
protected:
//- Interpolation table
autoPtr<DataEntry<scalar> > jumpTable_;
// Protected data
//- "jump" table
autoPtr<DataEntry<Type> > jumpTable_;
public:
//- Runtime type information
TypeName("temperatureJump");
TypeName("uniformJump");
// Constructors
//- Construct from patch and internal field
temperatureJumpFvPatchScalarField
uniformJumpFvPatchField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
temperatureJumpFvPatchScalarField
uniformJumpFvPatchField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given temperatureJumpFvPatchScalarField onto a
//- Construct by mapping given uniformJumpFvPatchField onto a
// new patch
temperatureJumpFvPatchScalarField
uniformJumpFvPatchField
(
const temperatureJumpFvPatchScalarField&,
const uniformJumpFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
temperatureJumpFvPatchScalarField
uniformJumpFvPatchField
(
const temperatureJumpFvPatchScalarField&
const uniformJumpFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<scalar> > clone() const
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<scalar> >
return tmp<fvPatchField<Type> >
(
new temperatureJumpFvPatchScalarField(*this)
new uniformJumpFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
temperatureJumpFvPatchScalarField
uniformJumpFvPatchField
(
const temperatureJumpFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
const uniformJumpFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<scalar> > clone
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<scalar, volMesh>& iF
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<scalar> >
return tmp<fvPatchField<Type> >
(
new temperatureJumpFvPatchScalarField(*this, iF)
new uniformJumpFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
// Access functions
//- Return jumpTable
const DataEntry<scalar>& jumpTable() const
{
return jumpTable_();
}
//- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const;
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "uniformJumpFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformJumpFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(uniformJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpFvPatchFields_H
#define uniformJumpFvPatchFields_H
#include "uniformJumpFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(uniformJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpFvPatchFieldsFwd_H
#define uniformJumpFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class uniformJumpFvPatchField;
makePatchTypeFieldTypedefs(uniformJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,138 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformJumpAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpAMIFvPatchField<Type>(p, iF),
jumpTable_(0)
{}
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedJumpAMIFvPatchField<Type>(ptf, p, iF, mapper),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
fixedJumpAMIFvPatchField<Type>(p, iF),
jumpTable_(new DataEntry<Type>("jumpTable"))
{
if (this->cyclicAMIPatch().owner())
{
jumpTable_ = DataEntry<Type>::New("jumpTable", dict);
}
if (dict.found("value"))
{
fvPatchField<Type>::operator=(Field<Type>("value", dict, p.size()));
}
}
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>& ptf
)
:
fixedJumpAMIFvPatchField<Type>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpAMIFvPatchField<Type>(ptf, iF),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::uniformJumpAMIFvPatchField<Type>::jump() const
{
if (this->cyclicAMIPatch().owner())
{
Type j = jumpTable_->value(this->db().time().value());
return tmp<Field<Type> >(new Field<Type>(this->size(), j));
}
else
{
const uniformJumpAMIFvPatchField& nbrPatch =
refCast<const uniformJumpAMIFvPatchField<Type> >
(
this->neighbourPatchField()
);
return this->cyclicAMIPatch().interpolate(nbrPatch.jump());
}
}
template<class Type>
void Foam::uniformJumpAMIFvPatchField<Type>::write(Ostream& os) const
{
fixedJumpAMIFvPatchField<Type>::write(os);
if (this->cyclicAMIPatch().owner())
{
jumpTable_->writeData(os);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::uniformJumpAMIFvPatchField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a jump condition, using the \c cyclicAMI
condition as a base. The jump is specified as a time-varying uniform
value across the patch.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclicAMI| yes |
jumpTable | jump value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type uniformJumpAMI;
patchType cyclicAMI;
jumpTable constant 10;
}
\endverbatim
The above example shows the use of a fixed jump of '10'.
Note
The uniformValue entry is a DataEntry type, able to describe time
varying functions. The example above gives the usage for supplying a
constant value.
The underlying \c patchType should be set to \c cyclic
SeeAlso
Foam::jumpCyclicAMIFvPatchField
SourceFiles
uniformJumpAMIFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpAMIFvPatchField_H
#define uniformJumpAMIFvPatchField_H
#include "fixedJumpAMIFvPatchField.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class uniformJumpAMIFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class uniformJumpAMIFvPatchField
:
public fixedJumpAMIFvPatchField<Type>
{
protected:
// Protected data
//- "jump" table
autoPtr<DataEntry<Type> > jumpTable_;
public:
//- Runtime type information
TypeName("uniformJumpAMI");
// Constructors
//- Construct from patch and internal field
uniformJumpAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
uniformJumpAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given uniformJumpAMIFvPatchField onto a
// new patch
uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new uniformJumpAMIFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new uniformJumpAMIFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
//- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const;
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "uniformJumpAMIFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformJumpAMIFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(uniformJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpAMIFvPatchFields_H
#define uniformJumpAMIFvPatchFields_H
#include "uniformJumpAMIFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(uniformJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpAMIFvPatchFieldsFwd_H
#define uniformJumpAMIFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class uniformJumpAMIFvPatchField;
makePatchTypeFieldTypedefs(uniformJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -10,7 +10,9 @@ rhoThermo/rhoThermos.C
derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C
derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C
derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C
derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C
derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C
derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C
derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C

View File

@ -1,8 +1,8 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-L$(FOAM_USER_LIBBIN)/FvPatchScalarFieldEnthalpyJump
-lfiniteVolume

View File

@ -25,7 +25,7 @@ License
#include "addToRunTimeSelectionTable.H"
#include "energyJumpFvPatchScalarField.H"
#include "temperatureJumpFvPatchScalarField.H"
#include "fixedJumpFvPatchFields.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -61,7 +61,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField
:
fixedJumpFvPatchField<scalar>(p, iF)
{
if (dict.found("value"))
{
fvPatchScalarField::operator=
@ -77,7 +76,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField
const energyJumpFvPatchScalarField& ptf
)
:
cyclicLduInterfaceField(),
fixedJumpFvPatchField<scalar>(ptf)
{}
@ -103,29 +101,21 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs()
if (this->cyclicPatch().owner())
{
const basicThermo& thermo = db().lookupObject<basicThermo>
(
"thermophysicalProperties"
);
const basicThermo& thermo =
db().lookupObject<basicThermo>("thermophysicalProperties");
label patchID = patch().index();
const scalarField& pp = thermo.p().boundaryField()[patchID];
const temperatureJumpFvPatchScalarField& TbPatch =
refCast<const temperatureJumpFvPatchScalarField>
const fixedJumpFvPatchScalarField& TbPatch =
refCast<const fixedJumpFvPatchScalarField>
(
thermo.T().boundaryField()[patchID]
);
const scalar time = this->db().time().value();
const scalarField jumpTb
(
patch().size(), TbPatch.jumpTable().value(time)
);
const labelUList& faceCells = this->patch().faceCells();
jump_ = thermo.he(pp, jumpTb, faceCells);
jump_ = thermo.he(pp, TbPatch.jump(), faceCells);
}
fixedJumpFvPatchField<scalar>::updateCoeffs();

View File

@ -29,23 +29,8 @@ Group
Description
This boundary condition provides an energy jump condition across a pair
of coupled patches.
\heading Patch usage
\table
Property | Description | Required | Default value
jump | energy jump values | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type energyJump;
jump uniform 100;
}
\endverbatim
of coupled patches. It is not applied directly, but is employed on-the-fly
when converting temperature boundary conditions into energy.
SeeAlso
Foam::fixedJumpFvPatchField

View File

@ -24,51 +24,43 @@ License
\*---------------------------------------------------------------------------*/
#include "addToRunTimeSelectionTable.H"
#include "temperatureJumpFvPatchScalarField.H"
#include "volFields.H"
#include "energyJumpAMIFvPatchScalarField.H"
#include "fixedJumpAMIFvPatchFields.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedJumpFvPatchField<scalar>(p, iF),
jumpTable_(0)
fixedJumpAMIFvPatchField<scalar>(p, iF)
{}
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const temperatureJumpFvPatchScalarField& ptf,
const energyJumpAMIFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper),
jumpTable_(ptf.jumpTable_().clone().ptr())
fixedJumpAMIFvPatchField<scalar>(ptf, p, iF, mapper)
{}
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedJumpFvPatchField<scalar>(p, iF),
jumpTable_(new DataEntry<scalar>("jumpTable"))
fixedJumpAMIFvPatchField<scalar>(p, iF)
{
if (this->cyclicPatch().owner())
{
jumpTable_ = DataEntry<scalar>::New("jumpTable", dict);
}
if (dict.found("value"))
{
fvPatchScalarField::operator=
@ -79,38 +71,60 @@ Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
}
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const temperatureJumpFvPatchScalarField& ptf
const energyJumpAMIFvPatchScalarField& ptf
)
:
cyclicLduInterfaceField(),
fixedJumpFvPatchField<scalar>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
fixedJumpAMIFvPatchField<scalar>(ptf)
{}
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const temperatureJumpFvPatchScalarField& ptf,
const energyJumpAMIFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedJumpFvPatchField<scalar>(ptf, iF),
jumpTable_(ptf.jumpTable_().clone().ptr())
fixedJumpAMIFvPatchField<scalar>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::temperatureJumpFvPatchScalarField::write(Ostream& os) const
void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs()
{
fixedJumpFvPatchField<scalar>::write(os);
if (this->cyclicPatch().owner())
if (this->updated())
{
jumpTable_->writeData(os);
return;
}
if (this->cyclicAMIPatch().owner())
{
const basicThermo& thermo =
db().lookupObject<basicThermo>("thermophysicalProperties");
label patchID = patch().index();
const scalarField& pp = thermo.p().boundaryField()[patchID];
const fixedJumpAMIFvPatchScalarField& TbPatch =
refCast<const fixedJumpAMIFvPatchScalarField>
(
thermo.T().boundaryField()[patchID]
);
const labelUList& faceCells = this->patch().faceCells();
jump_ = thermo.he(pp, TbPatch.jump(), faceCells);
}
fixedJumpAMIFvPatchField<scalar>::updateCoeffs();
}
void Foam::energyJumpAMIFvPatchScalarField::write(Ostream& os) const
{
fixedJumpAMIFvPatchField<scalar>::write(os);
this->writeEntry("value", os);
}
@ -122,7 +136,7 @@ namespace Foam
makePatchTypeField
(
fvPatchScalarField,
temperatureJumpFvPatchScalarField
energyJumpAMIFvPatchScalarField
);
}

View File

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::energyJumpAMIFvPatchScalarField
Group
grpThermoBoundaryConditions grpCoupledBoundaryConditions
Description
This boundary condition provides an energy jump condition across a pair
of coupled patches with an arbitrary mesh interface (AMI). It is not
applied directly, but is employed on-the-fly when converting temperature
boundary conditions into energy.
SeeAlso
Foam::fixedJumpAMIFvPatchField
SourceFiles
energyJumpAMIFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef energyJumpAMIFvPatchScalarField_H
#define energyJumpAMIFvPatchScalarField_H
#include "fixedJumpAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class energyJumpAMIFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class energyJumpAMIFvPatchScalarField
:
public fixedJumpAMIFvPatchField<scalar>
{
public:
//- Runtime type information
TypeName("energyJumpAMI");
// Constructors
//- Construct from patch and internal field
energyJumpAMIFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
energyJumpAMIFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given energyJumpAMIFvPatchScalarField onto a
// new patch
energyJumpAMIFvPatchScalarField
(
const energyJumpAMIFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
energyJumpAMIFvPatchScalarField
(
const energyJumpAMIFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchField<scalar> > clone() const
{
return tmp<fvPatchField<scalar> >
(
new energyJumpAMIFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
energyJumpAMIFvPatchScalarField
(
const energyJumpAMIFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<scalar> > clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchField<scalar> >
(
new energyJumpAMIFvPatchScalarField(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -28,8 +28,10 @@ License
#include "fixedEnergyFvPatchScalarField.H"
#include "gradientEnergyFvPatchScalarField.H"
#include "mixedEnergyFvPatchScalarField.H"
#include "temperatureJumpFvPatchScalarField.H"
#include "fixedJumpFvPatchFields.H"
#include "fixedJumpAMIFvPatchFields.H"
#include "energyJumpFvPatchScalarField.H"
#include "energyJumpAMIFvPatchScalarField.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -59,10 +61,14 @@ Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryTypes()
{
hbt[patchi] = mixedEnergyFvPatchScalarField::typeName;
}
else if (isA<temperatureJumpFvPatchScalarField>(tbf[patchi]))
else if (isA<fixedJumpFvPatchScalarField>(tbf[patchi]))
{
hbt[patchi] = energyJumpFvPatchScalarField::typeName;
}
else if (isA<fixedJumpAMIFvPatchScalarField>(tbf[patchi]))
{
hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName;
}
}
return hbt;

View File

@ -1,7 +1,11 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \
-lfiniteVolume
-lfiniteVolume \
-lfluidThermophysicalModels \
-lspecie \
-lmeshTools

View File

@ -7,36 +7,14 @@ cd ${0%/*} || exit 1 # run from this directory
# Get application name
application=`getApplication`
runKivaToFoam()
{
if [ -f log.kivaToFoam ]
then
echo "kivaToFoam already run: remove log file to re-run"
else
echo "kivaToFoam: converting kiva file"
kivaToFoam -file $1 > log.kivaToFoam 2>&1
fi
}
restartApplication()
{
if [ -f log-2.$1 ]
then
echo "$1 already run: remove log file to re-run"
else
echo "Running $1"
$1 > log-2.$1 2>&1
fi
}
runKivaToFoam otape17
runApplication kivaToFoam -file otape17
cp system/controlDict.1st system/controlDict
runApplication $application
mv log.$application log.$application.1
cp system/controlDict.2nd system/controlDict
restartApplication $application
runApplication $application
mv log.$application log.$application.2
# ----------------------------------------------------------------- end-of-file

View File

@ -1,5 +1,8 @@
#!/bin/sh
set -x
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
blockMesh > log.blockMesh 2>&1
runApplication blockMesh

View File

@ -7,24 +7,13 @@ cd ${0%/*} || exit 1 # run from this directory
# Get application name
application=`getApplication`
runStarToFoam()
{
if [ -f log.star3ToFoam -o -f log.starToFoam ]
then
echo "star3ToFoam already run on $PWD: remove log file to re-run"
else
echo "star3ToFoam: converting mesh $1"
star3ToFoam $1 > log.star3ToFoam 2>&1
fi
}
runApplication star3ToFoam prostar/nacaAirfoil
runStarToFoam prostar/nacaAirfoil
mv constant/polyMesh/boundary temp
sed -e s/"\([\t ]*type[\t ]*\)symmetryPlane"/"\1empty"/g \
temp > constant/polyMesh/boundary
rm temp
runApplication $application
# end-of-file
# ----------------------------------------------------------------- end-of-file

View File

@ -83,8 +83,16 @@ type -P gnuplot &>/dev/null || {
exit 1
}
SETSDIR="../sets"
if [ ! -d $SETSDIR ]
then
echo "createGraphs: results sets not available in folder $SETSDIR"
exit 0
fi
# paths to data
LATESTTIME=`ls ../sets`
LATESTTIME=`ls $SETSDIR`
OFDATAROOT=../sets/$LATESTTIME
EXPTDATAROOT=./exptData

View File

@ -13,7 +13,7 @@ unset FOAM_SETNAN
unset FOAM_SIGFPE
# Create first baffle
createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite > log.createBaffles 2>&1
runApplication createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite
# Create region
runApplication extrudeToRegionMesh -overwrite

View File

@ -1,5 +1,11 @@
#!/bin/sh
set -x
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
blockMesh > log.blockMesh 2>&1
runApplication blockMesh
# ----------------------------------------------------------------- end-of-file

View File

@ -1,7 +1,6 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

View File

@ -1,6 +1,13 @@
#!/bin/sh
set -x
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
blockMesh > log.blockMesh 2>&1
topoSet
runApplication blockMesh
runApplication topoSet
# ----------------------------------------------------------------- end-of-file

View File

@ -56,7 +56,6 @@ boundaryField
{
type fan;
patchType cyclic;
jump uniform 0;
jumpTable polynomial
2
@ -71,7 +70,6 @@ boundaryField
{
type fan;
patchType cyclic;
jump uniform 0;
value uniform 0;
}
defaultFaces

View File

@ -16,9 +16,13 @@ unset FOAM_SETNAN
# Create faceZones for fan and baffles
runApplication topoSet
# Create fan cyclics
createBaffles cyclicFaces '(fan_half0 fan_half1)' -overwrite > log.createBaffles 2>&1
runApplication createBaffles cyclicFaces '(fan_half0 fan_half1)' -overwrite
mv log.createBaffles log.createBaffles.1
# Create wall baffles
createBaffles baffleFaces '(baffles baffles)' -overwrite > log.createBaffles 2>&1
runApplication createBaffles baffleFaces '(baffles baffles)' -overwrite
mv log.createBaffles log.createBaffles.2
runApplication $application

View File

@ -8,7 +8,7 @@ cd ${0%/*} || exit 1 # run from this directory
application=`getApplication`
runApplication blockMesh
transformPoints -scale '(1.6666 1 1)'
runApplication transformPoints -scale '(1.6666 1 1)'
runApplication changeDictionary -instance system -dict system/changeDictionaryDict.X
runApplication mirrorMesh -overwrite

View File

@ -21,10 +21,12 @@ setsToZones -noFlipMap > log.setsToZones 2>&1
# - use binary writing to avoid 'nan'
# - use setFields to set values
unset FOAM_SIGFPE
createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite > log.createBaffles1 2>&1
runApplication createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite
mv log.createBaffles log.createBaffles1
# create the second cyclic - rhs of porous zone
createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite > log.createBaffles2 2>&1
runApplication createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite
mv log.createBaffles log.createBaffles2
# Initialise newly created patchFields to 0
runApplication changeDictionary

View File

@ -23,11 +23,8 @@ filter1
DarcyForchheimerCoeffs
{
Darcy
{
d d [0 -2 0 0 0 0 0] (500000 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
}
d d [0 -2 0 0 0 0 0] (500000 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
coordinateSystem
{

View File

@ -17,7 +17,7 @@ FoamFile
massSource1
{
type scalarExplicitSource;
type scalarSemiImplicitSource;
active true;
timeStart 0.2;
duration 2.0;
@ -27,13 +27,13 @@ massSource1
(2.75 0.5 0)
);
scalarExplicitSourceCoeffs
scalarSemiImplicitSourceCoeffs
{
volumeMode absolute;
injectionRate
injectionRateSuSp
{
rho 1e-4; // kg/s
H2O 1e-4; // kg/s
rho (1e-4 0); // kg/s
H2O (1e-4 0); // kg/s
}
}
}
@ -41,7 +41,7 @@ massSource1
momentumSource1
{
type vectorExplicitSource;
type vectorSemiImplicitSource;
active true;
timeStart 0.2;
duration 2.0;
@ -51,12 +51,12 @@ momentumSource1
(2.75 0.5 0)
);
vectorExplicitSourceCoeffs
vectorSemiImplicitSourceCoeffs
{
volumeMode absolute;
injectionRate
injectionRateSuSp
{
U (0 0.005 0);
U ((0 0.005 0) 0);
}
}
}
@ -64,7 +64,7 @@ momentumSource1
energySource1
{
type scalarExplicitSource;
type scalarSemiImplicitSource;
active true;
timeStart 0.2;
duration 2.0;
@ -74,12 +74,12 @@ energySource1
(2.75 0.5 0)
);
scalarExplicitSourceCoeffs
scalarSemiImplicitSourceCoeffs
{
volumeMode absolute;
injectionRate
injectionRateSuSp
{
h 10;
h (10 0);
}
}
}

View File

@ -186,6 +186,10 @@ snapControls
//- Use castellatedMeshControls::features
explicitFeatureSnap true;
//- Detect features between multiple surfaces
// (only for explicitFeatureSnap, default = false)
multiRegionFeatureSnap true;
}

View File

@ -16,7 +16,7 @@ unset FOAM_SETNAN
# Create faceZones for porous baffles
runApplication topoSet
createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite > log.createBaffles 2>&1
runApplication createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite
runApplication changeDictionary