Merge branch 'master' of ssh://noisy/home/noisy2/OpenFOAM/OpenFOAM-dev/

This commit is contained in:
andy 2008-05-23 11:25:04 +01:00
commit fee05a234a
41 changed files with 1748 additions and 200 deletions

View File

@ -60,7 +60,7 @@ void subsetVolFields
Info<< "Subsetting field " << fieldName << endl; Info<< "Subsetting field " << fieldName << endl;
GeometricField<Type, fvPatchField, volMesh> volField GeometricField<Type, fvPatchField, volMesh> fld
( (
IOobject IOobject
( (
@ -73,7 +73,7 @@ void subsetVolFields
baseMesh baseMesh
); );
subFields.set(i, subsetter.interpolate(volField)); subFields.set(i, subsetter.interpolate(fld));
} }
} }
@ -94,7 +94,7 @@ void subsetSurfaceFields
Info<< "Subsetting field " << fieldName << endl; Info<< "Subsetting field " << fieldName << endl;
GeometricField<Type, fvsPatchField, surfaceMesh> volField GeometricField<Type, fvsPatchField, surfaceMesh> fld
( (
IOobject IOobject
( (
@ -107,7 +107,42 @@ void subsetSurfaceFields
baseMesh baseMesh
); );
subFields.set(i, subsetter.interpolate(volField)); subFields.set(i, subsetter.interpolate(fld));
}
}
template<class Type>
void subsetPointFields
(
const fvMeshSubset& subsetter,
const pointMesh& pMesh,
const wordList& fieldNames,
PtrList<GeometricField<Type, pointPatchField, pointMesh> >& subFields
)
{
const fvMesh& baseMesh = subsetter.baseMesh();
forAll(fieldNames, i)
{
const word& fieldName = fieldNames[i];
Info<< "Subsetting field " << fieldName << endl;
GeometricField<Type, pointPatchField, pointMesh> fld
(
IOobject
(
fieldName,
baseMesh.time().timeName(),
baseMesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
pMesh
);
subFields.set(i, subsetter.interpolate(fld));
} }
} }
@ -163,7 +198,9 @@ int main(int argc, char *argv[])
IOobjectList objects(mesh, runTime.timeName()); IOobjectList objects(mesh, runTime.timeName());
// Read vol fields and subset.
// Read vol fields and subset
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
wordList scalarNames(objects.names(volScalarField::typeName)); wordList scalarNames(objects.names(volScalarField::typeName));
PtrList<volScalarField> scalarFlds(scalarNames.size()); PtrList<volScalarField> scalarFlds(scalarNames.size());
@ -191,7 +228,9 @@ int main(int argc, char *argv[])
PtrList<volTensorField> tensorFlds(tensorNames.size()); PtrList<volTensorField> tensorFlds(tensorNames.size());
subsetVolFields(subsetter, tensorNames, tensorFlds); subsetVolFields(subsetter, tensorNames, tensorFlds);
// Read surface fields and subset.
// Read surface fields and subset
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wordList surfScalarNames(objects.names(surfaceScalarField::typeName)); wordList surfScalarNames(objects.names(surfaceScalarField::typeName));
PtrList<surfaceScalarField> surfScalarFlds(surfScalarNames.size()); PtrList<surfaceScalarField> surfScalarFlds(surfScalarNames.size());
@ -231,6 +270,59 @@ int main(int argc, char *argv[])
subsetSurfaceFields(subsetter, surfTensorNames, surfTensorFlds); subsetSurfaceFields(subsetter, surfTensorNames, surfTensorFlds);
// Read point fields and subset
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pointMesh pMesh(mesh);
wordList pointScalarNames(objects.names(pointScalarField::typeName));
PtrList<pointScalarField> pointScalarFlds(pointScalarNames.size());
subsetPointFields(subsetter, pMesh, pointScalarNames, pointScalarFlds);
wordList pointVectorNames(objects.names(pointVectorField::typeName));
PtrList<pointVectorField> pointVectorFlds(pointVectorNames.size());
subsetPointFields(subsetter, pMesh, pointVectorNames, pointVectorFlds);
wordList pointSphericalTensorNames
(
objects.names(pointSphericalTensorField::typeName)
);
PtrList<pointSphericalTensorField> pointSphericalTensorFlds
(
pointSphericalTensorNames.size()
);
subsetPointFields
(
subsetter,
pMesh,
pointSphericalTensorNames,
pointSphericalTensorFlds
);
wordList pointSymmTensorNames
(
objects.names(pointSymmTensorField::typeName)
);
PtrList<pointSymmTensorField> pointSymmTensorFlds
(
pointSymmTensorNames.size()
);
subsetPointFields
(
subsetter,
pMesh,
pointSymmTensorNames,
pointSymmTensorFlds
);
wordList pointTensorNames(objects.names(pointTensorField::typeName));
PtrList<pointTensorField> pointTensorFlds(pointTensorNames.size());
subsetPointFields(subsetter, pMesh, pointTensorNames, pointTensorFlds);
// Write mesh and fields to new time
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
runTime++; runTime++;
@ -252,6 +344,18 @@ int main(int argc, char *argv[])
vectorFlds[i].write(); vectorFlds[i].write();
} }
forAll(sphericalTensorFlds, i)
{
sphericalTensorFlds[i].rename(sphericalTensorNames[i]);
sphericalTensorFlds[i].write();
}
forAll(symmTensorFlds, i)
{
symmTensorFlds[i].rename(symmTensorNames[i]);
symmTensorFlds[i].write();
}
forAll(tensorFlds, i) forAll(tensorFlds, i)
{ {
tensorFlds[i].rename(tensorNames[i]); tensorFlds[i].rename(tensorNames[i]);
@ -272,6 +376,18 @@ int main(int argc, char *argv[])
surfVectorFlds[i].write(); surfVectorFlds[i].write();
} }
forAll(surfSphericalTensorFlds, i)
{
surfSphericalTensorFlds[i].rename(surfSphericalTensorNames[i]);
surfSphericalTensorFlds[i].write();
}
forAll(surfSymmTensorFlds, i)
{
surfSymmTensorFlds[i].rename(surfSymmTensorNames[i]);
surfSymmTensorFlds[i].write();
}
forAll(surfTensorNames, i) forAll(surfTensorNames, i)
{ {
surfTensorFlds[i].rename(surfTensorNames[i]); surfTensorFlds[i].rename(surfTensorNames[i]);
@ -279,6 +395,39 @@ int main(int argc, char *argv[])
surfTensorFlds[i].write(); surfTensorFlds[i].write();
} }
// Point ones
forAll(pointScalarFlds, i)
{
pointScalarFlds[i].rename(pointScalarNames[i]);
pointScalarFlds[i].write();
}
forAll(pointVectorFlds, i)
{
pointVectorFlds[i].rename(pointVectorNames[i]);
pointVectorFlds[i].write();
}
forAll(pointSphericalTensorFlds, i)
{
pointSphericalTensorFlds[i].rename(pointSphericalTensorNames[i]);
pointSphericalTensorFlds[i].write();
}
forAll(pointSymmTensorFlds, i)
{
pointSymmTensorFlds[i].rename(pointSymmTensorNames[i]);
pointSymmTensorFlds[i].write();
}
forAll(pointTensorNames, i)
{
pointTensorFlds[i].rename(pointTensorNames[i]);
pointTensorFlds[i].write();
}
Info << nl << "End" << endl; Info << nl << "End" << endl;
return 0; return 0;

View File

@ -469,7 +469,6 @@ int main(int argc, char *argv[])
// Construct pointMesh only if nessecary since constructs edge // Construct pointMesh only if nessecary since constructs edge
// addressing (expensive on polyhedral meshes) // addressing (expensive on polyhedral meshes)
autoPtr<pointMesh> pMeshPtr(NULL);
if (noPointValues) if (noPointValues)
{ {
Info<< " pointScalarFields : switched off" Info<< " pointScalarFields : switched off"
@ -477,10 +476,6 @@ int main(int argc, char *argv[])
Info<< " pointVectorFields : switched off" Info<< " pointVectorFields : switched off"
<< " (\"-noPointValues\" option)\n"; << " (\"-noPointValues\" option)\n";
} }
else
{
pMeshPtr.reset(new pointMesh(mesh));
}
PtrList<pointScalarField> psf; PtrList<pointScalarField> psf;
PtrList<pointVectorField> pvf; PtrList<pointVectorField> pvf;
@ -488,21 +483,56 @@ int main(int argc, char *argv[])
PtrList<pointSymmTensorField> pSymmtf; PtrList<pointSymmTensorField> pSymmtf;
PtrList<pointTensorField> ptf; PtrList<pointTensorField> ptf;
if (pMeshPtr.valid()) if (!noPointValues)
{ {
readFields(pMeshPtr(), objects, selectedFields, psf); readFields
(
vMesh,
vMesh.basePointMesh(),
objects,
selectedFields,
psf
);
print(" pointScalarFields :", Info, psf); print(" pointScalarFields :", Info, psf);
readFields(pMeshPtr(), objects, selectedFields, pvf); readFields
(
vMesh,
vMesh.basePointMesh(),
objects,
selectedFields,
pvf
);
print(" pointVectorFields :", Info, pvf); print(" pointVectorFields :", Info, pvf);
readFields(pMeshPtr(), objects, selectedFields, pSpheretf); readFields
(
vMesh,
vMesh.basePointMesh(),
objects,
selectedFields,
pSpheretf
);
print(" pointSphericalTensorFields :", Info, pSpheretf); print(" pointSphericalTensorFields :", Info, pSpheretf);
readFields(pMeshPtr(), objects, selectedFields, pSymmtf); readFields
(
vMesh,
vMesh.basePointMesh(),
objects,
selectedFields,
pSymmtf
);
print(" pointSymmTensorFields :", Info, pSymmtf); print(" pointSymmTensorFields :", Info, pSymmtf);
readFields(pMeshPtr(), objects, selectedFields, ptf); readFields
(
vMesh,
vMesh.basePointMesh(),
objects,
selectedFields,
ptf
);
print(" pointTensorFields :", Info, ptf); print(" pointTensorFields :", Info, ptf);
} }
Info<< endl; Info<< endl;
@ -550,7 +580,7 @@ int main(int argc, char *argv[])
writer.write(vSymmtf); writer.write(vSymmtf);
writer.write(vtf); writer.write(vtf);
if (pMeshPtr.valid()) if (!noPointValues)
{ {
writeFuns::writePointDataHeader writeFuns::writePointDataHeader
( (
@ -567,7 +597,7 @@ int main(int argc, char *argv[])
writer.write(ptf); writer.write(ptf);
// Interpolated volFields // Interpolated volFields
volPointInterpolation pInterp(mesh, pMeshPtr()); volPointInterpolation pInterp(mesh, vMesh.pMesh());
writer.write(pInterp, vsf); writer.write(pInterp, vsf);
writer.write(pInterp, vvf); writer.write(pInterp, vvf);
writer.write(pInterp, vSpheretf); writer.write(pInterp, vSpheretf);
@ -705,7 +735,7 @@ int main(int argc, char *argv[])
writer.write(vSymmtf); writer.write(vSymmtf);
writer.write(vtf); writer.write(vtf);
if (pMeshPtr.valid()) if (!noPointValues)
{ {
writeFuns::writePointDataHeader writeFuns::writePointDataHeader
( (
@ -785,7 +815,7 @@ int main(int argc, char *argv[])
writer.write(vSymmtf); writer.write(vSymmtf);
writer.write(vtf); writer.write(vtf);
if (pMeshPtr.valid()) if (!noPointValues)
{ {
writeFuns::writePointDataHeader writeFuns::writePointDataHeader
( (

View File

@ -34,50 +34,6 @@ namespace Foam
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
//template<class GeoField, class Mesh>
template<class GeoField>
void readFields
(
const typename GeoField::Mesh& mesh,
const IOobjectList& objects,
const HashSet<word>& selectedFields,
PtrList<GeoField>& fields
)
{
// Search list of objects for volScalarFields
IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
// Construct the vol scalar fields
fields.setSize(fieldObjects.size());
label nFields = 0;
for
(
IOobjectList::iterator iter = fieldObjects.begin();
iter != fieldObjects.end();
++iter
)
{
if (!selectedFields.size() || selectedFields.found(iter()->name()))
{
fields.set
(
nFields,
new GeoField
(
*iter(),
mesh
)
);
nFields++;
}
}
fields.setSize(nFields);
}
template<class GeoField> template<class GeoField>
void readFields void readFields
( (

View File

@ -45,16 +45,6 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Read the fields and put on the pointer list
template<class GeoField>
void readFields
(
const typename GeoField::Mesh& mesh,
const IOobjectList& objects,
const HashSet<word>& selectedFields,
PtrList<GeoField>& fields
);
// Read the fields and optionally subset and put on the pointer list // Read the fields and optionally subset and put on the pointer list
template<class GeoField> template<class GeoField>
void readFields void readFields

View File

@ -45,8 +45,7 @@ Foam::vtkMesh::vtkMesh
: :
baseMesh_(baseMesh), baseMesh_(baseMesh),
subsetter_(baseMesh), subsetter_(baseMesh),
setName_(setName), setName_(setName)
topoPtr_(NULL)
{ {
if (setName.size() > 0) if (setName.size() > 0)
{ {
@ -59,14 +58,6 @@ Foam::vtkMesh::vtkMesh
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::vtkMesh::~vtkMesh()
{
deleteDemandDrivenData(topoPtr_);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::polyMesh::readUpdateState Foam::vtkMesh::readUpdate() Foam::polyMesh::readUpdateState Foam::vtkMesh::readUpdate()
@ -78,11 +69,11 @@ Foam::polyMesh::readUpdateState Foam::vtkMesh::readUpdate()
// Note: since fvMeshSubset has no movePoints() functionality reconstruct // Note: since fvMeshSubset has no movePoints() functionality reconstruct
// the subset even if only movement. // the subset even if only movement.
deleteDemandDrivenData(topoPtr_); topoPtr_.clear();
if (setName_.size() > 0) if (setName_.size() > 0)
{ {
Pout<< "Subsetting mesh based on cellSet " << setName_ << endl; Info<< "Subsetting mesh based on cellSet " << setName_ << endl;
// Read cellSet using whole mesh // Read cellSet using whole mesh
cellSet currentSet(baseMesh_, setName_); cellSet currentSet(baseMesh_, setName_);

View File

@ -39,6 +39,7 @@ SourceFiles
#include "vtkTopo.H" #include "vtkTopo.H"
#include "fvMeshSubset.H" #include "fvMeshSubset.H"
#include "pointMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,14 +60,17 @@ class vtkMesh
//- Reference to mesh //- Reference to mesh
fvMesh& baseMesh_; fvMesh& baseMesh_;
//- Subsetting engine //- Demand driven pointMesh
mutable autoPtr<pointMesh> pointMeshPtr_;
//- Subsetting engine + sub-fvMesh
fvMeshSubset subsetter_; fvMeshSubset subsetter_;
//- Current cellSet (or empty) //- Current cellSet (or empty)
const word setName_; const word setName_;
//- Current decomposition of topology //- Current decomposition of topology
mutable vtkTopo* topoPtr_; mutable autoPtr<vtkTopo> topoPtr_;
@ -87,11 +91,6 @@ public:
vtkMesh(fvMesh& baseMesh, const word& setName = ""); vtkMesh(fvMesh& baseMesh, const word& setName = "");
// Destructor
~vtkMesh();
// Member Functions // Member Functions
// Access // Access
@ -102,6 +101,15 @@ public:
return baseMesh_; return baseMesh_;
} }
const pointMesh& basePointMesh() const
{
if (!pointMeshPtr_.valid())
{
pointMeshPtr_.reset(new pointMesh(baseMesh_));
}
return pointMeshPtr_();
}
const fvMeshSubset& subsetter() const const fvMeshSubset& subsetter() const
{ {
return subsetter_; return subsetter_;
@ -116,11 +124,11 @@ public:
//- topology //- topology
const vtkTopo& topo() const const vtkTopo& topo() const
{ {
if (!topoPtr_) if (!topoPtr_.valid())
{ {
topoPtr_ = new vtkTopo(mesh()); topoPtr_.reset(new vtkTopo(mesh()));
} }
return *topoPtr_; return topoPtr_();
} }
//- Access either mesh or submesh //- Access either mesh or submesh
@ -136,6 +144,19 @@ public:
} }
} }
//- Access either pointMesh of base or pointMesh of subset
const pointMesh& pMesh() const
{
if (useSubMesh())
{
return subsetter_.subPointMesh();
}
else
{
return basePointMesh();
}
}
//- Number of field cells //- Number of field cells
label nFieldCells() const label nFieldCells() const
{ {
@ -145,7 +166,7 @@ public:
//- Number of field points //- Number of field points
label nFieldPoints() const label nFieldPoints() const
{ {
return mesh().nPoints() + topo().addPointCellLabels().size(); return pMesh().size() + topo().addPointCellLabels().size();
} }
@ -171,7 +192,6 @@ public:
return fld; return fld;
} }
} }
}; };

View File

@ -81,14 +81,17 @@ public:
// Public static data // Public static data
// this must be consistent with the enumeration in "vtkCell.H" // this must be consistent with the enumeration in "vtkCell.H"
static const label VTK_TRIANGLE = 5; enum vtkTypes
static const label VTK_POLYGON = 7; {
static const label VTK_QUAD = 9; VTK_TRIANGLE = 5,
VTK_POLYGON = 7,
VTK_QUAD = 9,
static const label VTK_TETRA = 10; VTK_TETRA = 10,
static const label VTK_PYRAMID = 14; VTK_PYRAMID = 14,
static const label VTK_WEDGE = 13; VTK_WEDGE = 13,
static const label VTK_HEXAHEDRON = 12; VTK_HEXAHEDRON = 12,
};
// Constructors // Constructors

View File

@ -66,7 +66,7 @@ basicSymmetryPointPatchField<Type>::basicSymmetryPointPatchField
const pointPatchFieldMapper& const pointPatchFieldMapper&
) )
: :
pointPatchField<Type>(ptf, iF) pointPatchField<Type>(p, iF)
{} {}

View File

@ -72,7 +72,7 @@ calculatedPointPatchField<Type>::calculatedPointPatchField
const pointPatchFieldMapper& const pointPatchFieldMapper&
) )
: :
pointPatchField<Type>(ptf, iF) pointPatchField<Type>(p, iF)
{} {}

View File

@ -65,7 +65,7 @@ coupledPointPatchField<Type>::coupledPointPatchField
const pointPatchFieldMapper& const pointPatchFieldMapper&
) )
: :
pointPatchField<Type>(ptf, iF) pointPatchField<Type>(p, iF)
{} {}

View File

@ -114,7 +114,7 @@ valuePointPatchField<Type>::valuePointPatchField
const pointPatchFieldMapper& mapper const pointPatchFieldMapper& mapper
) )
: :
pointPatchField<Type>(ptf, iF), pointPatchField<Type>(p, iF),
Field<Type>(ptf, mapper) Field<Type>(ptf, mapper)
{} {}

View File

@ -65,7 +65,7 @@ zeroGradientPointPatchField<Type>::zeroGradientPointPatchField
const pointPatchFieldMapper& const pointPatchFieldMapper&
) )
: :
pointPatchField<Type>(ptf, iF) pointPatchField<Type>(p, iF)
{} {}

View File

@ -81,10 +81,10 @@ cyclicPointPatchField<Type>::cyclicPointPatchField
const cyclicPointPatchField<Type>& ptf, const cyclicPointPatchField<Type>& ptf,
const pointPatch& p, const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF, const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& const pointPatchFieldMapper& mapper
) )
: :
coupledPointPatchField<Type>(ptf, iF), coupledPointPatchField<Type>(ptf, p, iF, mapper),
cyclicPatch_(refCast<const cyclicPointPatch>(p)) cyclicPatch_(refCast<const cyclicPointPatch>(p))
{ {
if (!isType<cyclicPointPatch>(this->patch())) if (!isType<cyclicPointPatch>(this->patch()))

View File

@ -81,7 +81,7 @@ emptyPointPatchField<Type>::emptyPointPatchField
const pointPatchFieldMapper& const pointPatchFieldMapper&
) )
: :
pointPatchField<Type>(ptf, iF) pointPatchField<Type>(p, iF)
{ {
if (!isType<emptyPointPatch>(this->patch())) if (!isType<emptyPointPatch>(this->patch()))
{ {

View File

@ -66,10 +66,10 @@ processorPointPatchField<Type>::processorPointPatchField
const processorPointPatchField<Type>& ptf, const processorPointPatchField<Type>& ptf,
const pointPatch& p, const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF, const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& const pointPatchFieldMapper& mapper
) )
: :
coupledPointPatchField<Type>(ptf, iF), coupledPointPatchField<Type>(ptf, p, iF, mapper),
procPatch_(refCast<const processorPointPatch>(ptf.patch())) procPatch_(refCast<const processorPointPatch>(ptf.patch()))
{} {}

View File

@ -78,10 +78,10 @@ symmetryPointPatchField<Type>::symmetryPointPatchField
const symmetryPointPatchField<Type>& ptf, const symmetryPointPatchField<Type>& ptf,
const pointPatch& p, const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF, const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& const pointPatchFieldMapper& mapper
) )
: :
basicSymmetryPointPatchField<Type>(ptf, iF) basicSymmetryPointPatchField<Type>(ptf, p, iF, mapper)
{ {
if (!isType<symmetryPointPatch>(this->patch())) if (!isType<symmetryPointPatch>(this->patch()))
{ {

View File

@ -82,7 +82,7 @@ wedgePointPatchField<Type>::wedgePointPatchField
const pointPatchFieldMapper& const pointPatchFieldMapper&
) )
: :
pointPatchField<Type>(ptf, iF) pointPatchField<Type>(p, iF)
{ {
if (!isType<wedgePointPatch>(this->patch())) if (!isType<wedgePointPatch>(this->patch()))
{ {

View File

@ -82,10 +82,10 @@ globalPointPatchField<Type>::globalPointPatchField
const globalPointPatchField<Type>& ptf, const globalPointPatchField<Type>& ptf,
const pointPatch& p, const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF, const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& const pointPatchFieldMapper& mapper
) )
: :
coupledPointPatchField<Type>(ptf, iF), coupledPointPatchField<Type>(ptf, p, iF, mapper),
globalPointPatch_(refCast<const globalPointPatch>(ptf.patch())) globalPointPatch_(refCast<const globalPointPatch>(ptf.patch()))
{ {
if (!isType<globalPointPatch>(this->patch())) if (!isType<globalPointPatch>(this->patch()))

View File

@ -62,10 +62,10 @@ slipPointPatchField<Type>::slipPointPatchField
const slipPointPatchField<Type>& ptf, const slipPointPatchField<Type>& ptf,
const pointPatch& p, const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF, const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& const pointPatchFieldMapper& mapper
) )
: :
basicSymmetryPointPatchField<Type>(ptf, iF) basicSymmetryPointPatchField<Type>(ptf, p, iF, mapper)
{} {}

View File

@ -48,7 +48,7 @@ namespace Foam
bool Foam::fvMeshSubset::checkCellSubset() const bool Foam::fvMeshSubset::checkCellSubset() const
{ {
if (!fvMeshSubsetPtr_) if (!fvMeshSubsetPtr_.valid())
{ {
FatalErrorIn("bool fvMeshSubset::checkCellSubset() const") FatalErrorIn("bool fvMeshSubset::checkCellSubset() const")
<< "Mesh subset not set. Please set the cell map using " << "Mesh subset not set. Please set the cell map using "
@ -267,7 +267,7 @@ void Foam::fvMeshSubset::subsetZones()
pz.name(), pz.name(),
subset(baseMesh().nPoints(), pz, pointMap()), subset(baseMesh().nPoints(), pz, pointMap()),
i, i,
fvMeshSubsetPtr_->pointZones() fvMeshSubsetPtr_().pointZones()
); );
} }
@ -315,7 +315,7 @@ void Foam::fvMeshSubset::subsetZones()
subAddressing, subAddressing,
subFlipStatus, subFlipStatus,
i, i,
fvMeshSubsetPtr_->faceZones() fvMeshSubsetPtr_().faceZones()
); );
} }
@ -333,13 +333,13 @@ void Foam::fvMeshSubset::subsetZones()
cz.name(), cz.name(),
subset(baseMesh().nCells(), cz, cellMap()), subset(baseMesh().nCells(), cz, cellMap()),
i, i,
fvMeshSubsetPtr_->cellZones() fvMeshSubsetPtr_().cellZones()
); );
} }
// Add the zones // Add the zones
fvMeshSubsetPtr_->addZones(pZonePtrs, fZonePtrs, cZonePtrs); fvMeshSubsetPtr_().addZones(pZonePtrs, fZonePtrs, cZonePtrs);
} }
@ -357,14 +357,6 @@ Foam::fvMeshSubset::fvMeshSubset(const fvMesh& baseMesh)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::fvMeshSubset::~fvMeshSubset()
{
deleteDemandDrivenData(fvMeshSubsetPtr_);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fvMeshSubset::setCellSubset void Foam::fvMeshSubset::setCellSubset
@ -671,7 +663,9 @@ void Foam::fvMeshSubset::setCellSubset
// Make a new mesh // Make a new mesh
fvMeshSubsetPtr_ = new fvMesh fvMeshSubsetPtr_.reset
(
new fvMesh
( (
IOobject IOobject
( (
@ -684,7 +678,9 @@ void Foam::fvMeshSubset::setCellSubset
newPoints, newPoints,
newFaces, newFaces,
newCells newCells
)
); );
pointMeshSubsetPtr_.clear();
// Add old patches // Add old patches
@ -700,7 +696,7 @@ void Foam::fvMeshSubset::setCellSubset
// Patch still exists. Add it // Patch still exists. Add it
newBoundary[nNewPatches] = oldPatches[patchI].clone newBoundary[nNewPatches] = oldPatches[patchI].clone
( (
fvMeshSubsetPtr_->boundaryMesh(), fvMeshSubsetPtr_().boundaryMesh(),
nNewPatches, nNewPatches,
boundaryPatchSizes[patchI], boundaryPatchSizes[patchI],
patchStart patchStart
@ -723,7 +719,7 @@ void Foam::fvMeshSubset::setCellSubset
boundaryPatchSizes[oldInternalPatchID], boundaryPatchSizes[oldInternalPatchID],
patchStart, patchStart,
nNewPatches, nNewPatches,
fvMeshSubsetPtr_->boundaryMesh() fvMeshSubsetPtr_().boundaryMesh()
); );
// The index for the first patch is -1 as it originates from // The index for the first patch is -1 as it originates from
@ -738,7 +734,7 @@ void Foam::fvMeshSubset::setCellSubset
patchMap_.setSize(nNewPatches); patchMap_.setSize(nNewPatches);
// Add the fvPatches // Add the fvPatches
fvMeshSubsetPtr_->addFvPatches(newBoundary); fvMeshSubsetPtr_().addFvPatches(newBoundary);
// Subset and add any zones // Subset and add any zones
subsetZones(); subsetZones();
@ -1166,7 +1162,9 @@ void Foam::fvMeshSubset::setLargeCellSubset
// not proper but cannot be avoided since otherwise surfaceInterpolation // not proper but cannot be avoided since otherwise surfaceInterpolation
// cannot find its fvSchemes (it will try to read e.g. // cannot find its fvSchemes (it will try to read e.g.
// system/region0SubSet/fvSchemes) // system/region0SubSet/fvSchemes)
fvMeshSubsetPtr_ = new fvMesh fvMeshSubsetPtr_.reset
(
new fvMesh
( (
IOobject IOobject
( (
@ -1180,8 +1178,9 @@ void Foam::fvMeshSubset::setLargeCellSubset
newFaces, newFaces,
newCells, newCells,
syncPar // parallel synchronisation syncPar // parallel synchronisation
)
); );
pointMeshSubsetPtr_.clear();
// Add old patches // Add old patches
List<polyPatch*> newBoundary(nbSize); List<polyPatch*> newBoundary(nbSize);
@ -1251,7 +1250,7 @@ void Foam::fvMeshSubset::setLargeCellSubset
// Clone (even if 0 size) // Clone (even if 0 size)
newBoundary[nNewPatches] = oldPatches[oldPatchI].clone newBoundary[nNewPatches] = oldPatches[oldPatchI].clone
( (
fvMeshSubsetPtr_->boundaryMesh(), fvMeshSubsetPtr_().boundaryMesh(),
nNewPatches, nNewPatches,
newSize, newSize,
patchStart patchStart
@ -1282,7 +1281,7 @@ void Foam::fvMeshSubset::setLargeCellSubset
boundaryPatchSizes[oldInternalPatchID], boundaryPatchSizes[oldInternalPatchID],
patchStart, patchStart,
nNewPatches, nNewPatches,
fvMeshSubsetPtr_->boundaryMesh() fvMeshSubsetPtr_().boundaryMesh()
); );
//Pout<< " oldInternalFaces : " //Pout<< " oldInternalFaces : "
@ -1310,7 +1309,7 @@ void Foam::fvMeshSubset::setLargeCellSubset
// Patch still exists. Add it // Patch still exists. Add it
newBoundary[nNewPatches] = oldPatches[oldPatchI].clone newBoundary[nNewPatches] = oldPatches[oldPatchI].clone
( (
fvMeshSubsetPtr_->boundaryMesh(), fvMeshSubsetPtr_().boundaryMesh(),
nNewPatches, nNewPatches,
newSize, newSize,
patchStart patchStart
@ -1331,7 +1330,7 @@ void Foam::fvMeshSubset::setLargeCellSubset
// Add the fvPatches // Add the fvPatches
fvMeshSubsetPtr_->addFvPatches(newBoundary); fvMeshSubsetPtr_().addFvPatches(newBoundary);
// Subset and add any zones // Subset and add any zones
subsetZones(); subsetZones();
@ -1359,7 +1358,7 @@ const fvMesh& Foam::fvMeshSubset::subMesh() const
{ {
checkCellSubset(); checkCellSubset();
return *fvMeshSubsetPtr_; return fvMeshSubsetPtr_();
} }
@ -1367,7 +1366,27 @@ fvMesh& Foam::fvMeshSubset::subMesh()
{ {
checkCellSubset(); checkCellSubset();
return *fvMeshSubsetPtr_; return fvMeshSubsetPtr_();
}
const pointMesh& Foam::fvMeshSubset::subPointMesh() const
{
if (!pointMeshSubsetPtr_.valid())
{
pointMeshSubsetPtr_.reset(new pointMesh(subMesh()));
}
return pointMeshSubsetPtr_();
}
pointMesh& Foam::fvMeshSubset::subPointMesh()
{
if (!pointMeshSubsetPtr_.valid())
{
pointMeshSubsetPtr_.reset(new pointMesh(subMesh()));
}
return pointMeshSubsetPtr_();
} }

View File

@ -56,11 +56,11 @@ SourceFiles
#define fvMeshSubset_H #define fvMeshSubset_H
#include "fvMesh.H" #include "fvMesh.H"
#include "pointMesh.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "pointPatchFieldMapper.H"
#include "GeometricField.H" #include "GeometricField.H"
#include "emptyFvPatchFields.H"
#include "labelHashSet.H" #include "labelHashSet.H"
#include "SubField.H"
#include "surfaceMesh.H" #include "surfaceMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -119,6 +119,48 @@ public:
}; };
//- Patch-field subset interpolation class
class pointPatchFieldSubset
:
public pointPatchFieldMapper
{
const labelList& directAddressing_;
public:
// Constructors
//- Construct given addressing
pointPatchFieldSubset(const labelList& directAddressing)
:
directAddressing_(directAddressing)
{}
// Destructor
virtual ~pointPatchFieldSubset()
{}
// Member Functions
label size() const
{
return directAddressing_.size();
}
bool direct() const
{
return true;
}
const unallocLabelList& directAddressing() const
{
return directAddressing_;
}
};
private: private:
// Private data // Private data
@ -127,7 +169,9 @@ private:
const fvMesh& baseMesh_; const fvMesh& baseMesh_;
//- Subset mesh pointer //- Subset mesh pointer
fvMesh* fvMeshSubsetPtr_; autoPtr<fvMesh> fvMeshSubsetPtr_;
mutable autoPtr<pointMesh> pointMeshSubsetPtr_;
//- Point mapping array //- Point mapping array
labelList pointMap_; labelList pointMap_;
@ -185,11 +229,6 @@ public:
explicit fvMeshSubset(const fvMesh&); explicit fvMeshSubset(const fvMesh&);
// Destructor
~fvMeshSubset();
// Member Functions // Member Functions
// Edit // Edit
@ -236,8 +275,14 @@ public:
//- Return reference to subset mesh //- Return reference to subset mesh
const fvMesh& subMesh() const; const fvMesh& subMesh() const;
fvMesh& subMesh(); fvMesh& subMesh();
//- Return reference to demand-driven subset pointMesh
const pointMesh& subPointMesh() const;
pointMesh& subPointMesh();
//- Return point map //- Return point map
const labelList& pointMap() const; const labelList& pointMap() const;
@ -289,6 +334,25 @@ public:
( (
const GeometricField<Type, fvsPatchField, surfaceMesh>& const GeometricField<Type, fvsPatchField, surfaceMesh>&
) const; ) const;
//- Map point field
template<class Type>
static tmp<GeometricField<Type, pointPatchField, pointMesh> >
interpolate
(
const GeometricField<Type, pointPatchField, pointMesh>&,
const pointMesh& sMesh,
const objectRegistry& reg,
const labelList& patchMap,
const labelList& pointMap
);
template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh> >
interpolate
(
const GeometricField<Type, pointPatchField, pointMesh>&
) const;
}; };

View File

@ -26,6 +26,8 @@ License
#include "fvMeshSubset.H" #include "fvMeshSubset.H"
#include "emptyFvsPatchField.H" #include "emptyFvsPatchField.H"
#include "emptyPointPatchField.H"
#include "emptyFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -134,6 +136,23 @@ tmp<GeometricField<Type, fvPatchField, volMesh> > fvMeshSubset::interpolate
} }
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> > fvMeshSubset::interpolate
(
const GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
return interpolate
(
vf,
subMesh(),
patchMap(),
cellMap(),
faceMap()
);
}
template<class Type> template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate
( (
@ -258,23 +277,6 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate
} }
template<class Type>
tmp<GeometricField<Type, fvPatchField, volMesh> > fvMeshSubset::interpolate
(
const GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
return interpolate
(
vf,
subMesh(),
patchMap(),
cellMap(),
faceMap()
);
}
template<class Type> template<class Type>
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate
( (
@ -291,6 +293,130 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > fvMeshSubset::interpolate
} }
template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh> >
fvMeshSubset::interpolate
(
const GeometricField<Type, pointPatchField, pointMesh>& vf,
const pointMesh& sMesh,
const objectRegistry& reg,
const labelList& patchMap,
const labelList& pointMap
)
{
// Create and map the internal-field values
Field<Type> internalField(vf.internalField(), pointMap);
// Create and map the patch field values
PtrList<pointPatchField<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
// as necessary.
if (patchMap[patchI] == -1)
{
patchFields.set
(
patchI,
new emptyPointPatchField<Type>
(
sMesh.boundary()[patchI],
DimensionedField<Type, pointMesh>::null()
)
);
}
else
{
// Construct addressing
const pointPatch& basePatch =
vf.mesh().boundary()[patchMap[patchI]];
const labelList& meshPoints = basePatch.meshPoints();
// Make addressing from mesh to patch point
Map<label> meshPointMap(2*meshPoints.size());
forAll(meshPoints, localI)
{
meshPointMap.insert(meshPoints[localI], localI);
}
// Find which subpatch points originate from which patch point
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);
forAll(subMeshPoints, localI)
{
// Get mesh point on original mesh.
label meshPointI = pointMap[subMeshPoints[localI]];
Map<label>::const_iterator iter = meshPointMap.find(meshPointI);
if (iter != meshPointMap.end())
{
directAddressing[localI] = iter();
}
}
patchFields.set
(
patchI,
pointPatchField<Type>::New
(
vf.boundaryField()[patchMap[patchI]],
subPatch,
DimensionedField<Type, pointMesh>::null(),
pointPatchFieldSubset(directAddressing)
)
);
}
}
// Create the complete field from the pieces
tmp<GeometricField<Type, pointPatchField, pointMesh> > tresF
(
new GeometricField<Type, pointPatchField, pointMesh>
(
IOobject
(
"subset"+vf.name(),
vf.time().timeName(),
reg,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sMesh,
vf.dimensions(),
internalField,
patchFields
)
);
return tresF;
}
template<class Type>
tmp<GeometricField<Type, pointPatchField, pointMesh> > fvMeshSubset::interpolate
(
const GeometricField<Type, pointPatchField, pointMesh>& sf
) const
{
return interpolate
(
sf,
subPointMesh(), // subsetted point mesh
subMesh(), // registry (pointfields are stored on the polyMesh)
patchMap(),
pointMap()
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -77,7 +77,7 @@ surfaceSlipDisplacementPointPatchVectorField
const dictionary& dict const dictionary& dict
) )
: :
pointPatchVectorField(p, iF), pointPatchVectorField(p, iF, dict),
surfaceNames_(dict.lookup("projectSurfaces")), surfaceNames_(dict.lookup("projectSurfaces")),
projectMode_(followModeNames_.read(dict.lookup("followMode"))), projectMode_(followModeNames_.read(dict.lookup("followMode"))),
projectDir_(dict.lookup("projectDirection")), projectDir_(dict.lookup("projectDirection")),

View File

@ -5,3 +5,4 @@ wmake libso basic
wmake libso solidParticle wmake libso solidParticle
wmake libso intermediate wmake libso intermediate
wmake libso dieselSpray wmake libso dieselSpray
wmake libso molecule

View File

@ -2,7 +2,7 @@
currDir=`pwd` currDir=`pwd`
application=`basename $currDir` application=`basename $currDir`
cases="pitzDaily" cases="pitzDaily pitzDailyDirectMapped"
tutorialPath=`dirname $0`/.. tutorialPath=`dirname $0`/..
. $tutorialPath/CleanFunctions . $tutorialPath/CleanFunctions

View File

@ -2,11 +2,19 @@
currDir=`pwd` currDir=`pwd`
application=`basename $currDir` application=`basename $currDir`
case="pitzDaily" cases="pitzDaily pitzDailyDirectMapped"
tutorialPath=`dirname $0`/.. tutorialPath=`dirname $0`/..
. $tutorialPath/RunFunctions . $tutorialPath/RunFunctions
runApplication blockMesh $case for case in $cases
runApplication $application $case do
runApplication blockMesh $case
if [ "$case" = "pitzDailyDirectMapped" ]
then
runApplication changeDictionary $case
fi
runApplication $application $case
done

View File

@ -0,0 +1,64 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class volTensorField;
object B;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform (0 0 0 0 0 0 0 0 0);
boundaryField
{
inlet
{
type directMapped;
value uniform (0 0 0 0 0 0 0 0 0);
setAverage false;
average (0 0 0 0 0 0 0 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0 0 0 0 0 0 0);
value uniform (0 0 0 0 0 0 0 0 0);
}
upperWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type directMapped;
value uniform (10 0 0);
setAverage true;
average (10 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
upperWall
{
type fixedValue;
value uniform (0 0 0);
}
lowerWall
{
type fixedValue;
value uniform (0 0 0);
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type directMapped;
value uniform 2e-05;
setAverage false;
average 2e-05;
}
outlet
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
upperWall
{
type fixedValue;
value uniform 0;
}
lowerWall
{
type fixedValue;
value uniform 0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class volScalarField;
object nuSgs;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
upperWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class volScalarField;
object nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type directMapped;
value uniform 0;
setAverage false;
average 0;
}
outlet
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
upperWall
{
type fixedValue;
value uniform 0;
}
lowerWall
{
type fixedValue;
value uniform 0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
upperWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,161 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.001;
vertices
(
(-70.0 0 -0.5)
(-70.0 3 -0.5)
(-70.0 12.7 -0.5)
(-70.0 25.4 -0.5)
(0 -25.4 -0.5)
(0 -5 -0.5)
(0 0 -0.5)
(0 3 -0.5)
(0 12.7 -0.5)
(0 25.4 -0.5)
(206 -25.4 -0.5)
(206 -8.5 -0.5)
(206 0 -0.5)
(206 6.5 -0.5)
(206 17 -0.5)
(206 25.4 -0.5)
(290 -16.6 -0.5)
(290 -6.3 -0.5)
(290 0 -0.5)
(290 4.5 -0.5)
(290 11 -0.5)
(290 16.6 -0.5)
(-70.0 0 0.5)
(-70.0 3 0.5)
(-70.0 12.7 0.5)
(-70.0 25.4 0.5)
(0 -25.4 0.5)
(0 -5 0.5)
(0 0 0.5)
(0 3 0.5)
(0 12.7 0.5)
(0 25.4 0.5)
(206 -25.4 0.5)
(206 -8.5 0.5)
(206 0 0.5)
(206 6.5 0.5)
(206 17 0.5)
(206 25.4 0.5)
(290 -16.6 0.5)
(290 -6.3 0.5)
(290 0 0.5)
(290 4.5 0.5)
(290 11 0.5)
(290 16.6 0.5)
);
blocks
(
hex (0 6 7 1 22 28 29 23) (70 7 1) simpleGrading (1 1.8 1)
hex (1 7 8 2 23 29 30 24) (70 10 1) simpleGrading (1 4 1)
hex (2 8 9 3 24 30 31 25) (70 13 1) simpleGrading (1 0.25 1)
hex (4 10 11 5 26 32 33 27) (180 18 1) simpleGrading (4 1 1)
hex (5 11 12 6 27 33 34 28) (180 9 1) edgeGrading (4 4 4 4 0.5 1 1 0.5 1 1 1 1)
hex (6 12 13 7 28 34 35 29) (180 7 1) edgeGrading (4 4 4 4 1.8 1 1 1.8 1 1 1 1)
hex (7 13 14 8 29 35 36 30) (180 10 1) edgeGrading (4 4 4 4 4 1 1 4 1 1 1 1)
hex (8 14 15 9 30 36 37 31) (180 13 1) simpleGrading (4 0.25 1)
hex (10 16 17 11 32 38 39 33) (25 18 1) simpleGrading (2.5 1 1)
hex (11 17 18 12 33 39 40 34) (25 9 1) simpleGrading (2.5 1 1)
hex (12 18 19 13 34 40 41 35) (25 7 1) simpleGrading (2.5 1 1)
hex (13 19 20 14 35 41 42 36) (25 10 1) simpleGrading (2.5 1 1)
hex (14 20 21 15 36 42 43 37) (25 13 1) simpleGrading (2.5 0.25 1)
);
edges
(
);
patches
(
patch inlet
(
(0 22 23 1)
(1 23 24 2)
(2 24 25 3)
)
patch outlet
(
(16 17 39 38)
(17 18 40 39)
(18 19 41 40)
(19 20 42 41)
(20 21 43 42)
)
wall upperWall
(
(3 25 31 9)
(9 31 37 15)
(15 37 43 21)
)
wall lowerWall
(
(0 6 28 22)
(6 5 27 28)
(5 4 26 27)
(4 10 32 26)
(10 16 38 32)
)
empty frontAndBack
(
(22 28 29 23)
(23 29 30 24)
(24 30 31 25)
(26 32 33 27)
(27 33 34 28)
(28 34 35 29)
(29 35 36 30)
(30 36 37 31)
(32 38 39 33)
(33 39 40 34)
(34 40 41 35)
(35 41 42 36)
(36 42 43 37)
(0 1 7 6)
(1 2 8 7)
(2 3 9 8)
(4 5 11 10)
(5 6 12 11)
(6 7 13 12)
(7 8 14 13)
(8 9 15 14)
(10 11 17 16)
(11 12 18 17)
(12 13 19 18)
(13 14 20 19)
(14 15 21 20)
)
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
object boundary;
location "constant/polyMesh";
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
inlet
{
nFaces 30;
startFace 27238;
type directMappedPatch;
offset ( 0.05 0 0 );
}
outlet
{
type patch;
nFaces 57;
startFace 27268;
}
upperWall
{
type wall;
nFaces 275;
startFace 27325;
}
lowerWall
{
type wall;
nFaces 302;
startFace 27600;
}
frontAndBack
{
type empty;
nFaces 27570;
startFace 27902;
}
)
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu nu [0 2 -1 0 0 0 0] 1e-05;
CrossPowerLawCoeffs
{
nu0 nu0 [0 2 -1 0 0 0 0] 1e-06;
nuInf nuInf [0 2 -1 0 0 0 0] 1e-06;
m m [0 0 1 0 0 0 0] 1;
n n [0 0 0 0 0 0 0] 1;
}
BirdCarreauCoeffs
{
nu0 nu0 [0 2 -1 0 0 0 0] 1e-06;
nuInf nuInf [0 2 -1 0 0 0 0] 1e-06;
k k [0 0 1 0 0 0 0] 0;
n n [0 0 0 0 0 0 0] 1;
}
// ************************************************************************* //

View File

@ -0,0 +1,183 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
LESmodel oneEqEddy;
delta cubeRootVol;
laminarCoeffs
{
}
oneEqEddyCoeffs
{
ck ck [0 0 0 0 0 0 0] 0.07;
ce ce [0 0 0 0 0 0 0] 1.05;
}
dynOneEqEddyCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
filter simple;
}
locDynOneEqEddyCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
filter simple;
}
SmagorinskyCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
ck ck [0 0 0 0 0 0 0] 0.07;
}
Smagorinsky2Coeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
ck ck [0 0 0 0 0 0 0] 0.07;
cD2 cD2 [0 1 0 0 0 0 0] 0.02;
}
spectEddyViscCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
cB cB [0 0 0 0 0 0 0] 8.22;
cK1 cK1 [0 0 0 0 0 0 0] 0.83;
cK2 cK2 [0 0 0 0 0 0 0] 1.03;
cK3 cK3 [0 0 0 0 0 0 0] 4.75;
cK4 cK4 [0 0 0 0 0 0 0] 2.55;
}
dynSmagorinskyCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
filter simple;
}
mixedSmagorinskyCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
ck ck [0 0 0 0 0 0 0] 0.07;
filter simple;
}
dynMixedSmagorinskyCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
filter simple;
}
LRRDiffStressCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
ck ck [0 0 0 0 0 0 0] 0.09;
c1 c1 [0 0 0 0 0 0 0] 1.8;
c2 c2 [0 0 0 0 0 0 0] 0.6;
}
DeardorffDiffStressCoeffs
{
ce ce [0 0 0 0 0 0 0] 1.05;
ck ck [0 0 0 0 0 0 0] 0.09;
cm cm [0 0 0 0 0 0 0] 4.13;
}
SpalartAllmarasCoeffs
{
alphaNut alphaNut [0 0 0 0 0 0 0] 1.5;
Cb1 Cb1 [0 0 0 0 0 0 0] 0.1355;
Cb2 Cb2 [0 0 0 0 0 0 0] 0.622;
Cw2 Cw2 [0 0 0 0 0 0 0] 0.3;
Cw3 Cw3 [0 0 0 0 0 0 0] 2;
Cv1 Cv1 [0 0 0 0 0 0 0] 7.1;
Cv2 Cv2 [0 0 0 0 0 0 0] 5.0;
CDES CDES [0 0 0 0 0 0 0] 0.65;
ck ck [0 0 0 0 0 0 0] 0.07;
}
cubeRootVolCoeffs
{
deltaCoeff 1;
}
PrandtlCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
Cdelta Cdelta [0 0 0 0 0 0 0] 0.158;
}
vanDriestCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
Aplus Aplus [0 0 0 0 0 0 0] 26;
Cdelta Cdelta [0 0 0 0 0 0 0] 0.158;
}
smoothCoeffs
{
delta cubeRootVol;
cubeRootVolCoeffs
{
deltaCoeff 1;
}
maxDeltaRatio 1.1;
}
kappa kappa [0 0 0 0 0 0 0] 0.4187;
wallFunctionCoeffs
{
E E [0 0 0 0 0 0 0] 9;
}
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
FoamFile
{
version 2.0;
format ascii;
root "/home/warhol/chris/foam/chris2.1/run/tutorials/interFoam";
case "damBreak";
instance "system";
local "";
class dictionary;
object changePatchTypeDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
// boundary handled explicitly since not dictionary.
boundary
{
inlet
{
type directMappedPatch;
offset (0.05 0 0);
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application oodles;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.1;
deltaT 1e-05;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
functions
(
probes1
{
// Type of functionObject
type probes;
// Where to load it from (if not already in solver)
functionObjectLibs ("libsampling.so");
// Locations to be probed. runTime modifiable!
probeLocations
(
(0.0254 0.0253 0.0)
(0.0508 0.0253 0.0)
(0.0762 0.0253 0.0)
(0.1016 0.0253 0.0)
(0.1270 0.0253 0.0)
(0.1524 0.0253 0.0)
(0.1778 0.0253 0.0)
);
// Fields to be probed. runTime modifiable!
fields
(
p
);
}
fieldAverage1
{
// Type of functionObject
type fieldAverage;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldAverage.so");
// Fields to be averaged - runTime modifiable
fields
(
U
{
mean on;
prime2Mean on;
base time;
}
p
{
mean on;
prime2Mean on;
base time;
}
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.3 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
//method hierarchical;
method metis;
simpleCoeffs
{
n (2 1 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (2 1 1);
delta 0.001;
order xyz;
}
metisCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots
(
);
// ************************************************************************* //

View File

@ -0,0 +1,79 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default backward;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}
divSchemes
{
default none;
// rate(0.2) of adding gradient, allow unboundedness(0.)
div(phi,U) Gauss filteredLinear2V 0.2 0.0;
//div(phi,U) Gauss linear;
div(phi,k) Gauss limitedLinear 1;
div(phi,B) Gauss limitedLinear 1;
div(phi,nuTilda) Gauss limitedLinear 1;
div(B) Gauss linear;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DBEff,B) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(U) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.4 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p PCG
{
preconditioner DIC;
tolerance 1e-06;
relTol 0.05;
};
pFinal PCG
{
preconditioner DIC;
tolerance 1e-06;
relTol 0;
};
U PBiCG
{
preconditioner DILU;
tolerance 1e-05;
relTol 0;
};
k PBiCG
{
preconditioner DILU;
tolerance 1e-05;
relTol 0;
};
B PBiCG
{
preconditioner DILU;
tolerance 1e-05;
relTol 0;
};
nuTilda PBiCG
{
preconditioner DILU;
tolerance 1e-05;
relTol 0;
};
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}
// ************************************************************************* //