mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: externalCoupled: changed to non-OutputFilter functionObject.
- moved control to functionObject (from bc) - this allows multi-region support - see heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater tut - generalisation of streamed reading/writing of specialised bcs
This commit is contained in:
@ -0,0 +1,10 @@
|
|||||||
|
//
|
||||||
|
// addRegionOption.H
|
||||||
|
// ~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Foam::argList::addOption
|
||||||
|
(
|
||||||
|
"regions",
|
||||||
|
"(name1 .. nameN)",
|
||||||
|
"specify alternative mesh regions"
|
||||||
|
);
|
||||||
@ -38,6 +38,11 @@ Usage
|
|||||||
\param -region \<name\> \n
|
\param -region \<name\> \n
|
||||||
Specify an alternative mesh region.
|
Specify an alternative mesh region.
|
||||||
|
|
||||||
|
\param -regions (\<name1\> \<name2\> .. \<namen\>) \n
|
||||||
|
Specify alternative mesh regions. The region names will be sorted
|
||||||
|
alphabetically and a single composite name will be created
|
||||||
|
\<nameX\>_\<nameY\>.._\<nameZ\>
|
||||||
|
|
||||||
On execution, the combined patch geometry (points and faces) are output
|
On execution, the combined patch geometry (points and faces) are output
|
||||||
to the communications directory.
|
to the communications directory.
|
||||||
|
|
||||||
@ -59,6 +64,7 @@ SeeAlso
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
|
#include "addRegionsOption.H"
|
||||||
argList::validArgs.append("patchGroup");
|
argList::validArgs.append("patchGroup");
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
@ -68,16 +74,52 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createNamedMesh.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
wordList regionNames(1, fvMesh::defaultRegion);
|
||||||
|
if (!args.optionReadIfPresent("region", regionNames[0]))
|
||||||
|
{
|
||||||
|
args.optionReadIfPresent("regions", regionNames);
|
||||||
|
}
|
||||||
|
|
||||||
const wordRe patchGroup(args[1]);
|
const wordRe patchGroup(args.argRead<wordRe>(1));
|
||||||
|
|
||||||
fileName commsDir(runTime.path()/"comms");
|
fileName commsDir(runTime.path()/"comms");
|
||||||
args.optionReadIfPresent("commsDir", commsDir);
|
args.optionReadIfPresent("commsDir", commsDir);
|
||||||
|
|
||||||
externalCoupledFunctionObject::writeGeometry(mesh, commsDir, patchGroup);
|
|
||||||
|
// Make sure region names are in canonical order
|
||||||
|
stableSort(regionNames);
|
||||||
|
|
||||||
|
|
||||||
|
PtrList<const fvMesh> meshes(regionNames.size());
|
||||||
|
forAll(regionNames, i)
|
||||||
|
{
|
||||||
|
Info<< "Create mesh " << regionNames[i] << " for time = "
|
||||||
|
<< runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
meshes.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new fvMesh
|
||||||
|
(
|
||||||
|
Foam::IOobject
|
||||||
|
(
|
||||||
|
regionNames[i],
|
||||||
|
runTime.timeName(),
|
||||||
|
runTime,
|
||||||
|
Foam::IOobject::MUST_READ
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
externalCoupledFunctionObject::writeGeometry
|
||||||
|
(
|
||||||
|
UPtrList<const fvMesh>(meshes),
|
||||||
|
commsDir,
|
||||||
|
patchGroup
|
||||||
|
);
|
||||||
|
|
||||||
Info<< "\nEnd\n" << endl;
|
Info<< "\nEnd\n" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,7 @@ License
|
|||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
|
#include "DynamicField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -65,11 +66,16 @@ Foam::fileName Foam::externalCoupledFunctionObject::baseDir() const
|
|||||||
Foam::fileName Foam::externalCoupledFunctionObject::groupDir
|
Foam::fileName Foam::externalCoupledFunctionObject::groupDir
|
||||||
(
|
(
|
||||||
const fileName& commsDir,
|
const fileName& commsDir,
|
||||||
const word& regionName,
|
const word& regionGroupName,
|
||||||
const wordRe& groupName
|
const wordRe& groupName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fileName result(commsDir/regionName/string::validate<fileName>(groupName));
|
fileName result
|
||||||
|
(
|
||||||
|
commsDir
|
||||||
|
/regionGroupName
|
||||||
|
/string::validate<fileName>(groupName)
|
||||||
|
);
|
||||||
result.clean();
|
result.clean();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -126,11 +132,11 @@ void Foam::externalCoupledFunctionObject::removeReadFiles() const
|
|||||||
|
|
||||||
if (log_) Info<< type() << ": removing all read files" << endl;
|
if (log_) Info<< type() << ": removing all read files" << endl;
|
||||||
|
|
||||||
forAll(regionNames_, regionI)
|
forAll(regionGroupNames_, regionI)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames_[regionI];
|
const word& compName = regionGroupNames_[regionI];
|
||||||
const fvMesh& mesh = time_.lookupObject<fvMesh>(regionName);
|
|
||||||
const labelList& groups = regionToGroups_[regionName];
|
const labelList& groups = regionToGroups_[compName];
|
||||||
forAll(groups, i)
|
forAll(groups, i)
|
||||||
{
|
{
|
||||||
label groupI = groups[i];
|
label groupI = groups[i];
|
||||||
@ -141,7 +147,7 @@ void Foam::externalCoupledFunctionObject::removeReadFiles() const
|
|||||||
const word& fieldName = groupReadFields_[groupI][fieldI];
|
const word& fieldName = groupReadFields_[groupI][fieldI];
|
||||||
rm
|
rm
|
||||||
(
|
(
|
||||||
groupDir(commsDir_, mesh.dbDir(), groupName)
|
groupDir(commsDir_, compName, groupName)
|
||||||
/ fieldName + ".in"
|
/ fieldName + ".in"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -159,22 +165,22 @@ void Foam::externalCoupledFunctionObject::removeWriteFiles() const
|
|||||||
|
|
||||||
if (log_) Info<< type() << ": removing all write files" << endl;
|
if (log_) Info<< type() << ": removing all write files" << endl;
|
||||||
|
|
||||||
forAll(regionNames_, regionI)
|
forAll(regionGroupNames_, regionI)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames_[regionI];
|
const word& compName = regionGroupNames_[regionI];
|
||||||
const fvMesh& mesh = time_.lookupObject<fvMesh>(regionName);
|
|
||||||
const labelList& groups = regionToGroups_[regionName];
|
const labelList& groups = regionToGroups_[compName];
|
||||||
forAll(groups, i)
|
forAll(groups, i)
|
||||||
{
|
{
|
||||||
label groupI = groups[i];
|
label groupI = groups[i];
|
||||||
const wordRe& groupName = groupNames_[groupI];
|
const wordRe& groupName = groupNames_[groupI];
|
||||||
|
|
||||||
forAll(groupWriteFields_[groupI], fieldI)
|
forAll(groupReadFields_[groupI], fieldI)
|
||||||
{
|
{
|
||||||
const word& fieldName = groupWriteFields_[groupI][fieldI];
|
const word& fieldName = groupReadFields_[groupI][fieldI];
|
||||||
rm
|
rm
|
||||||
(
|
(
|
||||||
groupDir(commsDir_, mesh.dbDir(), groupName)
|
groupDir(commsDir_, compName, groupName)
|
||||||
/ fieldName + ".out"
|
/ fieldName + ".out"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -376,12 +382,21 @@ void Foam::externalCoupledFunctionObject::readLines
|
|||||||
|
|
||||||
void Foam::externalCoupledFunctionObject::writeGeometry
|
void Foam::externalCoupledFunctionObject::writeGeometry
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const UPtrList<const fvMesh>& meshes,
|
||||||
const fileName& commsDir,
|
const fileName& commsDir,
|
||||||
const wordRe& groupName
|
const wordRe& groupName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fileName dir(groupDir(commsDir, mesh.dbDir(), groupName));
|
wordList regionNames(meshes.size());
|
||||||
|
forAll(meshes, i)
|
||||||
|
{
|
||||||
|
regionNames[i] = meshes[i].dbDir();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure meshes are provided in sorted order
|
||||||
|
checkOrder(regionNames);
|
||||||
|
|
||||||
|
fileName dir(groupDir(commsDir, compositeName(regionNames), groupName));
|
||||||
|
|
||||||
//if (log_)
|
//if (log_)
|
||||||
{
|
{
|
||||||
@ -397,6 +412,14 @@ void Foam::externalCoupledFunctionObject::writeGeometry
|
|||||||
osFacesPtr.reset(new OFstream(dir/"patchFaces"));
|
osFacesPtr.reset(new OFstream(dir/"patchFaces"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DynamicList<face> allMeshesFaces;
|
||||||
|
DynamicField<point> allMeshesPoints;
|
||||||
|
|
||||||
|
forAll(meshes, meshI)
|
||||||
|
{
|
||||||
|
const fvMesh& mesh = meshes[meshI];
|
||||||
|
|
||||||
const labelList patchIDs
|
const labelList patchIDs
|
||||||
(
|
(
|
||||||
mesh.boundaryMesh().patchSet
|
mesh.boundaryMesh().patchSet
|
||||||
@ -405,91 +428,194 @@ void Foam::externalCoupledFunctionObject::writeGeometry
|
|||||||
).sortedToc()
|
).sortedToc()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Count faces
|
||||||
|
label nFaces = 0;
|
||||||
forAll(patchIDs, i)
|
forAll(patchIDs, i)
|
||||||
{
|
{
|
||||||
label patchI = patchIDs[i];
|
nFaces += mesh.boundaryMesh()[patchIDs[i]].size();
|
||||||
|
}
|
||||||
|
|
||||||
const polyPatch& p = mesh.boundaryMesh()[patchI];
|
// Collect faces
|
||||||
|
DynamicList<label> allFaceIDs(nFaces);
|
||||||
|
forAll(patchIDs, i)
|
||||||
|
{
|
||||||
|
const polyPatch& p = mesh.boundaryMesh()[patchIDs[i]];
|
||||||
|
|
||||||
|
forAll(p, pI)
|
||||||
|
{
|
||||||
|
allFaceIDs.append(p.start()+pI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct overall patch
|
||||||
|
indirectPrimitivePatch allPatch
|
||||||
|
(
|
||||||
|
IndirectList<face>(mesh.faces(), allFaceIDs),
|
||||||
|
mesh.points()
|
||||||
|
);
|
||||||
|
|
||||||
labelList pointToGlobal;
|
labelList pointToGlobal;
|
||||||
labelList uniquePointIDs;
|
labelList uniquePointIDs;
|
||||||
mesh.globalData().mergePoints
|
mesh.globalData().mergePoints
|
||||||
(
|
(
|
||||||
p.meshPoints(),
|
allPatch.meshPoints(),
|
||||||
p.meshPointMap(),
|
allPatch.meshPointMap(),
|
||||||
pointToGlobal,
|
pointToGlobal,
|
||||||
uniquePointIDs
|
uniquePointIDs
|
||||||
);
|
);
|
||||||
|
|
||||||
label procI = Pstream::myProcNo();
|
label procI = Pstream::myProcNo();
|
||||||
|
|
||||||
List<pointField> allPoints(Pstream::nProcs());
|
List<pointField> collectedPoints(Pstream::nProcs());
|
||||||
allPoints[procI] = pointField(mesh.points(), uniquePointIDs);
|
collectedPoints[procI] = pointField(mesh.points(), uniquePointIDs);
|
||||||
Pstream::gatherList(allPoints);
|
Pstream::gatherList(collectedPoints);
|
||||||
|
|
||||||
List<faceList> allFaces(Pstream::nProcs());
|
List<faceList> collectedFaces(Pstream::nProcs());
|
||||||
faceList& patchFaces = allFaces[procI];
|
faceList& patchFaces = collectedFaces[procI];
|
||||||
patchFaces = p.localFaces();
|
patchFaces = allPatch.localFaces();
|
||||||
forAll(patchFaces, faceI)
|
forAll(patchFaces, faceI)
|
||||||
{
|
{
|
||||||
inplaceRenumber(pointToGlobal, patchFaces[faceI]);
|
inplaceRenumber(pointToGlobal, patchFaces[faceI]);
|
||||||
}
|
}
|
||||||
Pstream::gatherList(allFaces);
|
Pstream::gatherList(collectedFaces);
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
pointField pts
|
// Append and renumber
|
||||||
(
|
label nPoints = allMeshesPoints.size();
|
||||||
ListListOps::combine<pointField>
|
|
||||||
(
|
forAll(collectedPoints, procI)
|
||||||
allPoints,
|
{
|
||||||
accessOp<pointField>()
|
allMeshesPoints.append(collectedPoints[procI]);
|
||||||
)
|
|
||||||
);
|
}
|
||||||
|
face newFace;
|
||||||
|
forAll(collectedFaces, procI)
|
||||||
|
{
|
||||||
|
const faceList& procFaces = collectedFaces[procI];
|
||||||
|
|
||||||
|
forAll(procFaces, faceI)
|
||||||
|
{
|
||||||
|
const face& f = procFaces[faceI];
|
||||||
|
|
||||||
|
newFace.setSize(f.size());
|
||||||
|
forAll(f, fp)
|
||||||
|
{
|
||||||
|
newFace[fp] = f[fp]+nPoints;
|
||||||
|
}
|
||||||
|
allMeshesFaces.append(newFace);
|
||||||
|
}
|
||||||
|
|
||||||
|
nPoints += collectedPoints[procI].size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//if (log_)
|
//if (log_)
|
||||||
{
|
{
|
||||||
Info<< typeName << ": for patch " << p.name()
|
Info<< typeName << ": for mesh " << mesh.name()
|
||||||
<< " writing " << pts.size() << " points to "
|
<< " writing " << allMeshesPoints.size() << " points to "
|
||||||
<< osPointsPtr().name() << endl;
|
<< osPointsPtr().name() << endl;
|
||||||
|
Info<< typeName << ": for mesh " << mesh.name()
|
||||||
|
<< " writing " << allMeshesFaces.size() << " faces to "
|
||||||
|
<< osFacesPtr().name() << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write points
|
// Write points
|
||||||
osPointsPtr() << patchKey.c_str() << p.name() << pts << endl;
|
if (osPointsPtr.valid())
|
||||||
|
|
||||||
faceList fcs
|
|
||||||
(
|
|
||||||
ListListOps::combine<faceList>(allFaces, accessOp<faceList>())
|
|
||||||
);
|
|
||||||
|
|
||||||
//if (log_)
|
|
||||||
{
|
{
|
||||||
Info<< typeName << ": for patch " << p.name()
|
osPointsPtr() << allMeshesPoints << endl;
|
||||||
<< " writing " << fcs.size() << " faces to "
|
|
||||||
<< osFacesPtr().name() << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write faces
|
// Write faces
|
||||||
osFacesPtr() << patchKey.c_str() << p.name() << fcs << endl;
|
if (osFacesPtr.valid())
|
||||||
|
{
|
||||||
|
osFacesPtr() << allMeshesFaces << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::word Foam::externalCoupledFunctionObject::compositeName
|
||||||
|
(
|
||||||
|
const wordList& regionNames
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (regionNames.size() == 0)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"externalCoupledFunctionObject::compositeName(const wordList&)"
|
||||||
|
) << "Empty regionNames" << abort(FatalError);
|
||||||
|
return word::null;
|
||||||
|
}
|
||||||
|
else if (regionNames.size() == 1)
|
||||||
|
{
|
||||||
|
if (regionNames[0] == polyMesh::defaultRegion)
|
||||||
|
{
|
||||||
|
// For compatibility with single region cases suppress single
|
||||||
|
// region name
|
||||||
|
return word("");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return regionNames[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Enforce lexical ordering
|
||||||
|
checkOrder(regionNames);
|
||||||
|
|
||||||
|
word composite(regionNames[0]);
|
||||||
|
for (label i = 1; i < regionNames.size(); i++)
|
||||||
|
{
|
||||||
|
composite += "_" + regionNames[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return composite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::externalCoupledFunctionObject::checkOrder
|
||||||
|
(
|
||||||
|
const wordList& regionNames
|
||||||
|
)
|
||||||
|
{
|
||||||
|
labelList order;
|
||||||
|
sortedOrder(regionNames, order);
|
||||||
|
if (order != identity(regionNames.size()))
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"externalCoupledFunctionObject::checkOrder(const wordList&)"
|
||||||
|
) << "regionNames " << regionNames << " not in alphabetical order :"
|
||||||
|
<< order << exit(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::externalCoupledFunctionObject::readData()
|
void Foam::externalCoupledFunctionObject::readData()
|
||||||
{
|
{
|
||||||
forAll(regionNames_, regionI)
|
forAll(regionGroupNames_, regionI)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames_[regionI];
|
const word& compName = regionGroupNames_[regionI];
|
||||||
const labelList& groups = regionToGroups_[regionName];
|
const wordList& regionNames = regionGroupRegions_[regionI];
|
||||||
|
|
||||||
const fvMesh& mesh = time_.lookupObject<fvMesh>(regionName);
|
// Get the meshes for the region-group
|
||||||
|
UPtrList<const fvMesh> meshes(regionNames.size());
|
||||||
|
forAll(regionNames, j)
|
||||||
|
{
|
||||||
|
const word& regionName = regionNames[j];
|
||||||
|
meshes.set(j, &time_.lookupObject<fvMesh>(regionName));
|
||||||
|
}
|
||||||
|
|
||||||
|
const labelList& groups = regionToGroups_[compName];
|
||||||
|
|
||||||
forAll(groups, i)
|
forAll(groups, i)
|
||||||
{
|
{
|
||||||
label groupI = groups[i];
|
label groupI = groups[i];
|
||||||
const wordRe& groupName = groupNames_[groupI];
|
const wordRe& groupName = groupNames_[groupI];
|
||||||
const labelList& patchIDs = groupPatchIDs_[groupI];
|
|
||||||
const wordList& fieldNames = groupReadFields_[groupI];
|
const wordList& fieldNames = groupReadFields_[groupI];
|
||||||
|
|
||||||
forAll(fieldNames, fieldI)
|
forAll(fieldNames, fieldI)
|
||||||
@ -498,37 +624,32 @@ void Foam::externalCoupledFunctionObject::readData()
|
|||||||
|
|
||||||
bool ok = readData<scalar>
|
bool ok = readData<scalar>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
ok = ok || readData<vector>
|
ok = ok || readData<vector>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
ok = ok || readData<sphericalTensor>
|
ok = ok || readData<sphericalTensor>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
ok = ok || readData<symmTensor>
|
ok = ok || readData<symmTensor>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
ok = ok || readData<tensor>
|
ok = ok || readData<tensor>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -538,7 +659,7 @@ void Foam::externalCoupledFunctionObject::readData()
|
|||||||
(
|
(
|
||||||
"void Foam::externalCoupledFunctionObject::readData()"
|
"void Foam::externalCoupledFunctionObject::readData()"
|
||||||
)
|
)
|
||||||
<< "Field " << fieldName << " in region " << mesh.name()
|
<< "Field " << fieldName << " in regions " << compName
|
||||||
<< " was not found." << endl;
|
<< " was not found." << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -549,56 +670,59 @@ void Foam::externalCoupledFunctionObject::readData()
|
|||||||
|
|
||||||
void Foam::externalCoupledFunctionObject::writeData() const
|
void Foam::externalCoupledFunctionObject::writeData() const
|
||||||
{
|
{
|
||||||
forAll(regionNames_, regionI)
|
forAll(regionGroupNames_, regionI)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames_[regionI];
|
const word& compName = regionGroupNames_[regionI];
|
||||||
const labelList& groups = regionToGroups_[regionName];
|
const wordList& regionNames = regionGroupRegions_[regionI];
|
||||||
|
|
||||||
const fvMesh& mesh = time_.lookupObject<fvMesh>(regionName);
|
// Get the meshes for the region-group
|
||||||
|
UPtrList<const fvMesh> meshes(regionNames.size());
|
||||||
|
forAll(regionNames, j)
|
||||||
|
{
|
||||||
|
const word& regionName = regionNames[j];
|
||||||
|
meshes.set(j, &time_.lookupObject<fvMesh>(regionName));
|
||||||
|
}
|
||||||
|
|
||||||
|
const labelList& groups = regionToGroups_[compName];
|
||||||
|
|
||||||
forAll(groups, i)
|
forAll(groups, i)
|
||||||
{
|
{
|
||||||
label groupI = groups[i];
|
label groupI = groups[i];
|
||||||
const wordRe& groupName = groupNames_[groupI];
|
const wordRe& groupName = groupNames_[groupI];
|
||||||
const labelList& patchIDs = groupPatchIDs_[groupI];
|
|
||||||
const wordList& fieldNames = groupWriteFields_[groupI];
|
const wordList& fieldNames = groupWriteFields_[groupI];
|
||||||
|
|
||||||
forAll(fieldNames, fieldI)
|
forAll(fieldNames, fieldI)
|
||||||
{
|
{
|
||||||
const word& fieldName = fieldNames[fieldI];
|
const word& fieldName = fieldNames[fieldI];
|
||||||
|
|
||||||
bool ok = writeData<scalar>
|
bool ok = writeData<scalar>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
ok = ok || writeData<vector>
|
ok = ok || writeData<vector>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
ok = ok || writeData<sphericalTensor>
|
ok = ok || writeData<sphericalTensor>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
ok = ok || writeData<symmTensor>
|
ok = ok || writeData<symmTensor>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
ok = ok || writeData<tensor>
|
ok = ok || writeData<tensor>
|
||||||
(
|
(
|
||||||
mesh,
|
meshes,
|
||||||
groupName,
|
groupName,
|
||||||
patchIDs,
|
|
||||||
fieldName
|
fieldName
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -608,7 +732,7 @@ void Foam::externalCoupledFunctionObject::writeData() const
|
|||||||
(
|
(
|
||||||
"void Foam::externalCoupledFunctionObject::writeData()"
|
"void Foam::externalCoupledFunctionObject::writeData()"
|
||||||
)
|
)
|
||||||
<< "Field " << fieldName << " in region " << mesh.name()
|
<< "Field " << fieldName << " in regions " << compName
|
||||||
<< " was not found." << endl;
|
<< " was not found." << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -625,12 +749,20 @@ void Foam::externalCoupledFunctionObject::initialise()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write the geometry if not already there
|
// Write the geometry if not already there
|
||||||
forAll(regionNames_, regionI)
|
forAll(regionGroupRegions_, i)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames_[regionI];
|
const word& compName = regionGroupNames_[i];
|
||||||
const labelList& groups = regionToGroups_[regionName];
|
const wordList& regionNames = regionGroupRegions_[i];
|
||||||
|
|
||||||
const fvMesh& mesh = time_.lookupObject<fvMesh>(regionName);
|
// Get the meshes for the region-group
|
||||||
|
UPtrList<const fvMesh> meshes(regionNames.size());
|
||||||
|
forAll(regionNames, j)
|
||||||
|
{
|
||||||
|
const word& regionName = regionNames[j];
|
||||||
|
meshes.set(j, &time_.lookupObject<fvMesh>(regionName));
|
||||||
|
}
|
||||||
|
|
||||||
|
const labelList& groups = regionToGroups_[compName];
|
||||||
|
|
||||||
forAll(groups, i)
|
forAll(groups, i)
|
||||||
{
|
{
|
||||||
@ -640,14 +772,16 @@ void Foam::externalCoupledFunctionObject::initialise()
|
|||||||
bool exists = false;
|
bool exists = false;
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
fileName dir(groupDir(commsDir_, mesh.dbDir(), groupName));
|
fileName dir(groupDir(commsDir_, compName, groupName));
|
||||||
|
|
||||||
exists = isFile(dir/"patchPoints") || isFile(dir/"patchFaces");
|
exists =
|
||||||
|
isFile(dir/"patchPoints")
|
||||||
|
|| isFile(dir/"patchFaces");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!returnReduce(exists, orOp<bool>()))
|
if (!returnReduce(exists, orOp<bool>()))
|
||||||
{
|
{
|
||||||
writeGeometry(mesh, commsDir_, groupName);
|
writeGeometry(meshes, commsDir_, groupName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -802,6 +936,12 @@ bool Foam::externalCoupledFunctionObject::read(const dictionary& dict)
|
|||||||
initByExternal_ = readBool(dict.lookup("initByExternal"));
|
initByExternal_ = readBool(dict.lookup("initByExternal"));
|
||||||
log_ = dict.lookupOrDefault("log", false);
|
log_ = dict.lookupOrDefault("log", false);
|
||||||
|
|
||||||
|
|
||||||
|
// Get names of all fvMeshes (and derived types)
|
||||||
|
wordList allRegionNames(time_.lookupClass<fvMesh>().sortedToc());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const dictionary& allRegionsDict = dict.subDict("regions");
|
const dictionary& allRegionsDict = dict.subDict("regions");
|
||||||
|
|
||||||
forAllConstIter(dictionary, allRegionsDict, iter)
|
forAllConstIter(dictionary, allRegionsDict, iter)
|
||||||
@ -818,9 +958,16 @@ bool Foam::externalCoupledFunctionObject::read(const dictionary& dict)
|
|||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
const word& regionName = iter().keyword();
|
const wordRe regionGroupName(iter().keyword());
|
||||||
const dictionary& regionDict = iter().dict();
|
const dictionary& regionDict = iter().dict();
|
||||||
regionNames_.append(regionName);
|
|
||||||
|
labelList regionIDs = findStrings(regionGroupName, allRegionNames);
|
||||||
|
|
||||||
|
const wordList regionNames(allRegionNames, regionIDs);
|
||||||
|
|
||||||
|
regionGroupNames_.append(compositeName(regionNames));
|
||||||
|
regionGroupRegions_.append(regionNames);
|
||||||
|
|
||||||
|
|
||||||
forAllConstIter(dictionary, regionDict, regionIter)
|
forAllConstIter(dictionary, regionDict, regionIter)
|
||||||
{
|
{
|
||||||
@ -844,7 +991,7 @@ bool Foam::externalCoupledFunctionObject::read(const dictionary& dict)
|
|||||||
|
|
||||||
HashTable<labelList>::iterator fnd = regionToGroups_.find
|
HashTable<labelList>::iterator fnd = regionToGroups_.find
|
||||||
(
|
(
|
||||||
regionName
|
regionGroupNames_.last()
|
||||||
);
|
);
|
||||||
if (fnd != regionToGroups_.end())
|
if (fnd != regionToGroups_.end())
|
||||||
{
|
{
|
||||||
@ -852,21 +999,15 @@ bool Foam::externalCoupledFunctionObject::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
regionToGroups_.insert(regionName, labelList(1, nGroups));
|
regionToGroups_.insert
|
||||||
|
(
|
||||||
|
regionGroupNames_.last(),
|
||||||
|
labelList(1, nGroups)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
groupNames_.append(groupName);
|
groupNames_.append(groupName);
|
||||||
groupReadFields_.append(readFields);
|
groupReadFields_.append(readFields);
|
||||||
groupWriteFields_.append(writeFields);
|
groupWriteFields_.append(writeFields);
|
||||||
|
|
||||||
// Pre-calculate the patchIDs
|
|
||||||
const fvMesh& mesh = time_.lookupObject<fvMesh>(regionName);
|
|
||||||
groupPatchIDs_.append
|
|
||||||
(
|
|
||||||
mesh.boundaryMesh().patchSet
|
|
||||||
(
|
|
||||||
List<wordRe>(1, groupName)
|
|
||||||
).sortedToc()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -875,25 +1016,26 @@ bool Foam::externalCoupledFunctionObject::read(const dictionary& dict)
|
|||||||
if (log_)
|
if (log_)
|
||||||
{
|
{
|
||||||
Info<< type() << ": Communicating with regions:" << endl;
|
Info<< type() << ": Communicating with regions:" << endl;
|
||||||
forAll(regionNames_, regionI)
|
forAll(regionGroupNames_, rgI)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames_[regionI];
|
//const wordList& regionNames = regionGroupRegions_[rgI];
|
||||||
const fvMesh& mesh = time_.lookupObject<fvMesh>(regionName);
|
const word& compName = regionGroupNames_[rgI];
|
||||||
|
|
||||||
Info<< "Region: " << mesh.name() << endl << incrIndent;
|
Info<< "Region: " << compName << endl << incrIndent;
|
||||||
const labelList& groups = regionToGroups_[regionName];
|
const labelList& groups = regionToGroups_[compName];
|
||||||
forAll(groups, i)
|
forAll(groups, i)
|
||||||
{
|
{
|
||||||
label groupI = groups[i];
|
label groupI = groups[i];
|
||||||
const wordRe& groupName = groupNames_[groupI];
|
const wordRe& groupName = groupNames_[groupI];
|
||||||
const labelList& patchIDs = groupPatchIDs_[groupI];
|
|
||||||
|
|
||||||
Info<< indent << "Group: " << groupName << "\t"
|
Info<< indent << "patchGroup: " << groupName << "\t"
|
||||||
<< " patches: " << patchIDs << endl
|
|
||||||
<< incrIndent
|
|
||||||
<< indent << "Reading fields: " << groupReadFields_[groupI]
|
|
||||||
<< endl
|
<< endl
|
||||||
<< indent << "Writing fields: " << groupWriteFields_[groupI]
|
<< incrIndent
|
||||||
|
<< indent << "Reading fields: "
|
||||||
|
<< groupReadFields_[groupI]
|
||||||
|
<< endl
|
||||||
|
<< indent << "Writing fields: "
|
||||||
|
<< groupWriteFields_[groupI]
|
||||||
<< endl
|
<< endl
|
||||||
<< decrIndent;
|
<< decrIndent;
|
||||||
}
|
}
|
||||||
@ -907,17 +1049,17 @@ bool Foam::externalCoupledFunctionObject::read(const dictionary& dict)
|
|||||||
// should already be written - but just make sure
|
// should already be written - but just make sure
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
forAll(regionNames_, regionI)
|
forAll(regionGroupNames_, rgI)
|
||||||
{
|
{
|
||||||
const word& regionName = regionNames_[regionI];
|
const word& compName = regionGroupNames_[rgI];
|
||||||
const fvMesh& mesh = time_.lookupObject<fvMesh>(regionName);
|
|
||||||
const labelList& groups = regionToGroups_[regionName];
|
const labelList& groups = regionToGroups_[compName];
|
||||||
forAll(groups, i)
|
forAll(groups, i)
|
||||||
{
|
{
|
||||||
label groupI = groups[i];
|
label groupI = groups[i];
|
||||||
const wordRe& groupName = groupNames_[groupI];
|
const wordRe& groupName = groupNames_[groupI];
|
||||||
|
|
||||||
fileName dir(groupDir(commsDir_, mesh.dbDir(), groupName));
|
fileName dir(groupDir(commsDir_, compName, groupName));
|
||||||
if (!isDir(dir))
|
if (!isDir(dir))
|
||||||
{
|
{
|
||||||
if (log_)
|
if (log_)
|
||||||
@ -925,7 +1067,6 @@ bool Foam::externalCoupledFunctionObject::read(const dictionary& dict)
|
|||||||
Info<< type() << ": creating communications directory "
|
Info<< type() << ": creating communications directory "
|
||||||
<< dir << endl;
|
<< dir << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
mkDir(dir);
|
mkDir(dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,10 @@ Description
|
|||||||
which gets read/written on the master processor only. In the
|
which gets read/written on the master processor only. In the
|
||||||
communications directory the structure will be
|
communications directory the structure will be
|
||||||
|
|
||||||
<regionName>/<patchGroup>/<fieldName>.[in|out]
|
<regionsName>/<patchGroup>/<fieldName>.[in|out]
|
||||||
|
|
||||||
|
(where regionsName is either the name of a single region or a composite
|
||||||
|
of multiple region names)
|
||||||
|
|
||||||
At start-up, the boundary creates a lock file, i.e..
|
At start-up, the boundary creates a lock file, i.e..
|
||||||
|
|
||||||
@ -58,13 +61,13 @@ Description
|
|||||||
execution the boundary values are written to files (one per region,
|
execution the boundary values are written to files (one per region,
|
||||||
per patch(group), per field), e.g.
|
per patch(group), per field), e.g.
|
||||||
|
|
||||||
<regionName>/<patchGroup>/<fieldName>.out
|
<regionsName>/<patchGroup>/<fieldName>.out
|
||||||
|
|
||||||
The lock file is then removed, instructing the external source to take
|
The lock file is then removed, instructing the external source to take
|
||||||
control of the program execution. When ready, the external program
|
control of the program execution. When ready, the external program
|
||||||
should create the return values, e.g. to files
|
should create the return values, e.g. to files
|
||||||
|
|
||||||
<regionName>/<patchGroup>/<fieldName>.in
|
<regionsName>/<patchGroup>/<fieldName>.in
|
||||||
|
|
||||||
... and then re-instate the lock file. The functionObject will then
|
... and then re-instate the lock file. The functionObject will then
|
||||||
read these values, apply them to the boundary conditions and pass
|
read these values, apply them to the boundary conditions and pass
|
||||||
@ -82,7 +85,7 @@ Description
|
|||||||
|
|
||||||
regions
|
regions
|
||||||
{
|
{
|
||||||
region0
|
"(region1|region0)" // Name of region(s)
|
||||||
{
|
{
|
||||||
TPatchGroup // Name of patch(group)
|
TPatchGroup // Name of patch(group)
|
||||||
{
|
{
|
||||||
@ -95,7 +98,7 @@ Description
|
|||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
This reads/writes (on the master processor) the directory:
|
This reads/writes (on the master processor) the directory:
|
||||||
comms/region0/TPatchGroup/
|
comms/region0_region1/TPatchGroup/
|
||||||
with contents:
|
with contents:
|
||||||
patchPoints (collected points)
|
patchPoints (collected points)
|
||||||
patchFaces (collected faces)
|
patchFaces (collected faces)
|
||||||
@ -120,6 +123,7 @@ SourceFiles
|
|||||||
#include "wordReList.H"
|
#include "wordReList.H"
|
||||||
#include "scalarField.H"
|
#include "scalarField.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
|
#include "UPtrList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -167,18 +171,18 @@ class externalCoupledFunctionObject
|
|||||||
//- Log flag
|
//- Log flag
|
||||||
bool log_;
|
bool log_;
|
||||||
|
|
||||||
//- Names of regions
|
//- Names of (composite) regions
|
||||||
DynamicList<word> regionNames_;
|
DynamicList<word> regionGroupNames_;
|
||||||
|
|
||||||
// Per region the indices of the group information
|
// Per (composite) region the names of the regions
|
||||||
|
DynamicList<wordList> regionGroupRegions_;
|
||||||
|
|
||||||
|
// Per (composite) region the indices of the group information
|
||||||
HashTable<labelList> regionToGroups_;
|
HashTable<labelList> regionToGroups_;
|
||||||
|
|
||||||
// Per group the names of the patches/patchGroups
|
// Per group the names of the patches/patchGroups
|
||||||
DynamicList<wordRe> groupNames_;
|
DynamicList<wordRe> groupNames_;
|
||||||
|
|
||||||
// Per group the indices of the patches
|
|
||||||
DynamicList<labelList> groupPatchIDs_;
|
|
||||||
|
|
||||||
// Per group the names of the fields to read
|
// Per group the names of the fields to read
|
||||||
DynamicList<wordList> groupReadFields_;
|
DynamicList<wordList> groupReadFields_;
|
||||||
|
|
||||||
@ -195,7 +199,7 @@ class externalCoupledFunctionObject
|
|||||||
static fileName groupDir
|
static fileName groupDir
|
||||||
(
|
(
|
||||||
const fileName& commsDir,
|
const fileName& commsDir,
|
||||||
const word& regionName,
|
const word& regionsName,
|
||||||
const wordRe& groupName
|
const wordRe& groupName
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -225,9 +229,8 @@ class externalCoupledFunctionObject
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
bool readData
|
bool readData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const UPtrList<const fvMesh>& meshes,
|
||||||
const wordRe& groupName,
|
const wordRe& groupName,
|
||||||
const labelList& patchIDs,
|
|
||||||
const word& fieldName
|
const word& fieldName
|
||||||
);
|
);
|
||||||
//- Read data for all regions, all fields
|
//- Read data for all regions, all fields
|
||||||
@ -237,9 +240,8 @@ class externalCoupledFunctionObject
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
bool writeData
|
bool writeData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const UPtrList<const fvMesh>& meshes,
|
||||||
const wordRe& groupName,
|
const wordRe& groupName,
|
||||||
const labelList& patchIDs,
|
|
||||||
const word& fieldName
|
const word& fieldName
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
@ -275,6 +277,7 @@ class externalCoupledFunctionObject
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
static tmp<Field<Type> > gatherAndCombine(const Field<Type>& fld);
|
static tmp<Field<Type> > gatherAndCombine(const Field<Type>& fld);
|
||||||
|
|
||||||
|
static void checkOrder(const wordList&);
|
||||||
|
|
||||||
//- Disallow default bitwise copy construc
|
//- Disallow default bitwise copy construc
|
||||||
externalCoupledFunctionObject(const externalCoupledFunctionObject&);
|
externalCoupledFunctionObject(const externalCoupledFunctionObject&);
|
||||||
@ -356,10 +359,14 @@ public:
|
|||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
|
||||||
|
//- Create single name by appending words (in sorted order),
|
||||||
|
// separated by '_'
|
||||||
|
static word compositeName(const wordList&);
|
||||||
|
|
||||||
//- Write geometry for the group/patch
|
//- Write geometry for the group/patch
|
||||||
static void writeGeometry
|
static void writeGeometry
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const UPtrList<const fvMesh>& meshes,
|
||||||
const fileName& commsDir,
|
const fileName& commsDir,
|
||||||
const wordRe& groupName
|
const wordRe& groupName
|
||||||
);
|
);
|
||||||
|
|||||||
@ -40,25 +40,20 @@ License
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
bool Foam::externalCoupledFunctionObject::readData
|
bool Foam::externalCoupledFunctionObject::readData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const UPtrList<const fvMesh>& meshes,
|
||||||
const wordRe& groupName,
|
const wordRe& groupName,
|
||||||
const labelList& patchIDs,
|
|
||||||
const word& fieldName
|
const word& fieldName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
|
typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
|
||||||
typedef externalCoupledMixedFvPatchField<Type> patchFieldType;
|
typedef externalCoupledMixedFvPatchField<Type> patchFieldType;
|
||||||
|
|
||||||
if (!mesh.foundObject<volFieldType>(fieldName))
|
wordList regionNames(meshes.size());
|
||||||
|
forAll(meshes, i)
|
||||||
{
|
{
|
||||||
return false;
|
regionNames[i] = meshes[i].dbDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
const volFieldType& cvf = mesh.lookupObject<volFieldType>(fieldName);
|
|
||||||
const typename volFieldType::GeometricBoundaryField& bf =
|
|
||||||
cvf.boundaryField();
|
|
||||||
|
|
||||||
|
|
||||||
// File only opened on master; contains data for all processors, for all
|
// File only opened on master; contains data for all processors, for all
|
||||||
// patchIDs.
|
// patchIDs.
|
||||||
autoPtr<IFstream> masterFilePtr;
|
autoPtr<IFstream> masterFilePtr;
|
||||||
@ -66,7 +61,7 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
{
|
{
|
||||||
const fileName transferFile
|
const fileName transferFile
|
||||||
(
|
(
|
||||||
groupDir(commsDir_, mesh.dbDir(), groupName)
|
groupDir(commsDir_, compositeName(regionNames), groupName)
|
||||||
/ fieldName + ".in"
|
/ fieldName + ".in"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -82,18 +77,46 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
(
|
(
|
||||||
"void externalCoupledFunctionObject::readData"
|
"void externalCoupledFunctionObject::readData"
|
||||||
"("
|
"("
|
||||||
"const fvMesh&, "
|
"const UPtrList<const fvMesh>&, "
|
||||||
"const wordRe&, "
|
"const wordRe&, "
|
||||||
"const labelList&, "
|
|
||||||
"const word&"
|
"const word&"
|
||||||
")",
|
")",
|
||||||
masterFilePtr()
|
masterFilePtr()
|
||||||
) << "Cannot open file for region " << mesh.name()
|
) << "Cannot open file for region " << compositeName(regionNames)
|
||||||
<< ", field " << fieldName << ", patches " << patchIDs
|
<< ", field " << fieldName
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
label nFound = 0;
|
||||||
|
|
||||||
|
|
||||||
|
forAll(meshes, i)
|
||||||
|
{
|
||||||
|
const fvMesh& mesh = meshes[i];
|
||||||
|
|
||||||
|
if (!mesh.foundObject<volFieldType>(fieldName))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
nFound++;
|
||||||
|
|
||||||
|
const volFieldType& cvf = mesh.lookupObject<volFieldType>(fieldName);
|
||||||
|
const typename volFieldType::GeometricBoundaryField& bf =
|
||||||
|
cvf.boundaryField();
|
||||||
|
|
||||||
|
|
||||||
|
// Get the patches
|
||||||
|
const labelList patchIDs
|
||||||
|
(
|
||||||
|
mesh.boundaryMesh().patchSet
|
||||||
|
(
|
||||||
|
List<wordRe>(1, groupName)
|
||||||
|
).sortedToc()
|
||||||
|
);
|
||||||
|
|
||||||
// Handle column-wise reading of patch data. Supports most easy types
|
// Handle column-wise reading of patch data. Supports most easy types
|
||||||
forAll(patchIDs, i)
|
forAll(patchIDs, i)
|
||||||
{
|
{
|
||||||
@ -101,8 +124,8 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
|
|
||||||
if (isA<patchFieldType>(bf[patchI]))
|
if (isA<patchFieldType>(bf[patchI]))
|
||||||
{
|
{
|
||||||
// Explicit handling of externalCoupledObjectMixed bcs - they have
|
// Explicit handling of externalCoupledMixed bcs - they
|
||||||
// specialised reading routines.
|
// have specialised reading routines.
|
||||||
|
|
||||||
patchFieldType& pf = const_cast<patchFieldType&>
|
patchFieldType& pf = const_cast<patchFieldType&>
|
||||||
(
|
(
|
||||||
@ -141,7 +164,8 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
data
|
data
|
||||||
);
|
);
|
||||||
|
|
||||||
mixedFvPatchField<Type>& pf = const_cast<mixedFvPatchField<Type>&>
|
mixedFvPatchField<Type>& pf =
|
||||||
|
const_cast<mixedFvPatchField<Type>&>
|
||||||
(
|
(
|
||||||
refCast<const mixedFvPatchField<Type> >
|
refCast<const mixedFvPatchField<Type> >
|
||||||
(
|
(
|
||||||
@ -154,12 +178,22 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
direction columnI = 2*pTraits<Type>::nComponents;
|
direction columnI = 2*pTraits<Type>::nComponents;
|
||||||
|
|
||||||
Field<Type>& refValue = pf.refValue();
|
Field<Type>& refValue = pf.refValue();
|
||||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
for
|
||||||
|
(
|
||||||
|
direction cmpt = 0;
|
||||||
|
cmpt < pTraits<Type>::nComponents;
|
||||||
|
cmpt++
|
||||||
|
)
|
||||||
{
|
{
|
||||||
refValue.replace(cmpt, data[columnI++]);
|
refValue.replace(cmpt, data[columnI++]);
|
||||||
}
|
}
|
||||||
Field<Type>& refGrad = pf.refGrad();
|
Field<Type>& refGrad = pf.refGrad();
|
||||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
for
|
||||||
|
(
|
||||||
|
direction cmpt = 0;
|
||||||
|
cmpt < pTraits<Type>::nComponents;
|
||||||
|
cmpt++
|
||||||
|
)
|
||||||
{
|
{
|
||||||
refGrad.replace(cmpt, data[columnI++]);
|
refGrad.replace(cmpt, data[columnI++]);
|
||||||
}
|
}
|
||||||
@ -192,9 +226,18 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
|
|
||||||
// Transfer gradient to bc
|
// Transfer gradient to bc
|
||||||
Field<Type>& gradient = pf.gradient();
|
Field<Type>& gradient = pf.gradient();
|
||||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
for
|
||||||
|
(
|
||||||
|
direction cmpt = 0;
|
||||||
|
cmpt < pTraits<Type>::nComponents;
|
||||||
|
cmpt++
|
||||||
|
)
|
||||||
{
|
{
|
||||||
gradient.replace(cmpt, data[pTraits<Type>::nComponents+cmpt]);
|
gradient.replace
|
||||||
|
(
|
||||||
|
cmpt,
|
||||||
|
data[pTraits<Type>::nComponents+cmpt]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the value from the read coefficicient. Bypass any
|
// Update the value from the read coefficicient. Bypass any
|
||||||
@ -215,7 +258,12 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
|
|
||||||
// Transfer read value to bc
|
// Transfer read value to bc
|
||||||
Field<Type> value(bf[patchI].size());
|
Field<Type> value(bf[patchI].size());
|
||||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
for
|
||||||
|
(
|
||||||
|
direction cmpt = 0;
|
||||||
|
cmpt < pTraits<Type>::nComponents;
|
||||||
|
cmpt++
|
||||||
|
)
|
||||||
{
|
{
|
||||||
value.replace(cmpt, data[cmpt]);
|
value.replace(cmpt, data[cmpt]);
|
||||||
}
|
}
|
||||||
@ -241,9 +289,8 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
(
|
(
|
||||||
"void externalCoupledFunctionObject::readData"
|
"void externalCoupledFunctionObject::readData"
|
||||||
"("
|
"("
|
||||||
"const fvMesh&, "
|
"const UPtrList<const fvMesh>&, "
|
||||||
"const wordRe&, "
|
"const wordRe&, "
|
||||||
"const labelList&, "
|
|
||||||
"const word&"
|
"const word&"
|
||||||
")"
|
")"
|
||||||
)
|
)
|
||||||
@ -255,8 +302,9 @@ bool Foam::externalCoupledFunctionObject::readData
|
|||||||
|
|
||||||
initialised_ = true;
|
initialised_ = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return nFound > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -308,25 +356,20 @@ Foam::externalCoupledFunctionObject::gatherAndCombine
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
bool Foam::externalCoupledFunctionObject::writeData
|
bool Foam::externalCoupledFunctionObject::writeData
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const UPtrList<const fvMesh>& meshes,
|
||||||
const wordRe& groupName,
|
const wordRe& groupName,
|
||||||
const labelList& patchIDs,
|
|
||||||
const word& fieldName
|
const word& fieldName
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
|
typedef GeometricField<Type, fvPatchField, volMesh> volFieldType;
|
||||||
typedef externalCoupledMixedFvPatchField<Type> patchFieldType;
|
typedef externalCoupledMixedFvPatchField<Type> patchFieldType;
|
||||||
|
|
||||||
if (!mesh.foundObject<volFieldType>(fieldName))
|
wordList regionNames(meshes.size());
|
||||||
|
forAll(meshes, i)
|
||||||
{
|
{
|
||||||
return false;
|
regionNames[i] = meshes[i].dbDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
const volFieldType& cvf = mesh.lookupObject<volFieldType>(fieldName);
|
|
||||||
const typename volFieldType::GeometricBoundaryField& bf =
|
|
||||||
cvf.boundaryField();
|
|
||||||
|
|
||||||
|
|
||||||
// File only opened on master; contains data for all processors, for all
|
// File only opened on master; contains data for all processors, for all
|
||||||
// patchIDs
|
// patchIDs
|
||||||
autoPtr<OFstream> masterFilePtr;
|
autoPtr<OFstream> masterFilePtr;
|
||||||
@ -334,7 +377,7 @@ bool Foam::externalCoupledFunctionObject::writeData
|
|||||||
{
|
{
|
||||||
const fileName transferFile
|
const fileName transferFile
|
||||||
(
|
(
|
||||||
groupDir(commsDir_, mesh.dbDir(), groupName)
|
groupDir(commsDir_, compositeName(regionNames), groupName)
|
||||||
/ fieldName + ".out"
|
/ fieldName + ".out"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -350,14 +393,13 @@ bool Foam::externalCoupledFunctionObject::writeData
|
|||||||
(
|
(
|
||||||
"externalCoupledFunctionObject::writeData"
|
"externalCoupledFunctionObject::writeData"
|
||||||
"("
|
"("
|
||||||
"const fvMesh&, "
|
"const UPtrList<const fvMesh>&, "
|
||||||
"const wordRe&, "
|
"const wordRe&, "
|
||||||
"const labelList&, "
|
|
||||||
"const word&"
|
"const word&"
|
||||||
") const",
|
") const",
|
||||||
masterFilePtr()
|
masterFilePtr()
|
||||||
) << "Cannot open file for region " << mesh.name()
|
) << "Cannot open file for region " << compositeName(regionNames)
|
||||||
<< ", field " << fieldName << ", patches " << patchIDs
|
<< ", field " << fieldName
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -365,6 +407,33 @@ bool Foam::externalCoupledFunctionObject::writeData
|
|||||||
|
|
||||||
bool headerDone = false;
|
bool headerDone = false;
|
||||||
|
|
||||||
|
label nFound = 0;
|
||||||
|
|
||||||
|
forAll(meshes, i)
|
||||||
|
{
|
||||||
|
const fvMesh& mesh = meshes[i];
|
||||||
|
|
||||||
|
if (!mesh.foundObject<volFieldType>(fieldName))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
nFound++;
|
||||||
|
|
||||||
|
const volFieldType& cvf = mesh.lookupObject<volFieldType>(fieldName);
|
||||||
|
const typename volFieldType::GeometricBoundaryField& bf =
|
||||||
|
cvf.boundaryField();
|
||||||
|
|
||||||
|
|
||||||
|
// Get the patches
|
||||||
|
const labelList patchIDs
|
||||||
|
(
|
||||||
|
mesh.boundaryMesh().patchSet
|
||||||
|
(
|
||||||
|
List<wordRe>(1, groupName)
|
||||||
|
).sortedToc()
|
||||||
|
);
|
||||||
|
|
||||||
// Handle column-wise writing of patch data. Supports most easy types
|
// Handle column-wise writing of patch data. Supports most easy types
|
||||||
forAll(patchIDs, i)
|
forAll(patchIDs, i)
|
||||||
{
|
{
|
||||||
@ -374,8 +443,8 @@ bool Foam::externalCoupledFunctionObject::writeData
|
|||||||
|
|
||||||
if (isA<patchFieldType>(bf[patchI]))
|
if (isA<patchFieldType>(bf[patchI]))
|
||||||
{
|
{
|
||||||
// Explicit handling of externalCoupledObjectMixed bcs - they have
|
// Explicit handling of externalCoupledMixed bcs - they
|
||||||
// specialised writing routines
|
// have specialised writing routines
|
||||||
|
|
||||||
const patchFieldType& pf = refCast<const patchFieldType>
|
const patchFieldType& pf = refCast<const patchFieldType>
|
||||||
(
|
(
|
||||||
@ -451,8 +520,9 @@ bool Foam::externalCoupledFunctionObject::writeData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return nFound > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,56 +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 volScalarField;
|
|
||||||
location "0";
|
|
||||||
object T;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 0 1 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 293;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
frontAndBack
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
topAndBottom
|
|
||||||
{
|
|
||||||
type zeroGradient;
|
|
||||||
}
|
|
||||||
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type externalCoupledTemperature;
|
|
||||||
commsDir "${FOAM_CASE}/comms";
|
|
||||||
fileName "data";
|
|
||||||
initByExternal yes;
|
|
||||||
log true;
|
|
||||||
value uniform 307.75; // 34.6 degC
|
|
||||||
}
|
|
||||||
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type externalCoupledTemperature;
|
|
||||||
commsDir "${FOAM_CASE}/comms";
|
|
||||||
fileName "data";
|
|
||||||
initByExternal yes;
|
|
||||||
log true;
|
|
||||||
value uniform 288.15; // 15 degC
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,51 +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 volScalarField;
|
|
||||||
location "0";
|
|
||||||
object alphat;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [1 -1 -1 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
frontAndBack
|
|
||||||
{
|
|
||||||
type compressible::alphatWallFunction;
|
|
||||||
Prt 0.85;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
topAndBottom
|
|
||||||
{
|
|
||||||
type compressible::alphatWallFunction;
|
|
||||||
Prt 0.85;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type compressible::alphatWallFunction;
|
|
||||||
Prt 0.85;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type compressible::alphatWallFunction;
|
|
||||||
Prt 0.85;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,47 +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 volScalarField;
|
|
||||||
location "0";
|
|
||||||
object k;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 2 -2 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 3.75e-04;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
frontAndBack
|
|
||||||
{
|
|
||||||
type kqRWallFunction;
|
|
||||||
value uniform 3.75e-04;
|
|
||||||
}
|
|
||||||
topAndBottom
|
|
||||||
{
|
|
||||||
type kqRWallFunction;
|
|
||||||
value uniform 3.75e-04;
|
|
||||||
}
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type kqRWallFunction;
|
|
||||||
value uniform 3.75e-04;
|
|
||||||
}
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type kqRWallFunction;
|
|
||||||
value uniform 3.75e-04;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,47 +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 volScalarField;
|
|
||||||
location "0";
|
|
||||||
object omega;
|
|
||||||
}
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
dimensions [0 0 -1 0 0 0 0];
|
|
||||||
|
|
||||||
internalField uniform 0.12;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
|
||||||
frontAndBack
|
|
||||||
{
|
|
||||||
type omegaWallFunction;
|
|
||||||
value uniform 0.12;
|
|
||||||
}
|
|
||||||
topAndBottom
|
|
||||||
{
|
|
||||||
type omegaWallFunction;
|
|
||||||
value uniform 0.12;
|
|
||||||
}
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type omegaWallFunction;
|
|
||||||
value uniform 0.12;
|
|
||||||
}
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type omegaWallFunction;
|
|
||||||
value uniform 0.12;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
# Source tutorial run functions
|
|
||||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
|
||||||
|
|
||||||
cleanCase
|
|
||||||
|
|
||||||
rm -rf comms
|
|
||||||
|
|
||||||
killall externalSolver > /dev/null 2>&1
|
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
# Source tutorial run functions
|
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
|
||||||
|
|
||||||
./Allrun.pre
|
|
||||||
|
|
||||||
runApplication $(getApplication) &
|
|
||||||
|
|
||||||
./externalSolver
|
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
# Source tutorial run functions
|
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
|
||||||
|
|
||||||
./Allrun.pre
|
|
||||||
|
|
||||||
runApplication decomposePar
|
|
||||||
|
|
||||||
runParallel $(getApplication) 4 &
|
|
||||||
|
|
||||||
./externalSolver
|
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # Run from this directory
|
|
||||||
|
|
||||||
# Source tutorial run functions
|
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
|
||||||
|
|
||||||
runApplication blockMesh
|
|
||||||
runApplication createExternalCoupledPatchGeometry T
|
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
Example of an explicit coupling between OpenFOAM and an external application
|
|
||||||
using the externalCoupled boundary conditions.
|
|
||||||
|
|
||||||
The case is based on the buoyantCavity tutorial case, whereby on each iteration
|
|
||||||
the 'hot' and 'cold' patch temperatures are incremented by 1K.
|
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
/*--------------------------------*- 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 volScalarField;
|
||||||
|
object T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -10,41 +10,21 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class volVectorField;
|
class volVectorField;
|
||||||
location "0";
|
|
||||||
object U;
|
object U;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
dimensions [0 1 -1 0 0 0 0];
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
internalField uniform (0 0 0);
|
internalField uniform (0.01 0 0);
|
||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
frontAndBack
|
".*"
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type calculated;
|
||||||
value uniform (0 0 0);
|
value uniform (0.01 0 0);
|
||||||
}
|
|
||||||
|
|
||||||
topAndBottom
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value uniform (0 0 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value uniform (0 0 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type fixedValue;
|
|
||||||
value uniform (0 0 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
/*--------------------------------*- 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 volScalarField;
|
||||||
|
object epsilon;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -3 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0.01;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
/*--------------------------------*- 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 volScalarField;
|
||||||
|
object k;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0.1;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0.1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -10,7 +10,6 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class volScalarField;
|
class volScalarField;
|
||||||
location "0";
|
|
||||||
object p;
|
object p;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -21,30 +20,11 @@ internalField uniform 1e5;
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
frontAndBack
|
".*"
|
||||||
{
|
{
|
||||||
type calculated;
|
type calculated;
|
||||||
value $internalField;
|
value uniform 1e5;
|
||||||
}
|
|
||||||
|
|
||||||
topAndBottom
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
|
||||||
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type calculated;
|
|
||||||
value $internalField;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -10,7 +10,6 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class volScalarField;
|
class volScalarField;
|
||||||
location "0";
|
|
||||||
object p_rgh;
|
object p_rgh;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -21,30 +20,11 @@ internalField uniform 1e5;
|
|||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
frontAndBack
|
".*"
|
||||||
{
|
{
|
||||||
type fixedFluxPressure;
|
type calculated;
|
||||||
value uniform 1e5;
|
|
||||||
}
|
|
||||||
|
|
||||||
topAndBottom
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
value uniform 1e5;
|
|
||||||
}
|
|
||||||
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
value uniform 1e5;
|
|
||||||
}
|
|
||||||
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type fixedFluxPressure;
|
|
||||||
value uniform 1e5;
|
value uniform 1e5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Source tutorial clean functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
|
cleanCase
|
||||||
|
rm -rf comms
|
||||||
|
rm -rf VTK
|
||||||
|
rm -rf constant/cellToRegion constant/polyMesh/sets
|
||||||
|
rm -rf 0/bottomWater
|
||||||
|
rm -rf 0/topAir
|
||||||
|
rm -rf 0/heater
|
||||||
|
rm -rf 0/leftSolid
|
||||||
|
rm -rf 0/rightSolid
|
||||||
|
rm -f 0/cellToRegion
|
||||||
|
rm -rf constant/bottomWater/polyMesh
|
||||||
|
rm -rf constant/topAir/polyMesh
|
||||||
|
rm -rf constant/heater/polyMesh
|
||||||
|
rm -rf constant/leftSolid/polyMesh
|
||||||
|
rm -rf constant/rightSolid/polyMesh
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
#-- Run on single processor
|
||||||
|
#runApplication `getApplication` &
|
||||||
|
# Simulated external solver
|
||||||
|
#runApplication ./externalSolver
|
||||||
|
|
||||||
|
# Decompose
|
||||||
|
runApplication decomposePar -allRegions
|
||||||
|
|
||||||
|
# Run OpenFOAM
|
||||||
|
runParallel `getApplication` 4 &
|
||||||
|
|
||||||
|
# Simulated external solver
|
||||||
|
runApplication ./externalSolver
|
||||||
|
|
||||||
|
# Reconstruct
|
||||||
|
runApplication reconstructPar -allRegions
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
runApplication blockMesh
|
||||||
|
runApplication topoSet
|
||||||
|
runApplication splitMeshRegions -cellZones -overwrite
|
||||||
|
|
||||||
|
# remove fluid fields from solid regions (important for post-processing)
|
||||||
|
for i in heater leftSolid rightSolid
|
||||||
|
do
|
||||||
|
rm -f 0*/$i/{nut,alphat,epsilon,k,U,p_rgh}
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
for i in bottomWater topAir heater leftSolid rightSolid
|
||||||
|
do
|
||||||
|
changeDictionary -region $i > log.changeDictionary.$i 2>&1
|
||||||
|
done
|
||||||
|
|
||||||
|
# Create coupling geometry
|
||||||
|
runApplication createExternalCoupledPatchGeometry \
|
||||||
|
-regions '(topAir heater)' coupleGroup
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "creating files for paraview post-processing"
|
||||||
|
echo
|
||||||
|
paraFoam -touchAll
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
Modification of the heatTransfer chtMultiRegionFoam tutorial that demonstrates
|
||||||
|
the externalCoupled functionObject in combination with the ./externalSolver
|
||||||
|
script to simulate coupling to an external code.
|
||||||
@ -10,7 +10,6 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class uniformDimensionedVectorField;
|
class uniformDimensionedVectorField;
|
||||||
location "constant";
|
|
||||||
object g;
|
object g;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -18,5 +17,4 @@ FoamFile
|
|||||||
dimensions [0 1 -2 0 0 0 0];
|
dimensions [0 1 -2 0 0 0 0];
|
||||||
value (0 -9.81 0);
|
value (0 -9.81 0);
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object radiationProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
radiation off;
|
||||||
|
|
||||||
|
radiationModel none;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -9,39 +9,43 @@ FoamFile
|
|||||||
{
|
{
|
||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class volScalarField;
|
class dictionary;
|
||||||
location "0";
|
object thermophysicalProperties;
|
||||||
object epsilon;
|
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
dimensions [0 2 -3 0 0 0 0];
|
thermoType
|
||||||
|
|
||||||
internalField uniform 4e-06;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
{
|
||||||
frontAndBack
|
type heRhoThermo;
|
||||||
{
|
mixture pureMixture;
|
||||||
type epsilonWallFunction;
|
transport const;
|
||||||
value uniform 4e-06;
|
thermo hConst;
|
||||||
}
|
equationOfState rhoConst;
|
||||||
topAndBottom
|
specie specie;
|
||||||
{
|
energy sensibleEnthalpy;
|
||||||
type epsilonWallFunction;
|
|
||||||
value uniform 4e-06;
|
|
||||||
}
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type epsilonWallFunction;
|
|
||||||
value uniform 4e-06;
|
|
||||||
}
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type epsilonWallFunction;
|
|
||||||
value uniform 4e-06;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mixture
|
||||||
|
{
|
||||||
|
specie
|
||||||
|
{
|
||||||
|
nMoles 1;
|
||||||
|
molWeight 18;
|
||||||
|
}
|
||||||
|
equationOfState
|
||||||
|
{
|
||||||
|
rho 1000;
|
||||||
|
}
|
||||||
|
thermodynamics
|
||||||
|
{
|
||||||
|
Cp 4181;
|
||||||
|
Hf 0;
|
||||||
|
}
|
||||||
|
transport
|
||||||
|
{
|
||||||
|
mu 959e-6;
|
||||||
|
Pr 6.62;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
simulationType laminar;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
location "constant";
|
||||||
|
object radiationProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
radiation off;
|
||||||
|
|
||||||
|
radiationModel none;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -9,39 +9,45 @@ FoamFile
|
|||||||
{
|
{
|
||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class volScalarField;
|
class dictionary;
|
||||||
location "0";
|
object thermophysicalProperties;
|
||||||
object nut;
|
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
dimensions [0 2 -1 0 0 0 0];
|
thermoType
|
||||||
|
|
||||||
internalField uniform 0;
|
|
||||||
|
|
||||||
boundaryField
|
|
||||||
{
|
{
|
||||||
frontAndBack
|
type heSolidThermo;
|
||||||
{
|
mixture pureMixture;
|
||||||
type nutUWallFunction;
|
transport constIso;
|
||||||
value uniform 0;
|
thermo hConst;
|
||||||
}
|
equationOfState rhoConst;
|
||||||
topAndBottom
|
specie specie;
|
||||||
{
|
energy sensibleEnthalpy;
|
||||||
type nutUWallFunction;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type nutUWallFunction;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type nutUWallFunction;
|
|
||||||
value uniform 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mixture
|
||||||
|
{
|
||||||
|
specie
|
||||||
|
{
|
||||||
|
nMoles 1;
|
||||||
|
molWeight 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
transport
|
||||||
|
{
|
||||||
|
kappa 80;
|
||||||
|
}
|
||||||
|
|
||||||
|
thermodynamics
|
||||||
|
{
|
||||||
|
Hf 0;
|
||||||
|
Cp 450;
|
||||||
|
}
|
||||||
|
|
||||||
|
equationOfState
|
||||||
|
{
|
||||||
|
rho 8000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../heater/radiationProperties
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../heater/thermophysicalProperties
|
||||||
@ -14,66 +14,77 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
convertToMeters 0.001;
|
convertToMeters 1;
|
||||||
|
|
||||||
vertices
|
vertices
|
||||||
(
|
(
|
||||||
( 0 0 -260)
|
(-0.1 -0.04 -0.05)
|
||||||
(76 0 -260)
|
( 0.1 -0.04 -0.05)
|
||||||
(76 2180 -260)
|
( 0.1 0.04 -0.05)
|
||||||
( 0 2180 -260)
|
(-0.1 0.04 -0.05)
|
||||||
( 0 0 260)
|
(-0.1 -0.04 0.05)
|
||||||
(76 0 260)
|
( 0.1 -0.04 0.05)
|
||||||
(76 2180 260)
|
( 0.1 0.04 0.05)
|
||||||
( 0 2180 260)
|
(-0.1 0.04 0.05)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) (30 10 10) simpleGrading (1 1 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
edges
|
edges
|
||||||
(
|
(
|
||||||
);
|
);
|
||||||
|
|
||||||
blocks
|
|
||||||
(
|
|
||||||
hex (0 1 2 3 4 5 6 7) (35 150 15) simpleGrading (1 1 1)
|
|
||||||
);
|
|
||||||
|
|
||||||
boundary
|
boundary
|
||||||
(
|
(
|
||||||
frontAndBack
|
maxY
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
faces
|
faces
|
||||||
(
|
(
|
||||||
(0 1 5 4)
|
(3 7 6 2)
|
||||||
(2 3 7 6)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
minX
|
||||||
topAndBottom
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(2 6 5 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
minY
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(1 5 4 0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
minZ
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
maxZ
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
faces
|
faces
|
||||||
(
|
(
|
||||||
(4 5 6 7)
|
(4 5 6 7)
|
||||||
(3 2 1 0)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
hot
|
|
||||||
{
|
|
||||||
type wall;
|
|
||||||
faces
|
|
||||||
(
|
|
||||||
(6 5 1 2)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
cold
|
|
||||||
{
|
|
||||||
type wall;
|
|
||||||
faces
|
|
||||||
(
|
|
||||||
(4 7 3 0)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -81,3 +92,5 @@ boundary
|
|||||||
mergePatchPairs
|
mergePatchPairs
|
||||||
(
|
(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: dev-OpenCFD.feature-externalCoupled |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -15,35 +15,47 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
4
|
6
|
||||||
(
|
(
|
||||||
frontAndBack
|
maxY
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
inGroups 1(wall);
|
inGroups 1(wall);
|
||||||
nFaces 1050;
|
nFaces 300;
|
||||||
startFace 228225;
|
startFace 8300;
|
||||||
}
|
}
|
||||||
topAndBottom
|
minX
|
||||||
{
|
{
|
||||||
type wall;
|
type patch;
|
||||||
inGroups 1(wall);
|
nFaces 100;
|
||||||
nFaces 10500;
|
startFace 8600;
|
||||||
startFace 229275;
|
|
||||||
}
|
}
|
||||||
hot
|
maxX
|
||||||
{
|
{
|
||||||
type wall;
|
type patch;
|
||||||
inGroups 1(wall);
|
nFaces 100;
|
||||||
nFaces 2250;
|
startFace 8700;
|
||||||
startFace 239775;
|
|
||||||
}
|
}
|
||||||
cold
|
minY
|
||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
inGroups 1(wall);
|
inGroups 1(wall);
|
||||||
nFaces 2250;
|
nFaces 300;
|
||||||
startFace 242025;
|
startFace 8800;
|
||||||
|
}
|
||||||
|
minZ
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
inGroups 1(wall);
|
||||||
|
nFaces 300;
|
||||||
|
startFace 9100;
|
||||||
|
}
|
||||||
|
maxZ
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
inGroups 1(wall);
|
||||||
|
nFaces 300;
|
||||||
|
startFace 9400;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
location "constant";
|
||||||
|
object regionProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
regions
|
||||||
|
(
|
||||||
|
fluid (bottomWater topAir)
|
||||||
|
solid (heater leftSolid rightSolid)
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../heater/radiationProperties
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../heater/thermophysicalProperties
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../bottomWater/g
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../bottomWater/radiationProperties
|
||||||
@ -10,7 +10,7 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
location "constant";
|
location "constant/bottomWater";
|
||||||
object thermophysicalProperties;
|
object thermophysicalProperties;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -31,17 +31,17 @@ mixture
|
|||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
nMoles 1;
|
||||||
molWeight 28.96;
|
molWeight 28.9;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
{
|
{
|
||||||
Cp 1004.4;
|
Cp 1000;
|
||||||
Hf 0;
|
Hf 0;
|
||||||
}
|
}
|
||||||
transport
|
transport
|
||||||
{
|
{
|
||||||
mu 1.831e-05;
|
mu 1.8e-05;
|
||||||
Pr 0.705;
|
Pr 0.7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../bottomWater/turbulenceProperties
|
||||||
@ -1,20 +1,29 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Dummy external solver to communicate with OpenFOAM via externalCoupled
|
# Dummy external solver to communicate with OpenFOAM via externalCoupled
|
||||||
# boundary conditions
|
# functionObject
|
||||||
#
|
#
|
||||||
# Functionality is hard-coded for this particular test case
|
# Functionality is hard-coded for this particular test case
|
||||||
# - patch temperatures increased by 1K on each step
|
# - patch temperatures increased by 1K on each step
|
||||||
#
|
#
|
||||||
cd ${0%/*} || exit 1 # run from this directory
|
cd ${0%/*} || exit 1 # Run from this directory
|
||||||
|
|
||||||
|
# Check for unassigned variables
|
||||||
|
set -u
|
||||||
|
|
||||||
echo "Executing dummy external solver"
|
echo "Executing dummy external solver"
|
||||||
|
|
||||||
commsDir="comms"
|
commsDir="comms"
|
||||||
|
regionGroupName="heater_topAir"
|
||||||
|
patchGroupName="coupleGroup"
|
||||||
|
fieldName="T"
|
||||||
|
|
||||||
lockFile="${commsDir}/OpenFOAM.lock"
|
lockFile="${commsDir}/OpenFOAM.lock"
|
||||||
dataFile="${commsDir}/data"
|
dataFile="${commsDir}/${regionGroupName}/${patchGroupName}/${fieldName}"
|
||||||
waitSec=1
|
waitSec=1
|
||||||
timeOut=10
|
timeOut=10
|
||||||
|
nSteps=200 # maximum number of time steps. Note: should be more than
|
||||||
|
# number of iterations on the OpenFOAM side
|
||||||
refGrad=0
|
refGrad=0
|
||||||
valueFraction=1
|
valueFraction=1
|
||||||
|
|
||||||
@ -27,16 +36,21 @@ init()
|
|||||||
{
|
{
|
||||||
log "initialisation: creating ${dataFile}.in"
|
log "initialisation: creating ${dataFile}.in"
|
||||||
|
|
||||||
# Hard-coded for 2 patches of size 2250
|
# Hard-coded for patch of size 8 (heater/minY)
|
||||||
n=2250
|
n1=8
|
||||||
refCold=283
|
refValue1=500
|
||||||
refHot=303
|
|
||||||
touch "${dataFile}.in"
|
touch "${dataFile}.in"
|
||||||
for i in $(seq 1 $n); do
|
log "initialisation: adding $n1 data elements with refValue $refValue1"
|
||||||
echo "$refHot $refGrad $valueFraction" >> "${dataFile}.in"
|
for i in $(seq 1 $n1); do
|
||||||
|
echo "$refValue1 $refGrad $valueFraction" >> "${dataFile}.in"
|
||||||
done
|
done
|
||||||
for i in $(seq 1 $n); do
|
|
||||||
echo "$refCold $refGrad $valueFraction" >> "${dataFile}.in"
|
# Hard-coded for patch of size 40 (topAir/minX)
|
||||||
|
n2=40
|
||||||
|
refValue2=300
|
||||||
|
log "initialisation: adding $n2 data elements with refValue $refValue2"
|
||||||
|
for i in $(seq 1 $n2); do
|
||||||
|
echo "$refValue2 $refGrad $valueFraction" >> "${dataFile}.in"
|
||||||
done
|
done
|
||||||
|
|
||||||
# create lock file to pass control to OF
|
# create lock file to pass control to OF
|
||||||
@ -44,6 +58,10 @@ init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# create the comms directory
|
||||||
|
mkdir -p ${commsDir}/${regionGroupName}/${patchGroupName}
|
||||||
|
|
||||||
|
|
||||||
# tutorial case employs the 'initByExternalOption', so we need to provide
|
# tutorial case employs the 'initByExternalOption', so we need to provide
|
||||||
# the initial values
|
# the initial values
|
||||||
init
|
init
|
||||||
@ -51,7 +69,7 @@ init
|
|||||||
|
|
||||||
totalWait=0
|
totalWait=0
|
||||||
step=0
|
step=0
|
||||||
while [ 1 ]; do
|
while [ $step -lt $nSteps ]; do
|
||||||
if [ -f $lockFile ]; then
|
if [ -f $lockFile ]; then
|
||||||
log "found lock file ${lockFile} - waiting"
|
log "found lock file ${lockFile} - waiting"
|
||||||
totalWait=$(expr $totalWait + $waitSec)
|
totalWait=$(expr $totalWait + $waitSec)
|
||||||
@ -70,9 +88,10 @@ while [ 1 ]; do
|
|||||||
log "sleeping for $waitSec secs to simulate external process"
|
log "sleeping for $waitSec secs to simulate external process"
|
||||||
sleep $waitSec
|
sleep $waitSec
|
||||||
|
|
||||||
log "creating ${dataFile}.in"
|
log "updating ${dataFile}.in from ${dataFile}.out"
|
||||||
|
|
||||||
awk '{if( $1 != "#" ){print $2+1 " 0 1"}}' ${dataFile}.out > ${dataFile}.in
|
awk '{if( $1 != "#" ){print $1+1 " 0 1"}}' \
|
||||||
|
${dataFile}.out | tee ${dataFile}.in
|
||||||
|
|
||||||
log "creating lock file ${lockFile}"
|
log "creating lock file ${lockFile}"
|
||||||
touch ${lockFile}
|
touch ${lockFile}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
fvSolution is used for outer correctors specification.
|
||||||
|
fvSchemes is only so that pre-processing activities can proceed
|
||||||
|
|
||||||
@ -0,0 +1,173 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object changeDictionaryDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dictionaryReplacement
|
||||||
|
{
|
||||||
|
U
|
||||||
|
{
|
||||||
|
internalField uniform (0.001 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0.001 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform (0 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
T
|
||||||
|
{
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
"bottomWater_to_.*"
|
||||||
|
{
|
||||||
|
type compressible::turbulentTemperatureCoupledBaffleMixed;
|
||||||
|
Tnbr T;
|
||||||
|
kappa fluidThermo;
|
||||||
|
kappaName none;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
epsilon
|
||||||
|
{
|
||||||
|
internalField uniform 0.01;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.01;
|
||||||
|
}
|
||||||
|
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type epsilonWallFunction;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
k
|
||||||
|
{
|
||||||
|
internalField uniform 0.1;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
value uniform 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type kqRWallFunction;
|
||||||
|
value uniform 0.1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p_rgh
|
||||||
|
{
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type fixedFluxPressure;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p
|
||||||
|
{
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
note "mesh decomposition control dictionary";
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
//- Keep owner and neighbour on same processor for faces in zones:
|
||||||
|
// preserveFaceZones (heater solid1 solid3);
|
||||||
|
|
||||||
|
method scotch;
|
||||||
|
// method hierarchical;
|
||||||
|
// method simple;
|
||||||
|
// method manual;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
scotchCoeffs
|
||||||
|
{
|
||||||
|
//processorWeights
|
||||||
|
//(
|
||||||
|
// 1
|
||||||
|
// 1
|
||||||
|
// 1
|
||||||
|
// 1
|
||||||
|
//);
|
||||||
|
//writeGraph true;
|
||||||
|
//strategy "b";
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "decompositionData";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//// Is the case distributed
|
||||||
|
//distributed yes;
|
||||||
|
//// Per slave (so nProcs-1 entries) the directory above the case.
|
||||||
|
//roots
|
||||||
|
//(
|
||||||
|
// "/tmp"
|
||||||
|
// "/tmp"
|
||||||
|
//);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -16,7 +16,7 @@ FoamFile
|
|||||||
|
|
||||||
ddtSchemes
|
ddtSchemes
|
||||||
{
|
{
|
||||||
default steadyState;
|
default Euler;
|
||||||
}
|
}
|
||||||
|
|
||||||
gradSchemes
|
gradSchemes
|
||||||
@ -28,18 +28,19 @@ divSchemes
|
|||||||
{
|
{
|
||||||
default none;
|
default none;
|
||||||
|
|
||||||
div(phi,U) bounded Gauss limitedLinear 0.2;
|
div(phi,U) Gauss upwind;
|
||||||
div(phi,K) bounded Gauss limitedLinear 0.2;
|
div(phi,K) Gauss linear;
|
||||||
div(phi,h) bounded Gauss limitedLinear 0.2;
|
div(phi,h) Gauss upwind;
|
||||||
div(phi,k) bounded Gauss limitedLinear 0.2;
|
div(phi,k) Gauss upwind;
|
||||||
div(phi,epsilon) bounded Gauss limitedLinear 0.2;
|
div(phi,epsilon) Gauss upwind;
|
||||||
div(phi,omega) bounded Gauss limitedLinear 0.2;
|
div(phi,R) Gauss upwind;
|
||||||
|
div(R) Gauss linear;
|
||||||
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
laplacianSchemes
|
laplacianSchemes
|
||||||
{
|
{
|
||||||
default Gauss linear orthogonal;
|
default Gauss linear corrected;
|
||||||
}
|
}
|
||||||
|
|
||||||
interpolationSchemes
|
interpolationSchemes
|
||||||
@ -49,13 +50,13 @@ interpolationSchemes
|
|||||||
|
|
||||||
snGradSchemes
|
snGradSchemes
|
||||||
{
|
{
|
||||||
default orthogonal;
|
default corrected;
|
||||||
}
|
}
|
||||||
|
|
||||||
wallDist
|
fluxRequired
|
||||||
{
|
{
|
||||||
method meshWave;
|
default no;
|
||||||
|
p_rgh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -10,20 +10,34 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
location "system";
|
|
||||||
object fvSolution;
|
object fvSolution;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
|
rho
|
||||||
|
{
|
||||||
|
solver PCG;
|
||||||
|
preconditioner DIC;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
rhoFinal
|
||||||
|
{
|
||||||
|
$rho;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
p_rgh
|
p_rgh
|
||||||
{
|
{
|
||||||
solver GAMG;
|
solver GAMG;
|
||||||
tolerance 1e-7;
|
tolerance 1e-7;
|
||||||
relTol 0.01;
|
relTol 0.01;
|
||||||
|
|
||||||
smoother DICGaussSeidel;
|
smoother GaussSeidel;
|
||||||
|
|
||||||
cacheAgglomeration true;
|
cacheAgglomeration true;
|
||||||
nCellsInCoarsestLevel 10;
|
nCellsInCoarsestLevel 10;
|
||||||
@ -31,47 +45,43 @@ solvers
|
|||||||
mergeLevels 1;
|
mergeLevels 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
"(U|h|k|epsilon|omega)"
|
p_rghFinal
|
||||||
|
{
|
||||||
|
$p_rgh;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(U|h|k|epsilon|R)"
|
||||||
{
|
{
|
||||||
solver PBiCG;
|
solver PBiCG;
|
||||||
preconditioner DILU;
|
preconditioner DILU;
|
||||||
tolerance 1e-8;
|
tolerance 1e-7;
|
||||||
relTol 0.1;
|
relTol 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"(U|h|k|epsilon|R)Final"
|
||||||
|
{
|
||||||
|
$U;
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SIMPLE
|
PIMPLE
|
||||||
{
|
{
|
||||||
momentumPredictor yes;
|
momentumPredictor on;
|
||||||
|
nCorrectors 2;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
pRefCell 0;
|
|
||||||
pRefValue 0;
|
|
||||||
|
|
||||||
residualControl
|
|
||||||
{
|
|
||||||
p_rgh 1e-2;
|
|
||||||
U 1e-3;
|
|
||||||
h 1e-3;
|
|
||||||
|
|
||||||
// possibly check turbulence fields
|
|
||||||
"(k|epsilon|omega)" 1e-3;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
relaxationFactors
|
relaxationFactors
|
||||||
{
|
{
|
||||||
fields
|
|
||||||
{
|
|
||||||
rho 1.0;
|
|
||||||
p_rgh 0.7;
|
|
||||||
}
|
|
||||||
equations
|
equations
|
||||||
{
|
{
|
||||||
U 0.3;
|
"h.*" 1;
|
||||||
h 0.3;
|
"U.*" 1;
|
||||||
"(k|epsilon|omega)" 0.7;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Library defines new boundary conditions
|
||||||
|
libs ("libOpenFOAM.so" "libjobControl.so");
|
||||||
|
|
||||||
|
application chtMultiRegionFoam;
|
||||||
|
|
||||||
|
startFrom startTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 1;
|
||||||
|
|
||||||
|
deltaT 0.001;
|
||||||
|
|
||||||
|
writeControl adjustableRunTime;
|
||||||
|
writeInterval 0.1;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 8;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable yes;
|
||||||
|
|
||||||
|
maxCo 0.6;
|
||||||
|
|
||||||
|
// Maximum diffusion number
|
||||||
|
maxDi 10.0;
|
||||||
|
|
||||||
|
adjustTimeStep yes;
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
externalCoupled
|
||||||
|
{
|
||||||
|
// Where to load it from (if not already in solver)
|
||||||
|
functionObjectLibs ("libjobControl.so");
|
||||||
|
|
||||||
|
type externalCoupled;
|
||||||
|
|
||||||
|
// Directory to use for communication
|
||||||
|
commsDir "${FOAM_CASE}/comms";
|
||||||
|
|
||||||
|
// Does external process start first
|
||||||
|
initByExternal true;
|
||||||
|
|
||||||
|
// Additional output
|
||||||
|
log true;
|
||||||
|
|
||||||
|
regions
|
||||||
|
{
|
||||||
|
// Region name (wildcards allowed)
|
||||||
|
"(topAir|heater)"
|
||||||
|
{
|
||||||
|
// In topAir adjust the minX patch (fixedValue)
|
||||||
|
|
||||||
|
// Patch or patchGroup
|
||||||
|
coupleGroup
|
||||||
|
{
|
||||||
|
// Fields to output in commsDir
|
||||||
|
writeFields (T);
|
||||||
|
// Fields to read from commsDir
|
||||||
|
readFields (T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
note "mesh decomposition control dictionary";
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
//- Keep owner and neighbour on same processor for faces in zones:
|
||||||
|
// preserveFaceZones (heater solid1 solid3);
|
||||||
|
|
||||||
|
method scotch;
|
||||||
|
// method hierarchical;
|
||||||
|
// method simple;
|
||||||
|
// method manual;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "decompositionData";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//// Is the case distributed
|
||||||
|
//distributed yes;
|
||||||
|
//// Per slave (so nProcs-1 entries) the directory above the case.
|
||||||
|
//roots
|
||||||
|
//(
|
||||||
|
// "/tmp"
|
||||||
|
// "/tmp"
|
||||||
|
//);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -10,19 +10,36 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
location "system";
|
object fvSchemes;
|
||||||
object decomposeParDict;
|
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
numberOfSubdomains 4;
|
ddtSchemes
|
||||||
|
{
|
||||||
method simple;
|
}
|
||||||
|
|
||||||
simpleCoeffs
|
gradSchemes
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
{
|
{
|
||||||
n (2 2 1);
|
|
||||||
delta 0.001;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -10,20 +10,13 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
object RASProperties;
|
object fvSolution;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
simulationType RAS;
|
PIMPLE
|
||||||
|
|
||||||
RAS
|
|
||||||
{
|
{
|
||||||
RASModel kOmegaSST;
|
nOuterCorrectors 1;
|
||||||
|
|
||||||
turbulence on;
|
|
||||||
|
|
||||||
printCoeffs on;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object changeDictionaryDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dictionaryReplacement
|
||||||
|
{
|
||||||
|
boundary
|
||||||
|
{
|
||||||
|
minY
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
inGroups (coupleGroup);
|
||||||
|
}
|
||||||
|
minZ
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
}
|
||||||
|
maxZ
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
T
|
||||||
|
{
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
"heater_to_.*"
|
||||||
|
{
|
||||||
|
type compressible::turbulentTemperatureCoupledBaffleMixed;
|
||||||
|
Tnbr T;
|
||||||
|
kappa solidThermo;
|
||||||
|
kappaName none;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
heater_to_leftSolid
|
||||||
|
{
|
||||||
|
type compressible::turbulentTemperatureCoupledBaffleMixed;
|
||||||
|
Tnbr T;
|
||||||
|
kappa solidThermo;
|
||||||
|
kappaName none;
|
||||||
|
thicknessLayers (1e-3);
|
||||||
|
kappaLayers (5e-4);
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
minY
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -10,39 +10,35 @@ FoamFile
|
|||||||
version 2.0;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
object controlDict;
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
application buoyantSimpleFoam;
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
startFrom startTime;
|
method scotch;
|
||||||
|
|
||||||
startTime 0;
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
stopAt endTime;
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
endTime 100;
|
scotchCoeffs
|
||||||
|
{
|
||||||
deltaT 1;
|
}
|
||||||
|
|
||||||
writeControl timeStep;
|
|
||||||
|
|
||||||
writeInterval 10;
|
|
||||||
|
|
||||||
purgeWrite 0;
|
|
||||||
|
|
||||||
writeFormat ascii;
|
|
||||||
|
|
||||||
writePrecision 6;
|
|
||||||
|
|
||||||
writeCompression off;
|
|
||||||
|
|
||||||
timeFormat general;
|
|
||||||
|
|
||||||
timePrecision 6;
|
|
||||||
|
|
||||||
runTimeModifiable true;
|
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "decompositionData";
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(alpha,h) Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
h
|
||||||
|
{
|
||||||
|
solver PCG;
|
||||||
|
preconditioner DIC;
|
||||||
|
tolerance 1e-06;
|
||||||
|
relTol 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
hFinal
|
||||||
|
{
|
||||||
|
$h;
|
||||||
|
tolerance 1e-06;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object changeDictionaryDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dictionaryReplacement
|
||||||
|
{
|
||||||
|
boundary
|
||||||
|
{
|
||||||
|
minZ
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
}
|
||||||
|
maxZ
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
T
|
||||||
|
{
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
"leftSolid_to_.*"
|
||||||
|
{
|
||||||
|
type compressible::turbulentTemperatureCoupledBaffleMixed;
|
||||||
|
Tnbr T;
|
||||||
|
kappa solidThermo;
|
||||||
|
kappaName none;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
leftSolid_to_heater
|
||||||
|
{
|
||||||
|
type compressible::turbulentTemperatureCoupledBaffleMixed;
|
||||||
|
Tnbr T;
|
||||||
|
kappa solidThermo;
|
||||||
|
kappaName none;
|
||||||
|
thicknessLayers (1e-3);
|
||||||
|
kappaLayers (5e-4);
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
method scotch;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
scotchCoeffs
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "decompositionData";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../heater/fvSchemes
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../heater/fvSolution
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object changeDictionaryDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dictionaryReplacement
|
||||||
|
{
|
||||||
|
boundary
|
||||||
|
{
|
||||||
|
minZ
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
}
|
||||||
|
maxZ
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
T
|
||||||
|
{
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
"rightSolid_to_.*"
|
||||||
|
{
|
||||||
|
type compressible::turbulentTemperatureCoupledBaffleMixed;
|
||||||
|
Tnbr T;
|
||||||
|
kappa solidThermo;
|
||||||
|
kappaName none;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
method scotch;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
scotchCoeffs
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "decompositionData";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../heater/fvSchemes
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../heater/fvSolution
|
||||||
@ -0,0 +1,179 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object changeDictionaryDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dictionaryReplacement
|
||||||
|
{
|
||||||
|
boundary
|
||||||
|
{
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
inGroups (coupleGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
U
|
||||||
|
{
|
||||||
|
internalField uniform (0.1 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform ( 0.1 0 0 );
|
||||||
|
}
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform ( 0 0 0 );
|
||||||
|
value uniform ( 0.1 0 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
T
|
||||||
|
{
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 300;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
"topAir_to_.*"
|
||||||
|
{
|
||||||
|
type compressible::turbulentTemperatureCoupledBaffleMixed;
|
||||||
|
Tnbr T;
|
||||||
|
kappa fluidThermo;
|
||||||
|
kappaName none;
|
||||||
|
value uniform 300;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
epsilon
|
||||||
|
{
|
||||||
|
internalField uniform 0.01;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type epsilonWallFunction;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.01;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
k
|
||||||
|
{
|
||||||
|
internalField uniform 0.1;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type kqRWallFunction;
|
||||||
|
value uniform 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
minX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.1;
|
||||||
|
}
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.1;
|
||||||
|
value uniform 0.1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p_rgh
|
||||||
|
{
|
||||||
|
internalField uniform 1e5;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type fixedFluxPressure;
|
||||||
|
value uniform 1e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 1e5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p
|
||||||
|
{
|
||||||
|
internalField uniform 1e5;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 1e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
maxX
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 1e5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
note "mesh decomposition control dictionary";
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 4;
|
||||||
|
|
||||||
|
//- Keep owner and neighbour on same processor for faces in zones:
|
||||||
|
// preserveFaceZones (heater solid1 solid3);
|
||||||
|
|
||||||
|
method scotch;
|
||||||
|
// method hierarchical;
|
||||||
|
// method simple;
|
||||||
|
// method manual;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (2 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
scotchCoeffs
|
||||||
|
{
|
||||||
|
//processorWeights
|
||||||
|
//(
|
||||||
|
// 1
|
||||||
|
// 1
|
||||||
|
// 1
|
||||||
|
// 1
|
||||||
|
//);
|
||||||
|
//writeGraph true;
|
||||||
|
//strategy "b";
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "decompositionData";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//// Is the case distributed
|
||||||
|
//distributed yes;
|
||||||
|
//// Per slave (so nProcs-1 entries) the directory above the case.
|
||||||
|
//roots
|
||||||
|
//(
|
||||||
|
// "/tmp"
|
||||||
|
// "/tmp"
|
||||||
|
//);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../bottomWater/fvSchemes
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../bottomWater/fvSolution
|
||||||
@ -0,0 +1,178 @@
|
|||||||
|
/*--------------------------------*- 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 dictionary;
|
||||||
|
object topoSetDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
actions
|
||||||
|
(
|
||||||
|
// Heater
|
||||||
|
{
|
||||||
|
name heaterCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action new;
|
||||||
|
source boxToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
box (-0.01001 0 -100 )(0.01001 0.00999 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name heaterCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action add;
|
||||||
|
source boxToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
box (-0.01001 -100 -0.01001)(0.01001 0.00999 0.01001);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name heater;
|
||||||
|
type cellZoneSet;
|
||||||
|
action new;
|
||||||
|
source setToCellZone;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set heaterCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// leftSolid
|
||||||
|
{
|
||||||
|
name leftSolidCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action new;
|
||||||
|
source boxToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
box (-100 0 -100 )(-0.01001 0.00999 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name leftSolid;
|
||||||
|
type cellZoneSet;
|
||||||
|
action new;
|
||||||
|
source setToCellZone;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set leftSolidCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// rightSolid
|
||||||
|
{
|
||||||
|
name rightSolidCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action new;
|
||||||
|
source boxToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
box (0.01001 0 -100 )(100 0.00999 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name rightSolid;
|
||||||
|
type cellZoneSet;
|
||||||
|
action new;
|
||||||
|
source setToCellZone;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set rightSolidCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// topAir
|
||||||
|
{
|
||||||
|
name topAirCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action new;
|
||||||
|
source boxToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
box (-100 0.00999 -100 )(100 100 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name topAir;
|
||||||
|
type cellZoneSet;
|
||||||
|
action new;
|
||||||
|
source setToCellZone;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set topAirCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// bottomWater is all the other cells
|
||||||
|
{
|
||||||
|
name bottomWaterCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action new;
|
||||||
|
source cellToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set heaterCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name bottomWaterCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action add;
|
||||||
|
source cellToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set leftSolidCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name bottomWaterCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action add;
|
||||||
|
source cellToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set rightSolidCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name bottomWaterCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action add;
|
||||||
|
source cellToCell;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set topAirCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name bottomWaterCellSet;
|
||||||
|
type cellSet;
|
||||||
|
action invert;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name bottomWater;
|
||||||
|
type cellZoneSet;
|
||||||
|
action new;
|
||||||
|
source setToCellZone;
|
||||||
|
sourceInfo
|
||||||
|
{
|
||||||
|
set bottomWaterCellSet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user