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

This commit is contained in:
laurence
2013-09-06 16:31:12 +01:00
35 changed files with 440 additions and 293 deletions

View File

@ -25,7 +25,7 @@ Application
thermoFoam
Description
Evolves the thermodynamics on a forzen flow field
Evolves the thermodynamics on a frozen flow field
\*---------------------------------------------------------------------------*/

View File

@ -614,11 +614,6 @@ int main(int argc, char *argv[])
"boundBox",
"simplify the surface using snappyHexMesh starting from a boundBox"
);
Foam::argList::addBoolOption
(
"writeLevel",
"write pointLevel and cellLevel postprocessing files"
);
Foam::argList::addOption
(
"patches",
@ -640,7 +635,6 @@ int main(int argc, char *argv[])
const bool overwrite = args.optionFound("overwrite");
const bool checkGeometry = args.optionFound("checkGeometry");
const bool surfaceSimplify = args.optionFound("surfaceSimplify");
const bool writeLevel = args.optionFound("writeLevel");
autoPtr<fvMesh> meshPtr;
@ -852,6 +846,8 @@ int main(int argc, char *argv[])
autoLayerDriver::debug = debug;
}
const bool writeLevel = meshDict.lookupOrDefault<bool>("writeLevel", false);
// Read geometry
// ~~~~~~~~~~~~~

View File

@ -213,25 +213,21 @@ void Foam::doxygenXmlParser::skipForward
) const
{
// recurse to move forward in 'is' until come across <blockName>
// fast-forward until we reach a '<'
char c;
while (is.get(c) && c != '<')
{}
string entryName = "";
while (is.get(c) && c != '>')
{
entryName = entryName + c;
}
char c;
if (entryName == blockName)
while (is.good() && (entryName != blockName))
{
return;
}
else
{
skipForward(is, blockName);
entryName = "";
// fast-forward until we reach a '<'
while (is.get(c) && c != '<')
{}
while (is.get(c) && c != '>')
{
entryName = entryName + c;
}
}
}

View File

@ -39,6 +39,31 @@ using namespace Foam;
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> >
volField
(
const fvMeshSubset& meshSubsetter,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
if (meshSubsetter.hasSubMesh())
{
tmp<GeometricField<Type, fvPatchField, volMesh> > tfld
(
meshSubsetter.interpolate(vf)
);
tfld().checkOut();
tfld().rename(vf.name());
return tfld;
}
else
{
return vf;
}
}
template<class Type>
Field<Type> map
(
@ -680,7 +705,7 @@ void ensightPointField
template<class Type>
void ensightField
(
const IOobject& fieldObject,
const GeometricField<Type, fvPatchField, volMesh>& vf,
const ensightMesh& eMesh,
const fileName& postProcPath,
const word& prepend,
@ -690,14 +715,11 @@ void ensightField
Ostream& ensightCaseFile
)
{
// Read field
GeometricField<Type, fvPatchField, volMesh> vf(fieldObject, eMesh.mesh());
if (nodeValues)
{
tmp<GeometricField<Type, pointPatchField, pointMesh> > pfld
(
volPointInterpolation::New(eMesh.mesh()).interpolate(vf)
volPointInterpolation::New(vf.mesh()).interpolate(vf)
);
pfld().rename(vf.name());

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
@ -35,13 +35,24 @@ SourceFiles
#define ensightField_H
#include "ensightMesh.H"
#include "fvMeshSubset.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Wrapper to get hold of the field or the subsetted field
template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
volField
(
const Foam::fvMeshSubset&,
const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>& vf
);
template<class Type>
void ensightField
(
const Foam::IOobject& fieldObject,
const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>& vf,
const Foam::ensightMesh& eMesh,
const Foam::fileName& postProcPath,
const Foam::word& prepend,

View File

@ -57,14 +57,6 @@ void Foam::ensightMesh::correct()
nFaceZonePrims_ = 0;
boundaryFaceToBeIncluded_.clear();
const cellShapeList& cellShapes = mesh_.cellShapes();
const cellModel& tet = *(cellModeller::lookup("tet"));
const cellModel& pyr = *(cellModeller::lookup("pyr"));
const cellModel& prism = *(cellModeller::lookup("prism"));
const cellModel& wedge = *(cellModeller::lookup("wedge"));
const cellModel& hex = *(cellModeller::lookup("hex"));
if (!noPatches_)
{
// Patches are output. Check that they're synced.
@ -111,6 +103,16 @@ void Foam::ensightMesh::correct()
}
else
{
const cellShapeList& cellShapes = mesh_.cellShapes();
const cellModel& tet = *(cellModeller::lookup("tet"));
const cellModel& pyr = *(cellModeller::lookup("pyr"));
const cellModel& prism = *(cellModeller::lookup("prism"));
const cellModel& wedge = *(cellModeller::lookup("wedge"));
const cellModel& hex = *(cellModeller::lookup("hex"));
// Count the shapes
labelList& tets = meshCellSets_.tets;
labelList& pyrs = meshCellSets_.pyrs;
@ -926,8 +928,10 @@ void Foam::ensightMesh::writeAllNSided
}
void Foam::ensightMesh::writeAllInternalPoints
void Foam::ensightMesh::writeAllPoints
(
const label ensightPartI,
const word& ensightPartName,
const pointField& uniquePoints,
const label nPoints,
ensightStream& ensightGeometryFile
@ -937,49 +941,8 @@ void Foam::ensightMesh::writeAllInternalPoints
if (Pstream::master())
{
ensightGeometryFile.writePartHeader(1);
ensightGeometryFile.write("internalMesh");
ensightGeometryFile.write("coordinates");
ensightGeometryFile.write(nPoints);
for (direction d=0; d<vector::nComponents; d++)
{
ensightGeometryFile.write(uniquePoints.component(d));
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
IPstream fromSlave(Pstream::scheduled, slave);
scalarField pointsComponent(fromSlave);
ensightGeometryFile.write(pointsComponent);
}
}
}
else
{
for (direction d=0; d<vector::nComponents; d++)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< uniquePoints.component(d);
}
}
}
void Foam::ensightMesh::writeAllPatchPoints
(
const label ensightPatchI,
const word& patchName,
const pointField& uniquePoints,
const label nPoints,
ensightStream& ensightGeometryFile
) const
{
barrier();
if (Pstream::master())
{
ensightGeometryFile.writePartHeader(ensightPatchI);
ensightGeometryFile.write(patchName.c_str());
ensightGeometryFile.writePartHeader(ensightPartI);
ensightGeometryFile.write(ensightPartName.c_str());
ensightGeometryFile.write("coordinates");
ensightGeometryFile.write(nPoints);
@ -998,11 +961,7 @@ void Foam::ensightMesh::writeAllPatchPoints
{
for (direction d=0; d<vector::nComponents; d++)
{
OPstream toMaster
(
Pstream::scheduled,
Pstream::masterNo()
);
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< uniquePoints.component(d);
}
}
@ -1076,8 +1035,10 @@ void Foam::ensightMesh::write
const pointField uniquePoints(mesh_.points(), uniquePointMap_);
writeAllInternalPoints
writeAllPoints
(
1,
"internalMesh",
uniquePoints,
nPoints,
ensightGeometryFile
@ -1166,7 +1127,7 @@ void Foam::ensightMesh::write
inplaceRenumber(pointToGlobal, patchFaces[i]);
}
writeAllPatchPoints
writeAllPoints
(
ensightPatchI++,
patchName,
@ -1271,7 +1232,7 @@ void Foam::ensightMesh::write
inplaceRenumber(pointToGlobal, faceZoneMasterFaces[i]);
}
writeAllPatchPoints
writeAllPoints
(
ensightPatchI++,
faceZoneName,

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
@ -244,17 +244,10 @@ private:
ensightStream& ensightGeometryFile
) const;
void writeAllInternalPoints
void writeAllPoints
(
const pointField& uniquePoints,
const label nPoints,
ensightStream& ensightGeometryFile
) const;
void writeAllPatchPoints
(
label ensightPatchI,
const word& patchName,
const label ensightPartI,
const word& ensightPartName,
const pointField& uniquePoints,
const label nPoints,
ensightStream& ensightGeometryFile

View File

@ -46,6 +46,9 @@ Usage
\param -faceZones zoneList \n
Specify faceZones to write, with wildcards
\param -cellZone zoneName \n
Specify single cellZone to write (not lagrangian)
Note
Parallel support for cloud data is not supported
- writes to \a EnSight directory to avoid collisions with foamToEnsightParts
@ -72,6 +75,9 @@ Note
#include "fvc.H"
#include "cellSet.H"
#include "fvMeshSubset.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -128,6 +134,12 @@ int main(int argc, char *argv[])
"wordReList",
"specify faceZones to write - eg '( slice \"mfp-.*\" )'."
);
argList::addOption
(
"cellZone",
"word",
"specify cellZone to write"
);
#include "setRootCase.H"
@ -212,9 +224,28 @@ int main(int argc, char *argv[])
zonePatterns = wordReList(args.optionLookup("faceZones")());
}
word cellZoneName;
const bool doCellZone = args.optionReadIfPresent("cellZone", cellZoneName);
fvMeshSubset meshSubsetter(mesh);
if (doCellZone)
{
Info<< "Converting cellZone " << cellZoneName
<< " only (puts outside faces into patch "
<< mesh.boundaryMesh()[0].name()
<< ")" << endl;
const cellZone& cz = mesh.cellZones()[cellZoneName];
cellSet c0(mesh, "c0", labelHashSet(cz));
meshSubsetter.setLargeCellSubset(c0, 0);
}
ensightMesh eMesh
(
mesh,
(
meshSubsetter.hasSubMesh()
? meshSubsetter.subMesh()
: meshSubsetter.baseMesh()
),
args.optionFound("noPatches"),
selectedPatches,
patchPatterns,
@ -349,6 +380,17 @@ int main(int argc, char *argv[])
Info<< "Translating time = " << runTime.timeName() << nl;
polyMesh::readUpdateState meshState = mesh.readUpdate();
if (timeIndex != 0 && meshSubsetter.hasSubMesh())
{
Info<< "Converting cellZone " << cellZoneName
<< " only (puts outside faces into patch "
<< mesh.boundaryMesh()[0].name()
<< ")" << endl;
const cellZone& cz = mesh.cellZones()[cellZoneName];
cellSet c0(mesh, "c0", labelHashSet(cz));
meshSubsetter.setLargeCellSubset(c0, 0);
}
if (meshState != polyMesh::UNCHANGED)
{
@ -406,9 +448,10 @@ int main(int argc, char *argv[])
if (volFieldTypes[i] == volScalarField::typeName)
{
volScalarField vf(fieldObject, mesh);
ensightField<scalar>
(
fieldObject,
volField(meshSubsetter, vf),
eMesh,
ensightDir,
prepend,
@ -420,9 +463,10 @@ int main(int argc, char *argv[])
}
else if (volFieldTypes[i] == volVectorField::typeName)
{
volVectorField vf(fieldObject, mesh);
ensightField<vector>
(
fieldObject,
volField(meshSubsetter, vf),
eMesh,
ensightDir,
prepend,
@ -434,9 +478,10 @@ int main(int argc, char *argv[])
}
else if (volFieldTypes[i] == volSphericalTensorField::typeName)
{
volSphericalTensorField vf(fieldObject, mesh);
ensightField<sphericalTensor>
(
fieldObject,
volField(meshSubsetter, vf),
eMesh,
ensightDir,
prepend,
@ -448,9 +493,10 @@ int main(int argc, char *argv[])
}
else if (volFieldTypes[i] == volSymmTensorField::typeName)
{
volSymmTensorField vf(fieldObject, mesh);
ensightField<symmTensor>
(
fieldObject,
volField(meshSubsetter, vf),
eMesh,
ensightDir,
prepend,
@ -462,9 +508,10 @@ int main(int argc, char *argv[])
}
else if (volFieldTypes[i] == volTensorField::typeName)
{
volTensorField vf(fieldObject, mesh);
ensightField<tensor>
(
fieldObject,
volField(meshSubsetter, vf),
eMesh,
ensightDir,
prepend,

View File

@ -952,8 +952,20 @@ int main(int argc, char *argv[])
forAllConstIter(dictionary, dict, iter)
{
if (!iter().isDict())
{
continue;
}
const dictionary& surfaceDict = iter().dict();
if (!surfaceDict.found("extractionMethod"))
{
continue;
}
const word extractionMethod = surfaceDict.lookup("extractionMethod");
const fileName surfFileName = iter().keyword();
const fileName sFeatFileName = surfFileName.lessExt().name();
@ -971,8 +983,6 @@ int main(int argc, char *argv[])
const Switch closeness =
surfaceDict.lookupOrDefault<Switch>("closeness", "off");
const word extractionMethod = surfaceDict.lookup("extractionMethod");
Info<< nl << "Feature line extraction is only valid on closed manifold "
<< "surfaces." << endl;

View File

@ -30,6 +30,9 @@ sh/csh variants:
* scotch.sh
application settings for compiling against scotch
* metis.sh
application settings for compiling against metis 5
---
The config/example directory contains various example configuration files

View File

@ -146,7 +146,7 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
if (ePtr)
{
// Read as primitiveEntry
const word newKeyword(ePtr->stream());
const keyType newKeyword(ePtr->stream());
return parentDict.add
(

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
@ -37,6 +37,14 @@ namespace functionEntries
{
defineTypeNameAndDebug(calcEntry, 0);
addToMemberFunctionSelectionTable
(
functionEntry,
calcEntry,
execute,
dictionaryIstream
);
addToMemberFunctionSelectionTable
(
functionEntry,
@ -96,4 +104,48 @@ bool Foam::functionEntries::calcEntry::execute
}
bool Foam::functionEntries::calcEntry::execute
(
dictionary& parentDict,
Istream& is
)
{
Info<< "Using #calcEntry at line " << is.lineNumber()
<< " in file " << parentDict.name() << endl;
dynamicCode::checkSecurity
(
"functionEntries::calcEntry::execute(..)",
parentDict
);
// Read string
string s(is);
// Make sure we stop this entry
//is.putBack(token(token::END_STATEMENT, is.lineNumber()));
// Construct codeDict for codeStream
// must reference parent for stringOps::expand to work nicely.
dictionary codeSubDict;
codeSubDict.add("code", "os << (" + s + ");");
dictionary codeDict(parentDict, codeSubDict);
codeStream::streamingFunctionType function = codeStream::getFunction
(
parentDict,
codeDict
);
// use function to write stream
OStringStream os(is.format());
(*function)(os, parentDict);
// get the entry from this stream
IStringStream resultStream(os.str());
parentDict.read(resultStream);
return true;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -89,6 +89,9 @@ public:
// Member Functions
//- Execute the functionEntry in a sub-dict context
static bool execute(dictionary& parentDict, Istream&);
//- Execute the functionEntry in a primitiveEntry context
static bool execute
(
const dictionary& parentDict,

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,9 +31,9 @@ Description
This boundary condition provides an oscillating condition in terms of
amplitude and frequency.
/f[
\f[
x_p = (1 + a sin(\pi f t))x_{ref} + x_o
/f]
\f]
where

View File

@ -79,7 +79,49 @@ Foam::fvPatchField<Type>::fvPatchField
updated_(false),
manipulatedMatrix_(false),
patchType_(ptf.patchType_)
{}
{
// For unmapped faces set to internal field value (zero-gradient)
if (&iF && iF.size())
{
Field<Type>& f = *this;
if
(
mapper.direct()
&& &mapper.directAddressing()
&& mapper.directAddressing().size()
)
{
Field<Type> pif(this->patchInternalField());
const labelList& mapAddressing = mapper.directAddressing();
forAll(mapAddressing, i)
{
if (mapAddressing[i] < 0)
{
f[i] = pif[i];
}
}
}
else if (!mapper.direct() && mapper.addressing().size())
{
Field<Type> pif(this->patchInternalField());
const labelListList& mapAddressing = mapper.addressing();
forAll(mapAddressing, i)
{
const labelList& localAddrs = mapAddressing[i];
if (!localAddrs.size())
{
f[i] = pif[i];
}
}
}
}
}
template<class Type>

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
@ -45,16 +45,13 @@ tmp<GeometricField<Type, fvPatchField, volMesh> > fvMeshSubset::interpolate
const labelList& faceMap
)
{
// Create and map the internal-field values
Field<Type> internalField(vf.internalField(), cellMap);
// Create and map the patch field values
// 1. Create the complete field with dummy patch fields
PtrList<fvPatchField<Type> > patchFields(patchMap.size());
forAll(patchFields, patchI)
{
// Set the first one by hand as it corresponds to the
// exposed internal faces. Additional interpolation can be put here
// exposed internal faces. Additional interpolation can be put here
// as necessary.
if (patchMap[patchI] == -1)
{
@ -69,6 +66,49 @@ tmp<GeometricField<Type, fvPatchField, volMesh> > fvMeshSubset::interpolate
);
}
else
{
patchFields.set
(
patchI,
new calculatedFvPatchField<Type>
(
sMesh.boundary()[patchI],
DimensionedField<Type, volMesh>::null()
)
);
}
}
tmp<GeometricField<Type, fvPatchField, volMesh> > tresF
(
new GeometricField<Type, fvPatchField, volMesh>
(
IOobject
(
"subset"+vf.name(),
sMesh.time().timeName(),
sMesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sMesh,
vf.dimensions(),
Field<Type>(vf.internalField(), cellMap),
patchFields
)
);
GeometricField<Type, fvPatchField, volMesh>& resF = tresF();
// 2. Change the fvPatchFields to the correct type using a mapper
// constructor (with reference to the now correct internal field)
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& bf = resF.boundaryField();
forAll(bf, patchI)
{
if (patchMap[patchI] != -1)
{
// Construct addressing
const fvPatch& subPatch = sMesh.boundary()[patchI];
@ -88,49 +128,26 @@ tmp<GeometricField<Type, fvPatchField, volMesh> > fvMeshSubset::interpolate
}
else
{
// Mapped from internal face. Do what? Map from element
// 0 for now.
directAddressing[i] = 0;
// Mapped from internal face. Do what? Leave up to
// fvPatchField
directAddressing[i] = -1;
}
}
patchFields.set
bf.set
(
patchI,
fvPatchField<Type>::New
(
vf.boundaryField()[patchMap[patchI]],
sMesh.boundary()[patchI],
DimensionedField<Type, volMesh>::null(),
subPatch,
resF.dimensionedInternalField(),
patchFieldSubset(directAddressing)
)
);
// What to do with exposed internal faces if put into this patch?
}
}
// Create the complete field from the pieces
tmp<GeometricField<Type, fvPatchField, volMesh> > tresF
(
new GeometricField<Type, fvPatchField, volMesh>
(
IOobject
(
"subset"+vf.name(),
sMesh.time().timeName(),
sMesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sMesh,
vf.dimensions(),
internalField,
patchFields
)
);
return tresF;
}
@ -161,24 +178,13 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate
const labelList& faceMap
)
{
// Create and map the internal-field values
Field<Type> internalField
(
vf.internalField(),
SubList<label>
(
faceMap,
sMesh.nInternalFaces()
)
);
// Create and map the patch field values
// 1. Create the complete field with dummy patch fields
PtrList<fvsPatchField<Type> > patchFields(patchMap.size());
forAll(patchFields, patchI)
{
// Set the first one by hand as it corresponds to the
// exposed internal faces. Additional interpolation can be put here
// exposed internal faces. Additional interpolation can be put here
// as necessary.
if (patchMap[patchI] == -1)
{
@ -193,6 +199,58 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate
);
}
else
{
patchFields.set
(
patchI,
new calculatedFvsPatchField<Type>
(
sMesh.boundary()[patchI],
DimensionedField<Type, surfaceMesh>::null()
)
);
}
}
// Create the complete field from the pieces
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tresF
(
new GeometricField<Type, fvsPatchField, surfaceMesh>
(
IOobject
(
"subset"+vf.name(),
sMesh.time().timeName(),
sMesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sMesh,
vf.dimensions(),
Field<Type>
(
vf.internalField(),
SubList<label>
(
faceMap,
sMesh.nInternalFaces()
)
),
patchFields
)
);
GeometricField<Type, fvsPatchField, surfaceMesh>& resF = tresF();
// 2. Change the fvsPatchFields to the correct type using a mapper
// constructor (with reference to the now correct internal field)
typename GeometricField<Type, fvsPatchField, surfaceMesh>::
GeometricBoundaryField& bf = resF.boundaryField();
forAll(bf, patchI)
{
if (patchMap[patchI] != -1)
{
// Construct addressing
const fvPatch& subPatch = sMesh.boundary()[patchI];
@ -212,66 +270,54 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate
}
else
{
// Mapped from internal face. Do what? Map from element
// 0 for now.
directAddressing[i] = 0;
// Mapped from internal face. Do what? Leave up to
// patchField. This would require also to pass in
// original internal field so for now do as postprocessing
directAddressing[i] = -1;
}
}
patchFields.set
bf.set
(
patchI,
fvsPatchField<Type>::New
(
vf.boundaryField()[patchMap[patchI]],
sMesh.boundary()[patchI],
DimensionedField<Type, surfaceMesh>::null(),
subPatch,
resF.dimensionedInternalField(),
patchFieldSubset(directAddressing)
)
);
}
}
// Map exposed internal faces. Note: Only necessary if exposed faces added
// into existing patch but since we don't know that at this point...
forAll(patchFields, patchI)
{
fvsPatchField<Type>& pfld = patchFields[patchI];
// Postprocess patch field for exposed faces
label meshFaceI = pfld.patch().start();
fvsPatchField<Type>& pfld = bf[patchI];
forAll(pfld, i)
{
label oldFaceI = faceMap[meshFaceI++];
if (oldFaceI < vf.internalField().size())
forAll(pfld, i)
{
pfld[i] = vf.internalField()[oldFaceI];
label baseFaceI = faceMap[subPatch.start()+i];
if (baseFaceI < vf.internalField().size())
{
// Exposed internal face
pfld[i] = vf.internalField()[baseFaceI];
}
else
{
// Exposed face from other patch.
// Only possible in case of a coupled boundary
label patchI = vf.mesh().boundaryMesh().whichPatch
(
baseFaceI
);
const fvPatch& otherPatch = vf.mesh().boundary()[patchI];
label patchFaceI = otherPatch.patch().whichFace(baseFaceI);
pfld[i] = vf.boundaryField()[patchI][patchFaceI];
}
}
}
}
// Create the complete field from the pieces
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tresF
(
new GeometricField<Type, fvsPatchField, surfaceMesh>
(
IOobject
(
"subset"+vf.name(),
sMesh.time().timeName(),
sMesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sMesh,
vf.dimensions(),
internalField,
patchFields
)
);
return tresF;
}
@ -344,8 +390,8 @@ fvMeshSubset::interpolate
const pointPatch& subPatch = sMesh.boundary()[patchI];
const labelList& subMeshPoints = subPatch.meshPoints();
// If mapped from outside patch use point 0 for lack of better.
labelList directAddressing(subPatch.size(), 0);
// If mapped from outside patch leave handling up to patchField
labelList directAddressing(subPatch.size(), -1);
forAll(subMeshPoints, localI)
{

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
@ -64,11 +64,12 @@ Foam::BreakupModel<CloudType>::BreakupModel
(
const dictionary& dict,
CloudType& owner,
const word& type
const word& type,
bool solveOscillationEq
)
:
SubModelBase<CloudType>(owner, dict, typeName, type),
solveOscillationEq_(this->coeffDict().lookup("solveOscillationEq")),
solveOscillationEq_(solveOscillationEq),
y0_(0.0),
yDot0_(0.0),
TABComega_(0.0),
@ -77,14 +78,12 @@ Foam::BreakupModel<CloudType>::BreakupModel
{
if (solveOscillationEq_)
{
const dictionary TABcoeffsDict(dict.subDict("TABCoeffs"));
y0_ = TABcoeffsDict.template lookupOrDefault<scalar>("y0", 0.0);
yDot0_ = TABcoeffsDict.template lookupOrDefault<scalar>("yDot0", 0.0);
TABComega_ =
TABcoeffsDict.template lookupOrDefault<scalar>("Comega", 8.0);
TABCmu_ = TABcoeffsDict.template lookupOrDefault<scalar>("Cmu", 10.0);
TABWeCrit_ =
TABcoeffsDict.template lookupOrDefault<scalar>("WeCrit", 12.0);
const dictionary coeffs(dict.subDict("TABCoeffs"));
y0_ = coeffs.template lookupOrDefault<scalar>("y0", 0.0);
yDot0_ = coeffs.template lookupOrDefault<scalar>("yDot0", 0.0);
TABComega_ = coeffs.template lookupOrDefault<scalar>("Comega", 8.0);
TABCmu_ = coeffs.template lookupOrDefault<scalar>("Cmu", 10.0);
TABWeCrit_ = coeffs.template lookupOrDefault<scalar>("WeCrit", 12.0);
}
}

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
@ -97,7 +97,8 @@ public:
(
const dictionary& dict,
CloudType& owner,
const word& type
const word& type,
bool solveOscillationEq = false
);
//- Construct copy

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
@ -34,36 +34,21 @@ Foam::ETAB<CloudType>::ETAB
CloudType& owner
)
:
BreakupModel<CloudType>(dict, owner, typeName),
Cmu_(10.0),
Comega_(8.0),
BreakupModel<CloudType>(dict, owner, typeName, true),
k1_(0.2),
k2_(0.2),
WeCrit_(12.0),
WeTransition_(100.0),
AWe_(0.0)
{
if (!this->defaultCoeffs(true))
{
this->coeffDict().lookup("Cmu") >> Cmu_;
this->coeffDict().lookup("Comega") >> Comega_;
this->coeffDict().lookup("k1") >> k1_;
this->coeffDict().lookup("k2") >> k2_;
this->coeffDict().lookup("WeCrit") >> WeCrit_;
this->coeffDict().lookup("WeTransition") >> WeTransition_;
}
scalar k21 = k2_/k1_;
AWe_ = (k21*sqrt(WeTransition_) - 1.0)/pow4(WeTransition_);
if (!BreakupModel<CloudType>::solveOscillationEq_)
{
Info<< "Warning: solveOscillationEq is set to "
<< BreakupModel<CloudType>::solveOscillationEq_ << nl
<< " Setting it to true in order for the ETAB model to work."
<< endl;
BreakupModel<CloudType>::solveOscillationEq_ = true;
}
}
@ -71,11 +56,8 @@ template<class CloudType>
Foam::ETAB<CloudType>::ETAB(const ETAB<CloudType>& bum)
:
BreakupModel<CloudType>(bum),
Cmu_(bum.Cmu_),
Comega_(bum.Comega_),
k1_(bum.k1_),
k2_(bum.k2_),
WeCrit_(bum.WeCrit_),
WeTransition_(bum.WeTransition_),
AWe_(bum.AWe_)
{}
@ -123,10 +105,10 @@ bool Foam::ETAB<CloudType>::update
scalar semiMass = nParticle*pow3(d);
// inverse of characteristic viscous damping time
scalar rtd = 0.5*Cmu_*mu/(rho*r2);
scalar rtd = 0.5*this->TABCmu_*mu/(rho*r2);
// oscillation frequency (squared)
scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd;
scalar omega2 = this->TABComega_*sigma/(rho*r3) - rtd*rtd;
if (omega2 > 0)
{
@ -134,7 +116,7 @@ bool Foam::ETAB<CloudType>::update
scalar romega = 1.0/omega;
scalar We = rhoc*sqr(Urmag)*r/sigma;
scalar Wetmp = We/WeCrit_;
scalar Wetmp = We/this->TABWeCrit_;
scalar y1 = y - Wetmp;
scalar y2 = yDot*romega;

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
@ -71,13 +71,8 @@ private:
// Model constants
// Cmu_ and Comega_ are the same as in the TAB model
scalar Cmu_;
scalar Comega_;
scalar k1_;
scalar k2_;
scalar WeCrit_;
scalar WeTransition_;
scalar AWe_;

View File

@ -165,8 +165,6 @@ bool Foam::ReitzKHRT<CloudType>::update
if ((tc > 0) || (lambdaRT < d) )
{
tc += dt;
scalar multiplier = d/lambdaRT;
d = cbrt(d3/multiplier);
}
// characteristic RT breakup time

View File

@ -34,10 +34,7 @@ Foam::TAB<CloudType>::TAB
CloudType& owner
)
:
BreakupModel<CloudType>(dict, owner, typeName),
Cmu_(BreakupModel<CloudType>::TABCmu_),
Comega_(BreakupModel<CloudType>::TABComega_),
WeCrit_(BreakupModel<CloudType>::TABWeCrit_),
BreakupModel<CloudType>(dict, owner, typeName, true),
SMDCalcMethod_(this->coeffDict().lookup("SMDCalculationMethod"))
{
// calculate the inverse function of the Rossin-Rammler Distribution
@ -52,16 +49,6 @@ Foam::TAB<CloudType>::TAB
(1.0 - exp(-xx)*(1.0 + xx + sqr(xx)/2.0 + pow3(xx)/6.0))*rrd100;
}
if (!BreakupModel<CloudType>::solveOscillationEq_)
{
WarningIn("Foam::TAB<CloudType>::TAB(const dictionary&, CloudType&)")
<< "solveOscillationEq is set to "
<< BreakupModel<CloudType>::solveOscillationEq_ << nl
<< " Setting it to true in order for the TAB model to work."
<< endl;
BreakupModel<CloudType>::solveOscillationEq_ = true;
}
if (SMDCalcMethod_ == "method1")
{
SMDMethod_ = method1;
@ -84,9 +71,6 @@ template<class CloudType>
Foam::TAB<CloudType>::TAB(const TAB<CloudType>& bum)
:
BreakupModel<CloudType>(bum),
Cmu_(bum.Cmu_),
Comega_(bum.Comega_),
WeCrit_(bum.WeCrit_),
SMDCalcMethod_(bum.SMDCalcMethod_)
{}
@ -135,16 +119,16 @@ bool Foam::TAB<CloudType>::update
scalar semiMass = nParticle*pow3(d);
// inverse of characteristic viscous damping time
scalar rtd = 0.5*Cmu_*mu/(rho*r2);
scalar rtd = 0.5*this->TABCmu_*mu/(rho*r2);
// oscillation frequency (squared)
scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd;
scalar omega2 = this->TABComega_*sigma/(rho*r3) - rtd*rtd;
if (omega2 > 0)
{
scalar omega = sqrt(omega2);
scalar We = rhoc*sqr(Urmag)*r/sigma;
scalar Wetmp = We/WeCrit_;
scalar Wetmp = We/this->TABWeCrit_;
scalar y1 = y - Wetmp;
scalar y2 = yDot/omega;

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
@ -83,9 +83,6 @@ private:
// Model constants
scalar Cmu_;
scalar Comega_;
scalar WeCrit_;
word SMDCalcMethod_;
SMDMethods SMDMethod_;

View File

@ -2450,17 +2450,17 @@ void Foam::autoLayerDriver::mergePatchFacesUndo
const dictionary& motionDict
)
{
scalar minCos =
Foam::cos(degToRad(layerParams.featureAngle()));
// Clip to 45 degrees
scalar planarAngle = min(45.0, layerParams.featureAngle());
scalar minCos = Foam::cos(degToRad(planarAngle));
scalar concaveCos =
Foam::cos(degToRad(layerParams.concaveAngle()));
scalar concaveCos = Foam::cos(degToRad(layerParams.concaveAngle()));
Info<< nl
<< "Merging all faces of a cell" << nl
<< "---------------------------" << nl
<< " - which are on the same patch" << nl
<< " - which make an angle < " << layerParams.featureAngle()
<< " - which make an angle < " << planarAngle
<< " degrees"
<< nl
<< " (cos:" << minCos << ')' << nl
@ -2478,7 +2478,7 @@ void Foam::autoLayerDriver::mergePatchFacesUndo
concaveCos,
meshRefiner_.meshedPatches(),
motionDict,
labelList(mesh.nFaces() -1)
labelList(mesh.nFaces(), -1)
);
nChanged += meshRefiner_.mergeEdgesUndo(minCos, motionDict);

View File

@ -1849,7 +1849,8 @@ void Foam::autoSnapDriver::doSnap
{
WarningIn("autoSnapDriver::doSnap(..)")
<< "Did not succesfully snap mesh."
<< " Continuing to snap to resolve easy surfaces but the"
<< " Continuing to snap to resolve easy" << nl
<< " surfaces but the"
<< " resulting mesh will not satisfy your quality"
<< " constraints" << nl << endl;
//Info<< "Did not succesfully snap mesh. Giving up."

View File

@ -250,6 +250,17 @@ Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::ST
const Foam::radiation::absorptionEmissionModel&
Foam::radiation::radiationModel::absorptionEmission() const
{
if (!absorptionEmission_.valid())
{
FatalErrorIn
(
"const Foam::radiation::absorptionEmissionModel&"
"Foam::radiation::radiationModel::absorptionEmission() const"
)
<< "Requested radiation absorptionEmission model, but model is "
<< "not activate" << abort(FatalError);
}
return absorptionEmission_();
}

View File

@ -231,7 +231,7 @@ public:
volScalarField& T
) const;
//- Access to absorptionEmissionModel
//- Access to absorptionEmission model
const absorptionEmissionModel& absorptionEmission() const;
};

View File

@ -59,7 +59,6 @@ $(v2WallFunctions)/v2WallFunction/v2WallFunctionFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C
derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C

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
@ -62,7 +62,7 @@ Description
\table
Property | Description | Required | Default value
z | vertical co-ordinate [m] | yes |
z | vertical direction of z-axis | yes |
kappa | Karman's constanat | no | 0.41
Uref | reference velocity [m/s] | yes |
Href | reference height [m] | yes |
@ -75,7 +75,7 @@ Description
myPatch
{
type atmBoundaryLayerInletEpsilon;
z 1.0;
z (0 1 0);
kappa 0.41;
Uref 1.0;
Href 0.0;

View File

@ -1,5 +1,6 @@
turbulenceModel.C
laminar/laminar.C
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
LIB = $(FOAM_LIBBIN)/libincompressibleTurbulenceModel

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
@ -69,7 +69,7 @@ Description
\table
Property | Description | Required | Default value
n | flow direction | yes |
z | vertical co-ordinate [m] | yes |
z | vertical direction of z-axis | yes |
kappa | Karman's constanat | no | 0.41
Uref | reference velocity [m/s] | yes |
Href | reference height [m] | yes |
@ -83,7 +83,7 @@ Description
{
type atmBoundaryLayerInletVelocity;
n (0 1 0);
z 1.0;
z (0 1 0);
kappa 0.41;
Uref 1.0;
Href 0.0;
@ -135,7 +135,7 @@ class atmBoundaryLayerInletVelocityFvPatchVectorField
//- Direction of the z-coordinate
vector z_;
//- Surface roughness lenght
//- Surface roughness length
scalarField z0_;
//- Von Karman constant

View File

@ -63,7 +63,6 @@ constantProperties
epsilon0 1;
f0 0.5;
Pr 0.7;
constantVolume false;
}

View File

@ -63,7 +63,6 @@ constantProperties
epsilon0 1;
f0 0.5;
Pr 0.7;
constantVolume false;
}

View File

@ -63,7 +63,6 @@ constantProperties
epsilon0 1;
f0 0.5;
Pr 0.7;
constantVolume false;
}