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

This commit is contained in:
mattijs
2013-01-08 12:39:30 +00:00
451 changed files with 1665 additions and 81009 deletions

View File

@ -74,7 +74,7 @@ fvAgglomerationMethods/Allwmake $*
wmake $makeType fvMotionSolver
wmake $makeType engine
wmake $makeType fieldSources
wmake $makeType fvOptions
wmake $makeType regionCoupled

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -1086,6 +1086,106 @@ Foam::label Foam::polyMeshFilter::filterEdges
}
Foam::label Foam::polyMeshFilter::filterIndirectPatchFaces()
{
newMeshPtr_ = copyMesh(mesh_);
fvMesh& newMesh = newMeshPtr_();
label nIterations = 0;
label nBadFaces = 0;
while (true)
{
Info<< nl << indent << "Iteration = "
<< nIterations++ << nl << incrIndent << endl;
// Per edge collapse status
PackedBoolList collapseEdge(newMesh.nEdges());
Map<point> collapsePointToLocation(newMesh.nPoints());
labelList boundaryPoint(newMesh.nPoints());
edgeCollapser collapser(newMesh, collapseFacesCoeffDict_);
collapser.markIndirectPatchFaces
(
collapseEdge,
collapsePointToLocation
);
// Merge edge collapses into consistent collapse-network.
// Make sure no cells get collapsed.
List<pointEdgeCollapse> allPointInfo;
const globalIndex globalPoints(newMesh.nPoints());
collapser.consistentCollapse
(
globalPoints,
boundaryPoint,
collapsePointToLocation,
collapseEdge,
allPointInfo
);
label nLocalCollapse = collapseEdge.count();
reduce(nLocalCollapse, sumOp<label>());
Info<< nl << indent << "Collapsing " << nLocalCollapse
<< " edges after synchronisation and PointEdgeWave" << endl;
if (nLocalCollapse == 0)
{
break;
}
// Apply collapses to current mesh
polyTopoChange newMeshMod(newMesh);
// Insert mesh refinement into polyTopoChange.
collapser.setRefinement(allPointInfo, newMeshMod);
Info<< indent << "Apply changes to the current mesh"
<< decrIndent << endl;
// Apply changes to current mesh
autoPtr<mapPolyMesh> newMapPtr = newMeshMod.changeMesh
(
newMesh,
false
);
const mapPolyMesh& newMap = newMapPtr();
// Update fields
newMesh.updateMesh(newMap);
if (newMap.hasMotionPoints())
{
newMesh.movePoints(newMap.preMotionPoints());
}
// Mesh check
// ~~~~~~~~~~~~~~~~~~
// Do not allow collapses in regions of error.
// Updates minEdgeLen, nRelaxedEdges
PackedBoolList isErrorPoint(newMesh.nPoints());
nBadFaces = edgeCollapser::checkMeshQuality
(
newMesh,
meshQualityCoeffDict_,
isErrorPoint
);
Info<< nl << " Number of bad faces : " << nBadFaces << nl
<< " Number of marked points : "
<< returnReduce(isErrorPoint.count(), sumOp<unsigned int>())
<< endl;
}
return nBadFaces;
}
const Foam::autoPtr<Foam::fvMesh>& Foam::polyMeshFilter::filteredMesh() const
{
return newMeshPtr_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -224,6 +224,8 @@ public:
//- Filter edges only.
label filterEdges(const label nOriginalBadFaces);
label filterIndirectPatchFaces();
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -803,11 +803,7 @@ void Foam::edgeCollapser::checkBoundaryPointMergeEdges
{
const pointField& points = mesh_.points();
if
(
pointPriority[pointI] == 0
&& pointPriority[otherPointI] < 0
)
if (pointPriority[pointI] >= 0 && pointPriority[otherPointI] < 0)
{
collapsePointToLocation.set
(
@ -1254,6 +1250,44 @@ bool Foam::edgeCollapser::setRefinement
const labelListList& pointFaces = mesh_.pointFaces();
const pointZoneMesh& pointZones = mesh_.pointZones();
// // Dump point collapses
// label count = 0;
// forAll(allPointInfo, ptI)
// {
// const pointEdgeCollapse& pec = allPointInfo[ptI];
//
// if (mesh_.points()[ptI] != pec.collapsePoint())
// {
// count++;
// }
// }
//
// OFstream str("collapses_" + name(count) + ".obj");
// // Dump point collapses
// forAll(allPointInfo, ptI)
// {
// const pointEdgeCollapse& pec = allPointInfo[ptI];
//
// if
// (
// mesh_.points()[ptI] != pec.collapsePoint()
// && pec.collapsePoint() != vector(GREAT, GREAT, GREAT)
// )
// {
// meshTools::writeOBJ
// (
// str,
// mesh_.points()[ptI],
// pec.collapsePoint()
// );
// }
// }
bool meshChanged = false;
PackedBoolList removedPoints(mesh_.nPoints());
@ -1301,6 +1335,29 @@ bool Foam::edgeCollapser::setRefinement
}
}
// OFstream str2("collapseStrings_" + name(count) + ".obj");
// // Dump point collapses
// forAllConstIter(Map<DynamicList<label> >, collapseStrings, iter)
// {
// const label masterPoint = iter.key();
// const DynamicList<label>& edgeCollapses = iter();
//
// forAll(edgeCollapses, eI)
// {
// meshTools::writeOBJ
// (
// str2,
// mesh_.points()[edgeCollapses[eI]],
// mesh_.points()[masterPoint]
// );
// }
// }
// Current faces (is also collapseStatus: f.size() < 3)
faceList newFaces(mesh_.faces());
@ -1346,7 +1403,6 @@ bool Foam::edgeCollapser::setRefinement
do
{
// Update face collapse from edge collapses
forAll(newFaces, faceI)
{
filterFace(collapseStrings, allPointInfo, newFaces[faceI]);
@ -1857,68 +1913,29 @@ Foam::label Foam::edgeCollapser::markMergeEdges
if (e0length <= e1length)
{
if (edges[e0].start() == pointI)
{
collapseEdge[e0] = true;
collapseEdge[e0] = true;
checkBoundaryPointMergeEdges
(
pointI,
edges[e0].end(),
pointPriority,
collapsePointToLocation
);
}
else
{
collapseEdge[e0] = true;
checkBoundaryPointMergeEdges
(
pointI,
edges[e0].start(),
pointPriority,
collapsePointToLocation
);
}
checkBoundaryPointMergeEdges
(
pointI,
edges[e0].otherVertex(pointI),
pointPriority,
collapsePointToLocation
);
}
else
{
if (edges[e1].start() == pointI)
{
collapseEdge[e1] = true;
collapseEdge[e1] = true;
checkBoundaryPointMergeEdges
(
pointI,
edges[e1].end(),
pointPriority,
collapsePointToLocation
);
}
else
{
collapseEdge[e1] = true;
checkBoundaryPointMergeEdges
(
pointI,
edges[e1].start(),
pointPriority,
collapsePointToLocation
);
}
checkBoundaryPointMergeEdges
(
pointI,
edges[e1].otherVertex(pointI),
pointPriority,
collapsePointToLocation
);
}
// if (boundaryPoint[leftV] == -1)
// {
// collapseEdge[e0] = findIndex(edges[e0], leftV);
// }
// else
// {
// collapseEdge[e1] = findIndex(edges[e1], rightV);
// }
nCollapsed++;
}
}
@ -1991,4 +2008,117 @@ Foam::labelPair Foam::edgeCollapser::markSmallSliverFaces
}
void Foam::edgeCollapser::markIndirectPatchFaces
(
PackedBoolList& collapseEdge,
Map<point>& collapsePointToLocation
) const
{
const faceZone& indirectFaceZone = mesh_.faceZones()["indirectPatchFaces"];
const edgeList& edges = mesh_.edges();
const pointField& points = mesh_.points();
const labelListList& edgeFaces = mesh_.edgeFaces();
const polyBoundaryMesh& bMesh = mesh_.boundaryMesh();
forAll(edges, eI)
{
const edge& e = edges[eI];
const labelList& eFaces = edgeFaces[eI];
bool keepEdge = false;
label nInternalFaces = 0;
label nPatchFaces = 0;
label nIndirectFaces = 0;
bool coupled = false;
forAll(eFaces, eFaceI)
{
const label eFaceIndex = eFaces[eFaceI];
if (mesh_.isInternalFace(eFaceIndex))
{
nInternalFaces++;
}
else
{
const label patchIndex = bMesh.whichPatch(eFaceIndex);
const polyPatch& pPatch = bMesh[patchIndex];
if (pPatch.coupled())
{
coupled = true;
nInternalFaces++;
}
else
{
// Keep the edge if an attached face is not in the face zone
if (indirectFaceZone.whichFace(eFaceIndex) == -1)
{
nPatchFaces++;
}
else
{
nIndirectFaces++;
}
}
}
}
if (eFaces.size() != nInternalFaces + nPatchFaces + nIndirectFaces)
{
Pout<< eFaces.size() << " ("
<< nInternalFaces << "/" << nPatchFaces << "/" << nIndirectFaces
<< ")" << endl;
}
if
(
eFaces.size() == nInternalFaces
|| nIndirectFaces < (coupled ? 1 : 2)
)
{
keepEdge = true;
}
if (!keepEdge)
{
collapseEdge[eI] = true;
const Foam::point collapsePoint =
0.5*(points[e.end()] + points[e.start()]);
collapsePointToLocation.insert(e.start(), collapsePoint);
collapsePointToLocation.insert(e.end(), collapsePoint);
}
}
// OFstream str
// (
// mesh_.time().path()
// /"markedEdges_" + name(collapseEdge.count()) + ".obj"
// );
// label count = 0;
//
// forAll(collapseEdge, eI)
// {
// if (collapseEdge[eI])
// {
// const edge& e = edges[eI];
//
// meshTools::writeOBJ
// (
// str,
// points[e.start()],
// points[e.end()],
// count
// );
// }
// }
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -331,6 +331,12 @@ public:
PackedBoolList& collapseEdge,
Map<point>& collapsePointToLocation
) const;
void markIndirectPatchFaces
(
PackedBoolList& collapseEdge,
Map<point>& collapsePointToLocation
) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,8 +75,7 @@ inline bool Foam::pointEdgeCollapse::update
{
bool identicalPoint = samePoint(w2.collapsePoint_);
bool nearer = magSqr(w2.collapsePoint_)
< magSqr(collapsePoint_);
bool nearer = (magSqr(w2.collapsePoint_) < magSqr(collapsePoint_));
if (nearer)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -579,9 +579,7 @@ void Foam::extendedFeatureEdgeMesh::allNearestFeaturePoints
label ptI = pointTree().shapes().pointLabels()[index];
const point& pt = points()[ptI];
pointIndexHit nearHit;
nearHit = pointIndexHit(true, pt, index);
pointIndexHit nearHit(true, pt, index);
dynPointHit.append(nearHit);
}
@ -631,16 +629,12 @@ void Foam::extendedFeatureEdgeMesh::allNearestFeatureEdges
label hitIndex = index + sliceStarts[i];
pointIndexHit nearHit;
if (!hitPoint.hit())
{
nearHit = pointIndexHit(false, hitPoint.missPoint(), hitIndex);
}
else
{
nearHit = pointIndexHit(true, hitPoint.hitPoint(), hitIndex);
}
pointIndexHit nearHit
(
hitPoint.hit(),
hitPoint.rawPoint(),
hitIndex
);
dynEdgeHit.append(nearHit);
}

View File

@ -1,2 +0,0 @@
Info<< "Creating sources" << endl;
IObasicSourceList sources(mesh);

View File

@ -1,7 +1,7 @@
basicSource/basicSource.C
basicSource/basicSourceIO.C
basicSource/basicSourceList.C
basicSource/IObasicSourceList.C
fvOptions/fvOption.C
fvOptions/fvOptionIO.C
fvOptions/fvOptionList.C
fvOptions/fvIOoptionList.C
/* sources */
@ -45,4 +45,4 @@ $(derivedConstraints)/fixedTemperatureConstraint/fixedTemperatureConstraint.C
$(derivedConstraints)/temperatureLimitsConstraint/temperatureLimitsConstraint.C
LIB = $(FOAM_LIBBIN)/libfieldSources
LIB = $(FOAM_LIBBIN)/libfvOptions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,16 +34,19 @@ License
namespace Foam
{
defineTypeNameAndDebug(fixedTemperatureConstraint, 0);
addToRunTimeSelectionTable
(
basicSource,
fixedTemperatureConstraint,
dictionary
);
namespace fv
{
defineTypeNameAndDebug(fixedTemperatureConstraint, 0);
addToRunTimeSelectionTable
(
option,
fixedTemperatureConstraint,
dictionary
);
}
template<>
const char* NamedEnum<fixedTemperatureConstraint::temperatureMode, 2>::
const char* NamedEnum<fv::fixedTemperatureConstraint::temperatureMode, 2>::
names[] =
{
"uniform",
@ -51,13 +54,13 @@ namespace Foam
};
}
const Foam::NamedEnum<Foam::fixedTemperatureConstraint::temperatureMode, 2>
Foam::fixedTemperatureConstraint::temperatureModeNames_;
const Foam::NamedEnum<Foam::fv::fixedTemperatureConstraint::temperatureMode, 2>
Foam::fv::fixedTemperatureConstraint::temperatureModeNames_;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fixedTemperatureConstraint::fixedTemperatureConstraint
Foam::fv::fixedTemperatureConstraint::fixedTemperatureConstraint
(
const word& name,
const word& modelType,
@ -65,7 +68,7 @@ Foam::fixedTemperatureConstraint::fixedTemperatureConstraint
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
mode_(temperatureModeNames_.read(coeffs_.lookup("mode"))),
Tuniform_(NULL),
TName_("T")
@ -99,13 +102,13 @@ Foam::fixedTemperatureConstraint::fixedTemperatureConstraint
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::fixedTemperatureConstraint::alwaysApply() const
bool Foam::fv::fixedTemperatureConstraint::alwaysApply() const
{
return true;
}
void Foam::fixedTemperatureConstraint::setValue
void Foam::fv::fixedTemperatureConstraint::setValue
(
fvMatrix<scalar>& eqn,
const label
@ -146,16 +149,16 @@ void Foam::fixedTemperatureConstraint::setValue
}
void Foam::fixedTemperatureConstraint::writeData(Ostream& os) const
void Foam::fv::fixedTemperatureConstraint::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
}
bool Foam::fixedTemperatureConstraint::read(const dictionary& dict)
bool Foam::fv::fixedTemperatureConstraint::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
if (coeffs_.found(Tuniform_->name()))
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::fixedTemperatureConstraint
Foam::fv::fixedTemperatureConstraint
Description
Fixed temperature equation constraint
@ -46,14 +46,14 @@ Note:
by means of the DataEntry type.
SourceFiles
basicSource.C
fvOption.C
\*---------------------------------------------------------------------------*/
#ifndef fixedTemperatureConstraint_H
#define fixedTemperatureConstraint_H
#include "basicSource.H"
#include "fvOption.H"
#include "NamedEnum.H"
#include "DataEntry.H"
@ -61,6 +61,8 @@ SourceFiles
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class fixedTemperatureConstraint Declaration
@ -68,7 +70,7 @@ namespace Foam
class fixedTemperatureConstraint
:
public basicSource
public option
{
public:
@ -156,6 +158,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,19 +32,22 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(temperatureLimitsConstraint, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
temperatureLimitsConstraint,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::temperatureLimitsConstraint::temperatureLimitsConstraint
Foam::fv::temperatureLimitsConstraint::temperatureLimitsConstraint
(
const word& name,
const word& modelType,
@ -52,7 +55,7 @@ Foam::temperatureLimitsConstraint::temperatureLimitsConstraint
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
Tmin_(readScalar(coeffs_.lookup("Tmin"))),
Tmax_(readScalar(coeffs_.lookup("Tmax")))
{
@ -63,13 +66,13 @@ Foam::temperatureLimitsConstraint::temperatureLimitsConstraint
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::temperatureLimitsConstraint::alwaysApply() const
bool Foam::fv::temperatureLimitsConstraint::alwaysApply() const
{
return true;
}
void Foam::temperatureLimitsConstraint::correct(volScalarField& he)
void Foam::fv::temperatureLimitsConstraint::correct(volScalarField& he)
{
const basicThermo& thermo =
mesh_.lookupObject<basicThermo>("thermophysicalProperties");
@ -123,16 +126,16 @@ void Foam::temperatureLimitsConstraint::correct(volScalarField& he)
}
void Foam::temperatureLimitsConstraint::writeData(Ostream& os) const
void Foam::fv::temperatureLimitsConstraint::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
}
bool Foam::temperatureLimitsConstraint::read(const dictionary& dict)
bool Foam::fv::temperatureLimitsConstraint::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
coeffs_.readIfPresent("Tmin", Tmin_);
coeffs_.readIfPresent("Tmax", Tmax_);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::temperatureLimitsConstraint
Foam::fv::temperatureLimitsConstraint
Description
Constraint for temperature to apply limits between minimum and maximum
@ -39,19 +39,21 @@ Description
SourceFiles
basicSource.C
fvOption.C
\*---------------------------------------------------------------------------*/
#ifndef temperatureLimitsConstraint_H
#define temperatureLimitsConstraint_H
#include "basicSource.H"
#include "fvOption.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class temperatureLimitsConstraint Declaration
@ -59,7 +61,7 @@ namespace Foam
class temperatureLimitsConstraint
:
public basicSource
public option
{
protected:
@ -130,6 +132,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,7 +31,7 @@ License
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::ExplicitSetValue<Type>::setFieldData(const dictionary& dict)
void Foam::fv::ExplicitSetValue<Type>::setFieldData(const dictionary& dict)
{
fieldNames_.setSize(dict.toc().size());
injectionRate_.setSize(fieldNames_.size());
@ -51,7 +51,7 @@ void Foam::ExplicitSetValue<Type>::setFieldData(const dictionary& dict)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::ExplicitSetValue<Type>::ExplicitSetValue
Foam::fv::ExplicitSetValue<Type>::ExplicitSetValue
(
const word& name,
const word& modelType,
@ -59,7 +59,7 @@ Foam::ExplicitSetValue<Type>::ExplicitSetValue
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
injectionRate_()
{
read(dict);
@ -69,7 +69,7 @@ Foam::ExplicitSetValue<Type>::ExplicitSetValue
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::ExplicitSetValue<Type>::setValue
void Foam::fv::ExplicitSetValue<Type>::setValue
(
fvMatrix<Type>& eqn,
const label fieldI

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::explicitSetValue
Foam::fv::explicitSetValue
Description
Set values field values explicity.
@ -41,7 +41,7 @@ Description
\endverbatim
SeeAlso
Foam::basicSource
Foam::fvOption
SourceFiles
explicitSetValue.C
@ -51,13 +51,15 @@ SourceFiles
#ifndef ExplicitSetValue_H
#define ExplicitSetValue_H
#include "basicSource.H"
#include "fvOption.H"
#include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class explicitSetValue Declaration
@ -66,7 +68,7 @@ namespace Foam
template<class Type>
class ExplicitSetValue
:
public basicSource
public option
{
protected:
@ -121,6 +123,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::ExplicitSetValue<Type>::writeData(Ostream& os) const
void Foam::fv::ExplicitSetValue<Type>::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
@ -36,9 +36,9 @@ void Foam::ExplicitSetValue<Type>::writeData(Ostream& os) const
template<class Type>
bool Foam::ExplicitSetValue<Type>::read(const dictionary& dict)
bool Foam::fv::ExplicitSetValue<Type>::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
setFieldData(coeffs_.subDict("injectionRate"));
return true;

View File

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

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,21 +23,21 @@ License
\*---------------------------------------------------------------------------*/
#include "IObasicSourceList.H"
#include "fvIOoptionList.H"
#include "fvMesh.H"
#include "Time.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::IOobject Foam::IObasicSourceList::createIOobject
Foam::IOobject Foam::fv::IOoptionList::createIOobject
(
const fvMesh& mesh
) const
{
IOobject io
(
"sourcesProperties",
mesh.time().constant(),
"fvOptions",
mesh.time().system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
@ -62,21 +62,21 @@ Foam::IOobject Foam::IObasicSourceList::createIOobject
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::IObasicSourceList::IObasicSourceList
Foam::fv::IOoptionList::IOoptionList
(
const fvMesh& mesh
)
:
IOdictionary(createIOobject(mesh)),
basicSourceList(mesh, *this)
optionList(mesh, *this)
{}
bool Foam::IObasicSourceList::read()
bool Foam::fv::IOoptionList::read()
{
if (regIOobject::read())
{
basicSourceList::read(*this);
optionList::read(*this);
return true;
}
else
@ -87,4 +87,3 @@ bool Foam::IObasicSourceList::read()
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,20 +22,20 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::IObasicSourceList
Foam::fv::IOoptionList
Description
IObasicSourceList
IOoptionList
SourceFiles
IObasicSourceList.C
IOoptionList.C
\*---------------------------------------------------------------------------*/
#ifndef IObasicSourceList_H
#define IObasicSourceList_H
#ifndef IOoptionList_H
#define IOoptionList_H
#include "basicSourceList.H"
#include "fvOptionList.H"
#include "IOdictionary.H"
#include "autoPtr.H"
@ -43,15 +43,17 @@ SourceFiles
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class IObasicSourceList Declaration
Class IOoptionList Declaration
\*---------------------------------------------------------------------------*/
class IObasicSourceList
class IOoptionList
:
public IOdictionary,
public basicSourceList
public optionList
{
private:
@ -61,10 +63,10 @@ private:
IOobject createIOobject(const fvMesh& mesh) const;
//- Disallow default bitwise copy construct
IObasicSourceList(const IObasicSourceList&);
IOoptionList(const IOoptionList&);
//- Disallow default bitwise assignment
void operator=(const IObasicSourceList&);
void operator=(const IOoptionList&);
public:
@ -72,11 +74,11 @@ public:
// Constructors
//- Construct from components with list of field names
IObasicSourceList(const fvMesh& mesh);
IOoptionList(const fvMesh& mesh);
//- Destructor
virtual ~IObasicSourceList()
virtual ~IOoptionList()
{}
@ -89,6 +91,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "basicSource.H"
#include "fvOption.H"
#include "fvMesh.H"
#include "fvMatrices.H"
#include "volFields.H"
@ -33,12 +33,15 @@ License
namespace Foam
{
defineTypeNameAndDebug(basicSource, 0);
defineRunTimeSelectionTable(basicSource, dictionary);
namespace fv
{
defineTypeNameAndDebug(option, 0);
defineRunTimeSelectionTable(option, dictionary);
}
template<> const char* NamedEnum
<
basicSource::selectionModeType,
fv::option::selectionModeType,
5
>::names[] =
{
@ -49,20 +52,20 @@ namespace Foam
"all"
};
const NamedEnum<basicSource::selectionModeType, 5>
basicSource::selectionModeTypeNames_;
const NamedEnum<fv::option::selectionModeType, 5>
fv::option::selectionModeTypeNames_;
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::basicSource::alwaysApply() const
bool Foam::fv::option::alwaysApply() const
{
return false;
}
void Foam::basicSource::setSelection(const dictionary& dict)
void Foam::fv::option::setSelection(const dictionary& dict)
{
switch (selectionMode_)
{
@ -94,10 +97,8 @@ void Foam::basicSource::setSelection(const dictionary& dict)
}
default:
{
FatalErrorIn
(
"basicSource::setSelection(const dictionary&)"
) << "Unknown selectionMode "
FatalErrorIn("option::setSelection(const dictionary&)")
<< "Unknown selectionMode "
<< selectionModeTypeNames_[selectionMode_]
<< ". Valid selectionMode types are" << selectionModeTypeNames_
<< exit(FatalError);
@ -106,7 +107,7 @@ void Foam::basicSource::setSelection(const dictionary& dict)
}
void Foam::basicSource::setCellSet()
void Foam::fv::option::setCellSet()
{
switch (selectionMode_)
{
@ -127,7 +128,7 @@ void Foam::basicSource::setCellSet()
label globalCellI = returnReduce(cellI, maxOp<label>());
if (globalCellI < 0)
{
WarningIn("basicSource::setCellIds()")
WarningIn("option::setCellIds()")
<< "Unable to find owner cell for point " << points_[i]
<< endl;
@ -156,7 +157,7 @@ void Foam::basicSource::setCellSet()
label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
if (zoneID == -1)
{
FatalErrorIn("basicSource::setCellIds()")
FatalErrorIn("option::setCellIds()")
<< "Cannot find cellZone " << cellSetName_ << endl
<< "Valid cellZones are " << mesh_.cellZones().names()
<< exit(FatalError);
@ -195,10 +196,8 @@ void Foam::basicSource::setCellSet()
}
else
{
FatalErrorIn
(
"Foam::basicSource::setCellSet()"
) << "regions dont overlap "
FatalErrorIn("option::setCellSet()")
<< "regions dont overlap "
<< secondaryMesh.name()
<< " in region " << mesh_.name()
<< nl
@ -216,7 +215,7 @@ void Foam::basicSource::setCellSet()
}
default:
{
FatalErrorIn("basicSource::setCellIds()")
FatalErrorIn("option::setCellIds()")
<< "Unknown selectionMode "
<< selectionModeTypeNames_[selectionMode_]
<< ". Valid selectionMode types are" << selectionModeTypeNames_
@ -243,7 +242,7 @@ void Foam::basicSource::setCellSet()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicSource::basicSource
Foam::fv::option::option
(
const word& name,
const word& modelType,
@ -282,7 +281,7 @@ Foam::basicSource::basicSource
}
else
{
Info<< indent<< "-applying source for all time" << endl;
Info<< indent<< "- applying source for all time" << endl;
}
setSelection(dict_);
@ -295,7 +294,7 @@ Foam::basicSource::basicSource
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::basicSource> Foam::basicSource::New
Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
(
const word& name,
const dictionary& coeffs,
@ -313,8 +312,7 @@ Foam::autoPtr<Foam::basicSource> Foam::basicSource::New
{
FatalErrorIn
(
"basicSource::New"
"(const name&, const dictionary&, const fvMesh&)"
"option::New(const name&, const dictionary&, const fvMesh&)"
) << "Unknown Model type " << modelType
<< nl << nl
<< "Valid model types are:" << nl
@ -322,11 +320,11 @@ Foam::autoPtr<Foam::basicSource> Foam::basicSource::New
<< exit(FatalError);
}
return autoPtr<basicSource>(cstrIter()(name, modelType, coeffs, mesh));
return autoPtr<option>(cstrIter()(name, modelType, coeffs, mesh));
}
Foam::basicSource::~basicSource()
Foam::fv::option::~option()
{
if (!secondaryToPrimaryInterpPtr_.empty())
{
@ -337,7 +335,7 @@ Foam::basicSource::~basicSource()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::basicSource::isActive()
bool Foam::fv::option::isActive()
{
if (active_ && inTimeLimits(mesh_.time().value()))
{
@ -355,7 +353,7 @@ bool Foam::basicSource::isActive()
}
Foam::label Foam::basicSource::applyToField(const word& fieldName) const
Foam::label Foam::fv::option::applyToField(const word& fieldName) const
{
if (alwaysApply())
{
@ -374,13 +372,13 @@ Foam::label Foam::basicSource::applyToField(const word& fieldName) const
}
void Foam::basicSource::checkApplied() const
void Foam::fv::option::checkApplied() const
{
forAll(applied_, i)
{
if (!applied_[i])
{
WarningIn("void Foam::basicSource::checkApplied() const")
WarningIn("void option::checkApplied() const")
<< "Source " << name_ << " defined for field "
<< fieldNames_[i] << " but never used" << endl;
}
@ -388,49 +386,49 @@ void Foam::basicSource::checkApplied() const
}
void Foam::basicSource::correct(volScalarField& fld)
void Foam::fv::option::correct(volScalarField& fld)
{
// do nothing
}
void Foam::basicSource::correct(volVectorField& fld)
void Foam::fv::option::correct(volVectorField& fld)
{
// do nothing
}
void Foam::basicSource::correct(volSphericalTensorField& fld)
void Foam::fv::option::correct(volSphericalTensorField& fld)
{
// do nothing
}
void Foam::basicSource::correct(volSymmTensorField& fld)
void Foam::fv::option::correct(volSymmTensorField& fld)
{
// do nothing
}
void Foam::basicSource::correct(volTensorField& fld)
void Foam::fv::option::correct(volTensorField& fld)
{
// do nothing
}
void Foam::basicSource::addSup(fvMatrix<scalar>& eqn, const label fieldI)
void Foam::fv::option::addSup(fvMatrix<scalar>& eqn, const label fieldI)
{
// do nothing
}
void Foam::basicSource::addSup(fvMatrix<vector>& eqn, const label fieldI)
void Foam::fv::option::addSup(fvMatrix<vector>& eqn, const label fieldI)
{
// do nothing
}
void Foam::basicSource::addSup
void Foam::fv::option::addSup
(
fvMatrix<sphericalTensor>& eqn,
const label fieldI
@ -440,31 +438,31 @@ void Foam::basicSource::addSup
}
void Foam::basicSource::addSup(fvMatrix<symmTensor>& eqn, const label fieldI)
void Foam::fv::option::addSup(fvMatrix<symmTensor>& eqn, const label fieldI)
{
// do nothing
}
void Foam::basicSource::addSup(fvMatrix<tensor>& eqn, const label fieldI)
void Foam::fv::option::addSup(fvMatrix<tensor>& eqn, const label fieldI)
{
// do nothing
}
void Foam::basicSource::setValue(fvMatrix<scalar>& eqn, const label fieldI)
void Foam::fv::option::setValue(fvMatrix<scalar>& eqn, const label fieldI)
{
// do nothing
}
void Foam::basicSource::setValue(fvMatrix<vector>& eqn, const label fieldI)
void Foam::fv::option::setValue(fvMatrix<vector>& eqn, const label fieldI)
{
// do nothing
}
void Foam::basicSource::setValue
void Foam::fv::option::setValue
(
fvMatrix<sphericalTensor>& eqn,
const label fieldI
@ -474,7 +472,7 @@ void Foam::basicSource::setValue
}
void Foam::basicSource::setValue
void Foam::fv::option::setValue
(
fvMatrix<symmTensor>& eqn,
const label fieldI
@ -484,19 +482,19 @@ void Foam::basicSource::setValue
}
void Foam::basicSource::setValue(fvMatrix<tensor>& eqn, const label fieldI)
void Foam::fv::option::setValue(fvMatrix<tensor>& eqn, const label fieldI)
{
// do nothing
}
void Foam::basicSource::relativeFlux(surfaceScalarField& phi) const
void Foam::fv::option::relativeFlux(surfaceScalarField& phi) const
{
// do nothing
}
void Foam::basicSource::relativeFlux
void Foam::fv::option::relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
@ -506,13 +504,13 @@ void Foam::basicSource::relativeFlux
}
void Foam::basicSource::absoluteFlux(surfaceScalarField& phi) const
void Foam::fv::option::absoluteFlux(surfaceScalarField& phi) const
{
// do nothing
}
void Foam::basicSource::absoluteFlux
void Foam::fv::option::absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,10 +22,11 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::basicSource
Foam::fv::option
Description
Field source abtract base class. Provides a base set of controls, e.g.
Finite volume options abtract base class. Provides a base set of controls,
e.g.
type scalarExplicitSource // source type
active on; // on/off switch
@ -33,18 +34,17 @@ Description
duration 1000.0; // duration
selectionMode cellSet; // cellSet // points //cellZone
// mapRegion
Note:
On evaluation, source expects to be added to the rhs of the equation
SourceFiles
basicSource.C
basicSourceIO.C
fvOption.C
fvOptionIO.C
\*---------------------------------------------------------------------------*/
#ifndef basicSource_H
#define basicSource_H
#ifndef fvOption_H
#define fvOption_H
#include "fvMatricesFwd.H"
#include "volFieldsFwd.H"
@ -61,11 +61,14 @@ namespace Foam
class fvMesh;
namespace fv
{
/*---------------------------------------------------------------------------*\
Class basicSource Declaration
Class option Declaration
\*---------------------------------------------------------------------------*/
class basicSource
class option
{
public:
@ -163,7 +166,7 @@ protected:
public:
//- Runtime type information
TypeName("basicSource");
TypeName("option");
// Declare run-time constructor selection table
@ -171,7 +174,7 @@ public:
declareRunTimeSelectionTable
(
autoPtr,
basicSource,
option,
dictionary,
(
const word& name,
@ -186,7 +189,7 @@ public:
// Constructors
//- Construct from components
basicSource
option
(
const word& name,
const word& modelType,
@ -195,13 +198,13 @@ public:
);
//- Return clone
autoPtr<basicSource> clone() const
autoPtr<option> clone() const
{
notImplemented("autoPtr<basicSource> clone() const");
return autoPtr<basicSource>(NULL);
notImplemented("autoPtr<option> clone() const");
return autoPtr<option>(NULL);
}
//- Return pointer to new basicSource object created
//- Return pointer to new fvOption object created
// on the freestore from an Istream
class iNew
{
@ -221,19 +224,14 @@ public:
name_(name)
{}
autoPtr<basicSource> operator()(Istream& is) const
autoPtr<option> operator()(Istream& is) const
{
//const word name(is);
const dictionary dict(is);
return autoPtr<basicSource>
return autoPtr<option>
(
basicSource::New
(
name_,
dict,
mesh_
)
option::New(name_, dict, mesh_)
);
}
};
@ -241,8 +239,8 @@ public:
// Selectors
//- Return a reference to the selected basicSource model
static autoPtr<basicSource> New
//- Return a reference to the selected fvOption model
static autoPtr<option> New
(
const word& name,
const dictionary& dict,
@ -251,7 +249,7 @@ public:
//- Destructor
virtual ~basicSource();
virtual ~option();
@ -468,11 +466,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "basicSourceI.H"
#include "fvOptionI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,47 +23,47 @@ License
\*---------------------------------------------------------------------------*/
#include "basicSource.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::word& Foam::basicSource::name() const
inline const Foam::word& Foam::fv::option::name() const
{
return name_;
}
inline const Foam::fvMesh& Foam::basicSource::mesh() const
inline const Foam::fvMesh& Foam::fv::option::mesh() const
{
return mesh_;
}
inline const Foam::dictionary& Foam::basicSource::coeffs() const
inline const Foam::dictionary& Foam::fv::option::coeffs() const
{
return coeffs_;
}
inline bool Foam::basicSource::active() const
inline bool Foam::fv::option::active() const
{
return active_;
}
inline Foam::scalar Foam::basicSource::timeStart() const
inline Foam::scalar Foam::fv::option::timeStart() const
{
return timeStart_;
}
inline Foam::scalar Foam::basicSource::duration() const
inline Foam::scalar Foam::fv::option::duration() const
{
return duration_;
}
inline bool Foam::basicSource::inTimeLimits(const scalar time) const
inline bool Foam::fv::option::inTimeLimits(const scalar time) const
{
return
(
@ -77,68 +77,69 @@ inline bool Foam::basicSource::inTimeLimits(const scalar time) const
}
inline const Foam::basicSource::selectionModeType&
Foam::basicSource::selectionMode() const
inline const Foam::fv::option::selectionModeType&
Foam::fv::option::selectionMode() const
{
return selectionMode_;
}
inline const Foam::word& Foam::basicSource::cellSetName() const
inline const Foam::word& Foam::fv::option::cellSetName() const
{
return cellSetName_;
}
inline Foam::scalar Foam::basicSource::V() const
inline Foam::scalar Foam::fv::option::V() const
{
return V_;
}
inline const Foam::labelList& Foam::basicSource::cells() const
inline const Foam::labelList& Foam::fv::option::cells() const
{
return cells_;
}
inline void Foam::basicSource::setApplied(const label fieldI)
inline void Foam::fv::option::setApplied(const label fieldI)
{
applied_[fieldI] = true;
}
inline bool& Foam::basicSource::active()
inline bool& Foam::fv::option::active()
{
return active_;
}
inline Foam::scalar& Foam::basicSource::timeStart()
inline Foam::scalar& Foam::fv::option::timeStart()
{
return timeStart_;
}
inline Foam::scalar& Foam::basicSource::duration()
inline Foam::scalar& Foam::fv::option::duration()
{
return duration_;
}
inline const Foam::word Foam::basicSource::secondarySourceName() const
inline const Foam::word Foam::fv::option::secondarySourceName() const
{
return secondarySourceName_;
}
inline const Foam::autoPtr<Foam::meshToMesh> Foam::basicSource::
secondaryToPrimaryInterpPtr() const
inline const Foam::autoPtr<Foam::meshToMesh>
Foam::fv::option::secondaryToPrimaryInterpPtr() const
{
return secondaryToPrimaryInterpPtr_;
}
inline const Foam::word Foam::basicSource::mapRegionName() const
inline const Foam::word Foam::fv::option::mapRegionName() const
{
return mapRegionName_;
}

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,24 +23,24 @@ License
\*---------------------------------------------------------------------------*/
#include "basicSource.H"
#include "fvOption.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::basicSource::writeHeader(Ostream& os) const
void Foam::fv::option::writeHeader(Ostream& os) const
{
os << indent << name_ << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
}
void Foam::basicSource::writeFooter(Ostream& os) const
void Foam::fv::option::writeFooter(Ostream& os) const
{
os << decrIndent << indent << token::END_BLOCK << endl;
}
void Foam::basicSource::writeData(Ostream& os) const
void Foam::fv::option::writeData(Ostream& os) const
{
os.writeKeyword("active") << active_ << token::END_STATEMENT << nl;
os.writeKeyword("timeStart") << timeStart_ << token::END_STATEMENT << nl;
@ -78,7 +78,7 @@ void Foam::basicSource::writeData(Ostream& os) const
}
default:
{
FatalErrorIn("basicSource::writeData(Ostream&) const")
FatalErrorIn("option::writeData(Ostream&) const")
<< "Unknown selectionMode "
<< selectionMode_
<< abort(FatalError);
@ -87,7 +87,7 @@ void Foam::basicSource::writeData(Ostream& os) const
}
bool Foam::basicSource::read(const dictionary& dict)
bool Foam::fv::option::read(const dictionary& dict)
{
active_ = readBool(dict.lookup("active"));
timeStart_ = readScalar(dict.lookup("timeStart"));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "basicSourceList.H"
#include "fvOptionList.H"
#include "addToRunTimeSelectionTable.H"
#include "fvMesh.H"
#include "Time.H"
@ -32,19 +32,22 @@ License
namespace Foam
{
defineTypeNameAndDebug(basicSourceList, 0);
namespace fv
{
defineTypeNameAndDebug(optionList, 0);
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::basicSourceList::checkApplied() const
void Foam::fv::optionList::checkApplied() const
{
if (mesh_.time().timeIndex() == checkTimeIndex_)
{
forAll(*this, i)
{
const basicSource& bs = this->operator[](i);
const option& bs = this->operator[](i);
bs.checkApplied();
}
}
@ -53,13 +56,9 @@ void Foam::basicSourceList::checkApplied() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicSourceList::basicSourceList
(
const fvMesh& mesh,
const dictionary& dict
)
Foam::fv::optionList::optionList(const fvMesh& mesh, const dictionary& dict)
:
PtrList<basicSource>(),
PtrList<option>(),
mesh_(mesh),
checkTimeIndex_(mesh_.time().startTimeIndex() + 2)
{
@ -67,9 +66,9 @@ Foam::basicSourceList::basicSourceList
}
Foam::basicSourceList::basicSourceList(const fvMesh& mesh)
Foam::fv::optionList::optionList(const fvMesh& mesh)
:
PtrList<basicSource>(),
PtrList<option>(),
mesh_(mesh),
checkTimeIndex_(mesh_.time().startTimeIndex() + 2)
{}
@ -77,7 +76,7 @@ Foam::basicSourceList::basicSourceList(const fvMesh& mesh)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::basicSourceList::reset(const dictionary& dict)
void Foam::fv::optionList::reset(const dictionary& dict)
{
label count = 0;
forAllConstIter(dictionary, dict, iter)
@ -101,14 +100,14 @@ void Foam::basicSourceList::reset(const dictionary& dict)
this->set
(
i++,
basicSource::New(name, sourceDict, mesh_)
option::New(name, sourceDict, mesh_)
);
}
}
}
void Foam::basicSourceList::relativeFlux(surfaceScalarField& phi) const
void Foam::fv::optionList::relativeFlux(surfaceScalarField& phi) const
{
forAll(*this, i)
{
@ -117,7 +116,7 @@ void Foam::basicSourceList::relativeFlux(surfaceScalarField& phi) const
}
void Foam::basicSourceList::relativeFlux
void Foam::fv::optionList::relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
@ -130,7 +129,7 @@ void Foam::basicSourceList::relativeFlux
}
void Foam::basicSourceList::absoluteFlux(surfaceScalarField& phi) const
void Foam::fv::optionList::absoluteFlux(surfaceScalarField& phi) const
{
forAll(*this, i)
{
@ -139,7 +138,7 @@ void Foam::basicSourceList::absoluteFlux(surfaceScalarField& phi) const
}
void Foam::basicSourceList::absoluteFlux
void Foam::fv::optionList::absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
@ -152,14 +151,14 @@ void Foam::basicSourceList::absoluteFlux
}
bool Foam::basicSourceList::read(const dictionary& dict)
bool Foam::fv::optionList::read(const dictionary& dict)
{
checkTimeIndex_ = mesh_.time().timeIndex() + 2;
bool allOk = true;
forAll(*this, i)
{
basicSource& bs = this->operator[](i);
option& bs = this->operator[](i);
bool ok = bs.read(dict.subDict(bs.name()));
allOk = (allOk && ok);
}
@ -167,7 +166,7 @@ bool Foam::basicSourceList::read(const dictionary& dict)
}
bool Foam::basicSourceList::writeData(Ostream& os) const
bool Foam::fv::optionList::writeData(Ostream& os) const
{
// Write list contents
forAll(*this, i)
@ -183,14 +182,17 @@ bool Foam::basicSourceList::writeData(Ostream& os) const
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const basicSourceList& sources
)
namespace Foam
{
sources.writeData(os);
return os;
Ostream& operator<<
(
Ostream& os,
const fv::optionList& options
)
{
options.writeData(os);
return os;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,36 +22,38 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::basicSourceList
Foam::fv::optionList
Description
List of explict sources
List of finite volume options
SourceFile
basicSourceList.C
optionList.C
\*---------------------------------------------------------------------------*/
#ifndef basicSourceList_H
#define basicSourceList_H
#ifndef optionList_H
#define optionList_H
#include "PtrList.H"
#include "GeometricField.H"
#include "fvPatchField.H"
#include "basicSource.H"
#include "fvOption.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class basicSourceList Declaration
Class optionList Declaration
\*---------------------------------------------------------------------------*/
class basicSourceList
class optionList
:
public PtrList<basicSource>
public PtrList<option>
{
protected:
@ -70,29 +72,29 @@ protected:
void checkApplied() const;
//- Disallow default bitwise copy construct
basicSourceList(const basicSourceList&);
optionList(const optionList&);
//- Disallow default bitwise assignment
void operator=(const basicSourceList&);
void operator=(const optionList&);
public:
//- Runtime type information
TypeName("basicSourceList");
TypeName("optionList");
// Constructors
//- Construct null
basicSourceList(const fvMesh& mesh);
optionList(const fvMesh& mesh);
//- Construct from mesh and dictionary
basicSourceList(const fvMesh& mesh, const dictionary& dict);
optionList(const fvMesh& mesh, const dictionary& dict);
//- Destructor
virtual ~basicSourceList()
virtual ~optionList()
{}
@ -187,18 +189,19 @@ public:
friend Ostream& operator<<
(
Ostream& os,
const basicSourceList& sources
const optionList& options
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "basicSourceListTemplates.C"
#include "fvOptionListTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::basicSourceList::correct
void Foam::fv::optionList::correct
(
GeometricField<Type, fvPatchField, volMesh>& fld
)
@ -35,7 +35,7 @@ void Foam::basicSourceList::correct
forAll(*this, i)
{
basicSource& source = this->operator[](i);
option& source = this->operator[](i);
label fieldI = source.applyToField(fieldName);
@ -59,7 +59,7 @@ void Foam::basicSourceList::correct
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
GeometricField<Type, fvPatchField, volMesh>& fld
)
@ -69,7 +69,7 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
template<class Type>
Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
GeometricField<Type, fvPatchField, volMesh>& fld,
const word& fieldName
@ -86,7 +86,7 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
forAll(*this, i)
{
basicSource& source = this->operator[](i);
option& source = this->operator[](i);
label fieldI = source.applyToField(fieldName);
@ -112,7 +112,7 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
template<class Type, class RhoType>
Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
const RhoType& rho,
GeometricField<Type, fvPatchField, volMesh>& fld
@ -123,7 +123,7 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
template<class Type, class RhoType>
Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator()
(
const RhoType& rho,
GeometricField<Type, fvPatchField, volMesh>& fld,
@ -141,7 +141,7 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
forAll(*this, i)
{
basicSource& source = this->operator[](i);
option& source = this->operator[](i);
label fieldI = source.applyToField(fieldName);
@ -167,14 +167,14 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::basicSourceList::operator()
template<class Type>
void Foam::basicSourceList::constrain(fvMatrix<Type>& eqn)
void Foam::fv::optionList::constrain(fvMatrix<Type>& eqn)
{
constrain(eqn, eqn.psi().name());
}
template<class Type>
void Foam::basicSourceList::constrain
void Foam::fv::optionList::constrain
(
fvMatrix<Type>& eqn,
const word& fieldName
@ -184,7 +184,7 @@ void Foam::basicSourceList::constrain
forAll(*this, i)
{
basicSource& source = this->operator[](i);
option& source = this->operator[](i);
label fieldI = source.applyToField(fieldName);

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,25 +23,25 @@ License
\*---------------------------------------------------------------------------*/
#ifndef makeBasicSource_H
#define makeBasicSource_H
#ifndef makeFvOption_H
#define makeFvOption_H
#include "basicSource.H"
#include "fvOption.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeBasicSource(Source, Type) \
#define makeFvOption(Option, Type) \
\
defineTemplateTypeNameAndDebugWithName \
( \
Source<Type>, \
#Type#Source, \
Option<Type>, \
#Type#Option, \
0 \
); \
\
basicSource::adddictionaryConstructorToTable<Source<Type> > \
add##Source##Type##dictionary##ConstructorTobasicSourceTable_
option::adddictionaryConstructorToTable<Option<Type> > \
add##Option##Type##dictionary##ConstructorTooptionTable_
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,2 @@
Info<< "Creating finite volume options" << endl;
fv::IOoptionList fvOptions(mesh);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,19 +33,22 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(MRFSource, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
MRFSource,
dictionary
);
}
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::MRFSource::initialise()
void Foam::fv::MRFSource::initialise()
{
if (selectionMode_ != smCellZone)
{
@ -77,7 +80,7 @@ void Foam::MRFSource::initialise()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::MRFSource::MRFSource
Foam::fv::MRFSource::MRFSource
(
const word& name,
const word& modelType,
@ -85,7 +88,7 @@ Foam::MRFSource::MRFSource
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
mrfPtr_(NULL),
UName_(coeffs_.lookupOrDefault<word>("UName", "U")),
rhoName_(coeffs_.lookupOrDefault<word>("rhoName", "rho"))
@ -96,7 +99,7 @@ Foam::MRFSource::MRFSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::MRFSource::addSup
void Foam::fv::MRFSource::addSup
(
fvMatrix<vector>& eqn,
const label fieldI
@ -118,13 +121,13 @@ void Foam::MRFSource::addSup
}
void Foam::MRFSource::relativeFlux(surfaceScalarField& phi) const
void Foam::fv::MRFSource::relativeFlux(surfaceScalarField& phi) const
{
mrfPtr_->relativeFlux(phi);
}
void Foam::MRFSource::relativeFlux
void Foam::fv::MRFSource::relativeFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
@ -134,13 +137,13 @@ void Foam::MRFSource::relativeFlux
}
void Foam::MRFSource::absoluteFlux(surfaceScalarField& phi) const
void Foam::fv::MRFSource::absoluteFlux(surfaceScalarField& phi) const
{
mrfPtr_->absoluteFlux(phi);
}
void Foam::MRFSource::absoluteFlux
void Foam::fv::MRFSource::absoluteFlux
(
const surfaceScalarField& rho,
surfaceScalarField& phi
@ -150,16 +153,16 @@ void Foam::MRFSource::absoluteFlux
}
void Foam::MRFSource::writeData(Ostream& os) const
void Foam::fv::MRFSource::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
}
bool Foam::MRFSource::read(const dictionary& dict)
bool Foam::fv::MRFSource::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
coeffs_.readIfPresent("UName", UName_);
coeffs_.readIfPresent("rhoName", rhoName_);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::MRFSource
Foam::fv::MRFSource
Description
Multiple Reference Frame (MRF) source
@ -45,7 +45,7 @@ SourceFiles
#ifndef MRFSource_H
#define MRFSource_H
#include "basicSource.H"
#include "fvOption.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,13 +54,16 @@ namespace Foam
class MRFZone;
namespace fv
{
/*---------------------------------------------------------------------------*\
Class MRFSource Declaration
\*---------------------------------------------------------------------------*/
class MRFSource
:
public basicSource
public option
{
protected:
@ -164,6 +167,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,49 +26,52 @@ License
#include "actuationDiskSource.H"
#include "fvMesh.H"
#include "fvMatrices.H"
#include "fvMatrix.H"
#include "geometricOneField.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(actuationDiskSource, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
actuationDiskSource,
dictionary
);
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::actuationDiskSource::checkData() const
void Foam::fv::actuationDiskSource::checkData() const
{
if (magSqr(diskArea_) <= VSMALL)
{
FatalErrorIn("Foam::actuationDiskSource::checkData()")
FatalErrorIn("Foam::fv::actuationDiskSource::checkData()")
<< "diskArea is approximately zero"
<< exit(FatalIOError);
}
if (Cp_ <= VSMALL || Ct_ <= VSMALL)
{
FatalErrorIn("Foam::actuationDiskSource::checkData()")
FatalErrorIn("Foam::fv::actuationDiskSource::checkData()")
<< "Cp and Ct must be greater than zero"
<< exit(FatalIOError);
}
if (mag(diskDir_) < VSMALL)
{
FatalErrorIn("Foam::actuationDiskSource::checkData()")
FatalErrorIn("Foam::fv::actuationDiskSource::checkData()")
<< "disk direction vector is approximately zero"
<< exit(FatalIOError);
}
if (returnReduce(upstreamCellId_, maxOp<label>()) == -1)
{
FatalErrorIn("Foam::actuationDiskSource::checkData()")
FatalErrorIn("Foam::fv::actuationDiskSource::checkData()")
<< "upstream location " << upstreamPoint_ << " not found in mesh"
<< exit(FatalIOError);
}
@ -77,7 +80,7 @@ void Foam::actuationDiskSource::checkData() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::actuationDiskSource::actuationDiskSource
Foam::fv::actuationDiskSource::actuationDiskSource
(
const word& name,
const word& modelType,
@ -85,7 +88,7 @@ Foam::actuationDiskSource::actuationDiskSource
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
diskDir_(coeffs_.lookup("diskDir")),
Cp_(readScalar(coeffs_.lookup("Cp"))),
Ct_(readScalar(coeffs_.lookup("Ct"))),
@ -107,7 +110,7 @@ Foam::actuationDiskSource::actuationDiskSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::actuationDiskSource::addSup
void Foam::fv::actuationDiskSource::addSup
(
fvMatrix<vector>& eqn,
const label fieldI
@ -151,16 +154,16 @@ void Foam::actuationDiskSource::addSup
}
void Foam::actuationDiskSource::writeData(Ostream& os) const
void Foam::fv::actuationDiskSource::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
}
bool Foam::actuationDiskSource::read(const dictionary& dict)
bool Foam::fv::actuationDiskSource::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
coeffs_.readIfPresent("diskDir", diskDir_);
coeffs_.readIfPresent("Cp", Cp_);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::actuationDiskSource
Foam::fv::actuationDiskSource
Description
Actuation disk source
@ -61,12 +61,14 @@ SourceFiles
#ifndef actuationDiskSource_H
#define actuationDiskSource_H
#include "basicSource.H"
#include "fvOption.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class actuationDiskSource Declaration
@ -74,7 +76,7 @@ namespace Foam
class actuationDiskSource
:
public basicSource
public option
{
protected:
@ -195,6 +197,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,13 +26,11 @@ License
#include "actuationDiskSource.H"
#include "volFields.H"
#include "fvMatrix.H"
#include "fvm.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class RhoFieldType>
void Foam::actuationDiskSource::addActuationDiskAxialInertialResistance
void Foam::fv::actuationDiskSource::addActuationDiskAxialInertialResistance
(
vectorField& Usource,
const labelList& cells,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,23 +33,26 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(explicitPorositySource, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
explicitPorositySource,
dictionary
);
}
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::explicitPorositySource::initialise()
void Foam::fv::explicitPorositySource::initialise()
{
if (selectionMode_ != smCellZone)
{
FatalErrorIn("void Foam::explicitPorositySource::initialise()")
FatalErrorIn("void Foam::fv::explicitPorositySource::initialise()")
<< "The porosity region must be specified as a cellZone. Current "
<< "selection mode is " << selectionModeTypeNames_[selectionMode_]
<< exit(FatalError);
@ -73,7 +76,7 @@ void Foam::explicitPorositySource::initialise()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::explicitPorositySource::explicitPorositySource
Foam::fv::explicitPorositySource::explicitPorositySource
(
const word& name,
const word& modelType,
@ -81,7 +84,7 @@ Foam::explicitPorositySource::explicitPorositySource
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
porosityPtr_(NULL),
UName_(coeffs_.lookupOrDefault<word>("UName", "U")),
rhoName_(coeffs_.lookupOrDefault<word>("rhoName", "rho")),
@ -93,7 +96,7 @@ Foam::explicitPorositySource::explicitPorositySource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::explicitPorositySource::addSup
void Foam::fv::explicitPorositySource::addSup
(
fvMatrix<vector>& eqn,
const label fieldI
@ -118,16 +121,16 @@ void Foam::explicitPorositySource::addSup
}
void Foam::explicitPorositySource::writeData(Ostream& os) const
void Foam::fv::explicitPorositySource::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
}
bool Foam::explicitPorositySource::read(const dictionary& dict)
bool Foam::fv::explicitPorositySource::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
coeffs_.readIfPresent("UName", UName_);
coeffs_.readIfPresent("rhoName", rhoName_);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::explicitPorositySource
Foam::fv::explicitPorositySource
Description
Explicit porosity source
@ -57,7 +57,7 @@ SourceFiles
#ifndef explicitPorositySource_H
#define explicitPorositySource_H
#include "basicSource.H"
#include "fvOption.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,13 +66,17 @@ namespace Foam
class porosityModel;
namespace fv
{
/*---------------------------------------------------------------------------*\
Class explicitPorositySource Declaration
\*---------------------------------------------------------------------------*/
class explicitPorositySource
:
public basicSource
public option
{
protected:
@ -157,6 +161,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,27 +25,29 @@ License
#include "constantHeatTransfer.H"
#include "fvm.H"
#include "IObasicSourceList.H"
#include "addToRunTimeSelectionTable.H"
#include "fvcVolumeIntegrate.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(constantHeatTransfer, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
constantHeatTransfer,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::constantHeatTransfer::constantHeatTransfer
Foam::fv::constantHeatTransfer::constantHeatTransfer
(
const word& name,
const word& modelType,
@ -99,20 +101,20 @@ Foam::constantHeatTransfer::constantHeatTransfer
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::constantHeatTransfer::~constantHeatTransfer()
Foam::fv::constantHeatTransfer::~constantHeatTransfer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::tmp<Foam::volScalarField>Foam::constantHeatTransfer::
calculateHtc()
const Foam::tmp<Foam::volScalarField>
Foam::fv::constantHeatTransfer::calculateHtc()
{
return htc_;
}
void Foam::constantHeatTransfer::writeData(Ostream& os) const
void Foam::fv::constantHeatTransfer::writeData(Ostream& os) const
{
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
interRegionHeatTransferModel::writeData(os);
@ -125,9 +127,9 @@ void Foam::constantHeatTransfer::writeData(Ostream& os) const
}
bool Foam::constantHeatTransfer::read(const dictionary& dict)
bool Foam::fv::constantHeatTransfer::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
return true;
}
@ -138,4 +140,4 @@ bool Foam::constantHeatTransfer::read(const dictionary& dict)
}
// ************************************************************************* //
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::constantHeatTransfer
Foam::fv::constantHeatTransfer
Description
Constant heat transfer model. htCoeffs [W/m2/K] and area [m2] must be
@ -40,8 +40,11 @@ Description
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class constantHeatTransfer Declaration
Class constantHeatTransfer Declaration
\*---------------------------------------------------------------------------*/
class constantHeatTransfer
@ -94,17 +97,16 @@ public:
//- Read dictionary
virtual bool read(const dictionary& dict) ;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,32 +26,32 @@ License
#include "interRegionHeatTransferModel.H"
#include "fluidThermo.H"
#include "fvm.H"
#include "IObasicSourceList.H"
#include "zeroGradientFvPatchFields.H"
#include "fvcVolumeIntegrate.H"
#include "fvOptionList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(interRegionHeatTransferModel, 0);
};
}
}
// * * * * * * * * * * * * Private member functions * * * * * * * * * * * //
void Foam::interRegionHeatTransferModel::check()
void Foam::fv::interRegionHeatTransferModel::check()
{
const fvMesh& secondaryMesh =
mesh_.time().lookupObject<fvMesh>(mapRegionName_);
mesh_.time().lookupObject<fvMesh>(mapRegionName_);
const basicSourceList& IObsl =
secondaryMesh.lookupObject<basicSourceList>
(
"sourcesProperties"
);
const optionList& IObsl =
secondaryMesh.lookupObject<optionList>("sourcesProperties");
const PtrList<basicSource>& bsl = IObsl;
const PtrList<option>& bsl = IObsl;
bool secSourceFound(false);
@ -70,10 +70,8 @@ void Foam::interRegionHeatTransferModel::check()
if (!secSourceFound)
{
FatalErrorIn
(
"constantHeatTransfer::interRegionHeatTransferModel::check()"
) << "Secondary source name not found" << secondarySourceName_
FatalErrorIn("interRegionHeatTransferModel::check()")
<< "Secondary source name not found" << secondarySourceName_
<< " in region " << secondaryMesh.name()
<< nl
<< exit(FatalError);
@ -83,7 +81,7 @@ void Foam::interRegionHeatTransferModel::check()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::interRegionHeatTransferModel::interRegionHeatTransferModel
Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
(
const word& name,
const word& modelType,
@ -91,7 +89,7 @@ Foam::interRegionHeatTransferModel::interRegionHeatTransferModel
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
secIrht_(),
firstIter_(true),
htc_
@ -121,13 +119,13 @@ Foam::interRegionHeatTransferModel::interRegionHeatTransferModel
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::interRegionHeatTransferModel::~interRegionHeatTransferModel()
Foam::fv::interRegionHeatTransferModel::~interRegionHeatTransferModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::interRegionHeatTransferModel::addSup
void Foam::fv::interRegionHeatTransferModel::addSup
(
fvMatrix<scalar>& eEqn,
const label fieldI
@ -234,7 +232,7 @@ void Foam::interRegionHeatTransferModel::addSup
}
void Foam::interRegionHeatTransferModel::writeData(Ostream& os) const
void Foam::fv::interRegionHeatTransferModel::writeData(Ostream& os) const
{
os.writeKeyword("name") << this->name() << token::END_STATEMENT << nl;
os.writeKeyword("mapRegionName") << mapRegionName_
@ -254,9 +252,9 @@ void Foam::interRegionHeatTransferModel::writeData(Ostream& os) const
}
bool Foam::interRegionHeatTransferModel::read(const dictionary& dict)
bool Foam::fv::interRegionHeatTransferModel::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
return true;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::interRegionHeatTransferModel
Foam::fv::interRegionHeatTransferModel
Description
Base class for inter region heat exchange. The derived classes must
@ -33,7 +33,7 @@ Description
#ifndef interRegionHeatTransferModel_H
#define interRegionHeatTransferModel_H
#include "basicSource.H"
#include "fvOption.H"
#include "volFields.H"
@ -41,6 +41,8 @@ Description
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class interRegionHeatTransferModel Declaration
@ -48,7 +50,7 @@ namespace Foam
class interRegionHeatTransferModel
:
public basicSource
public option
{
private:
@ -129,9 +131,9 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,20 +31,23 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(tabulatedHeatTransfer, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
tabulatedHeatTransfer,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::tabulatedHeatTransfer::tabulatedHeatTransfer
Foam::fv::tabulatedHeatTransfer::tabulatedHeatTransfer
(
const word& name,
const word& modelType,
@ -86,15 +89,15 @@ Foam::tabulatedHeatTransfer::tabulatedHeatTransfer
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::tabulatedHeatTransfer::~tabulatedHeatTransfer()
Foam::fv::tabulatedHeatTransfer::~tabulatedHeatTransfer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::tmp<Foam::volScalarField>Foam::tabulatedHeatTransfer::
calculateHtc()
const Foam::tmp<Foam::volScalarField>
Foam::fv::tabulatedHeatTransfer::calculateHtc()
{
const fvMesh& secondaryMesh =
mesh_.time().lookupObject<fvMesh>(mapRegionName());
@ -126,7 +129,7 @@ calculateHtc()
}
void Foam::tabulatedHeatTransfer::writeData(Ostream& os) const
void Foam::fv::tabulatedHeatTransfer::writeData(Ostream& os) const
{
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
interRegionHeatTransferModel::writeData(os);
@ -139,9 +142,9 @@ void Foam::tabulatedHeatTransfer::writeData(Ostream& os) const
}
bool Foam::tabulatedHeatTransfer::read(const dictionary& dict)
bool Foam::fv::tabulatedHeatTransfer::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
return true;
}
@ -152,4 +155,4 @@ bool Foam::tabulatedHeatTransfer::read(const dictionary& dict)
}
// ************************************************************************* //
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::tabulatedHeatTransfer
Foam::fv::tabulatedHeatTransfer
Description
Tabulated heat transfer model. The heat exchange area must be
@ -42,6 +42,9 @@ Description
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class tabulatedHeatTransfer Declaration
\*---------------------------------------------------------------------------*/
@ -102,6 +105,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,27 +24,29 @@ License
\*---------------------------------------------------------------------------*/
#include "variableHeatTransfer.H"
#include "IObasicSourceList.H"
#include "turbulenceModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(variableHeatTransfer, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
variableHeatTransfer,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::variableHeatTransfer::variableHeatTransfer
Foam::fv::variableHeatTransfer::variableHeatTransfer
(
const word& name,
const word& modelType,
@ -88,17 +90,16 @@ Foam::variableHeatTransfer::variableHeatTransfer
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::variableHeatTransfer::~variableHeatTransfer()
Foam::fv::variableHeatTransfer::~variableHeatTransfer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::tmp<Foam::volScalarField> Foam::variableHeatTransfer::
calculateHtc()
const Foam::tmp<Foam::volScalarField>
Foam::fv::variableHeatTransfer::calculateHtc()
{
const fvMesh& secondaryMesh =
mesh_.time().lookupObject<fvMesh>(mapRegionName());
@ -140,7 +141,7 @@ calculateHtc()
}
void Foam::variableHeatTransfer::writeData(Ostream& os) const
void Foam::fv::variableHeatTransfer::writeData(Ostream& os) const
{
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
interRegionHeatTransferModel::writeData(os);
@ -159,9 +160,9 @@ void Foam::variableHeatTransfer::writeData(Ostream& os) const
}
bool Foam::variableHeatTransfer::read(const dictionary& dict)
bool Foam::fv::variableHeatTransfer::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
const dictionary& sourceDict = dict.subDict(name());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::variableHeatTransfer
Foam::fv::variableHeatTransfer
Description
Variable heat transfer model depending on local values. The area of contact
@ -30,13 +30,13 @@ Description
Nu = a*pow(Re, b)*pow(Pr, c)
and the heat transfer coefficient as:
and the heat transfer coefficient as:
htc = Nu*K/ds
where:
K is the heat conduction
ds is the strut diameter
where:
K is the heat conduction
ds is the strut diameter
\*---------------------------------------------------------------------------*/
@ -50,8 +50,11 @@ Description
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class variableHeatTransfer Declaration
Class variableHeatTransfer Declaration
\*---------------------------------------------------------------------------*/
class variableHeatTransfer
@ -80,7 +83,7 @@ private:
public:
//- Runtime type information
TypeName("variableHeatTransfer");
TypeName("variableHeatTransfer");
// Constructors
@ -112,17 +115,16 @@ public:
//- Read dictionary
virtual bool read(const dictionary& dict) ;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,21 +32,27 @@ License
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(pressureGradientExplicitSource, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
pressureGradientExplicitSource,
dictionary
);
}
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::pressureGradientExplicitSource::writeProps(const scalar gradP) const
void Foam::fv::pressureGradientExplicitSource::writeProps
(
const scalar gradP
) const
{
// Only write on output time
if (mesh_.time().outputTime())
@ -71,7 +77,7 @@ void Foam::pressureGradientExplicitSource::writeProps(const scalar gradP) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pressureGradientExplicitSource::pressureGradientExplicitSource
Foam::fv::pressureGradientExplicitSource::pressureGradientExplicitSource
(
const word& sourceName,
const word& modelType,
@ -79,7 +85,7 @@ Foam::pressureGradientExplicitSource::pressureGradientExplicitSource
const fvMesh& mesh
)
:
basicSource(sourceName, modelType, dict, mesh),
option(sourceName, modelType, dict, mesh),
Ubar_(coeffs_.lookup("Ubar")),
gradP0_(0.0),
dGradP_(0.0),
@ -92,7 +98,7 @@ Foam::pressureGradientExplicitSource::pressureGradientExplicitSource
{
FatalErrorIn
(
"Foam::pressureGradientExplicitSource::"
"Foam::fv::pressureGradientExplicitSource::"
"pressureGradientExplicitSource"
"("
"const word&, "
@ -125,7 +131,7 @@ Foam::pressureGradientExplicitSource::pressureGradientExplicitSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::pressureGradientExplicitSource::correct(volVectorField& U)
void Foam::fv::pressureGradientExplicitSource::correct(volVectorField& U)
{
const scalarField& rAU = invAPtr_().internalField();
@ -169,7 +175,7 @@ void Foam::pressureGradientExplicitSource::correct(volVectorField& U)
}
void Foam::pressureGradientExplicitSource::addSup
void Foam::fv::pressureGradientExplicitSource::addSup
(
fvMatrix<vector>& eqn,
const label fieldI
@ -197,7 +203,7 @@ void Foam::pressureGradientExplicitSource::addSup
}
void Foam::pressureGradientExplicitSource::setValue
void Foam::fv::pressureGradientExplicitSource::setValue
(
fvMatrix<vector>& eqn,
const label

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::pressureGradientExplicitSource
Foam::fv::pressureGradientExplicitSource
Description
Creates a pressure gradient source
@ -53,12 +53,14 @@ SourceFiles
#include "cellSet.H"
#include "fvMesh.H"
#include "volFields.H"
#include "basicSource.H"
#include "fvOption.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class pressureGradientExplicitSource Declaration
@ -66,7 +68,7 @@ namespace Foam
class pressureGradientExplicitSource
:
public basicSource
public option
{
// Private data
@ -149,6 +151,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,11 +27,11 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::pressureGradientExplicitSource::writeData(Ostream& os) const
void Foam::fv::pressureGradientExplicitSource::writeData(Ostream& os) const
{
notImplemented
(
"void Foam::pressureGradientExplicitSource::writeData"
"void Foam::fv::pressureGradientExplicitSource::writeData"
"("
"Ostream&"
") const"
@ -39,11 +39,11 @@ void Foam::pressureGradientExplicitSource::writeData(Ostream& os) const
}
bool Foam::pressureGradientExplicitSource::read(const dictionary& dict)
bool Foam::fv::pressureGradientExplicitSource::read(const dictionary& dict)
{
notImplemented
(
"bool Foam::pressureGradientExplicitSource::read"
"bool Foam::fv::pressureGradientExplicitSource::read"
"("
"const dictionary&"
") const"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,20 +31,22 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(radialActuationDiskSource, 0);
addToRunTimeSelectionTable
(
basicSource,
option,
radialActuationDiskSource,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::radialActuationDiskSource::radialActuationDiskSource
Foam::fv::radialActuationDiskSource::radialActuationDiskSource
(
const word& name,
const word& modelType,
@ -61,7 +63,7 @@ Foam::radialActuationDiskSource::radialActuationDiskSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::radialActuationDiskSource::addSup
void Foam::fv::radialActuationDiskSource::addSup
(
fvMatrix<vector>& eqn,
const label fieldI
@ -105,15 +107,15 @@ void Foam::radialActuationDiskSource::addSup
}
void Foam::radialActuationDiskSource::writeData(Ostream& os) const
void Foam::fv::radialActuationDiskSource::writeData(Ostream& os) const
{
actuationDiskSource::writeData(os);
}
bool Foam::radialActuationDiskSource::read(const dictionary& dict)
bool Foam::fv::radialActuationDiskSource::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
coeffs_.readIfPresent("diskDir", diskDir_);
coeffs_.readIfPresent("Cp", Cp_);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::radialActuationDiskSource
Foam::fv::radialActuationDiskSource
Description
Actuation disk zone definition.
@ -73,6 +73,8 @@ SourceFiles
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class radialActuationDiskSource Declaration
@ -131,24 +133,25 @@ public:
{}
// Public Functions
// Member Functions
//- Source term to fvMatrix<vector>
virtual void addSup(fvMatrix<vector>& eqn, const label fieldI);
//- Source term to fvMatrix<vector>
virtual void addSup(fvMatrix<vector>& eqn, const label fieldI);
// I-O
// I-O
//- Write data
virtual void writeData(Ostream&) const;
//- Write data
virtual void writeData(Ostream&) const;
//- Read dictionary
virtual bool read(const dictionary& dict);
//- Read dictionary
virtual bool read(const dictionary& dict);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,7 +33,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class RhoFieldType>
void Foam::radialActuationDiskSource::
void Foam::fv::radialActuationDiskSource::
addRadialActuationDiskAxialInertialResistance
(
vectorField& Usource,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -93,7 +93,7 @@ public:
// Selectors
//- Return a reference to the selected basicSource model
//- Return a reference to the selected fvOption model
static autoPtr<profileModel> New(const dictionary& dict);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,20 +37,23 @@ using namespace Foam::constant;
namespace Foam
{
defineTypeNameAndDebug(rotorDiskSource, 0);
addToRunTimeSelectionTable(basicSource, rotorDiskSource, dictionary);
namespace fv
{
defineTypeNameAndDebug(rotorDiskSource, 0);
addToRunTimeSelectionTable(option, rotorDiskSource, dictionary);
}
template<> const char* NamedEnum<rotorDiskSource::geometryModeType, 2>::
template<> const char* NamedEnum<fv::rotorDiskSource::geometryModeType, 2>::
names[] =
{
"auto",
"specified"
};
const NamedEnum<rotorDiskSource::geometryModeType, 2>
rotorDiskSource::geometryModeTypeNames_;
const NamedEnum<fv::rotorDiskSource::geometryModeType, 2>
fv::rotorDiskSource::geometryModeTypeNames_;
template<> const char* NamedEnum<rotorDiskSource::inletFlowType, 3>::
template<> const char* NamedEnum<fv::rotorDiskSource::inletFlowType, 3>::
names[] =
{
"fixed",
@ -58,14 +61,14 @@ namespace Foam
"local"
};
const NamedEnum<rotorDiskSource::inletFlowType, 3>
rotorDiskSource::inletFlowTypeNames_;
const NamedEnum<fv::rotorDiskSource::inletFlowType, 3>
fv::rotorDiskSource::inletFlowTypeNames_;
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::rotorDiskSource::checkData()
void Foam::fv::rotorDiskSource::checkData()
{
// set inflow type
switch (selectionMode())
@ -122,7 +125,7 @@ void Foam::rotorDiskSource::checkData()
}
void Foam::rotorDiskSource::setFaceArea(vector& axis, const bool correct)
void Foam::fv::rotorDiskSource::setFaceArea(vector& axis, const bool correct)
{
area_ = 0.0;
@ -235,7 +238,7 @@ void Foam::rotorDiskSource::setFaceArea(vector& axis, const bool correct)
}
void Foam::rotorDiskSource::createCoordinateSystem()
void Foam::fv::rotorDiskSource::createCoordinateSystem()
{
// construct the local rotor co-prdinate system
vector origin(vector::zero);
@ -348,7 +351,7 @@ void Foam::rotorDiskSource::createCoordinateSystem()
}
void Foam::rotorDiskSource::constructGeometry()
void Foam::fv::rotorDiskSource::constructGeometry()
{
const vectorField& C = mesh_.C();
@ -382,7 +385,7 @@ void Foam::rotorDiskSource::constructGeometry()
}
Foam::tmp<Foam::vectorField> Foam::rotorDiskSource::inflowVelocity
Foam::tmp<Foam::vectorField> Foam::fv::rotorDiskSource::inflowVelocity
(
const volVectorField& U
) const
@ -410,7 +413,7 @@ Foam::tmp<Foam::vectorField> Foam::rotorDiskSource::inflowVelocity
FatalErrorIn
(
"Foam::tmp<Foam::vectorField> "
"Foam::rotorDiskSource::inflowVelocity"
"Foam::fv::rotorDiskSource::inflowVelocity"
"(const volVectorField&) const"
) << "Unknown inlet flow specification" << abort(FatalError);
}
@ -422,7 +425,7 @@ Foam::tmp<Foam::vectorField> Foam::rotorDiskSource::inflowVelocity
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
Foam::rotorDiskSource::rotorDiskSource
Foam::fv::rotorDiskSource::rotorDiskSource
(
const word& name,
const word& modelType,
@ -431,7 +434,7 @@ Foam::rotorDiskSource::rotorDiskSource
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
rhoName_("none"),
rhoRef_(1.0),
omega_(0.0),
@ -456,13 +459,13 @@ Foam::rotorDiskSource::rotorDiskSource
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::rotorDiskSource::~rotorDiskSource()
Foam::fv::rotorDiskSource::~rotorDiskSource()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::rotorDiskSource::calculate
void Foam::fv::rotorDiskSource::calculate
(
const vectorField& U,
const scalarField& thetag,
@ -585,7 +588,11 @@ void Foam::rotorDiskSource::calculate
}
void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn, const label fieldI)
void Foam::fv::rotorDiskSource::addSup
(
fvMatrix<vector>& eqn,
const label fieldI
)
{
dimensionSet dims = dimless;
if (eqn.dimensions() == dimForce)
@ -632,16 +639,16 @@ void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn, const label fieldI)
}
void Foam::rotorDiskSource::writeData(Ostream& os) const
void Foam::fv::rotorDiskSource::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
}
bool Foam::rotorDiskSource::read(const dictionary& dict)
bool Foam::fv::rotorDiskSource::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
coeffs_.lookup("fieldNames") >> fieldNames_;
applied_.setSize(fieldNames_.size(), false);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::rotorDiskSource
Foam::fv::rotorDiskSource
Description
Cell based momemtum source
@ -87,7 +87,7 @@ SourceFiles
#ifndef rotorDiskSource_H
#define rotorDiskSource_H
#include "basicSource.H"
#include "fvOption.H"
#include "cylindricalCS.H"
#include "NamedEnum.H"
#include "bladeModel.H"
@ -103,13 +103,16 @@ namespace Foam
// Forward declaration of classes
class trimModel;
namespace fv
{
/*---------------------------------------------------------------------------*\
Class rotorDiskSource Declaration
\*---------------------------------------------------------------------------*/
class rotorDiskSource
:
public basicSource
public option
{
public:
@ -305,6 +308,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,37 +27,37 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::scalar Foam::rotorDiskSource::rhoRef() const
Foam::scalar Foam::fv::rotorDiskSource::rhoRef() const
{
return rhoRef_;
}
Foam::scalar Foam::rotorDiskSource::omega() const
Foam::scalar Foam::fv::rotorDiskSource::omega() const
{
return omega_;
}
const Foam::List<Foam::point>& Foam::rotorDiskSource::x() const
const Foam::List<Foam::point>& Foam::fv::rotorDiskSource::x() const
{
return x_;
}
const Foam::cylindricalCS& Foam::rotorDiskSource::coordSys() const
const Foam::cylindricalCS& Foam::fv::rotorDiskSource::coordSys() const
{
return coordSys_;
}
bool Foam::rotorDiskSource::compressible() const
bool Foam::fv::rotorDiskSource::compressible() const
{
return rhoName_ != "none";
}
Foam::tmp<Foam::volScalarField> Foam::rotorDiskSource::rho() const
Foam::tmp<Foam::volScalarField> Foam::fv::rotorDiskSource::rho() const
{
if (compressible())
{
@ -69,4 +69,5 @@ Foam::tmp<Foam::volScalarField> Foam::rotorDiskSource::rho() const
}
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,7 +29,7 @@ License
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::rotorDiskSource::writeField
void Foam::fv::rotorDiskSource::writeField
(
const word& name,
const List<Type>& values,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,7 +42,11 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fixedTrim::fixedTrim(const rotorDiskSource& rotor, const dictionary& dict)
Foam::fixedTrim::fixedTrim
(
const fv::rotorDiskSource& rotor,
const dictionary& dict
)
:
trimModel(rotor, dict, typeName),
thetag_(rotor.cells().size(), 0.0)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,7 +65,7 @@ public:
TypeName("fixedTrim");
//- Constructor
fixedTrim(const rotorDiskSource& rotor, const dictionary& dict);
fixedTrim(const fv::rotorDiskSource& rotor, const dictionary& dict);
//- Destructor
virtual ~fixedTrim();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -105,7 +105,7 @@ Foam::vector Foam::targetCoeffTrim::calcCoeffs
Foam::targetCoeffTrim::targetCoeffTrim
(
const rotorDiskSource& rotor,
const fv::rotorDiskSource& rotor,
const dictionary& dict
)
:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -139,7 +139,7 @@ public:
TypeName("targetCoeffTrim");
//- Constructor
targetCoeffTrim(const rotorDiskSource& rotor, const dictionary& dict);
targetCoeffTrim(const fv::rotorDiskSource& rotor, const dictionary& dict);
//- Destructor
virtual ~targetCoeffTrim();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,7 +38,7 @@ namespace Foam
Foam::trimModel::trimModel
(
const rotorDiskSource& rotor,
const fv::rotorDiskSource& rotor,
const dictionary& dict,
const word& name
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,7 +56,7 @@ protected:
// Protected data
//- Reference to the rotor source model
const rotorDiskSource& rotor_;
const fv::rotorDiskSource& rotor_;
//- Name of model
const word name_;
@ -79,7 +79,7 @@ public:
trimModel,
dictionary,
(
const rotorDiskSource& rotor,
const fv::rotorDiskSource& rotor,
const dictionary& dict
),
(rotor, dict)
@ -91,7 +91,7 @@ public:
//- Construct from components
trimModel
(
const rotorDiskSource& rotor,
const fv::rotorDiskSource& rotor,
const dictionary& dict,
const word& name
);
@ -102,7 +102,7 @@ public:
//- Return a reference to the selected trim model
static autoPtr<trimModel> New
(
const rotorDiskSource& rotor,
const fv::rotorDiskSource& rotor,
const dictionary& dict
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,7 +29,7 @@ License
Foam::autoPtr<Foam::trimModel> Foam::trimModel::New
(
const rotorDiskSource& rotor,
const fv::rotorDiskSource& rotor,
const dictionary& dict
)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,13 +29,10 @@ License
#include "dynamicCode.H"
#include "dynamicCodeContext.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::CodedSource<Type>::prepare
void Foam::fv::CodedSource<Type>::prepare
(
dynamicCode& dynCode,
const dynamicCodeContext& context
@ -54,10 +51,10 @@ void Foam::CodedSource<Type>::prepare
dynCode.setFilterVariable("codeSetValue", codeSetValue_);
// compile filtered C template
dynCode.addCompileFile("codedBasicSourceTemplate.C");
dynCode.addCompileFile("codedFvOptionTemplate.C");
// copy filtered H template
dynCode.addCopyFile("codedBasicSourceTemplate.H");
dynCode.addCopyFile("codedFvOptionTemplate.H");
// debugging: make BC verbose
// dynCode.setFilterVariable("verbose", "true");
@ -84,28 +81,28 @@ void Foam::CodedSource<Type>::prepare
template<class Type>
Foam::dlLibraryTable& Foam::CodedSource<Type>::libs() const
Foam::dlLibraryTable& Foam::fv::CodedSource<Type>::libs() const
{
return const_cast<Time&>(mesh_.time()).libs();
}
template<class Type>
Foam::string Foam::CodedSource<Type>::description() const
Foam::string Foam::fv::CodedSource<Type>::description() const
{
return "basicSource " + name_;
return "fvOption:: " + name_;
}
template<class Type>
void Foam::CodedSource<Type>::clearRedirect() const
void Foam::fv::CodedSource<Type>::clearRedirect() const
{
redirectBasicSourcePtr_.clear();
redirectFvOptionPtr_.clear();
}
template<class Type>
const Foam::dictionary& Foam::CodedSource<Type>::codeDict() const
const Foam::dictionary& Foam::fv::CodedSource<Type>::codeDict() const
{
return coeffs_;
}
@ -114,7 +111,7 @@ const Foam::dictionary& Foam::CodedSource<Type>::codeDict() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::CodedSource<Type>::CodedSource
Foam::fv::CodedSource<Type>::CodedSource
(
const word& name,
const word& modelType,
@ -122,7 +119,7 @@ Foam::CodedSource<Type>::CodedSource
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh)
option(name, modelType, dict, mesh)
{
read(dict);
}
@ -131,27 +128,26 @@ Foam::CodedSource<Type>::CodedSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::basicSource& Foam::CodedSource<Type>::redirectBasicSource()
const
Foam::fv::option& Foam::fv::CodedSource<Type>::redirectFvOption() const
{
if (!redirectBasicSourcePtr_.valid())
if (!redirectFvOptionPtr_.valid())
{
dictionary constructDict(dict_);
constructDict.set("type", redirectType_);
redirectBasicSourcePtr_ = basicSource::New
redirectFvOptionPtr_ = option::New
(
redirectType_,
constructDict,
mesh_
);
}
return redirectBasicSourcePtr_();
return redirectFvOptionPtr_();
}
template<class Type>
void Foam::CodedSource<Type>::correct
void Foam::fv::CodedSource<Type>::correct
(
GeometricField<Type, fvPatchField, volMesh>& fld
)
@ -163,12 +159,12 @@ void Foam::CodedSource<Type>::correct
}
updateLibrary(redirectType_);
redirectBasicSource().correct(fld);
redirectFvOption().correct(fld);
}
template<class Type>
void Foam::CodedSource<Type>::addSup
void Foam::fv::CodedSource<Type>::addSup
(
fvMatrix<Type>& eqn,
const label fieldI
@ -181,12 +177,12 @@ void Foam::CodedSource<Type>::addSup
}
updateLibrary(redirectType_);
redirectBasicSource().addSup(eqn, fieldI);
redirectFvOption().addSup(eqn, fieldI);
}
template<class Type>
void Foam::CodedSource<Type>::setValue
void Foam::fv::CodedSource<Type>::setValue
(
fvMatrix<Type>& eqn,
const label fieldI
@ -199,7 +195,7 @@ void Foam::CodedSource<Type>::setValue
}
updateLibrary(redirectType_);
redirectBasicSource().setValue(eqn, fieldI);
redirectFvOption().setValue(eqn, fieldI);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,10 +22,10 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::codedSource
Foam::fv::codedSource
Description
Constructs on-the-fly a new basicSource.
Constructs on-the-fly a new fvOption.
E.g. in constant/sourcesProperties
@ -80,22 +80,24 @@ SourceFiles
#ifndef CodedSource_H
#define CodedSource_H
#include "basicSource.H"
#include "fvOption.H"
#include "codedBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class codedSource Declaration
Class codedSource Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class CodedSource
:
public basicSource,
public option,
public codedBase
{
@ -110,7 +112,7 @@ protected:
string codeSetValue_;
//- Underlying functionObject
mutable autoPtr<basicSource> redirectBasicSourcePtr_;
mutable autoPtr<option> redirectFvOptionPtr_;
// Protected Member Functions
@ -119,7 +121,7 @@ protected:
virtual dlLibraryTable& libs() const;
//- adapt the context for the current object
virtual void prepare(dynamicCode &,const dynamicCodeContext&) const;
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
// Return a description (type + name) for the output
virtual string description() const;
@ -151,8 +153,8 @@ public:
// Member Functions
//- Dynamically compiled basicSource
basicSource& redirectBasicSource() const;
//- Dynamically compiled fvOption
option& redirectFvOption() const;
// Evaluation
@ -189,6 +191,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,7 +29,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::CodedSource<Type>::writeData(Ostream& os) const
void Foam::fv::CodedSource<Type>::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
@ -37,9 +37,9 @@ void Foam::CodedSource<Type>::writeData(Ostream& os) const
template<class Type>
bool Foam::CodedSource<Type>::read(const dictionary& dict)
bool Foam::fv::CodedSource<Type>::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
coeffs_.lookup("fieldNames") >> fieldNames_;
applied_.setSize(fieldNames_.size(), false);

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,8 +32,7 @@ License
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
template<class Type>
const Foam::wordList Foam::SemiImplicitSource<Type>::
volumeModeTypeNames_
const Foam::wordList Foam::fv::SemiImplicitSource<Type>::volumeModeTypeNames_
(
IStringStream("(absolute specific)")()
);
@ -42,8 +41,8 @@ volumeModeTypeNames_
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type>
typename Foam::SemiImplicitSource<Type>::volumeModeType
Foam::SemiImplicitSource<Type>::wordToVolumeModeType
typename Foam::fv::SemiImplicitSource<Type>::volumeModeType
Foam::fv::SemiImplicitSource<Type>::wordToVolumeModeType
(
const word& vmtName
) const
@ -69,7 +68,7 @@ Foam::SemiImplicitSource<Type>::wordToVolumeModeType
template<class Type>
Foam::word Foam::SemiImplicitSource<Type>::volumeModeTypeToWord
Foam::word Foam::fv::SemiImplicitSource<Type>::volumeModeTypeToWord
(
const volumeModeType& vmtType
) const
@ -86,7 +85,7 @@ Foam::word Foam::SemiImplicitSource<Type>::volumeModeTypeToWord
template<class Type>
void Foam::SemiImplicitSource<Type>::setFieldData(const dictionary& dict)
void Foam::fv::SemiImplicitSource<Type>::setFieldData(const dictionary& dict)
{
fieldNames_.setSize(dict.toc().size());
injectionRate_.setSize(fieldNames_.size());
@ -112,7 +111,7 @@ void Foam::SemiImplicitSource<Type>::setFieldData(const dictionary& dict)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::SemiImplicitSource<Type>::SemiImplicitSource
Foam::fv::SemiImplicitSource<Type>::SemiImplicitSource
(
const word& name,
const word& modelType,
@ -120,7 +119,7 @@ Foam::SemiImplicitSource<Type>::SemiImplicitSource
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh),
option(name, modelType, dict, mesh),
volumeMode_(vmAbsolute),
VDash_(1.0),
injectionRate_()
@ -132,7 +131,7 @@ Foam::SemiImplicitSource<Type>::SemiImplicitSource
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::SemiImplicitSource<Type>::addSup
void Foam::fv::SemiImplicitSource<Type>::addSup
(
fvMatrix<Type>& eqn,
const label fieldI

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::SemiImplicitSource
Foam::fv::SemiImplicitSource
Description
Semi-implicit source, described using an input dictionary. The injection
@ -58,7 +58,7 @@ Description
- specific: values are given as \<quantity\>/m3
SeeAlso
Foam::basicSource
Foam::fvOption
SourceFiles
SemiImplicitSource.C
@ -69,16 +69,17 @@ SourceFiles
#define SemiImplicitSource_H
#include "Tuple2.H"
#include "basicSource.H"
#include "fvOption.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
// Forward declaration of classes
class fvMesh;
template<class Type>
class SemiImplicitSource;
@ -99,7 +100,7 @@ Ostream& operator<<
template<class Type>
class SemiImplicitSource
:
public basicSource
public option
{
public:
@ -198,6 +199,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,8 +28,8 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
inline const typename Foam::SemiImplicitSource<Type>::volumeModeType&
Foam::SemiImplicitSource<Type>::volumeMode() const
inline const typename Foam::fv::SemiImplicitSource<Type>::volumeModeType&
Foam::fv::SemiImplicitSource<Type>::volumeMode() const
{
return volumeMode_;
}
@ -37,15 +37,15 @@ Foam::SemiImplicitSource<Type>::volumeMode() const
template<class Type>
inline const Foam::List<Foam::Tuple2<Type, Foam::scalar> >&
Foam::SemiImplicitSource<Type>::injectionRate() const
Foam::fv::SemiImplicitSource<Type>::injectionRate() const
{
return injectionRate_;
}
template<class Type>
inline typename Foam::SemiImplicitSource<Type>::volumeModeType&
Foam::SemiImplicitSource<Type>::volumeMode()
inline typename Foam::fv::SemiImplicitSource<Type>::volumeModeType&
Foam::fv::SemiImplicitSource<Type>::volumeMode()
{
return volumeMode_;
}
@ -53,7 +53,7 @@ Foam::SemiImplicitSource<Type>::volumeMode()
template<class Type>
inline Foam::List<Foam::Tuple2<Type,
Foam::scalar> >& Foam::SemiImplicitSource<Type>::injectionRate()
Foam::scalar> >& Foam::fv::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-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::SemiImplicitSource<Type>::writeData(Ostream& os) const
void Foam::fv::SemiImplicitSource<Type>::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
@ -36,9 +36,9 @@ void Foam::SemiImplicitSource<Type>::writeData(Ostream& os) const
template<class Type>
bool Foam::SemiImplicitSource<Type>::read(const dictionary& dict)
bool Foam::fv::SemiImplicitSource<Type>::read(const dictionary& dict)
{
if (basicSource::read(dict))
if (option::read(dict))
{
volumeMode_ = wordToVolumeModeType(coeffs_.lookup("volumeMode"));
setFieldData(coeffs_.subDict("injectionRateSuSp"));

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -496,6 +496,9 @@ template<class CloudType>
void Foam::ThermoCloud<CloudType>::info()
{
CloudType::info();
Info<< " Temperature min/max = " << Tmin() << ", " << Tmax()
<< endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -308,6 +308,15 @@ public:
inline tmp<volScalarField> sigmap() const;
// Check
//- Maximum temperature
inline scalar Tmax() const;
//- Minimum temperature
inline scalar Tmin() const;
// Cloud evolution functions
//- Set parcel thermo properties

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -379,4 +379,36 @@ Foam::ThermoCloud<CloudType>::sigmap() const
}
template<class CloudType>
inline Foam::scalar Foam::ThermoCloud<CloudType>::Tmax() const
{
scalar T = -GREAT;
forAllConstIter(typename ThermoCloud<CloudType>, *this, iter)
{
const parcelType& p = iter();
T = max(T, p.T());
}
reduce(T, maxOp<scalar>());
return max(0.0, T);
}
template<class CloudType>
inline Foam::scalar Foam::ThermoCloud<CloudType>::Tmin() const
{
scalar T = GREAT;
forAllConstIter(typename ThermoCloud<CloudType>, *this, iter)
{
const parcelType& p = iter();
T = min(T, p.T());
}
reduce(T, minOp<scalar>());
return max(0.0, T);
}
// ************************************************************************* //

View File

@ -1,6 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fieldSources/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/dsmc/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
@ -14,7 +14,7 @@ EXE_INC = \
LIB_LIBS = \
-lfiniteVolume \
-lfieldSources \
-lfvOptions \
-lmeshTools \
-lsampling \
-llagrangian \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -151,7 +151,7 @@ Foam::scalarTransport::scalarTransport
resetOnStartUp_(false),
nCorr_(0),
autoSchemes_(false),
sources_(mesh_),
fvOptions_(mesh_),
T_
(
IOobject
@ -205,7 +205,7 @@ void Foam::scalarTransport::read(const dictionary& dict)
dict.lookup("autoSchemes") >> autoSchemes_;
sources_.reset(dict.subDict("sources"));
fvOptions_.reset(dict.subDict("fvOptions"));
}
}
@ -246,12 +246,12 @@ void Foam::scalarTransport::execute()
+ fvm::div(phi, T_, divScheme)
- fvm::laplacian(DT, T_, laplacianScheme)
==
sources_(T_)
fvOptions_(T_)
);
TEqn.relax(relaxCoeff);
sources_.constrain(TEqn);
fvOptions_.constrain(TEqn);
TEqn.solve(mesh_.solverDict(UName_));
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,7 +55,7 @@ SeeAlso
#include "surfaceFieldsFwd.H"
#include "pointFieldFwd.H"
#include "fvMatricesFwd.H"
#include "basicSourceList.H"
#include "fvOptionList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -105,8 +105,8 @@ class scalarTransport
//- Flag to employ schemes for velocity for scalar transport
bool autoSchemes_;
//- Run-time selectable sources
basicSourceList sources_;
//- Run-time selectable finite volume options, e.g. sources, constraints
fv::optionList fvOptions_;
//- The scalar field
volScalarField T_;