mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -12,7 +12,4 @@
|
|||||||
tmp<volScalarField> tkappa = thermo.kappa();
|
tmp<volScalarField> tkappa = thermo.kappa();
|
||||||
const volScalarField& kappa = tkappa();
|
const volScalarField& kappa = tkappa();
|
||||||
|
|
||||||
//tmp<volSymmTensorField> tkappa = thermo.directionalKappa();
|
|
||||||
//const volSymmTensorField& kappa = tkappa();
|
|
||||||
|
|
||||||
volScalarField& h = thermo.he();
|
volScalarField& h = thermo.he();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -123,7 +123,7 @@ void starMesh::createCoupleMatches()
|
|||||||
cellRemovedFaces.insert
|
cellRemovedFaces.insert
|
||||||
(
|
(
|
||||||
fp.masterCell(),
|
fp.masterCell(),
|
||||||
fp.masterFace()
|
SLList<label>(fp.masterFace())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1362,7 +1362,7 @@ void starMesh::createCoupleMatches()
|
|||||||
cellRemovedFaces.insert
|
cellRemovedFaces.insert
|
||||||
(
|
(
|
||||||
fp.masterCell(),
|
fp.masterCell(),
|
||||||
fp.masterFace()
|
SLList<label>(fp.masterFace())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1378,7 +1378,7 @@ void starMesh::createCoupleMatches()
|
|||||||
cellRemovedFaces.insert
|
cellRemovedFaces.insert
|
||||||
(
|
(
|
||||||
fp.slaveCell(),
|
fp.slaveCell(),
|
||||||
fp.slaveFace()
|
SLList<label>(fp.slaveFace())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -40,6 +40,7 @@ Description
|
|||||||
#include "refinementFeatures.H"
|
#include "refinementFeatures.H"
|
||||||
#include "shellSurfaces.H"
|
#include "shellSurfaces.H"
|
||||||
#include "decompositionMethod.H"
|
#include "decompositionMethod.H"
|
||||||
|
#include "noDecomp.H"
|
||||||
#include "fvMeshDistribute.H"
|
#include "fvMeshDistribute.H"
|
||||||
#include "wallPolyPatch.H"
|
#include "wallPolyPatch.H"
|
||||||
#include "refinementParameters.H"
|
#include "refinementParameters.H"
|
||||||
@ -176,17 +177,28 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
// Read decomposePar dictionary
|
// Read decomposePar dictionary
|
||||||
IOdictionary decomposeDict
|
dictionary decomposeDict;
|
||||||
(
|
{
|
||||||
IOobject
|
if (Pstream::parRun())
|
||||||
(
|
{
|
||||||
"decomposeParDict",
|
decomposeDict = IOdictionary
|
||||||
runTime.system(),
|
(
|
||||||
mesh,
|
IOobject
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
(
|
||||||
IOobject::NO_WRITE
|
"decomposeParDict",
|
||||||
)
|
runTime.system(),
|
||||||
);
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
decomposeDict.add("method", "none");
|
||||||
|
decomposeDict.add("numberOfSubdomains", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
|
|||||||
@ -95,11 +95,12 @@ FoamFile
|
|||||||
// type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex
|
// type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Cells with cell centre within box
|
// // Cells with cell centre within box ('box') or multiple boxes ('boxes')
|
||||||
// source boxToCell;
|
// source boxToCell;
|
||||||
// sourceInfo
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// box (0 0 0) (1 1 1);
|
// box (0 0 0) (1 1 1);
|
||||||
|
// //boxes ((0 0 0) (1 1 1) (10 10 10)(11 11 11));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Cells with cell centre within box
|
// // Cells with cell centre within box
|
||||||
@ -223,11 +224,12 @@ FoamFile
|
|||||||
// name ".*Zone1"; // Name of faceZone, regular expressions allowed
|
// name ".*Zone1"; // Name of faceZone, regular expressions allowed
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Faces with face centre within box
|
// // Faces with face centre within box ('box') or multiple boxes ('boxes')
|
||||||
// source boxToFace;
|
// source boxToFace;
|
||||||
// sourceInfo
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// box (0 0 0) (1 1 1);
|
// box (0 0 0) (1 1 1);
|
||||||
|
// //boxes ((0 0 0) (1 1 1) (10 10 10)(11 11 11));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Faces with normal to within certain angle aligned with vector.
|
// // Faces with normal to within certain angle aligned with vector.
|
||||||
@ -295,11 +297,12 @@ FoamFile
|
|||||||
// points ((0 0 0) (1 1 1));
|
// points ((0 0 0) (1 1 1));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Points with coordinate within box
|
// // Points with coordinate within box ('box') or multiple boxes ('boxes')
|
||||||
// source boxToPoint;
|
// source boxToPoint;
|
||||||
// sourceInfo
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// box (0 0 0) (1 1 1);
|
// box (0 0 0) (1 1 1);
|
||||||
|
// //boxes ((0 0 0) (1 1 1) (10 10 10)(11 11 11));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Select based on surface
|
// // Select based on surface
|
||||||
|
|||||||
@ -191,6 +191,22 @@ int main(int argc, char *argv[])
|
|||||||
outputFieldList<tensor>(vtf, patchIDs[0]);
|
outputFieldList<tensor>(vtf, patchIDs[0]);
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// No group.
|
||||||
|
forAll(patchIDs, i)
|
||||||
|
{
|
||||||
|
label patchI = patchIDs[i];
|
||||||
|
Info<< bm[patchI].type()
|
||||||
|
<< "\t: " << bm[patchI].name() << nl;
|
||||||
|
outputFieldList<scalar>(vsf, patchI);
|
||||||
|
outputFieldList<vector>(vvf, patchI);
|
||||||
|
outputFieldList<sphericalTensor>(vsptf, patchI);
|
||||||
|
outputFieldList<symmTensor>(vsytf, patchI);
|
||||||
|
outputFieldList<tensor>(vtf, patchI);
|
||||||
|
Info<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,7 +122,8 @@ structuredCoeffs
|
|||||||
patches (bottomPatch);
|
patches (bottomPatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Is the case distributed
|
//// Is the case distributed? Note: command-line argument -roots takes
|
||||||
|
//// precedence
|
||||||
//distributed yes;
|
//distributed yes;
|
||||||
//// Per slave (so nProcs-1 entries) the directory above the case.
|
//// Per slave (so nProcs-1 entries) the directory above the case.
|
||||||
//roots
|
//roots
|
||||||
|
|||||||
@ -143,8 +143,6 @@ int main(int argc, char *argv[])
|
|||||||
args
|
args
|
||||||
);
|
);
|
||||||
|
|
||||||
instantList masterTimeDirs = runTime.times();
|
|
||||||
|
|
||||||
if (timeDirs.empty())
|
if (timeDirs.empty())
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
@ -152,6 +150,16 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Get current times if -newTimes
|
||||||
|
instantList masterTimeDirs;
|
||||||
|
if (newTimes)
|
||||||
|
{
|
||||||
|
masterTimeDirs = runTime.times();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# include "createNamedMesh.H"
|
# include "createNamedMesh.H"
|
||||||
word regionDir = word::null;
|
word regionDir = word::null;
|
||||||
if (regionName != fvMesh::defaultRegion)
|
if (regionName != fvMesh::defaultRegion)
|
||||||
@ -176,11 +184,24 @@ int main(int argc, char *argv[])
|
|||||||
// Loop over all times
|
// Loop over all times
|
||||||
forAll(timeDirs, timeI)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
if (newTimes && findIndex(masterTimeDirs, timeDirs[timeI]) != -1)
|
if (newTimes)
|
||||||
{
|
{
|
||||||
Info<< "Skipping time " << timeDirs[timeI].name()
|
// Compare on timeName, not value
|
||||||
<< endl << endl;
|
bool foundTime = false;
|
||||||
continue;
|
forAll(masterTimeDirs, i)
|
||||||
|
{
|
||||||
|
if (masterTimeDirs[i].name() == timeDirs[timeI].name())
|
||||||
|
{
|
||||||
|
foundTime = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (foundTime)
|
||||||
|
{
|
||||||
|
Info<< "Skipping time " << timeDirs[timeI].name()
|
||||||
|
<< endl << endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -63,294 +63,6 @@ Description
|
|||||||
static const scalar defaultMergeTol = 1e-6;
|
static const scalar defaultMergeTol = 1e-6;
|
||||||
|
|
||||||
|
|
||||||
//// Read mesh if available. Otherwise create empty mesh with same non-proc
|
|
||||||
//// patches as proc0 mesh. Requires all processors to have all patches
|
|
||||||
//// (and in same order).
|
|
||||||
//autoPtr<fvMesh> createMesh
|
|
||||||
//(
|
|
||||||
// const Time& runTime,
|
|
||||||
// const word& regionName,
|
|
||||||
// const fileName& instDir,
|
|
||||||
// const bool haveMesh
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// //Pout<< "Create mesh for time = "
|
|
||||||
// // << runTime.timeName() << nl << endl;
|
|
||||||
//
|
|
||||||
// IOobject io
|
|
||||||
// (
|
|
||||||
// regionName,
|
|
||||||
// instDir,
|
|
||||||
// runTime,
|
|
||||||
// IOobject::MUST_READ
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// if (!haveMesh)
|
|
||||||
// {
|
|
||||||
// // Create dummy mesh. Only used on procs that don't have mesh.
|
|
||||||
// IOobject noReadIO(io);
|
|
||||||
// noReadIO.readOpt() = IOobject::NO_READ;
|
|
||||||
// fvMesh dummyMesh
|
|
||||||
// (
|
|
||||||
// noReadIO,
|
|
||||||
// xferCopy(pointField()),
|
|
||||||
// xferCopy(faceList()),
|
|
||||||
// xferCopy(labelList()),
|
|
||||||
// xferCopy(labelList()),
|
|
||||||
// false
|
|
||||||
// );
|
|
||||||
// // Add some dummy zones so upon reading it does not read them
|
|
||||||
// // from the undecomposed case. Should be done as extra argument to
|
|
||||||
// // regIOobject::readStream?
|
|
||||||
// List<pointZone*> pz
|
|
||||||
// (
|
|
||||||
// 1,
|
|
||||||
// new pointZone
|
|
||||||
// (
|
|
||||||
// "dummyPointZone",
|
|
||||||
// labelList(0),
|
|
||||||
// 0,
|
|
||||||
// dummyMesh.pointZones()
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
// List<faceZone*> fz
|
|
||||||
// (
|
|
||||||
// 1,
|
|
||||||
// new faceZone
|
|
||||||
// (
|
|
||||||
// "dummyFaceZone",
|
|
||||||
// labelList(0),
|
|
||||||
// boolList(0),
|
|
||||||
// 0,
|
|
||||||
// dummyMesh.faceZones()
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
// List<cellZone*> cz
|
|
||||||
// (
|
|
||||||
// 1,
|
|
||||||
// new cellZone
|
|
||||||
// (
|
|
||||||
// "dummyCellZone",
|
|
||||||
// labelList(0),
|
|
||||||
// 0,
|
|
||||||
// dummyMesh.cellZones()
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
// dummyMesh.addZones(pz, fz, cz);
|
|
||||||
// //Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath()
|
|
||||||
// // << endl;
|
|
||||||
// dummyMesh.write();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //Pout<< "Reading mesh from " << io.objectPath() << endl;
|
|
||||||
// autoPtr<fvMesh> meshPtr(new fvMesh(io));
|
|
||||||
// fvMesh& mesh = meshPtr();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// // Sync patches
|
|
||||||
// // ~~~~~~~~~~~~
|
|
||||||
//
|
|
||||||
// if (Pstream::master())
|
|
||||||
// {
|
|
||||||
// // Send patches
|
|
||||||
// for
|
|
||||||
// (
|
|
||||||
// int slave=Pstream::firstSlave();
|
|
||||||
// slave<=Pstream::lastSlave();
|
|
||||||
// slave++
|
|
||||||
// )
|
|
||||||
// {
|
|
||||||
// OPstream toSlave(Pstream::scheduled, slave);
|
|
||||||
// toSlave << mesh.boundaryMesh();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// // Receive patches
|
|
||||||
// IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
// PtrList<entry> patchEntries(fromMaster);
|
|
||||||
//
|
|
||||||
// if (haveMesh)
|
|
||||||
// {
|
|
||||||
// // Check master names against mine
|
|
||||||
//
|
|
||||||
// const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
|
||||||
//
|
|
||||||
// forAll(patchEntries, patchI)
|
|
||||||
// {
|
|
||||||
// const entry& e = patchEntries[patchI];
|
|
||||||
// const word type(e.dict().lookup("type"));
|
|
||||||
// const word& name = e.keyword();
|
|
||||||
//
|
|
||||||
// if (type == processorPolyPatch::typeName)
|
|
||||||
// {
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (patchI >= patches.size())
|
|
||||||
// {
|
|
||||||
// FatalErrorIn
|
|
||||||
// (
|
|
||||||
// "createMesh(const Time&, const fileName&, const bool)"
|
|
||||||
// ) << "Non-processor patches not synchronised."
|
|
||||||
// << endl
|
|
||||||
// << "Processor " << Pstream::myProcNo()
|
|
||||||
// << " has only " << patches.size()
|
|
||||||
// << " patches, master has "
|
|
||||||
// << patchI
|
|
||||||
// << exit(FatalError);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if
|
|
||||||
// (
|
|
||||||
// type != patches[patchI].type()
|
|
||||||
// || name != patches[patchI].name()
|
|
||||||
// )
|
|
||||||
// {
|
|
||||||
// FatalErrorIn
|
|
||||||
// (
|
|
||||||
// "createMesh(const Time&, const fileName&, const bool)"
|
|
||||||
// ) << "Non-processor patches not synchronised."
|
|
||||||
// << endl
|
|
||||||
// << "Master patch " << patchI
|
|
||||||
// << " name:" << type
|
|
||||||
// << " type:" << type << endl
|
|
||||||
// << "Processor " << Pstream::myProcNo()
|
|
||||||
// << " patch " << patchI
|
|
||||||
// << " has name:" << patches[patchI].name()
|
|
||||||
// << " type:" << patches[patchI].type()
|
|
||||||
// << exit(FatalError);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// // Add patch
|
|
||||||
// List<polyPatch*> patches(patchEntries.size());
|
|
||||||
// label nPatches = 0;
|
|
||||||
//
|
|
||||||
// forAll(patchEntries, patchI)
|
|
||||||
// {
|
|
||||||
// const entry& e = patchEntries[patchI];
|
|
||||||
// const word type(e.dict().lookup("type"));
|
|
||||||
// const word& name = e.keyword();
|
|
||||||
//
|
|
||||||
// if (type == processorPolyPatch::typeName)
|
|
||||||
// {
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //Pout<< "Adding patch:" << nPatches
|
|
||||||
// // << " name:" << name << " type:" << type << endl;
|
|
||||||
//
|
|
||||||
// dictionary patchDict(e.dict());
|
|
||||||
// patchDict.remove("nFaces");
|
|
||||||
// patchDict.add("nFaces", 0);
|
|
||||||
// patchDict.remove("startFace");
|
|
||||||
// patchDict.add("startFace", 0);
|
|
||||||
//
|
|
||||||
// patches[patchI] = polyPatch::New
|
|
||||||
// (
|
|
||||||
// name,
|
|
||||||
// patchDict,
|
|
||||||
// nPatches++,
|
|
||||||
// mesh.boundaryMesh()
|
|
||||||
// ).ptr();
|
|
||||||
// }
|
|
||||||
// patches.setSize(nPatches);
|
|
||||||
// mesh.addFvPatches(patches, false); // no parallel comms
|
|
||||||
//
|
|
||||||
// //// Write empty mesh now we have correct patches
|
|
||||||
// //meshPtr().write();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// // Determine zones
|
|
||||||
// // ~~~~~~~~~~~~~~~
|
|
||||||
//
|
|
||||||
// wordList pointZoneNames(mesh.pointZones().names());
|
|
||||||
// Pstream::scatter(pointZoneNames);
|
|
||||||
// wordList faceZoneNames(mesh.faceZones().names());
|
|
||||||
// Pstream::scatter(faceZoneNames);
|
|
||||||
// wordList cellZoneNames(mesh.cellZones().names());
|
|
||||||
// Pstream::scatter(cellZoneNames);
|
|
||||||
//
|
|
||||||
// if (!haveMesh)
|
|
||||||
// {
|
|
||||||
// // Add the zones. Make sure to remove the old dummy ones first
|
|
||||||
// mesh.pointZones().clear();
|
|
||||||
// mesh.faceZones().clear();
|
|
||||||
// mesh.cellZones().clear();
|
|
||||||
//
|
|
||||||
// List<pointZone*> pz(pointZoneNames.size());
|
|
||||||
// forAll(pointZoneNames, i)
|
|
||||||
// {
|
|
||||||
// pz[i] = new pointZone
|
|
||||||
// (
|
|
||||||
// pointZoneNames[i],
|
|
||||||
// labelList(0),
|
|
||||||
// i,
|
|
||||||
// mesh.pointZones()
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// List<faceZone*> fz(faceZoneNames.size());
|
|
||||||
// forAll(faceZoneNames, i)
|
|
||||||
// {
|
|
||||||
// fz[i] = new faceZone
|
|
||||||
// (
|
|
||||||
// faceZoneNames[i],
|
|
||||||
// labelList(0),
|
|
||||||
// boolList(0),
|
|
||||||
// i,
|
|
||||||
// mesh.faceZones()
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// List<cellZone*> cz(cellZoneNames.size());
|
|
||||||
// forAll(cellZoneNames, i)
|
|
||||||
// {
|
|
||||||
// cz[i] = new cellZone
|
|
||||||
// (
|
|
||||||
// cellZoneNames[i],
|
|
||||||
// labelList(0),
|
|
||||||
// i,
|
|
||||||
// mesh.cellZones()
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// mesh.addZones(pz, fz, cz);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// if (!haveMesh)
|
|
||||||
// {
|
|
||||||
// // We created a dummy mesh file above. Delete it.
|
|
||||||
// //Pout<< "Removing dummy mesh " << io.objectPath() << endl;
|
|
||||||
// rmDir(io.objectPath());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // Force recreation of globalMeshData.
|
|
||||||
// mesh.clearOut();
|
|
||||||
// mesh.globalData();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// // Do some checks.
|
|
||||||
//
|
|
||||||
// // Check if the boundary definition is unique
|
|
||||||
// mesh.boundaryMesh().checkDefinition(true);
|
|
||||||
// // Check if the boundary processor patches are correct
|
|
||||||
// mesh.boundaryMesh().checkParallelSync(true);
|
|
||||||
// // Check names of zones are equal
|
|
||||||
// mesh.cellZones().checkDefinition(true);
|
|
||||||
// mesh.cellZones().checkParallelSync(true);
|
|
||||||
// mesh.faceZones().checkDefinition(true);
|
|
||||||
// mesh.faceZones().checkParallelSync(true);
|
|
||||||
// mesh.pointZones().checkDefinition(true);
|
|
||||||
// mesh.pointZones().checkParallelSync(true);
|
|
||||||
//
|
|
||||||
// return meshPtr;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
// Get merging distance when matching face centres
|
// Get merging distance when matching face centres
|
||||||
scalar getMergeDistance
|
scalar getMergeDistance
|
||||||
(
|
(
|
||||||
@ -786,14 +498,6 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Per processor mesh availability : " << haveMesh << endl;
|
Info<< "Per processor mesh availability : " << haveMesh << endl;
|
||||||
const bool allHaveMesh = (findIndex(haveMesh, false) == -1);
|
const bool allHaveMesh = (findIndex(haveMesh, false) == -1);
|
||||||
|
|
||||||
// Create mesh
|
|
||||||
//autoPtr<fvMesh> meshPtr = createMesh
|
|
||||||
//(
|
|
||||||
// runTime,
|
|
||||||
// regionName,
|
|
||||||
// masterInstDir,
|
|
||||||
// haveMesh[Pstream::myProcNo()]
|
|
||||||
//);
|
|
||||||
autoPtr<fvMesh> meshPtr = loadOrCreateMesh
|
autoPtr<fvMesh> meshPtr = loadOrCreateMesh
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -908,6 +612,9 @@ int main(int argc, char *argv[])
|
|||||||
objects.erase(iter);
|
objects.erase(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// volFields
|
||||||
|
|
||||||
PtrList<volScalarField> volScalarFields;
|
PtrList<volScalarField> volScalarFields;
|
||||||
readFields
|
readFields
|
||||||
(
|
(
|
||||||
@ -958,6 +665,9 @@ int main(int argc, char *argv[])
|
|||||||
volTensorFields
|
volTensorFields
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// surfaceFields
|
||||||
|
|
||||||
PtrList<surfaceScalarField> surfScalarFields;
|
PtrList<surfaceScalarField> surfScalarFields;
|
||||||
readFields
|
readFields
|
||||||
(
|
(
|
||||||
|
|||||||
@ -3,4 +3,4 @@ autoPtr<solidThermo> thermo
|
|||||||
solidThermo::New(mesh)
|
solidThermo::New(mesh)
|
||||||
);
|
);
|
||||||
|
|
||||||
volScalarField& T = thermo->T();
|
const volScalarField& T = thermo->T();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -59,13 +59,13 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct given initial T
|
//- Construct given initial T
|
||||||
SLList(T a)
|
explicit SLList(T a)
|
||||||
:
|
:
|
||||||
LList<SLListBase, T>(a)
|
LList<SLListBase, T>(a)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
SLList(Istream& is)
|
explicit SLList(Istream& is)
|
||||||
:
|
:
|
||||||
LList<SLListBase, T>(is)
|
LList<SLListBase, T>(is)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -63,10 +63,7 @@ void Foam::polyMesh::clearGeom()
|
|||||||
|
|
||||||
primitiveMesh::clearGeom();
|
primitiveMesh::clearGeom();
|
||||||
|
|
||||||
forAll(boundary_, patchI)
|
boundary_.clearGeom();
|
||||||
{
|
|
||||||
boundary_[patchI].clearGeom();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset valid directions (could change with rotation)
|
// Reset valid directions (could change with rotation)
|
||||||
geometricD_ = Vector<label>::zero;
|
geometricD_ = Vector<label>::zero;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -65,6 +65,12 @@ void Foam::polyPatch::updateMesh(PstreamBuffers&)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::polyPatch::clearGeom()
|
||||||
|
{
|
||||||
|
primitivePatch::clearGeom();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::polyPatch::polyPatch
|
Foam::polyPatch::polyPatch
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -116,6 +116,9 @@ protected:
|
|||||||
//- Update of the patch topology
|
//- Update of the patch topology
|
||||||
virtual void updateMesh(PstreamBuffers&);
|
virtual void updateMesh(PstreamBuffers&);
|
||||||
|
|
||||||
|
//- Clear geometry
|
||||||
|
virtual void clearGeom();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -338,7 +341,7 @@ public:
|
|||||||
const labelList& meshEdges() const;
|
const labelList& meshEdges() const;
|
||||||
|
|
||||||
//- Clear addressing
|
//- Clear addressing
|
||||||
void clearAddressing();
|
virtual void clearAddressing();
|
||||||
|
|
||||||
|
|
||||||
// Other patch operations
|
// Other patch operations
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,6 +75,17 @@ class quaternion
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Component type
|
||||||
|
typedef scalar cmptType;
|
||||||
|
|
||||||
|
// Member constants
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
rank = 1 // Rank of quaternion is 1
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Static data members
|
// Static data members
|
||||||
|
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
@ -109,6 +120,9 @@ public:
|
|||||||
const scalar angleZ
|
const scalar angleZ
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct a quaternion from a rotation tensor
|
||||||
|
inline explicit quaternion(const tensor& rotationTensor);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
quaternion(Istream&);
|
quaternion(Istream&);
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,81 @@ inline Foam::quaternion::quaternion
|
|||||||
operator*=(quaternion(vector(0, 0, 1), angleZ));
|
operator*=(quaternion(vector(0, 0, 1), angleZ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Foam::quaternion::quaternion
|
||||||
|
(
|
||||||
|
const tensor& rotationTensor
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar trace = rotationTensor.xx()
|
||||||
|
+ rotationTensor.yy()
|
||||||
|
+ rotationTensor.zz();
|
||||||
|
|
||||||
|
if (trace > 0)
|
||||||
|
{
|
||||||
|
scalar s = 0.5/Foam::sqrt(trace + 1.0);
|
||||||
|
|
||||||
|
w_ = 0.25/s;
|
||||||
|
v_[0] = (rotationTensor.zy() - rotationTensor.yz())*s;
|
||||||
|
v_[1] = (rotationTensor.xz() - rotationTensor.zx())*s;
|
||||||
|
v_[2] = (rotationTensor.yx() - rotationTensor.xy())*s;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
rotationTensor.xx() > rotationTensor.yy()
|
||||||
|
&& rotationTensor.xx() > rotationTensor.zz()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar s = 2.0*Foam::sqrt
|
||||||
|
(
|
||||||
|
1.0
|
||||||
|
+ rotationTensor.xx()
|
||||||
|
- rotationTensor.yy()
|
||||||
|
- rotationTensor.zz()
|
||||||
|
);
|
||||||
|
|
||||||
|
w_ = (rotationTensor.zy() - rotationTensor.yz())/s;
|
||||||
|
v_[0] = 0.25*s;
|
||||||
|
v_[1] = (rotationTensor.xy() + rotationTensor.yx())/s;
|
||||||
|
v_[2] = (rotationTensor.xz() + rotationTensor.zx())/s;
|
||||||
|
}
|
||||||
|
else if
|
||||||
|
(
|
||||||
|
rotationTensor.yy() > rotationTensor.zz()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar s = 2.0*Foam::sqrt
|
||||||
|
(
|
||||||
|
1.0
|
||||||
|
+ rotationTensor.yy()
|
||||||
|
- rotationTensor.xx()
|
||||||
|
- rotationTensor.zz()
|
||||||
|
);
|
||||||
|
|
||||||
|
w_ = (rotationTensor.xz() - rotationTensor.xz())/s;
|
||||||
|
v_[0] = (rotationTensor.xy() + rotationTensor.yx())/s;
|
||||||
|
v_[1] = 0.25*s;
|
||||||
|
v_[2] = (rotationTensor.yz() + rotationTensor.zy())/s;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scalar s = 2.0*Foam::sqrt
|
||||||
|
(
|
||||||
|
1.0
|
||||||
|
+ rotationTensor.zz()
|
||||||
|
- rotationTensor.xx()
|
||||||
|
- rotationTensor.yy()
|
||||||
|
);
|
||||||
|
|
||||||
|
w_ = (rotationTensor.yx() - rotationTensor.xy())/s;
|
||||||
|
v_[0] = (rotationTensor.xz() + rotationTensor.zx())/s;
|
||||||
|
v_[1] = (rotationTensor.yz() + rotationTensor.zy())/s;
|
||||||
|
v_[2] = 0.25*s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -198,8 +198,7 @@ void Foam::interRegionHeatTransferModel::addSup
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//SAF: temporarily output
|
if (debug && mesh_.time().outputTime())
|
||||||
if (mesh_.time().outputTime())
|
|
||||||
{
|
{
|
||||||
Tmapped.write();
|
Tmapped.write();
|
||||||
htc_.write();
|
htc_.write();
|
||||||
|
|||||||
@ -143,21 +143,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
bool Foam::cyclicAMIFvPatchField<Type>::coupled() const
|
bool Foam::cyclicAMIFvPatchField<Type>::coupled() const
|
||||||
{
|
{
|
||||||
if
|
return cyclicAMIPatch_.coupled();
|
||||||
(
|
|
||||||
Pstream::parRun()
|
|
||||||
|| (
|
|
||||||
this->cyclicAMIPatch_.size()
|
|
||||||
&& this->cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().size()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -503,6 +503,19 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define makeFvPatchField(fvPatchTypeField) \
|
||||||
|
\
|
||||||
|
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
|
||||||
|
template<> \
|
||||||
|
int fvPatchTypeField::disallowGenericFvPatchField \
|
||||||
|
( \
|
||||||
|
debug::debugSwitch("disallowGenericFvPatchField", 0) \
|
||||||
|
); \
|
||||||
|
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
|
||||||
|
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \
|
||||||
|
defineTemplateRunTimeSelectionTable(fvPatchTypeField, dictionary);
|
||||||
|
|
||||||
|
|
||||||
#define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
|
#define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
|
||||||
addToRunTimeSelectionTable \
|
addToRunTimeSelectionTable \
|
||||||
( \
|
( \
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,18 +32,6 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#define makeFvPatchField(fvPatchTypeField) \
|
|
||||||
\
|
|
||||||
defineNamedTemplateTypeNameAndDebug(fvPatchTypeField, 0); \
|
|
||||||
template<> \
|
|
||||||
int fvPatchTypeField::disallowGenericFvPatchField \
|
|
||||||
( \
|
|
||||||
debug::debugSwitch("disallowGenericFvPatchField", 0) \
|
|
||||||
); \
|
|
||||||
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patch); \
|
|
||||||
defineTemplateRunTimeSelectionTable(fvPatchTypeField, patchMapper); \
|
|
||||||
defineTemplateRunTimeSelectionTable(fvPatchTypeField, dictionary);
|
|
||||||
|
|
||||||
makeFvPatchField(fvPatchScalarField)
|
makeFvPatchField(fvPatchScalarField)
|
||||||
makeFvPatchField(fvPatchVectorField)
|
makeFvPatchField(fvPatchVectorField)
|
||||||
makeFvPatchField(fvPatchSphericalTensorField)
|
makeFvPatchField(fvPatchSphericalTensorField)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -85,7 +85,7 @@ public:
|
|||||||
gradScheme<Type>(mesh),
|
gradScheme<Type>(mesh),
|
||||||
minDet_(readScalar(schemeData))
|
minDet_(readScalar(schemeData))
|
||||||
{
|
{
|
||||||
if (minDet_ < 0 || minDet_ > 8)
|
if (minDet_ < 0) //-for facearea weighted: || minDet_ > 8)
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
"(const fvMesh&, Istream& schemeData)",
|
"(const fvMesh&, Istream& schemeData)",
|
||||||
schemeData
|
schemeData
|
||||||
) << "Minimum determinant = " << minDet_
|
) << "Minimum determinant = " << minDet_
|
||||||
<< " should be >= 0 and <= 8"
|
<< " should be >= 0" // and <= 8"
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,6 +110,38 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
const labelUList& owner = mesh_.owner();
|
const labelUList& owner = mesh_.owner();
|
||||||
const labelUList& neighbour = mesh_.neighbour();
|
const labelUList& neighbour = mesh_.neighbour();
|
||||||
|
|
||||||
|
|
||||||
|
// Determine number of dimensions and (for 2D) missing dimension
|
||||||
|
label nDims = 0;
|
||||||
|
label twoD = -1;
|
||||||
|
for (direction dir = 0; dir < vector::nComponents; dir++)
|
||||||
|
{
|
||||||
|
if (mesh.geometricD()[dir] == 1)
|
||||||
|
{
|
||||||
|
nDims++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
twoD = dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nDims == 1)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"extendedLeastSquaresVectors::makeLeastSquaresVectors() const"
|
||||||
|
) << "Found a mesh with only one geometric dimension : "
|
||||||
|
<< mesh.geometricD()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
else if (nDims == 2)
|
||||||
|
{
|
||||||
|
Info<< "extendedLeastSquares : detected " << nDims
|
||||||
|
<< " valid directions. Missing direction " << twoD << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const volVectorField& C = mesh.C();
|
const volVectorField& C = mesh.C();
|
||||||
|
|
||||||
// Set up temporary storage for the dd tensor (before inversion)
|
// Set up temporary storage for the dd tensor (before inversion)
|
||||||
@ -122,7 +154,7 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
|
|
||||||
vector d = C[nei] - C[own];
|
vector d = C[nei] - C[own];
|
||||||
|
|
||||||
const symmTensor wdd(1.0/magSqr(d[facei])*sqr(d[facei]));
|
const symmTensor wdd(1.0/magSqr(d)*sqr(d));
|
||||||
|
|
||||||
dd[own] += wdd;
|
dd[own] += wdd;
|
||||||
dd[nei] += wdd;
|
dd[nei] += wdd;
|
||||||
@ -147,12 +179,35 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Check for missing dimensions
|
||||||
|
// Add the missing eigenvector (such that it does not
|
||||||
|
// affect the determinant)
|
||||||
|
if (nDims == 2)
|
||||||
|
{
|
||||||
|
forAll(dd, cellI)
|
||||||
|
{
|
||||||
|
if (twoD == 0)
|
||||||
|
{
|
||||||
|
dd[cellI].xx() = 1;
|
||||||
|
}
|
||||||
|
else if (twoD == 1)
|
||||||
|
{
|
||||||
|
dd[cellI].yy() = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dd[cellI].zz() = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
scalarField detdd(det(dd));
|
scalarField detdd(det(dd));
|
||||||
|
|
||||||
Info<< "max(detdd) = " << max(detdd) << nl
|
Info<< "max(detdd) = " << max(detdd) << nl
|
||||||
<< "min(detdd) = " << min(detdd) << nl
|
<< "min(detdd) = " << min(detdd) << nl
|
||||||
<< "average(detdd) = " << average(detdd) << endl;
|
<< "average(detdd) = " << average(detdd) << endl;
|
||||||
|
|
||||||
|
label nAdaptedCells = 0;
|
||||||
label nAddCells = 0;
|
label nAddCells = 0;
|
||||||
label maxNaddCells = 4*detdd.size();
|
label maxNaddCells = 4*detdd.size();
|
||||||
additionalCellsPtr_ = new List<labelPair>(maxNaddCells);
|
additionalCellsPtr_ = new List<labelPair>(maxNaddCells);
|
||||||
@ -162,6 +217,8 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
{
|
{
|
||||||
label count = 0;
|
label count = 0;
|
||||||
|
|
||||||
|
label oldNAddCells = nAddCells;
|
||||||
|
|
||||||
while (++count < 100 && detdd[i] < minDet_)
|
while (++count < 100 && detdd[i] < minDet_)
|
||||||
{
|
{
|
||||||
if (nAddCells == maxNaddCells)
|
if (nAddCells == maxNaddCells)
|
||||||
@ -170,7 +227,8 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
(
|
(
|
||||||
"extendedLeastSquaresVectors::"
|
"extendedLeastSquaresVectors::"
|
||||||
"makeLeastSquaresVectors() const"
|
"makeLeastSquaresVectors() const"
|
||||||
) << "nAddCells exceeds maxNaddCells"
|
) << "nAddCells exceeds maxNaddCells ("
|
||||||
|
<< maxNaddCells << ")"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,20 +246,35 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
|
|
||||||
if (cellj != i)
|
if (cellj != i)
|
||||||
{
|
{
|
||||||
if (cellj != -1)
|
vector dCij = (mesh.C()[cellj] - mesh.C()[i]);
|
||||||
|
|
||||||
|
symmTensor ddij =
|
||||||
|
dd[i] + (1.0/magSqr(dCij))*sqr(dCij);
|
||||||
|
|
||||||
|
// Add the missing eigenvector (such that it does not
|
||||||
|
// affect the determinant)
|
||||||
|
if (nDims == 2)
|
||||||
{
|
{
|
||||||
vector dCij = (mesh.C()[cellj] - mesh.C()[i]);
|
if (twoD == 0)
|
||||||
|
|
||||||
symmTensor ddij =
|
|
||||||
dd[i] + (1.0/magSqr(dCij))*sqr(dCij);
|
|
||||||
|
|
||||||
scalar detddij = det(ddij);
|
|
||||||
|
|
||||||
if (detddij > maxDetddij)
|
|
||||||
{
|
{
|
||||||
addCell = cellj;
|
ddij.xx() = 1;
|
||||||
maxDetddij = detddij;
|
|
||||||
}
|
}
|
||||||
|
else if (twoD == 1)
|
||||||
|
{
|
||||||
|
ddij.yy() = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ddij.zz() = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scalar detddij = det(ddij);
|
||||||
|
|
||||||
|
if (detddij > maxDetddij)
|
||||||
|
{
|
||||||
|
addCell = cellj;
|
||||||
|
maxDetddij = detddij;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,17 +286,50 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
additionalCells_[nAddCells++][1] = addCell;
|
additionalCells_[nAddCells++][1] = addCell;
|
||||||
vector dCij = mesh.C()[addCell] - mesh.C()[i];
|
vector dCij = mesh.C()[addCell] - mesh.C()[i];
|
||||||
dd[i] += (1.0/magSqr(dCij))*sqr(dCij);
|
dd[i] += (1.0/magSqr(dCij))*sqr(dCij);
|
||||||
|
|
||||||
|
// Add the missing eigenvector (such that it does not
|
||||||
|
// affect the determinant)
|
||||||
|
if (nDims == 2)
|
||||||
|
{
|
||||||
|
if (twoD == 0)
|
||||||
|
{
|
||||||
|
dd[i].xx() = 1;
|
||||||
|
}
|
||||||
|
else if (twoD == 1)
|
||||||
|
{
|
||||||
|
dd[i].yy() = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dd[i].zz() = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
detdd[i] = det(dd[i]);
|
detdd[i] = det(dd[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldNAddCells < nAddCells)
|
||||||
|
{
|
||||||
|
nAdaptedCells++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
additionalCells_.setSize(nAddCells);
|
additionalCells_.setSize(nAddCells);
|
||||||
|
|
||||||
Info<< "max(detdd) = " << max(detdd) << nl
|
reduce(nAddCells, sumOp<label>());
|
||||||
<< "min(detdd) = " << min(detdd) << nl
|
reduce(nAdaptedCells, sumOp<label>());
|
||||||
<< "average(detdd) = " << average(detdd) << nl
|
if (nAddCells)
|
||||||
<< "nAddCells/nCells = " << scalar(nAddCells)/mesh.nCells() << endl;
|
{
|
||||||
|
Info<< "max(detdd) = " << max(detdd) << nl
|
||||||
|
<< "min(detdd) = " << min(detdd) << nl
|
||||||
|
<< "average(detdd) = " << average(detdd) << nl
|
||||||
|
<< "nAdapted/nCells = "
|
||||||
|
<< scalar(nAdaptedCells)/mesh.globalData().nTotalCells() << nl
|
||||||
|
<< "nAddCells/nCells = "
|
||||||
|
<< scalar(nAddCells)/mesh.globalData().nTotalCells()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Invert the dd tensor
|
// Invert the dd tensor
|
||||||
const symmTensorField invDd(inv(dd));
|
const symmTensorField invDd(inv(dd));
|
||||||
@ -237,11 +343,8 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
|
|||||||
|
|
||||||
vector d = C[nei] - C[own];
|
vector d = C[nei] - C[own];
|
||||||
|
|
||||||
lsP[facei] =
|
lsP[facei] = (1.0/magSqr(d))*(invDd[own] & d);
|
||||||
(1.0/magSqr(d[facei]))*(invDd[owner[facei]] & d);
|
lsN[facei] = ((-1.0)/magSqr(d))*(invDd[nei] & d);
|
||||||
|
|
||||||
lsN[facei] =
|
|
||||||
((-1.0)/magSqr(d[facei]))*(invDd[neighbour[facei]] & d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(blsP, patchI)
|
forAll(blsP, patchI)
|
||||||
|
|||||||
@ -142,8 +142,8 @@ class fvMatrix
|
|||||||
mutable GeometricField<Type, fvsPatchField, surfaceMesh>
|
mutable GeometricField<Type, fvsPatchField, surfaceMesh>
|
||||||
*faceFluxCorrectionPtr_;
|
*faceFluxCorrectionPtr_;
|
||||||
|
|
||||||
// ***HGW for testing LduMatrix protected:
|
|
||||||
public:
|
protected:
|
||||||
|
|
||||||
//- Declare friendship with the fvSolver class
|
//- Declare friendship with the fvSolver class
|
||||||
friend class fvSolver;
|
friend class fvSolver;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -39,60 +39,82 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::cyclicAMIFvPatch::coupled() const
|
||||||
|
{
|
||||||
|
return Pstream::parRun() || (this->size() && neighbFvPatch().size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::cyclicAMIFvPatch::makeWeights(scalarField& w) const
|
void Foam::cyclicAMIFvPatch::makeWeights(scalarField& w) const
|
||||||
{
|
{
|
||||||
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
|
if (coupled())
|
||||||
|
|
||||||
const scalarField deltas(nf() & fvPatch::delta());
|
|
||||||
|
|
||||||
const scalarField nbrDeltas
|
|
||||||
(
|
|
||||||
interpolate(nbrPatch.nf() & nbrPatch.fvPatch::delta())
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(deltas, faceI)
|
|
||||||
{
|
{
|
||||||
scalar di = deltas[faceI];
|
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
|
||||||
scalar dni = nbrDeltas[faceI];
|
|
||||||
|
|
||||||
w[faceI] = dni/(di + dni);
|
const scalarField deltas(nf() & fvPatch::delta());
|
||||||
|
|
||||||
|
const scalarField nbrDeltas
|
||||||
|
(
|
||||||
|
interpolate(nbrPatch.nf() & nbrPatch.fvPatch::delta())
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(deltas, faceI)
|
||||||
|
{
|
||||||
|
scalar di = deltas[faceI];
|
||||||
|
scalar dni = nbrDeltas[faceI];
|
||||||
|
|
||||||
|
w[faceI] = dni/(di + dni);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Behave as uncoupled patch
|
||||||
|
fvPatch::makeWeights(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::vectorField> Foam::cyclicAMIFvPatch::delta() const
|
Foam::tmp<Foam::vectorField> Foam::cyclicAMIFvPatch::delta() const
|
||||||
{
|
{
|
||||||
const vectorField patchD(fvPatch::delta());
|
|
||||||
|
|
||||||
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
|
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
|
||||||
const vectorField nbrPatchD(interpolate(nbrPatch.fvPatch::delta()));
|
|
||||||
|
|
||||||
tmp<vectorField> tpdv(new vectorField(patchD.size()));
|
if (coupled())
|
||||||
vectorField& pdv = tpdv();
|
|
||||||
|
|
||||||
// do the transformation if necessary
|
|
||||||
if (parallel())
|
|
||||||
{
|
{
|
||||||
forAll(patchD, faceI)
|
const vectorField patchD(fvPatch::delta());
|
||||||
{
|
|
||||||
const vector& ddi = patchD[faceI];
|
|
||||||
const vector& dni = nbrPatchD[faceI];
|
|
||||||
|
|
||||||
pdv[faceI] = ddi - dni;
|
const vectorField nbrPatchD(interpolate(nbrPatch.fvPatch::delta()));
|
||||||
|
|
||||||
|
tmp<vectorField> tpdv(new vectorField(patchD.size()));
|
||||||
|
vectorField& pdv = tpdv();
|
||||||
|
|
||||||
|
// do the transformation if necessary
|
||||||
|
if (parallel())
|
||||||
|
{
|
||||||
|
forAll(patchD, faceI)
|
||||||
|
{
|
||||||
|
const vector& ddi = patchD[faceI];
|
||||||
|
const vector& dni = nbrPatchD[faceI];
|
||||||
|
|
||||||
|
pdv[faceI] = ddi - dni;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
forAll(patchD, faceI)
|
||||||
|
{
|
||||||
|
const vector& ddi = patchD[faceI];
|
||||||
|
const vector& dni = nbrPatchD[faceI];
|
||||||
|
|
||||||
|
pdv[faceI] = ddi - transform(forwardT()[0], dni);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tpdv;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
forAll(patchD, faceI)
|
return fvPatch::delta();
|
||||||
{
|
|
||||||
const vector& ddi = patchD[faceI];
|
|
||||||
const vector& dni = nbrPatchD[faceI];
|
|
||||||
|
|
||||||
pdv[faceI] = ddi - transform(forwardT()[0], dni);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tpdv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -146,6 +146,11 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return true if this patch is coupled. This is equivalent
|
||||||
|
// to the coupledPolyPatch::coupled() if parallel running or
|
||||||
|
// both sides present, false otherwise
|
||||||
|
virtual bool coupled() const;
|
||||||
|
|
||||||
//- Return delta (P to N) vectors across coupled patch
|
//- Return delta (P to N) vectors across coupled patch
|
||||||
virtual tmp<vectorField> delta() const;
|
virtual tmp<vectorField> delta() const;
|
||||||
|
|
||||||
|
|||||||
@ -165,7 +165,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Return true if this patch is coupled
|
//- Return true if this patch is coupled
|
||||||
bool coupled() const
|
virtual bool coupled() const
|
||||||
{
|
{
|
||||||
return polyPatch_.coupled();
|
return polyPatch_.coupled();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -965,6 +965,13 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing
|
|||||||
label tgtFaceI
|
label tgtFaceI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Pre-size to handle early exit
|
||||||
|
srcAddress_.setSize(srcPatch.size());
|
||||||
|
srcWeights_.setSize(srcPatch.size());
|
||||||
|
tgtAddress_.setSize(tgtPatch.size());
|
||||||
|
tgtWeights_.setSize(tgtPatch.size());
|
||||||
|
|
||||||
|
|
||||||
if (debug && (!srcPatch.size() || !tgtPatch.size()))
|
if (debug && (!srcPatch.size() || !tgtPatch.size()))
|
||||||
{
|
{
|
||||||
Pout<< "AMI: Patches not on processor: Source faces = "
|
Pout<< "AMI: Patches not on processor: Source faces = "
|
||||||
@ -1134,16 +1141,11 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing
|
|||||||
}
|
}
|
||||||
|
|
||||||
// transfer data to persistent storage
|
// transfer data to persistent storage
|
||||||
srcAddress_.setSize(srcPatch.size());
|
|
||||||
srcWeights_.setSize(srcPatch.size());
|
|
||||||
forAll(srcAddr, i)
|
forAll(srcAddr, i)
|
||||||
{
|
{
|
||||||
srcAddress_[i].transfer(srcAddr[i]);
|
srcAddress_[i].transfer(srcAddr[i]);
|
||||||
srcWeights_[i].transfer(srcWght[i]);
|
srcWeights_[i].transfer(srcWght[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgtAddress_.setSize(tgtPatch.size());
|
|
||||||
tgtWeights_.setSize(tgtPatch.size());
|
|
||||||
forAll(tgtAddr, i)
|
forAll(tgtAddr, i)
|
||||||
{
|
{
|
||||||
tgtAddress_[i].transfer(tgtAddr[i]);
|
tgtAddress_[i].transfer(tgtAddr[i]);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -208,7 +208,7 @@ void Foam::cyclicAMIPolyPatch::calcTransforms
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< " patch:" << name()
|
Pout<< "patch:" << name()
|
||||||
<< " Assuming cyclic AMI pairs are colocated" << endl;
|
<< " Assuming cyclic AMI pairs are colocated" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,6 +282,16 @@ void Foam::cyclicAMIPolyPatch::resetAMI() const
|
|||||||
AMIReverse_
|
AMIReverse_
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Pout<< "cyclicAMIPolyPatch : " << name()
|
||||||
|
<< " constructed AMI with " << nl
|
||||||
|
<< " " << ":srcAddress:" << AMIPtr_().srcAddress().size()
|
||||||
|
<< nl
|
||||||
|
<< " " << " tgAddress :" << AMIPtr_().tgtAddress().size()
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,6 +355,13 @@ void Foam::cyclicAMIPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::cyclicAMIPolyPatch::clearGeom()
|
||||||
|
{
|
||||||
|
AMIPtr_.clear();
|
||||||
|
polyPatch::clearGeom();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
|
Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
|
||||||
@ -645,16 +662,6 @@ const Foam::AMIPatchToPatchInterpolation& Foam::cyclicAMIPolyPatch::AMI() const
|
|||||||
resetAMI();
|
resetAMI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Pout<< "cyclicAMIPolyPatch : " << name()
|
|
||||||
<< " constructed AMI with " << endl
|
|
||||||
<< " " << ":srcAddress:" << AMIPtr_().srcAddress().size() << endl
|
|
||||||
<< " " << " tgAddress :" << AMIPtr_().tgtAddress().size() << endl
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return AMIPtr_();
|
return AMIPtr_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -141,6 +141,9 @@ protected:
|
|||||||
//- Update of the patch topology
|
//- Update of the patch topology
|
||||||
virtual void updateMesh(PstreamBuffers&);
|
virtual void updateMesh(PstreamBuffers&);
|
||||||
|
|
||||||
|
//- Clear geometry
|
||||||
|
virtual void clearGeom();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -814,7 +814,27 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
|
|||||||
nEvals_(0),
|
nEvals_(0),
|
||||||
nUnvisitedCells_(mesh_.nCells()),
|
nUnvisitedCells_(mesh_.nCells()),
|
||||||
nUnvisitedFaces_(mesh_.nFaces())
|
nUnvisitedFaces_(mesh_.nFaces())
|
||||||
{}
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
allFaceInfo.size() != mesh_.nFaces()
|
||||||
|
|| allCellInfo.size() != mesh_.nCells()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"FaceCellWave<Type, TrackingData>::FaceCellWave"
|
||||||
|
"(const polyMesh&, const labelList&, const List<Type>,"
|
||||||
|
" UList<Type>&, UList<Type>&, const label maxIter)"
|
||||||
|
) << "face and cell storage not the size of mesh faces, cells:"
|
||||||
|
<< endl
|
||||||
|
<< " allFaceInfo :" << allFaceInfo.size() << endl
|
||||||
|
<< " mesh_.nFaces():" << mesh_.nFaces() << endl
|
||||||
|
<< " allCellInfo :" << allCellInfo.size() << endl
|
||||||
|
<< " mesh_.nCells():" << mesh_.nCells()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Iterate, propagating changedFacesInfo across mesh, until no change (or
|
// Iterate, propagating changedFacesInfo across mesh, until no change (or
|
||||||
@ -850,6 +870,26 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
|
|||||||
nUnvisitedCells_(mesh_.nCells()),
|
nUnvisitedCells_(mesh_.nCells()),
|
||||||
nUnvisitedFaces_(mesh_.nFaces())
|
nUnvisitedFaces_(mesh_.nFaces())
|
||||||
{
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
allFaceInfo.size() != mesh_.nFaces()
|
||||||
|
|| allCellInfo.size() != mesh_.nCells()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"FaceCellWave<Type, TrackingData>::FaceCellWave"
|
||||||
|
"(const polyMesh&, const labelList&, const List<Type>,"
|
||||||
|
" UList<Type>&, UList<Type>&, const label maxIter)"
|
||||||
|
) << "face and cell storage not the size of mesh faces, cells:"
|
||||||
|
<< endl
|
||||||
|
<< " allFaceInfo :" << allFaceInfo.size() << endl
|
||||||
|
<< " mesh_.nFaces():" << mesh_.nFaces() << endl
|
||||||
|
<< " allCellInfo :" << allCellInfo.size() << endl
|
||||||
|
<< " mesh_.nCells():" << mesh_.nCells()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
// Copy initial changed faces data
|
// Copy initial changed faces data
|
||||||
setFaceInfo(changedFaces, changedFacesInfo);
|
setFaceInfo(changedFaces, changedFacesInfo);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -58,9 +58,13 @@ void Foam::boxToCell::combine(topoSet& set, const bool add) const
|
|||||||
|
|
||||||
forAll(ctrs, cellI)
|
forAll(ctrs, cellI)
|
||||||
{
|
{
|
||||||
if (bb_.contains(ctrs[cellI]))
|
forAll(bbs_, i)
|
||||||
{
|
{
|
||||||
addOrDelete(set, cellI, add);
|
if (bbs_[i].contains(ctrs[cellI]))
|
||||||
|
{
|
||||||
|
addOrDelete(set, cellI, add);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,11 +76,11 @@ void Foam::boxToCell::combine(topoSet& set, const bool add) const
|
|||||||
Foam::boxToCell::boxToCell
|
Foam::boxToCell::boxToCell
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const treeBoundBox& bb
|
const treeBoundBoxList& bbs
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(bb)
|
bbs_(bbs)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -88,7 +92,12 @@ Foam::boxToCell::boxToCell
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(dict.lookup("box"))
|
bbs_
|
||||||
|
(
|
||||||
|
dict.found("box")
|
||||||
|
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
|
||||||
|
: dict.lookup("boxes")
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -100,7 +109,7 @@ Foam::boxToCell::boxToCell
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(checkIs(is))
|
bbs_(1, treeBoundBox(checkIs(is)))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
@ -119,13 +128,13 @@ void Foam::boxToCell::applyToSet
|
|||||||
{
|
{
|
||||||
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
||||||
{
|
{
|
||||||
Info<< " Adding cells with center within box " << bb_ << endl;
|
Info<< " Adding cells with center within boxes " << bbs_ << endl;
|
||||||
|
|
||||||
combine(set, true);
|
combine(set, true);
|
||||||
}
|
}
|
||||||
else if (action == topoSetSource::DELETE)
|
else if (action == topoSetSource::DELETE)
|
||||||
{
|
{
|
||||||
Info<< " Removing cells with center within box " << bb_ << endl;
|
Info<< " Removing cells with center within boxes " << bbs_ << endl;
|
||||||
|
|
||||||
combine(set, false);
|
combine(set, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,7 +25,7 @@ Class
|
|||||||
Foam::boxToCell
|
Foam::boxToCell
|
||||||
|
|
||||||
Description
|
Description
|
||||||
A topoSetSource to select cells based on cell centres inside box.
|
A topoSetSource to select cells based on cell centres inside box(es).
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
boxToCell.C
|
boxToCell.C
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#define boxToCell_H
|
#define boxToCell_H
|
||||||
|
|
||||||
#include "topoSetSource.H"
|
#include "topoSetSource.H"
|
||||||
#include "treeBoundBox.H"
|
#include "treeBoundBoxList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class boxToCell
|
|||||||
|
|
||||||
|
|
||||||
//- bounding box.
|
//- bounding box.
|
||||||
treeBoundBox bb_;
|
treeBoundBoxList bbs_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -78,7 +78,7 @@ public:
|
|||||||
boxToCell
|
boxToCell
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const treeBoundBox& bb
|
const treeBoundBoxList& bbs
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -58,9 +58,13 @@ void Foam::boxToFace::combine(topoSet& set, const bool add) const
|
|||||||
|
|
||||||
forAll(ctrs, faceI)
|
forAll(ctrs, faceI)
|
||||||
{
|
{
|
||||||
if (bb_.contains(ctrs[faceI]))
|
forAll(bbs_, i)
|
||||||
{
|
{
|
||||||
addOrDelete(set, faceI, add);
|
if (bbs_[i].contains(ctrs[faceI]))
|
||||||
|
{
|
||||||
|
addOrDelete(set, faceI, add);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,11 +76,11 @@ void Foam::boxToFace::combine(topoSet& set, const bool add) const
|
|||||||
Foam::boxToFace::boxToFace
|
Foam::boxToFace::boxToFace
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const treeBoundBox& bb
|
const treeBoundBoxList& bbs
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(bb)
|
bbs_(bbs)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -88,7 +92,12 @@ Foam::boxToFace::boxToFace
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(dict.lookup("box"))
|
bbs_
|
||||||
|
(
|
||||||
|
dict.found("box")
|
||||||
|
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
|
||||||
|
: dict.lookup("boxes")
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -100,7 +109,7 @@ Foam::boxToFace::boxToFace
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(checkIs(is))
|
bbs_(1, treeBoundBox(checkIs(is)))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -120,13 +129,13 @@ void Foam::boxToFace::applyToSet
|
|||||||
{
|
{
|
||||||
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
||||||
{
|
{
|
||||||
Info<< " Adding faces with centre within box " << bb_ << endl;
|
Info<< " Adding faces with centre within boxes " << bbs_ << endl;
|
||||||
|
|
||||||
combine(set, true);
|
combine(set, true);
|
||||||
}
|
}
|
||||||
else if (action == topoSetSource::DELETE)
|
else if (action == topoSetSource::DELETE)
|
||||||
{
|
{
|
||||||
Info<< " Removing faces with centre within box " << bb_ << endl;
|
Info<< " Removing faces with centre within boxes " << bbs_ << endl;
|
||||||
|
|
||||||
combine(set, false);
|
combine(set, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#define boxToFace_H
|
#define boxToFace_H
|
||||||
|
|
||||||
#include "topoSetSource.H"
|
#include "topoSetSource.H"
|
||||||
#include "treeBoundBox.H"
|
#include "treeBoundBoxList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class boxToFace
|
|||||||
static addToUsageTable usage_;
|
static addToUsageTable usage_;
|
||||||
|
|
||||||
//- bounding box.
|
//- bounding box.
|
||||||
treeBoundBox bb_;
|
treeBoundBoxList bbs_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -77,7 +77,7 @@ public:
|
|||||||
boxToFace
|
boxToFace
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const treeBoundBox& bb
|
const treeBoundBoxList& bbs
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -58,9 +58,12 @@ void Foam::boxToPoint::combine(topoSet& set, const bool add) const
|
|||||||
|
|
||||||
forAll(pts, pointI)
|
forAll(pts, pointI)
|
||||||
{
|
{
|
||||||
if (bb_.contains(pts[pointI]))
|
forAll(bbs_, i)
|
||||||
{
|
{
|
||||||
addOrDelete(set, pointI, add);
|
if (bbs_[i].contains(pts[pointI]))
|
||||||
|
{
|
||||||
|
addOrDelete(set, pointI, add);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,11 +75,11 @@ void Foam::boxToPoint::combine(topoSet& set, const bool add) const
|
|||||||
Foam::boxToPoint::boxToPoint
|
Foam::boxToPoint::boxToPoint
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const treeBoundBox& bb
|
const treeBoundBoxList& bbs
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(bb)
|
bbs_(bbs)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -88,7 +91,12 @@ Foam::boxToPoint::boxToPoint
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(dict.lookup("box"))
|
bbs_
|
||||||
|
(
|
||||||
|
dict.found("box")
|
||||||
|
? treeBoundBoxList(1, treeBoundBox(dict.lookup("box")))
|
||||||
|
: dict.lookup("boxes")
|
||||||
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -100,7 +108,7 @@ Foam::boxToPoint::boxToPoint
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
topoSetSource(mesh),
|
topoSetSource(mesh),
|
||||||
bb_(checkIs(is))
|
bbs_(1, treeBoundBox(checkIs(is)))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -120,14 +128,14 @@ void Foam::boxToPoint::applyToSet
|
|||||||
{
|
{
|
||||||
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
|
||||||
{
|
{
|
||||||
Info<< " Adding points that are within box " << bb_ << " ..."
|
Info<< " Adding points that are within boxes " << bbs_ << " ..."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
combine(set, true);
|
combine(set, true);
|
||||||
}
|
}
|
||||||
else if (action == topoSetSource::DELETE)
|
else if (action == topoSetSource::DELETE)
|
||||||
{
|
{
|
||||||
Info<< " Removing points that are within box " << bb_ << " ..."
|
Info<< " Removing points that are within boxes " << bbs_ << " ..."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
combine(set, false);
|
combine(set, false);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#define boxToPoint_H
|
#define boxToPoint_H
|
||||||
|
|
||||||
#include "topoSetSource.H"
|
#include "topoSetSource.H"
|
||||||
#include "treeBoundBox.H"
|
#include "treeBoundBoxList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class boxToPoint
|
|||||||
static addToUsageTable usage_;
|
static addToUsageTable usage_;
|
||||||
|
|
||||||
//- bounding box.
|
//- bounding box.
|
||||||
treeBoundBox bb_;
|
treeBoundBoxList bbs_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -77,7 +77,7 @@ public:
|
|||||||
boxToPoint
|
boxToPoint
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
const treeBoundBox& bb
|
const treeBoundBoxList& bb
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
|
|||||||
@ -6,5 +6,6 @@ manualDecomp/manualDecomp.C
|
|||||||
multiLevelDecomp/multiLevelDecomp.C
|
multiLevelDecomp/multiLevelDecomp.C
|
||||||
structuredDecomp/topoDistanceData.C
|
structuredDecomp/topoDistanceData.C
|
||||||
structuredDecomp/structuredDecomp.C
|
structuredDecomp/structuredDecomp.C
|
||||||
|
noDecomp/noDecomp.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libdecompositionMethods
|
LIB = $(FOAM_LIBBIN)/libdecompositionMethods
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -111,7 +111,7 @@ public:
|
|||||||
notImplemented
|
notImplemented
|
||||||
(
|
(
|
||||||
"decompose(const labelListList&, const pointField&"
|
"decompose(const labelListList&, const pointField&"
|
||||||
", const scalarField)"
|
", const scalarField&)"
|
||||||
);
|
);
|
||||||
return labelList(0);
|
return labelList(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,53 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "noDecomp.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeName(noDecomp);
|
||||||
|
|
||||||
|
addNamedToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
decompositionMethod,
|
||||||
|
noDecomp,
|
||||||
|
dictionary,
|
||||||
|
none
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::noDecomp::noDecomp(const dictionary& decompositionDict)
|
||||||
|
:
|
||||||
|
decompositionMethod(decompositionDict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
134
src/parallel/decompose/decompositionMethods/noDecomp/noDecomp.H
Normal file
134
src/parallel/decompose/decompositionMethods/noDecomp/noDecomp.H
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::noDecomp
|
||||||
|
|
||||||
|
Description
|
||||||
|
Dummy decomposition method
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
noDecomp.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef noDecomp_H
|
||||||
|
#define noDecomp_H
|
||||||
|
|
||||||
|
#include "decompositionMethod.H"
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class noDecomp Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class noDecomp
|
||||||
|
:
|
||||||
|
public decompositionMethod
|
||||||
|
{
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct and assignment
|
||||||
|
void operator=(const noDecomp&);
|
||||||
|
noDecomp(const noDecomp&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("noDecomp");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct given the decomposition dictionary
|
||||||
|
noDecomp(const dictionary& decompositionDict);
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~noDecomp()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- manual decompose does not care about proc boundaries - is all
|
||||||
|
// up to the user.
|
||||||
|
virtual bool parallelAware() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return for every coordinate the wanted processor number. Use the
|
||||||
|
// mesh connectivity (if needed)
|
||||||
|
virtual labelList decompose
|
||||||
|
(
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const pointField& cc,
|
||||||
|
const scalarField& cWeights
|
||||||
|
)
|
||||||
|
{
|
||||||
|
notImplemented
|
||||||
|
(
|
||||||
|
"decompose(const polyMesh&, const pointField&"
|
||||||
|
", const scalarField&)"
|
||||||
|
);
|
||||||
|
return labelList(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return for every coordinate the wanted processor number. Explicitly
|
||||||
|
// provided connectivity - does not use mesh_.
|
||||||
|
// The connectivity is equal to mesh.cellCells() except for
|
||||||
|
// - in parallel the cell numbers are global cell numbers (starting
|
||||||
|
// from 0 at processor0 and then incrementing all through the
|
||||||
|
// processors)
|
||||||
|
// - the connections are across coupled patches
|
||||||
|
virtual labelList decompose
|
||||||
|
(
|
||||||
|
const labelListList& globalCellCells,
|
||||||
|
const pointField& cc,
|
||||||
|
const scalarField& cWeights
|
||||||
|
)
|
||||||
|
{
|
||||||
|
notImplemented
|
||||||
|
(
|
||||||
|
"decompose(const labelListList&, const pointField&"
|
||||||
|
", const scalarField&)"
|
||||||
|
);
|
||||||
|
return labelList(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -401,10 +401,10 @@ Foam::label Foam::ptscotchDecomp::decompose
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dump graph
|
// Dump graph
|
||||||
if (decompositionDict_.found("ptscotchCoeffs"))
|
if (decompositionDict_.found("scotchCoeffs"))
|
||||||
{
|
{
|
||||||
const dictionary& scotchCoeffs =
|
const dictionary& scotchCoeffs =
|
||||||
decompositionDict_.subDict("ptscotchCoeffs");
|
decompositionDict_.subDict("scotchCoeffs");
|
||||||
|
|
||||||
if (scotchCoeffs.lookupOrDefault("writeGraph", false))
|
if (scotchCoeffs.lookupOrDefault("writeGraph", false))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,16 +73,16 @@ void Foam::fieldMinMax::calcMinMaxFields
|
|||||||
Pstream::gatherList(maxVs);
|
Pstream::gatherList(maxVs);
|
||||||
Pstream::gatherList(maxCs);
|
Pstream::gatherList(maxCs);
|
||||||
|
|
||||||
label minI = findMin(minVs);
|
|
||||||
scalar minValue = minVs[minI];
|
|
||||||
const vector& minC = minCs[minI];
|
|
||||||
|
|
||||||
label maxI = findMax(maxVs);
|
|
||||||
scalar maxValue = maxVs[maxI];
|
|
||||||
const vector& maxC = maxCs[maxI];
|
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
|
label minI = findMin(minVs);
|
||||||
|
scalar minValue = minVs[minI];
|
||||||
|
const vector& minC = minCs[minI];
|
||||||
|
|
||||||
|
label maxI = findMax(maxVs);
|
||||||
|
scalar maxValue = maxVs[maxI];
|
||||||
|
const vector& maxC = maxCs[maxI];
|
||||||
|
|
||||||
if (write_)
|
if (write_)
|
||||||
{
|
{
|
||||||
fieldMinMaxFilePtr_()
|
fieldMinMaxFilePtr_()
|
||||||
@ -153,17 +153,16 @@ void Foam::fieldMinMax::calcMinMaxFields
|
|||||||
Pstream::gatherList(maxVs);
|
Pstream::gatherList(maxVs);
|
||||||
Pstream::gatherList(maxCs);
|
Pstream::gatherList(maxCs);
|
||||||
|
|
||||||
label minI = findMin(minVs);
|
|
||||||
Type minValue = minVs[minI];
|
|
||||||
const vector& minC = minCs[minI];
|
|
||||||
|
|
||||||
label maxI = findMax(maxVs);
|
|
||||||
Type maxValue = maxVs[maxI];
|
|
||||||
const vector& maxC = maxCs[maxI];
|
|
||||||
|
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
|
label minI = findMin(minVs);
|
||||||
|
Type minValue = minVs[minI];
|
||||||
|
const vector& minC = minCs[minI];
|
||||||
|
|
||||||
|
label maxI = findMax(maxVs);
|
||||||
|
Type maxValue = maxVs[maxI];
|
||||||
|
const vector& maxC = maxCs[maxI];
|
||||||
|
|
||||||
if (write_)
|
if (write_)
|
||||||
{
|
{
|
||||||
fieldMinMaxFilePtr_()
|
fieldMinMaxFilePtr_()
|
||||||
|
|||||||
@ -349,7 +349,7 @@ reactingOneDim::reactingOneDim(const word& modelType, const fvMesh& mesh)
|
|||||||
pyrolysisModel(modelType, mesh),
|
pyrolysisModel(modelType, mesh),
|
||||||
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
||||||
solidThermo_(solidChemistry_->solid()),
|
solidThermo_(solidChemistry_->solid()),
|
||||||
rho_(solidThermo_.rhos()),
|
rho_(solidThermo_.rho()),
|
||||||
Ys_(solidThermo_.composition().Y()),
|
Ys_(solidThermo_.composition().Y()),
|
||||||
h_(solidThermo_.he()),
|
h_(solidThermo_.he()),
|
||||||
primaryRadFluxName_(coeffs().lookupOrDefault<word>("radFluxName", "Qr")),
|
primaryRadFluxName_(coeffs().lookupOrDefault<word>("radFluxName", "Qr")),
|
||||||
@ -449,7 +449,7 @@ reactingOneDim::reactingOneDim
|
|||||||
pyrolysisModel(modelType, mesh, dict),
|
pyrolysisModel(modelType, mesh, dict),
|
||||||
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
||||||
solidThermo_(solidChemistry_->solid()),
|
solidThermo_(solidChemistry_->solid()),
|
||||||
rho_(solidThermo_.rhos()),
|
rho_(solidThermo_.rho()),
|
||||||
Ys_(solidThermo_.composition().Y()),
|
Ys_(solidThermo_.composition().Y()),
|
||||||
h_(solidThermo_.he()),
|
h_(solidThermo_.he()),
|
||||||
primaryRadFluxName_(dict.lookupOrDefault<word>("radFluxName", "Qr")),
|
primaryRadFluxName_(dict.lookupOrDefault<word>("radFluxName", "Qr")),
|
||||||
|
|||||||
@ -359,7 +359,7 @@ void thermoBaffle2D::info() const
|
|||||||
(
|
(
|
||||||
mag(regionMesh().Sf().boundaryField()[patchI])
|
mag(regionMesh().Sf().boundaryField()[patchI])
|
||||||
* ph.snGrad()
|
* ph.snGrad()
|
||||||
* thermo_->alpha(patchI)
|
* thermo_->alpha().boundaryField()[patchI]
|
||||||
) << endl;
|
) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,13 +171,15 @@ void Foam::meshToMesh::calcAddressing()
|
|||||||
wallBb.max() + vector(typDim, typDim, typDim)
|
wallBb.max() + vector(typDim, typDim, typDim)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Note: allow more levels than in meshSearch. Assume patch
|
||||||
|
// is not as big as all boundary faces
|
||||||
indexedOctree<treeDataFace> oc
|
indexedOctree<treeDataFace> oc
|
||||||
(
|
(
|
||||||
treeDataFace(false, fromPatch),
|
treeDataFace(false, fromPatch),
|
||||||
shiftedBb, // overall search domain
|
shiftedBb, // overall search domain
|
||||||
8, // maxLevel
|
12, // maxLevel
|
||||||
10, // leafsize
|
10, // leafsize
|
||||||
3.0 // duplicity
|
6.0 // duplicity
|
||||||
);
|
);
|
||||||
|
|
||||||
const vectorField::subField centresToBoundary =
|
const vectorField::subField centresToBoundary =
|
||||||
@ -185,7 +187,7 @@ void Foam::meshToMesh::calcAddressing()
|
|||||||
|
|
||||||
boundaryAddressing_[patchi].setSize(toPatch.size());
|
boundaryAddressing_[patchi].setSize(toPatch.size());
|
||||||
|
|
||||||
scalar distSqr = sqr(GREAT);
|
scalar distSqr = sqr(wallBb.mag());
|
||||||
|
|
||||||
forAll(toPatch, toi)
|
forAll(toPatch, toi)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -40,62 +40,7 @@ namespace Foam
|
|||||||
defineTypeNameAndDebug(basicThermo, 0);
|
defineTypeNameAndDebug(basicThermo, 0);
|
||||||
defineRunTimeSelectionTable(basicThermo, fvMesh);
|
defineRunTimeSelectionTable(basicThermo, fvMesh);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::wordList Foam::basicThermo::heBoundaryTypes()
|
|
||||||
{
|
|
||||||
const volScalarField::GeometricBoundaryField& tbf = T_.boundaryField();
|
|
||||||
|
|
||||||
wordList hbt = tbf.types();
|
|
||||||
|
|
||||||
forAll(tbf, patchi)
|
|
||||||
{
|
|
||||||
if (isA<fixedValueFvPatchScalarField>(tbf[patchi]))
|
|
||||||
{
|
|
||||||
hbt[patchi] = fixedEnergyFvPatchScalarField::typeName;
|
|
||||||
}
|
|
||||||
else if
|
|
||||||
(
|
|
||||||
isA<zeroGradientFvPatchScalarField>(tbf[patchi])
|
|
||||||
|| isA<fixedGradientFvPatchScalarField>(tbf[patchi])
|
|
||||||
)
|
|
||||||
{
|
|
||||||
hbt[patchi] = gradientEnergyFvPatchScalarField::typeName;
|
|
||||||
}
|
|
||||||
else if(isA<mixedFvPatchScalarField>(tbf[patchi]))
|
|
||||||
{
|
|
||||||
hbt[patchi] = mixedEnergyFvPatchScalarField::typeName;
|
|
||||||
}
|
|
||||||
else if (isA<temperatureJumpFvPatchScalarField>(tbf[patchi]))
|
|
||||||
{
|
|
||||||
hbt[patchi] = energyJumpFvPatchScalarField::typeName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return hbt;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::basicThermo::heBoundaryCorrection(volScalarField& h)
|
|
||||||
{
|
|
||||||
volScalarField::GeometricBoundaryField& hbf = h.boundaryField();
|
|
||||||
|
|
||||||
forAll(hbf, patchi)
|
|
||||||
{
|
|
||||||
if (isA<gradientEnergyFvPatchScalarField>(hbf[patchi]))
|
|
||||||
{
|
|
||||||
refCast<gradientEnergyFvPatchScalarField>(hbf[patchi]).gradient()
|
|
||||||
= hbf[patchi].fvPatchField::snGrad();
|
|
||||||
}
|
|
||||||
else if (isA<mixedEnergyFvPatchScalarField>(hbf[patchi]))
|
|
||||||
{
|
|
||||||
refCast<mixedEnergyFvPatchScalarField>(hbf[patchi]).refGrad()
|
|
||||||
= hbf[patchi].fvPatchField::snGrad();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,25 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
|
||||||
|
:
|
||||||
|
basicThermo(mesh, dict),
|
||||||
|
rho_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rhoThermo",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimDensity
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::rhoThermo::~rhoThermo()
|
Foam::rhoThermo::~rhoThermo()
|
||||||
|
|||||||
@ -90,6 +90,9 @@ public:
|
|||||||
//- Construct from mesh
|
//- Construct from mesh
|
||||||
rhoThermo(const fvMesh&);
|
rhoThermo(const fvMesh&);
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
rhoThermo(const fvMesh&, const dictionary&);
|
||||||
|
|
||||||
|
|
||||||
//- Selector
|
//- Selector
|
||||||
static autoPtr<rhoThermo> New(const fvMesh&);
|
static autoPtr<rhoThermo> New(const fvMesh&);
|
||||||
|
|||||||
@ -89,9 +89,6 @@ public:
|
|||||||
|
|
||||||
// Derived thermal properties
|
// Derived thermal properties
|
||||||
|
|
||||||
//- Isotropic thermal conductivity [W/m/K]
|
|
||||||
//virtual tmp<volScalarField> kappa() const;
|
|
||||||
|
|
||||||
//- Anisotropic thermal conductivity [W/m/K]
|
//- Anisotropic thermal conductivity [W/m/K]
|
||||||
virtual tmp<volVectorField> Kappa() const;
|
virtual tmp<volVectorField> Kappa() const;
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@ namespace Foam
|
|||||||
defineRunTimeSelectionTable(solidReactionThermo, dictionary);
|
defineRunTimeSelectionTable(solidReactionThermo, dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::solidReactionThermo::solidReactionThermo(const fvMesh& mesh)
|
Foam::solidReactionThermo::solidReactionThermo(const fvMesh& mesh)
|
||||||
@ -52,6 +53,7 @@ Foam::solidReactionThermo::solidReactionThermo
|
|||||||
solidThermo(mesh, dict)
|
solidThermo(mesh, dict)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::solidReactionThermo::~solidReactionThermo()
|
Foam::solidReactionThermo::~solidReactionThermo()
|
||||||
|
|||||||
@ -42,20 +42,7 @@ namespace Foam
|
|||||||
|
|
||||||
Foam::solidThermo::solidThermo(const fvMesh& mesh)
|
Foam::solidThermo::solidThermo(const fvMesh& mesh)
|
||||||
:
|
:
|
||||||
basicThermo(mesh),
|
rhoThermo(mesh)
|
||||||
rho_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimMass/dimVolume
|
|
||||||
)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -65,20 +52,7 @@ Foam::solidThermo::solidThermo
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
basicThermo(mesh, dict),
|
rhoThermo(mesh, dict)
|
||||||
rho_
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
mesh.time().timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimMass/dimVolume
|
|
||||||
)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -90,57 +64,10 @@ Foam::solidThermo::~solidThermo()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::volScalarField& Foam::solidThermo::T()
|
|
||||||
{
|
|
||||||
return this->T_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::volScalarField& Foam::solidThermo::T() const
|
|
||||||
{
|
|
||||||
return this->T_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::volScalarField& Foam::solidThermo::rhos() const
|
|
||||||
{
|
|
||||||
return rho_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::volScalarField& Foam::solidThermo::rhos()
|
|
||||||
{
|
|
||||||
return rho_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::volScalarField& Foam::solidThermo::p() const
|
|
||||||
{
|
|
||||||
return this->p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::volScalarField& Foam::solidThermo::p()
|
|
||||||
{
|
|
||||||
return this->p_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const Foam::volScalarField& Foam::solidThermo::alpha() const
|
|
||||||
{
|
|
||||||
return this->alpha_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::solidThermo::rho() const
|
|
||||||
{
|
|
||||||
return tmp<volScalarField>(rho_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::solidThermo::read()
|
bool Foam::solidThermo::read()
|
||||||
{
|
{
|
||||||
return regIOobject::read();
|
return regIOobject::read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -41,7 +41,7 @@ SourceFiles
|
|||||||
#include "IOdictionary.H"
|
#include "IOdictionary.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "basicSolidMixture.H"
|
#include "basicSolidMixture.H"
|
||||||
#include "basicThermo.H"
|
#include "rhoThermo.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -54,18 +54,9 @@ namespace Foam
|
|||||||
|
|
||||||
class solidThermo
|
class solidThermo
|
||||||
:
|
:
|
||||||
public basicThermo
|
public rhoThermo
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
|
|
||||||
// Fields
|
|
||||||
|
|
||||||
//- Density [kg/m3]
|
|
||||||
volScalarField rho_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -116,50 +107,9 @@ public:
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
//- Update properties
|
|
||||||
virtual void correct() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Access to thermodynamic state variables
|
|
||||||
|
|
||||||
//- Constant access to temperature [K]
|
|
||||||
virtual const volScalarField& T() const;
|
|
||||||
|
|
||||||
//- Non constant access to temperature [K]
|
|
||||||
virtual volScalarField& T();
|
|
||||||
|
|
||||||
//- Solid density [kg/m3]
|
|
||||||
virtual const volScalarField& rhos() const;
|
|
||||||
|
|
||||||
//- Non-const access for solid density [kg/m3]
|
|
||||||
virtual volScalarField& rhos();
|
|
||||||
|
|
||||||
|
|
||||||
//- Constant access to p [Pa]
|
|
||||||
virtual const volScalarField& p() const;
|
|
||||||
|
|
||||||
//- Non-constant access to p [Pa]
|
|
||||||
virtual volScalarField& p();
|
|
||||||
|
|
||||||
|
|
||||||
// Access to transport state variables
|
|
||||||
|
|
||||||
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
|
|
||||||
virtual const volScalarField& alpha() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Derived thermal properties
|
// Derived thermal properties
|
||||||
|
|
||||||
//- Enthalpy/Internal energy [J/kg]
|
|
||||||
virtual const volScalarField& he() const = 0;
|
|
||||||
|
|
||||||
//- Enthalpy/Internal energy [J/kg]
|
|
||||||
// Non-const access allowed for transport equations
|
|
||||||
virtual volScalarField& he() = 0;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/m/K]
|
|
||||||
virtual tmp<volScalarField> kappa() const = 0;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/m/K]
|
//- Thermal conductivity [W/m/K]
|
||||||
virtual tmp<volVectorField> Kappa() const = 0;
|
virtual tmp<volVectorField> Kappa() const = 0;
|
||||||
|
|
||||||
@ -172,50 +122,12 @@ public:
|
|||||||
//- Emissivity coefficient [1/m]
|
//- Emissivity coefficient [1/m]
|
||||||
virtual tmp<volScalarField> emissivity() const = 0;
|
virtual tmp<volScalarField> emissivity() const = 0;
|
||||||
|
|
||||||
//- Specific heat capacity [J/kg/K]
|
|
||||||
virtual tmp<volScalarField> Cp() const = 0;
|
|
||||||
|
|
||||||
//- Heat of formation [J/kg]
|
|
||||||
virtual tmp<volScalarField> hc() const = 0;
|
|
||||||
|
|
||||||
//- Density [kg/m^3]
|
|
||||||
virtual tmp<volScalarField> rho() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Per patch calculation
|
// Per patch calculation
|
||||||
|
|
||||||
//- Enthalpy/Internal energy [J/kg]
|
|
||||||
virtual tmp<scalarField> he
|
|
||||||
(
|
|
||||||
const scalarField& p,
|
|
||||||
const scalarField& T,
|
|
||||||
const label patchi
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
//- Specific heat capacity [J/kg/K)]
|
|
||||||
virtual tmp<scalarField> Cp
|
|
||||||
(
|
|
||||||
const scalarField& p,
|
|
||||||
const scalarField& T,
|
|
||||||
const label patchI
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
//- Isotropic thermal conductivity [W//m/K]
|
|
||||||
virtual tmp<scalarField> kappa
|
|
||||||
(
|
|
||||||
const label patchI
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Anisotropic thermal conductivity [W/m/K]
|
//- Anisotropic thermal conductivity [W/m/K]
|
||||||
virtual tmp<vectorField> Kappa
|
virtual tmp<vectorField> Kappa
|
||||||
(
|
|
||||||
const label patchI
|
|
||||||
) const = 0;
|
|
||||||
|
|
||||||
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
|
|
||||||
virtual tmp<scalarField> alpha
|
|
||||||
(
|
(
|
||||||
const label patchI
|
const label patchI
|
||||||
) const = 0;
|
) const = 0;
|
||||||
|
|||||||
@ -1,40 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: dev |
|
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
FoamFile
|
|
||||||
{
|
|
||||||
version 2.0;
|
|
||||||
format ascii;
|
|
||||||
class polyBoundaryMesh;
|
|
||||||
location "constant/polyMesh";
|
|
||||||
object boundary;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
3
|
|
||||||
(
|
|
||||||
movingWall
|
|
||||||
{
|
|
||||||
type wall;
|
|
||||||
nFaces 20;
|
|
||||||
startFace 760;
|
|
||||||
}
|
|
||||||
fixedWalls
|
|
||||||
{
|
|
||||||
type wall;
|
|
||||||
nFaces 60;
|
|
||||||
startFace 780;
|
|
||||||
}
|
|
||||||
frontAndBack
|
|
||||||
{
|
|
||||||
type empty;
|
|
||||||
nFaces 800;
|
|
||||||
startFace 840;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -12,5 +12,6 @@ application=`getApplication`
|
|||||||
#runApplication $application
|
#runApplication $application
|
||||||
runApplication decomposePar
|
runApplication decomposePar
|
||||||
runParallel $application 4
|
runParallel $application 4
|
||||||
|
runApplication reconstructPar
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
|
|
||||||
libs ("libOpenFOAM.so" "libfieldFunctionObjects.so");
|
libs ("libOpenFOAM.so" "libfieldFunctionObjects.so");
|
||||||
|
|
||||||
application simpleFoam;
|
application pisoFoam;
|
||||||
|
|
||||||
startFrom latestTime;
|
startFrom latestTime;
|
||||||
|
|
||||||
|
|||||||
@ -292,7 +292,7 @@ meshQualityControls
|
|||||||
// <0 = inside out tet,
|
// <0 = inside out tet,
|
||||||
// 0 = flat tet
|
// 0 = flat tet
|
||||||
// 1 = regular tet
|
// 1 = regular tet
|
||||||
minTetQuality 1e-30;
|
minTetQuality 1e-9;
|
||||||
|
|
||||||
//- Minimum face area. Set to <0 to disable.
|
//- Minimum face area. Set to <0 to disable.
|
||||||
minArea -1;
|
minArea -1;
|
||||||
|
|||||||
@ -13,4 +13,4 @@ ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
|
|||||||
LINK_LIBS = $(cDBUG) -L$(IA32ROOT)/lib
|
LINK_LIBS = $(cDBUG) -L$(IA32ROOT)/lib
|
||||||
|
|
||||||
LINKLIBSO = $(cc) $(cFLAGS) -shared
|
LINKLIBSO = $(cc) $(cFLAGS) -shared
|
||||||
LINKEXE = $(cc) $(cFLAGS)
|
LINKEXE = $(cc) $(cFLAGS) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
|
||||||
|
|||||||
@ -17,5 +17,5 @@ cpptoo = $(Ctoo)
|
|||||||
|
|
||||||
LINK_LIBS = $(c++DBUG) -L$(IA64ROOT)/lib
|
LINK_LIBS = $(c++DBUG) -L$(IA64ROOT)/lib
|
||||||
|
|
||||||
LINKLIBSO = $(CC) $(c++FLAGS) -shared
|
LINKLIBSO = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
|
||||||
LINKEXE = $(CC) $(c++FLAGS)
|
LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed
|
||||||
|
|||||||
@ -13,4 +13,4 @@ ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
|
|||||||
LINK_LIBS = $(cDBUG) -L$(IA32ROOT)/lib
|
LINK_LIBS = $(cDBUG) -L$(IA32ROOT)/lib
|
||||||
|
|
||||||
LINKLIBSO = $(cc) $(cFLAGS) -shared
|
LINKLIBSO = $(cc) $(cFLAGS) -shared
|
||||||
LINKEXE = $(cc) $(cFLAGS)
|
LINKEXE = $(cc) $(cFLAGS) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
|
||||||
|
|||||||
@ -19,5 +19,5 @@ cpptoo = $(Ctoo)
|
|||||||
#LINK_LIBS = $(c++DBUG) -lstdc++
|
#LINK_LIBS = $(c++DBUG) -lstdc++
|
||||||
LINK_LIBS = $(c++DBUG) -L$(IA32ROOT)/lib
|
LINK_LIBS = $(c++DBUG) -L$(IA32ROOT)/lib
|
||||||
|
|
||||||
LINKLIBSO = $(CC) $(c++FLAGS) -shared
|
LINKLIBSO = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
|
||||||
LINKEXE = $(CC) $(c++FLAGS)
|
LINKEXE = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed
|
||||||
|
|||||||
Reference in New Issue
Block a user