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

This commit is contained in:
mattijs
2011-07-11 11:06:39 +01:00
62 changed files with 340 additions and 208 deletions

View File

@ -34,6 +34,7 @@ Description
#include "nearWallDist.H"
#include "wallFvPatch.H"
#include "Switch.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,6 +48,9 @@ int main(int argc, char *argv[])
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
@ -54,16 +58,23 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (runTime.run())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readBubbleFoamControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
}
#include "alphaEqn.H"
#include "liftDragCoeffs.H"
#include "UEqns.H"
@ -73,7 +84,7 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
if (correctAlpha)
if (correctAlpha && !pimple.finalIter())
{
#include "alphaEqn.H"
}

View File

@ -26,7 +26,7 @@ Application
Description
Solver for a system of 2 incompressible fluid phases with one phase
dispersed, e.g. gas bubbles in a liquid.
dispersed, e.g. gas bubbles in a liquid or solid particles in a gas.
\*---------------------------------------------------------------------------*/
@ -78,10 +78,13 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
}
#include "alphaEqn.H"
#include "liftDragCoeffs.H"
#include "UEqns.H"
// --- PISO loop

View File

@ -104,7 +104,7 @@ int main(int argc, char *argv[])
label patchI = pp.index();
finalAgglom[patchI].setSize(pp.size(), 0);
if (pp.size() > 0 && !pp.coupled())
if (!pp.coupled())
{
if (agglomDict.found(pp.name()))
{

View File

@ -2,8 +2,7 @@
// Pre-size by assuming a certain percentage is visible.
// Maximum lenght for dynamicList
const label maxDynListLenght = 10000;
//label lenghtCount = 0;
const label maxDynListLength = 10000;
for (label procI = 0; procI < Pstream::nProcs(); procI++)
{
@ -22,69 +21,51 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
const pointField& remoteArea = remoteCoarseSf[procI];
const pointField& remoteFc = remoteCoarseCf[procI];
if (myFc.size()*remoteFc.size() > 0)
label i = 0;
label j = 0;
do
{
forAll(myFc, i)
for (; i < myFc.size(); i++)
{
const point& fc = myFc[i];
const vector& fA = myArea[i];
forAll(remoteFc, j)
for (; j < remoteFc.size(); j++)//
{
if (procI != Pstream::myProcNo() || i != j)
{
const point& remFc = remoteFc[j];
const vector& remA = remoteArea[j];
const vector& d = remFc-fc;
const vector& d = remFc - fc;
if (((d & fA) < 0.) && ((d & remA) > 0))
{
//lenghtCount ++;
start.append(fc + 0.0001*d);
startIndex.append(i);
end.append(fc + 0.9999*d);
label globalI = globalNumbering.toGlobal(procI, j);
endIndex.append(globalI);
if (startIndex.size() > maxDynListLenght)
if (startIndex.size() > maxDynListLength)
{
List<pointIndexHit> hitInfo(startIndex.size());
surfacesMesh.findLine
(
start,
end,
hitInfo
);
surfacesMesh.findLine(start, end, hitInfo);
forAll (hitInfo, rayI)
{
if (!hitInfo[rayI].hit())
{
rayStartFace.append(startIndex[rayI]);
rayEndFace.append(endIndex[rayI]);
}
}
//lenghtCount = 0;
start.clear();
startIndex.clear();
end.clear();
endIndex.clear();
break;
}
}
}
}
if (startIndex.size() > maxDynListLength)
{
break;
}
if (j == remoteFc.size())
{
j = 0;
}
}
}
if (!start.empty())
{
List<pointIndexHit> hitInfo(startIndex.size());
surfacesMesh.findLine
(
start,
end,
hitInfo
);
surfacesMesh.findLine(start, end, hitInfo);
forAll (hitInfo, rayI)
{
if (!hitInfo[rayI].hit())
@ -93,5 +74,12 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
rayEndFace.append(endIndex[rayI]);
}
}
}
start.clear();
startIndex.clear();
end.clear();
endIndex.clear();
}while (returnReduce(i < myFc.size(), orOp<bool>()));
}

View File

@ -117,6 +117,24 @@ do
done
#
# check that reader module has been built
#
if [ ! -f $PV_PLUGIN_PATH/libPV3FoamReader_SM.so ]
then
cat<< BUILDREADER
FATAL ERROR: ParaView reader module libraries do not exist
Please build the reader module before continuing:
cd \$FOAM_UTILITIES/postProcessing/graphics/PV3Readers
./Allwclean
./Allwmake
BUILDREADER
exit 1
fi
#
# check for --data=... argument
#

View File

@ -236,8 +236,8 @@ case ThirdParty:
# using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
set clang_version=llvm-2.9
#set clang_version=llvm-svn
#set clang_version=llvm-2.9
set clang_version=llvm-svn
breaksw
default:
echo

View File

@ -253,8 +253,8 @@ OpenFOAM | ThirdParty)
# using clang - not gcc
export WM_CC='clang'
export WM_CXX='clang++'
clang_version=llvm-2.9
#clang_version=llvm-svn
#clang_version=llvm-2.9
clang_version=llvm-svn
;;
*)
echo

View File

@ -264,7 +264,12 @@ bool Foam::chDir(const fileName& dir)
}
Foam::fileNameList Foam::findEtcFiles(const fileName& name, bool mandatory)
Foam::fileNameList Foam::findEtcFiles
(
const fileName& name,
bool mandatory,
bool findFirst
)
{
fileNameList results;
@ -279,12 +284,20 @@ Foam::fileNameList Foam::findEtcFiles(const fileName& name, bool mandatory)
if (isFile(fullName))
{
results.append(fullName);
if (findFirst)
{
return results;
}
}
fullName = searchDir/name;
if (isFile(fullName))
{
results.append(fullName);
if (findFirst)
{
return results;
}
}
}
@ -301,12 +314,20 @@ Foam::fileNameList Foam::findEtcFiles(const fileName& name, bool mandatory)
if (isFile(fullName))
{
results.append(fullName);
if (findFirst)
{
return results;
}
}
fullName = searchDir/name;
if (isFile(fullName))
{
results.append(fullName);
if (findFirst)
{
return results;
}
}
}
}
@ -323,12 +344,20 @@ Foam::fileNameList Foam::findEtcFiles(const fileName& name, bool mandatory)
if (isFile(fullName))
{
results.append(fullName);
if (findFirst)
{
return results;
}
}
fullName = searchDir/"site"/name;
if (isFile(fullName))
{
results.append(fullName);
if (findFirst)
{
return results;
}
}
}
}
@ -343,6 +372,10 @@ Foam::fileNameList Foam::findEtcFiles(const fileName& name, bool mandatory)
if (isFile(fullName))
{
results.append(fullName);
if (findFirst)
{
return results;
}
}
}
@ -367,7 +400,7 @@ Foam::fileNameList Foam::findEtcFiles(const fileName& name, bool mandatory)
Foam::fileName Foam::findEtcFile(const fileName& name, bool mandatory)
{
fileNameList results(findEtcFiles(name, mandatory));
fileNameList results(findEtcFiles(name, mandatory, true));
if (results.size())
{

View File

@ -119,7 +119,6 @@ public: \
defineTypeNameWithName(Type, Name)
//- Define the typeName as \a Name for template sub-classes
# define defineTemplate2TypeNameWithName(Type, Name) \
template<> \
template<> \
defineTypeNameWithName(Type, Name)
#endif
@ -161,7 +160,6 @@ public: \
defineDebugSwitchWithName(Type, Name, DebugSwitch)
//- Define the debug information for templates sub-classes, lookup as \a Name
# define defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) \
template<> \
template<> \
defineDebugSwitchWithName(Type, Name, DebugSwitch)
#endif

View File

@ -110,13 +110,19 @@ bool chDir(const fileName& dir);
//
// \return The list of full paths of all the matching files or
// an empty list if the name cannot be found.
// Optionally abort if the file cannot be found
fileNameList findEtcFiles(const fileName&, bool mandatory=false);
// Optionally abort if the file cannot be found.
// Optionally stop search after the first file has been found.
fileNameList findEtcFiles
(
const fileName&,
bool mandatory=false,
bool findFirst=false
);
//- Search for a file using findEtcFiles.
// \return The full path name of the first file found which in the
// \return The full path name of the first file found in the
// search hierarchy or an empty fileName if the name cannot be found.
// Optionally abort if the file cannot be found
// Optionally abort if the file cannot be found.
fileName findEtcFile(const fileName&, bool mandatory=false);
//- Make a directory and return an error if it could not be created

View File

@ -33,9 +33,9 @@ License
namespace Foam
{
template<>
const char* Foam::NamedEnum
const char* NamedEnum
<
Foam::fanPressureFvPatchScalarField::fanFlowDirection,
fanPressureFvPatchScalarField::fanFlowDirection,
2
>::names[] =
{

View File

@ -25,6 +25,7 @@ License
#include "pairPatchAgglomeration.H"
#include "meshTools.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -53,7 +54,7 @@ void Foam::pairPatchAgglomeration::setBasedEdgeWeights()
const bPatch& coarsePatch = patchLevels_[0];
forAll(coarsePatch.edges(), i)
{
if(coarsePatch.isInternalEdge(i))
if (coarsePatch.isInternalEdge(i))
{
scalar edgeLength =
coarsePatch.edges()[i].mag(coarsePatch.localPoints());
@ -63,12 +64,12 @@ void Foam::pairPatchAgglomeration::setBasedEdgeWeights()
if (eFaces.size() == 2)
{
scalar cosI =
coarsePatch.faceNormals()[eFaces[0]] &
coarsePatch.faceNormals()[eFaces[1]];
coarsePatch.faceNormals()[eFaces[0]]
& coarsePatch.faceNormals()[eFaces[1]];
const edge edgeCommon = edge(eFaces[0], eFaces[1]);
if(facePairWeight_.found(edgeCommon))
if (facePairWeight_.found(edgeCommon))
{
facePairWeight_[edgeCommon] += edgeLength;
}
@ -77,14 +78,7 @@ void Foam::pairPatchAgglomeration::setBasedEdgeWeights()
facePairWeight_.insert(edgeCommon, edgeLength);
}
if
(
cosI <
Foam::cos
(
featureAngle_*constant::mathematical::pi/180.0
)
)
if (cosI < Foam::cos(degToRad(featureAngle_)))
{
facePairWeight_[edgeCommon] = -1.0;
}
@ -109,11 +103,8 @@ void Foam::pairPatchAgglomeration::setEdgeWeights
const bPatch& coarsePatch = patchLevels_[fineLevelIndex];
const labelList& fineToCoarse = restrictAddressing_[fineLevelIndex];
const label nCoarseI = max(fineToCoarse)+1;
labelListList coarseToFine
(
invertOneToMany(nCoarseI, fineToCoarse)
);
const label nCoarseI = max(fineToCoarse) + 1;
labelListList coarseToFine(invertOneToMany(nCoarseI, fineToCoarse));
HashSet<edge, Hash<edge> > fineFeaturedFaces(coarsePatch.nEdges()/10);
@ -138,7 +129,7 @@ void Foam::pairPatchAgglomeration::setEdgeWeights
forAll(coarsePatch.edges(), i)
{
if(coarsePatch.isInternalEdge(i))
if (coarsePatch.isInternalEdge(i))
{
scalar edgeLength =
coarsePatch.edges()[i].mag(coarsePatch.localPoints());
@ -148,7 +139,7 @@ void Foam::pairPatchAgglomeration::setEdgeWeights
if (eFaces.size() == 2)
{
const edge edgeCommon = edge(eFaces[0], eFaces[1]);
if(facePairWeight_.found(edgeCommon))
if (facePairWeight_.found(edgeCommon))
{
facePairWeight_[edgeCommon] += edgeLength;
}
@ -220,11 +211,13 @@ Foam::pairPatchAgglomeration::pairPatchAgglomeration
setBasedEdgeWeights();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pairPatchAgglomeration::~pairPatchAgglomeration()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::bPatch& Foam::pairPatchAgglomeration::patchLevel
@ -259,8 +252,15 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
{
if (min(fineToCoarse) == -1)
{
FatalErrorIn("pairPatchAgglomeration::agglomeratePatch")
<< "min(fineToCoarse) == -1" << exit(FatalError);
FatalErrorIn
(
"pairPatchAgglomeration::agglomeratePatch"
"("
"const bPatch&, "
"const labelList&, "
"const label"
")"
) << "min(fineToCoarse) == -1" << exit(FatalError);
}
if (fineToCoarse.size() != patch.size())
@ -268,7 +268,11 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
FatalErrorIn
(
"pairPatchAgglomeration::agglomeratePatch"
"(const label fineLevelIndex)"
"("
"const bPatch&, "
"const labelList&, "
"const label"
")"
) << "restrict map does not correspond to fine level. " << endl
<< " Sizes: restrictMap: " << fineToCoarse.size()
<< " nEqns: " << patch.size()
@ -279,10 +283,7 @@ bool Foam::pairPatchAgglomeration::agglomeratePatch
List<face> patchFaces(nCoarseI);
// Patch faces per agglomeration
labelListList coarseToFine
(
invertOneToMany(nCoarseI, fineToCoarse)
);
labelListList coarseToFine(invertOneToMany(nCoarseI, fineToCoarse));
for (label coarseI = 0; coarseI < nCoarseI; coarseI++)
{
@ -351,7 +352,7 @@ void Foam::pairPatchAgglomeration:: agglomerate()
tmp<labelField> finalAgglomPtr(new labelField(patch.size()));
bool agglomOK = false;
while (!agglomOK)
while (!agglomOK && patch.size())
{
finalAgglomPtr = agglomerateOneLevel
(
@ -371,7 +372,7 @@ void Foam::pairPatchAgglomeration:: agglomerate()
restrictAddressing_.set(nCreatedLevels, finalAgglomPtr);
mapBaseToTopAgglom(nCreatedLevels);
if(!continueAgglomerating(nCoarseCells))
if (!continueAgglomerating(nCoarseCells))
{
break;
}
@ -407,7 +408,7 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
nCoarseCells = 0;
forAll (faceFaces, facei)
forAll(faceFaces, facei)
{
const labelList& fFaces = faceFaces[facei];
@ -425,8 +426,8 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
if
(
facePairWeight_[edgeCommon] > maxFaceWeight
&& coarseCellMap[faceNeig] < 0
&& facePairWeight_[edgeCommon] != -1.0
&& coarseCellMap[faceNeig] < 0
&& facePairWeight_[edgeCommon] != -1.0
)
{
// Match found. Pick up all the necessary data
@ -472,7 +473,8 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
coarseCellMap[facei] = coarseCellMap[clusterMatchFaceNo];
}
else
{// if not create single-cell "clusters" for each
{
// if not create single-cell "clusters" for each
coarseCellMap[facei] = nCoarseCells;
nCoarseCells ++;
}
@ -499,6 +501,7 @@ Foam::tmp<Foam::labelField> Foam::pairPatchAgglomeration::agglomerateOneLevel
return tcoarseCellMap;
}
void Foam::pairPatchAgglomeration::combineLevels(const label curLevel)
{
label prevLevel = curLevel - 1;
@ -522,4 +525,6 @@ void Foam::pairPatchAgglomeration::combineLevels(const label curLevel)
patchLevels_.set(prevLevel, patchLevels_.set(curLevel, NULL));
}
// ************************************************************************* //

View File

@ -148,13 +148,13 @@ public:
// Destructor
~pairPatchAgglomeration();
~pairPatchAgglomeration();
// Member Functions
//- Agglomerate patch
void agglomerate();
void agglomerate();
// Access
@ -200,7 +200,6 @@ public:
const Field<Type>& cf,
const label coarseLevelIndex
) const;
};

View File

@ -609,6 +609,8 @@ void Foam::KinematicCloud<CloudType>::preEvolve()
pAmbient_ = constProps_.dict().template
lookupOrDefault<scalar>("pAmbient", pAmbient_);
functions_.preEvolve();
}

View File

@ -74,6 +74,13 @@ Foam::CloudFunctionObject<CloudType>::~CloudFunctionObject()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::preEvolve()
{
// do nothing
}
template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::postEvolve()
{

View File

@ -123,6 +123,9 @@ public:
// Evaluation
//- Pre-evolve hook
virtual void preEvolve();
//- Post-evolve hook
virtual void postEvolve();

View File

@ -107,6 +107,16 @@ Foam::CloudFunctionObjectList<CloudType>::~CloudFunctionObjectList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::CloudFunctionObjectList<CloudType>::preEvolve()
{
forAll(*this, i)
{
this->operator[](i).preEvolve();
}
}
template<class CloudType>
void Foam::CloudFunctionObjectList<CloudType>::postEvolve()
{

View File

@ -103,6 +103,9 @@ public:
// Evaluation
//- Pre-evolve hook
virtual void preEvolve();
//- Post-evolve hook
virtual void postEvolve();

View File

@ -95,6 +95,19 @@ Foam::ParticleTracks<CloudType>::~ParticleTracks()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::ParticleTracks<CloudType>::preEvolve()
{
if (!cloudPtr_.valid())
{
cloudPtr_.reset
(
this->owner().cloneBare(this->owner().name() + "Tracks").ptr()
);
}
}
template<class CloudType>
void Foam::ParticleTracks<CloudType>::postPatch(const parcelType&, const label)
{}
@ -111,10 +124,10 @@ void Foam::ParticleTracks<CloudType>::postFace(const parcelType& p)
{
if (!cloudPtr_.valid())
{
cloudPtr_.reset
FatalErrorIn
(
this->owner().cloneBare(this->owner().name() + "Tracks").ptr()
);
"Foam::ParticleTracks<CloudType>::postFace(const parcelType&)"
)<< "Cloud storage not allocated" << abort(FatalError);
}
hitTableType::iterator iter =

View File

@ -136,6 +136,9 @@ public:
// Evaluation
//- Pre-evolve hook
virtual void preEvolve();
//- Post-patch hook
virtual void postPatch(const parcelType& p, const label patchI);

View File

@ -130,11 +130,11 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
(
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
),
volumeFlowRate_
flowRateProfile_
(
DataEntry<scalar>::New
(
"volumeFlowRate",
"flowRateProfile",
this->coeffDict()
)
),
@ -208,7 +208,7 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
tanVec2_ = direction_^tanVec1_;
// Set total volume to inject
this->volumeTotal_ = volumeFlowRate_().integrate(0.0, duration_);
this->volumeTotal_ = flowRateProfile_().integrate(0.0, duration_);
}
@ -227,7 +227,7 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
injectorCell_(im.injectorCell_),
direction_(im.direction_),
parcelsPerSecond_(im.parcelsPerSecond_),
volumeFlowRate_(im.volumeFlowRate_().clone().ptr()),
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
thetaInner_(im.thetaInner_().clone().ptr()),
thetaOuter_(im.thetaOuter_().clone().ptr()),
sizeDistribution_(im.sizeDistribution_().clone().ptr()),
@ -283,7 +283,7 @@ Foam::scalar Foam::ConeNozzleInjection<CloudType>::volumeToInject
{
if ((time0 >= 0.0) && (time0 < duration_))
{
return volumeFlowRate_().integrate(time0, time1);
return flowRateProfile_().integrate(time0, time1);
}
else
{
@ -405,7 +405,7 @@ void Foam::ConeNozzleInjection<CloudType>::setProperties
scalar Ai = 0.25*mathematical::pi*innerDiameter_*innerDiameter_;
scalar massFlowRate =
this->massTotal()
*volumeFlowRate_().value(t)
*flowRateProfile_().value(t)
/this->volumeTotal();
scalar Umag = massFlowRate/(parcel.rho()*Cd_().value(t)*(Ao - Ai));

View File

@ -131,8 +131,8 @@ private:
//- Number of parcels to introduce per second []
const label parcelsPerSecond_;
//- Volume flow rate of parcels to introduce relative to SOI [m^3/s]
const autoPtr<DataEntry<scalar> > volumeFlowRate_;
//- Flow rate profile relative to SOI []
const autoPtr<DataEntry<scalar> > flowRateProfile_;
//- Inner cone angle relative to SOI [deg]
const autoPtr<DataEntry<scalar> > thetaInner_;

View File

@ -62,12 +62,12 @@ bool noFilm::read()
noFilm::noFilm
(
const word&,
const word& modelType,
const fvMesh& mesh,
const dimensionedVector&
const dimensionedVector& g
)
:
surfaceFilmModel(mesh)
surfaceFilmModel(modelType, mesh, g)
{}

View File

@ -28,17 +28,19 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<>
const char* Foam::NamedEnum
<
Foam::regionModels::surfaceFilmModels::surfaceFilmModel::thermoModelType,
2
>::names[] =
namespace Foam
{
"constant",
"singleComponent"
};
template<>
const char* NamedEnum
<
regionModels::surfaceFilmModels::surfaceFilmModel::thermoModelType,
2
>::names[] =
{
"constant",
"singleComponent"
};
}
const Foam::NamedEnum
<
@ -48,7 +50,7 @@ const Foam::NamedEnum
Foam::regionModels::surfaceFilmModels::surfaceFilmModel::thermoModelTypeNames_;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
@ -81,14 +83,6 @@ bool surfaceFilmModel::read()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
surfaceFilmModel::surfaceFilmModel(const fvMesh& mesh)
:
singleLayerRegion(mesh),
g_(vector::zero),
thermoModel_(tmConstant)
{}
surfaceFilmModel::surfaceFilmModel
(
const word& modelType,

View File

@ -130,9 +130,6 @@ public:
// Constructors
//- Construct null
surfaceFilmModel(const fvMesh& mesh);
//- Construct from type name, mesh and gravity vector
surfaceFilmModel
(

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -177,6 +177,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -177,6 +177,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -200,6 +200,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
mu_.writeData(os); os << nl;
mug_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -101,8 +101,6 @@ inline Foam::scalar Foam::aC10H7CH3::D(scalar p, scalar T) const
}
inline Foam::scalar Foam::aC10H7CH3::D(scalar p, scalar T, scalar Wb) const
{
return D_.f(p, T, Wb);

View File

@ -178,6 +178,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -177,6 +177,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -177,6 +177,7 @@ public:
pv_.writeData(os); os << nl;
hl_.writeData(os); os << nl;
Cp_.writeData(os); os << nl;
h_.writeData(os); os << nl;
Cpg_.writeData(os); os << nl;
B_.writeData(os); os << nl;
mu_.writeData(os); os << nl;

View File

@ -108,10 +108,10 @@ Foam::radiation::viewFactor::viewFactor(const volScalarField& T)
label count = 0;
forAll(Qrp, patchI)
{
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
//const polyPatch& pp = mesh_.boundaryMesh()[patchI];
const fvPatchScalarField& QrPatchI = Qrp[patchI];
if ((isA<fixedValueFvPatchScalarField>(QrPatchI)) && (pp.size() > 0))
if ((isA<fixedValueFvPatchScalarField>(QrPatchI)))
{
selectedPatches_[count] = QrPatchI.patch().index();
nLocalCoarseFaces_ += coarsePatches[patchI].size();
@ -362,38 +362,49 @@ void Foam::radiation::viewFactor::calculate()
const polyPatch& pp = coarseMesh_.boundaryMesh()[patchID];
const labelList& coarsePatchFace = coarseMesh_.patchFaceMap()[patchID];
const labelList& agglom = finalAgglom_[patchID];
label nAgglom = max(agglom) + 1;
labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
scalarList Tave(pp.size(), 0.0);
scalarList Eave(Tave.size(), 0.0);
scalarList Hoiave(Tave.size(), 0.0);
forAll(coarseToFine, coarseI)
if (pp.size() > 0)
{
const label coarseFaceID = coarsePatchFace[coarseI];
const labelList& fineFaces = coarseToFine[coarseFaceID];
UIndirectList<scalar> fineSf
(
sf,
fineFaces
);
scalar area = sum(fineSf());
// Temperature, emissivity and external flux area weighting
forAll(fineFaces, j)
{
label faceI = fineFaces[j];
Tave[coarseI] += (Tp[faceI]*sf[faceI])/area;
Eave[coarseI] += (eb[faceI]*sf[faceI])/area;
Hoiave[coarseI] += (Hoi[faceI]*sf[faceI])/area;
}
const labelList& agglom = finalAgglom_[patchID];
label nAgglom = max(agglom) + 1;
localCoarseTave.append(Tave[coarseI]);
localCoarseEave.append(Eave[coarseI]);
localCoarseHoave.append(Hoiave[coarseI]);
labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
//scalarList Tave(pp.size(), 0.0);
//scalarList Eave(Tave.size(), 0.0);
//scalarList Hoiave(Tave.size(), 0.0);
forAll(coarseToFine, coarseI)
{
const label coarseFaceID = coarsePatchFace[coarseI];
const labelList& fineFaces = coarseToFine[coarseFaceID];
UIndirectList<scalar> fineSf
(
sf,
fineFaces
);
scalar area = sum(fineSf());
// Temperature, emissivity and external flux area weighting
forAll(fineFaces, j)
{
label faceI = fineFaces[j];
Tave[coarseI] += (Tp[faceI]*sf[faceI])/area;
Eave[coarseI] += (eb[faceI]*sf[faceI])/area;
Hoiave[coarseI] += (Hoi[faceI]*sf[faceI])/area;
}
//localCoarseTave.append(Tave[coarseI]);
//localCoarseEave.append(Eave[coarseI]);
//localCoarseHoave.append(Hoiave[coarseI]);
}
}
localCoarseTave.append(Tave);
localCoarseEave.append(Eave);
localCoarseHoave.append(Hoiave);
}
// Fill the local values to distribute
@ -494,7 +505,7 @@ void Foam::radiation::viewFactor::calculate()
scalar invEj = 1.0/E[j];
if (i==j)
{
CLU_()[i][j] = invEj - (invEj-1.0)*Fmatrix_()[i][j];
CLU_()[i][j] = invEj-(invEj-1.0)*Fmatrix_()[i][j];
}
else
{
@ -540,30 +551,35 @@ void Foam::radiation::viewFactor::calculate()
forAll(selectedPatches_, i)
{
const label patchID = selectedPatches_[i];
scalarField& Qrp = Qr_.boundaryField()[patchID];
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
const labelList& agglom = finalAgglom_[patchID];
label nAgglom = max(agglom)+1;
labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
const labelList& coarsePatchFace = coarseMesh_.patchFaceMap()[patchID];
scalar heatFlux = 0.0;
forAll(coarseToFine, coarseI)
const polyPatch& pp = mesh_.boundaryMesh()[patchID];
if (pp.size() > 0)
{
label globalCoarse =
globalNumbering.toGlobal(Pstream::myProcNo(), globCoarseId);
const label coarseFaceID = coarsePatchFace[coarseI];
const labelList& fineFaces = coarseToFine[coarseFaceID];
forAll(fineFaces, k)
{
label faceI = fineFaces[k];
scalarField& Qrp = Qr_.boundaryField()[patchID];
const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
const labelList& agglom = finalAgglom_[patchID];
label nAgglom = max(agglom)+1;
Qrp[faceI] = q[globalCoarse];
heatFlux += Qrp[faceI]*sf[faceI];
labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
const labelList& coarsePatchFace =
coarseMesh_.patchFaceMap()[patchID];
scalar heatFlux = 0.0;
forAll(coarseToFine, coarseI)
{
label globalCoarse =
globalNumbering.toGlobal(Pstream::myProcNo(), globCoarseId);
const label coarseFaceID = coarsePatchFace[coarseI];
const labelList& fineFaces = coarseToFine[coarseFaceID];
forAll(fineFaces, k)
{
label faceI = fineFaces[k];
Qrp[faceI] = q[globalCoarse];
heatFlux += Qrp[faceI]*sf[faceI];
}
globCoarseId ++;
}
globCoarseId ++;
}
}
@ -634,5 +650,4 @@ Foam::radiation::viewFactor::Ru() const
);
}
// ************************************************************************* //

View File

@ -135,11 +135,11 @@ ODESolidChemistryModel
Y0Default
)
);
}
// Calculate inital values of Ysi0 = rho*delta*Yi
Ys0_[fieldI].internalField() =
this->solidThermo().rho()*max(Ys_[fieldI],scalar(0.001))*mesh.V();
Ys0_[fieldI].internalField() =
this->solidThermo().rho()
*max(Ys_[fieldI], scalar(0.001))*mesh.V();
}
}
forAll(RRg_, fieldI)

View File

@ -32,36 +32,24 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#ifndef __clang__
template<>
#endif
const word triSurfaceLabelField::typeName("triSurfaceLabelField");
#ifndef __clang__
template<>
#endif
const word triSurfaceScalarField::typeName("triSurfaceScalarField");
#ifndef __clang__
template<>
#endif
const word triSurfaceVectorField::typeName("triSurfaceVectorField");
#ifndef __clang__
template<>
#endif
const word triSurfaceSphericalTensorField::typeName
("triSurfaceSphericalTensorField");
#ifndef __clang__
template<>
#endif
const word triSurfaceSymmTensorField::typeName
("triSurfaceSymmTensorField");
#ifndef __clang__
template<>
#endif
const word triSurfaceTensorField::typeName("triSurfaceTensorField");
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -170,7 +170,7 @@ public:
new volScalarField
(
"DnuTildaEff",
rho_*nuTilda_/sigmaNut_ + mu()
(rho_*nuTilda_ + mu())/sigmaNut_
)
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -233,7 +233,7 @@ tmp<volScalarField> SpalartAllmaras::DnuTildaEff() const
{
return tmp<volScalarField>
(
new volScalarField("DnuTildaEff", nuTilda_/sigmaNut_ + nu())
new volScalarField("DnuTildaEff", (nuTilda_ + nu())/sigmaNut_)
);
}

View File

@ -42,12 +42,23 @@ done
#-- Run on single processor
runApplication `getApplication`
## Run in parallel
## Decompose
#for i in bottomAir topAir heater leftSolid rightSolid
#do
# decomposePar -region $i > log.decomposePar.$i 2>&1
#done
#
#for i in bottomAir topAir
#do
# mpirun -np 4 faceAgglomerate -region $i -dict viewFactorsDict -parallel> log.faceAgglomerate.$i 2>&1
#done
#for i in bottomAir topAir
#do
# mpirun -np 4 viewFactorsGen -region $i -parallel > log.viewFactorsGen.$i 2>&1
#done
## Run
#runParallel `getApplication` 4
#
@ -61,9 +72,6 @@ runApplication `getApplication`
echo
echo "creating files for paraview post-processing"
echo
for i in bottomAir topAir heater leftSolid rightSolid
do
paraFoam -touch -region $i
done
paraFoam -touchAll
# ----------------------------------------------------------------- end-of-file