mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Adding 'baseGroup' option to createBaffle.C to add a pair patches but in
different groups. This is used in 3D baffle where the generated patches are not
coupled.
The tutorial circuitBoardCooling has been updated.
This commit is contained in:
@ -619,17 +619,39 @@ int main(int argc, char *argv[])
|
|||||||
const word masterName = groupName + "_master";
|
const word masterName = groupName + "_master";
|
||||||
const word slaveName = groupName + "_slave";
|
const word slaveName = groupName + "_slave";
|
||||||
|
|
||||||
dictionary patchDict = patchSource;
|
word groupNameMaster = groupName;
|
||||||
patchDict.set("nFaces", 0);
|
word groupNameSlave = groupName;
|
||||||
patchDict.set("startFace", 0);
|
|
||||||
patchDict.set("coupleGroup", groupName);
|
|
||||||
|
|
||||||
addPatch(mesh, masterName, groupName, patchDict);
|
|
||||||
addPatch(mesh, slaveName, groupName, patchDict);
|
dictionary patchDictMaster(patchSource);
|
||||||
}
|
patchDictMaster.set("nFaces", 0);
|
||||||
|
patchDictMaster.set("startFace", 0);
|
||||||
|
patchDictMaster.set("coupleGroup", groupName);
|
||||||
|
|
||||||
|
dictionary patchDictSlave(patchDictMaster);
|
||||||
|
|
||||||
|
// Note: This is added for the particular case where we want
|
||||||
|
// master and slave in different groupNames
|
||||||
|
// (ie 3D thermal baffles)
|
||||||
|
bool groupBase = false;
|
||||||
|
if (patchSource.found("groupBase"))
|
||||||
|
{
|
||||||
|
groupBase = readBool(patchSource.lookup("groupBase"));
|
||||||
|
|
||||||
|
if (groupBase)
|
||||||
|
{
|
||||||
|
groupNameMaster = groupName + "Group_master";
|
||||||
|
groupNameSlave = groupName + "Group_slave";
|
||||||
|
patchDictMaster.set("coupleGroup", groupNameMaster);
|
||||||
|
patchDictSlave.set("coupleGroup", groupNameSlave);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addPatch(mesh, masterName, groupNameMaster, patchDictMaster);
|
||||||
|
addPatch(mesh, slaveName, groupNameSlave, patchDictSlave);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Make sure patches and zoneFaces are synchronised across couples
|
// Make sure patches and zoneFaces are synchronised across couples
|
||||||
@ -793,6 +815,12 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
const dictionary& patchSource = dict.subDict("patchPairs");
|
const dictionary& patchSource = dict.subDict("patchPairs");
|
||||||
|
bool groupBase = false;
|
||||||
|
if (patchSource.found("groupBase"))
|
||||||
|
{
|
||||||
|
groupBase = readBool(patchSource.lookup("groupBase"));
|
||||||
|
}
|
||||||
|
|
||||||
const word& groupName = selectors[selectorI].name();
|
const word& groupName = selectors[selectorI].name();
|
||||||
|
|
||||||
if (patchSource.found("patchFields"))
|
if (patchSource.found("patchFields"))
|
||||||
@ -801,6 +829,9 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"patchFields"
|
"patchFields"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!groupBase)
|
||||||
|
{
|
||||||
// Add coupleGroup to all entries
|
// Add coupleGroup to all entries
|
||||||
forAllIter(dictionary, patchFieldsDict, iter)
|
forAllIter(dictionary, patchFieldsDict, iter)
|
||||||
{
|
{
|
||||||
@ -811,7 +842,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const labelList& patchIDs = pbm.groupPatchIDs()[groupName];
|
const labelList& patchIDs =
|
||||||
|
pbm.groupPatchIDs()[groupName];
|
||||||
|
|
||||||
forAll(patchIDs, i)
|
forAll(patchIDs, i)
|
||||||
{
|
{
|
||||||
fvMeshTools::setPatchFields
|
fvMeshTools::setPatchFields
|
||||||
@ -822,6 +855,29 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const word masterPatchName(groupName + "_master");
|
||||||
|
const word slavePatchName(groupName + "_slave");
|
||||||
|
|
||||||
|
label patchIMaster = pbm.findPatchID(masterPatchName);
|
||||||
|
label patchISlave = pbm.findPatchID(slavePatchName);
|
||||||
|
|
||||||
|
fvMeshTools::setPatchFields
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
patchIMaster,
|
||||||
|
patchFieldsDict
|
||||||
|
);
|
||||||
|
|
||||||
|
fvMeshTools::setPatchFields
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
patchISlave,
|
||||||
|
patchFieldsDict
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,39 @@ defineTypeNameAndDebug(extrudePatchMesh, 0);
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
extrudePatchMesh::extrudePatchMesh
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const fvPatch& patch,
|
||||||
|
const dictionary& dict,
|
||||||
|
const word regionName,
|
||||||
|
const List<polyPatch*>& regionPatches
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fvMesh
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
regionName,
|
||||||
|
mesh.facesInstance(),
|
||||||
|
mesh,
|
||||||
|
IOobject::READ_IF_PRESENT,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
true
|
||||||
|
),
|
||||||
|
xferCopy(pointField()),
|
||||||
|
xferCopy(faceList()),
|
||||||
|
xferCopy(labelList()),
|
||||||
|
xferCopy(labelList()),
|
||||||
|
false
|
||||||
|
),
|
||||||
|
extrudedPatch_(patch.patch()),
|
||||||
|
dict_(dict)
|
||||||
|
{
|
||||||
|
extrudeMesh(regionPatches);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extrudePatchMesh::extrudePatchMesh
|
extrudePatchMesh::extrudePatchMesh
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
@ -68,11 +101,59 @@ extrudePatchMesh::extrudePatchMesh
|
|||||||
xferCopy(labelList()),
|
xferCopy(labelList()),
|
||||||
false
|
false
|
||||||
),
|
),
|
||||||
extrudedPatch_(patch.patch())
|
extrudedPatch_(patch.patch()),
|
||||||
|
dict_(dict)
|
||||||
|
{
|
||||||
|
|
||||||
|
List<polyPatch*> regionPatches(3);
|
||||||
|
List<word> patchNames(regionPatches.size());
|
||||||
|
List<word> patchTypes(regionPatches.size());
|
||||||
|
PtrList<dictionary> dicts(regionPatches.size());
|
||||||
|
|
||||||
|
forAll (dicts, patchI)
|
||||||
|
{
|
||||||
|
if (!dicts.set(patchI))
|
||||||
|
{
|
||||||
|
dicts.set(patchI, new dictionary());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dicts[bottomPatchID] = dict_.subDict("bottomCoeffs");
|
||||||
|
dicts[sidePatchID] = dict_.subDict("sideCoeffs");
|
||||||
|
dicts[topPatchID] = dict_.subDict("topCoeffs");
|
||||||
|
|
||||||
|
forAll (dicts, patchI)
|
||||||
|
{
|
||||||
|
dicts[patchI].lookup("name") >> patchNames[patchI];
|
||||||
|
dicts[patchI].lookup("type") >> patchTypes[patchI];
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll (regionPatches, patchI)
|
||||||
|
{
|
||||||
|
dictionary& patchDict = dicts[patchI];
|
||||||
|
patchDict.set("nFaces", 0);
|
||||||
|
patchDict.set("startFace", 0);
|
||||||
|
|
||||||
|
regionPatches[patchI] = polyPatch::New
|
||||||
|
(
|
||||||
|
patchNames[patchI],
|
||||||
|
patchDict,
|
||||||
|
patchI,
|
||||||
|
mesh.boundaryMesh()
|
||||||
|
).ptr();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extrudeMesh(regionPatches);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
|
||||||
{
|
{
|
||||||
if (this->boundaryMesh().size() == 0)
|
if (this->boundaryMesh().size() == 0)
|
||||||
{
|
{
|
||||||
bool columnCells = readBool(dict.lookup("columnCells"));
|
bool columnCells = readBool(dict_.lookup("columnCells"));
|
||||||
|
|
||||||
PackedBoolList nonManifoldEdge(extrudedPatch_.nEdges());
|
PackedBoolList nonManifoldEdge(extrudedPatch_.nEdges());
|
||||||
for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++)
|
for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++)
|
||||||
@ -83,7 +164,7 @@ extrudePatchMesh::extrudePatchMesh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
autoPtr<extrudeModel> model_(extrudeModel::New(dict));
|
autoPtr<extrudeModel> model_(extrudeModel::New(dict_));
|
||||||
|
|
||||||
faceList pointGlobalRegions;
|
faceList pointGlobalRegions;
|
||||||
faceList pointLocalRegions;
|
faceList pointLocalRegions;
|
||||||
@ -180,7 +261,7 @@ extrudePatchMesh::extrudePatchMesh
|
|||||||
pointLocalRegions,
|
pointLocalRegions,
|
||||||
localRegionPoints
|
localRegionPoints
|
||||||
);
|
);
|
||||||
|
/*
|
||||||
List<polyPatch*> regionPatches(3);
|
List<polyPatch*> regionPatches(3);
|
||||||
List<word> patchNames(regionPatches.size());
|
List<word> patchNames(regionPatches.size());
|
||||||
List<word> patchTypes(regionPatches.size());
|
List<word> patchTypes(regionPatches.size());
|
||||||
@ -194,9 +275,9 @@ extrudePatchMesh::extrudePatchMesh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dicts[bottomPatchID] = dict.subDict("bottomCoeffs");
|
dicts[bottomPatchID] = dict_.subDict("bottomCoeffs");
|
||||||
dicts[sidePatchID] = dict.subDict("sideCoeffs");
|
dicts[sidePatchID] = dict_.subDict("sideCoeffs");
|
||||||
dicts[topPatchID] = dict.subDict("topCoeffs");
|
dicts[topPatchID] = dict_.subDict("topCoeffs");
|
||||||
|
|
||||||
forAll (dicts, patchI)
|
forAll (dicts, patchI)
|
||||||
{
|
{
|
||||||
@ -219,7 +300,7 @@ extrudePatchMesh::extrudePatchMesh
|
|||||||
).ptr();
|
).ptr();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
this->clearOut();
|
this->clearOut();
|
||||||
this->removeFvBoundary();
|
this->removeFvBoundary();
|
||||||
this->addFvPatches(regionPatches, true);
|
this->addFvPatches(regionPatches, true);
|
||||||
|
|||||||
@ -105,6 +105,15 @@ private:
|
|||||||
//- Const reference to the patch from which this mesh is extruded
|
//- Const reference to the patch from which this mesh is extruded
|
||||||
const polyPatch& extrudedPatch_;
|
const polyPatch& extrudedPatch_;
|
||||||
|
|
||||||
|
//- Model dictionary
|
||||||
|
dictionary dict_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private member functions
|
||||||
|
|
||||||
|
//- Extrude mesh using polyPatches
|
||||||
|
void extrudeMesh(const List<polyPatch*>& regionPatches);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -123,6 +132,17 @@ public:
|
|||||||
const word
|
const word
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from mesh, patch, dictionary and new mesh
|
||||||
|
// polyPatch information
|
||||||
|
extrudePatchMesh
|
||||||
|
(
|
||||||
|
const fvMesh&,
|
||||||
|
const fvPatch&,
|
||||||
|
const dictionary&,
|
||||||
|
const word,
|
||||||
|
const List<polyPatch*>& polyPatches
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~extrudePatchMesh();
|
virtual ~extrudePatchMesh();
|
||||||
|
|||||||
@ -25,6 +25,9 @@ License
|
|||||||
|
|
||||||
#include "thermalBaffleFvPatchScalarField.H"
|
#include "thermalBaffleFvPatchScalarField.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "emptyPolyPatch.H"
|
||||||
|
#include "polyPatch.H"
|
||||||
|
#include "mappedWallPolyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -114,17 +117,6 @@ thermalBaffleFvPatchScalarField
|
|||||||
owner_ = true;
|
owner_ = true;
|
||||||
baffle_->rename(baffleName);
|
baffle_->rename(baffleName);
|
||||||
}
|
}
|
||||||
else if //Backwards compatibility (if region exists)
|
|
||||||
(
|
|
||||||
thisMesh.time().foundObject<fvMesh>(regionName)
|
|
||||||
&& baffle_.empty()
|
|
||||||
&& regionName != "none"
|
|
||||||
)
|
|
||||||
{
|
|
||||||
baffle_.reset(baffle::New(thisMesh, dict).ptr());
|
|
||||||
owner_ = true;
|
|
||||||
baffle_->rename(baffleName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,19 +160,79 @@ void thermalBaffleFvPatchScalarField::rmap
|
|||||||
|
|
||||||
void thermalBaffleFvPatchScalarField::createPatchMesh()
|
void thermalBaffleFvPatchScalarField::createPatchMesh()
|
||||||
{
|
{
|
||||||
const fvMesh& defaultRegion =
|
|
||||||
db().time().lookupObject<fvMesh>(fvMesh::defaultRegion);
|
const fvMesh& thisMesh = patch().boundaryMesh().mesh();
|
||||||
|
|
||||||
word regionName = dict_.lookup("regionName");
|
word regionName = dict_.lookup("regionName");
|
||||||
|
|
||||||
|
List<polyPatch*> regionPatches(3);
|
||||||
|
List<word> patchNames(regionPatches.size());
|
||||||
|
List<word> patchTypes(regionPatches.size());
|
||||||
|
List<dictionary> dicts(regionPatches.size());
|
||||||
|
|
||||||
|
patchNames[bottomPatchID] = word("bottom");
|
||||||
|
patchNames[sidePatchID] = word("side");
|
||||||
|
patchNames[topPatchID] = word("top");
|
||||||
|
|
||||||
|
patchTypes[bottomPatchID] = mappedWallPolyPatch::typeName;
|
||||||
|
patchTypes[topPatchID] = mappedWallPolyPatch::typeName;
|
||||||
|
|
||||||
|
if (readBool(dict_.lookup("columnCells")))
|
||||||
|
{
|
||||||
|
patchTypes[sidePatchID] = emptyPolyPatch::typeName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
patchTypes[sidePatchID] = polyPatch::typeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
const mappedPatchBase& mpp =
|
||||||
|
refCast<const mappedPatchBase>(patch().patch());
|
||||||
|
|
||||||
|
const word coupleGroup(mpp.coupleGroup());
|
||||||
|
|
||||||
|
wordList inGroups(1);
|
||||||
|
inGroups[0] = coupleGroup;
|
||||||
|
|
||||||
|
dicts[bottomPatchID].add("coupleGroup", coupleGroup);
|
||||||
|
dicts[bottomPatchID].add("inGroups", inGroups);
|
||||||
|
dicts[bottomPatchID].add("sampleMode", mpp.sampleModeNames_[mpp.mode()]);
|
||||||
|
|
||||||
|
const label sepPos = coupleGroup.find('_');
|
||||||
|
|
||||||
|
const word coupleGroupSlave = coupleGroup(0, sepPos) + "_slave";
|
||||||
|
|
||||||
|
inGroups[0] = coupleGroupSlave;
|
||||||
|
dicts[topPatchID].add("coupleGroup", coupleGroupSlave);
|
||||||
|
dicts[topPatchID].add("inGroups", inGroups);
|
||||||
|
dicts[topPatchID].add("sampleMode", mpp.sampleModeNames_[mpp.mode()]);
|
||||||
|
|
||||||
|
|
||||||
|
forAll (regionPatches, patchI)
|
||||||
|
{
|
||||||
|
dictionary& patchDict = dicts[patchI];
|
||||||
|
patchDict.set("nFaces", 0);
|
||||||
|
patchDict.set("startFace", 0);
|
||||||
|
|
||||||
|
regionPatches[patchI] = polyPatch::New
|
||||||
|
(
|
||||||
|
patchTypes[patchI],
|
||||||
|
patchNames[patchI],
|
||||||
|
dicts[patchI],
|
||||||
|
patchI,
|
||||||
|
thisMesh.boundaryMesh()
|
||||||
|
).ptr();
|
||||||
|
}
|
||||||
|
|
||||||
extrudeMeshPtr_.reset
|
extrudeMeshPtr_.reset
|
||||||
(
|
(
|
||||||
new extrudePatchMesh
|
new extrudePatchMesh
|
||||||
(
|
(
|
||||||
defaultRegion,
|
thisMesh,
|
||||||
patch(),
|
patch(),
|
||||||
dict_,
|
dict_,
|
||||||
regionName
|
regionName,
|
||||||
|
regionPatches
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -182,6 +182,14 @@ class thermalBaffleFvPatchScalarField
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Enumeration of patch IDs
|
||||||
|
enum patchID
|
||||||
|
{
|
||||||
|
bottomPatchID,
|
||||||
|
topPatchID,
|
||||||
|
sidePatchID
|
||||||
|
};
|
||||||
|
|
||||||
//- Is the baffle owner
|
//- Is the baffle owner
|
||||||
bool owner_;
|
bool owner_;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -47,7 +47,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
|
|||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
mixedFvPatchScalarField(p, iF),
|
||||||
temperatureCoupledBase(patch(), "undefined", "undefined-K"),
|
temperatureCoupledBase(patch(), "undefined", "undefined-K"),
|
||||||
neighbourFieldName_("undefined-neighbourFieldName")
|
TnbrName_("undefined-Tnbr")
|
||||||
{
|
{
|
||||||
this->refValue() = 0.0;
|
this->refValue() = 0.0;
|
||||||
this->refGrad() = 0.0;
|
this->refGrad() = 0.0;
|
||||||
@ -66,7 +66,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
|
|||||||
:
|
:
|
||||||
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.kappaName()),
|
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.kappaName()),
|
||||||
neighbourFieldName_(ptf.neighbourFieldName_)
|
TnbrName_(ptf.TnbrName_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
|
|||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
mixedFvPatchScalarField(p, iF),
|
||||||
temperatureCoupledBase(patch(), dict),
|
temperatureCoupledBase(patch(), dict),
|
||||||
neighbourFieldName_(dict.lookup("neighbourFieldName"))
|
TnbrName_(dict.lookup("neighbourFieldName"))
|
||||||
{
|
{
|
||||||
if (!isA<mappedPatchBase>(this->patch().patch()))
|
if (!isA<mappedPatchBase>(this->patch().patch()))
|
||||||
{
|
{
|
||||||
@ -129,7 +129,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
|
|||||||
:
|
:
|
||||||
mixedFvPatchScalarField(wtcsf, iF),
|
mixedFvPatchScalarField(wtcsf, iF),
|
||||||
temperatureCoupledBase(patch(), wtcsf.KMethod(), wtcsf.kappaName()),
|
temperatureCoupledBase(patch(), wtcsf.KMethod(), wtcsf.kappaName()),
|
||||||
neighbourFieldName_(wtcsf.neighbourFieldName_)
|
TnbrName_(wtcsf.TnbrName_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
|
|||||||
(
|
(
|
||||||
nbrPatch.lookupPatchField<volScalarField, scalar>
|
nbrPatch.lookupPatchField<volScalarField, scalar>
|
||||||
(
|
(
|
||||||
neighbourFieldName_
|
TnbrName_
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write
|
|||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mixedFvPatchScalarField::write(os);
|
mixedFvPatchScalarField::write(os);
|
||||||
os.writeKeyword("neighbourFieldName")<< neighbourFieldName_
|
os.writeKeyword("TnbrName")<< TnbrName_
|
||||||
<< token::END_STATEMENT << nl;
|
<< token::END_STATEMENT << nl;
|
||||||
temperatureCoupledBase::write(os);
|
temperatureCoupledBase::write(os);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -89,7 +89,7 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Name of field on the neighbour region
|
//- Name of field on the neighbour region
|
||||||
const word neighbourFieldName_;
|
const word TnbrName_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -84,9 +84,9 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
|
|||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
mixedFvPatchScalarField(p, iF),
|
||||||
temperatureCoupledBase(patch(), dict),
|
temperatureCoupledBase(patch(), dict),
|
||||||
TnbrName_(dict.lookup("Tnbr")),
|
TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
|
||||||
QrNbrName_(dict.lookup("QrNbr")),
|
QrNbrName_(dict.lookupOrDefault<word>("QrNbr", "none")),
|
||||||
QrName_(dict.lookup("Qr"))
|
QrName_(dict.lookupOrDefault<word>("Qr", "none"))
|
||||||
{
|
{
|
||||||
if (!isA<mappedPatchBase>(this->patch().patch()))
|
if (!isA<mappedPatchBase>(this->patch().patch()))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -24,11 +24,8 @@ boundaryField
|
|||||||
bottom
|
bottom
|
||||||
{
|
{
|
||||||
type compressible::thermalBaffle;
|
type compressible::thermalBaffle;
|
||||||
Tnbr T;
|
|
||||||
kappa solidThermo;
|
kappa solidThermo;
|
||||||
kappaName none;
|
kappaName none;
|
||||||
QrNbr none;
|
|
||||||
Qr none;
|
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
side
|
side
|
||||||
@ -38,11 +35,8 @@ boundaryField
|
|||||||
top
|
top
|
||||||
{
|
{
|
||||||
type compressible::thermalBaffle;
|
type compressible::thermalBaffle;
|
||||||
Tnbr T;
|
|
||||||
kappa solidThermo;
|
kappa solidThermo;
|
||||||
kappaName none;
|
kappaName none;
|
||||||
QrNbr none;
|
|
||||||
Qr none;
|
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,15 +9,10 @@
|
|||||||
T
|
T
|
||||||
{
|
{
|
||||||
type compressible::thermalBaffle;
|
type compressible::thermalBaffle;
|
||||||
Tnbr T;
|
|
||||||
kappa fluidThermo;
|
kappa fluidThermo;
|
||||||
kappaName none;
|
kappaName none;
|
||||||
QrNbr none;
|
|
||||||
Qr none;
|
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
|
|
||||||
// Thermo baffle model
|
|
||||||
//thermalBaffleModel thermalBaffle;
|
|
||||||
regionName ${baffleRegionName};
|
regionName ${baffleRegionName};
|
||||||
active yes;
|
active yes;
|
||||||
|
|
||||||
@ -26,33 +21,6 @@ T
|
|||||||
// New fvMesh (region) information
|
// New fvMesh (region) information
|
||||||
# include "extrudeModel"
|
# include "extrudeModel"
|
||||||
|
|
||||||
|
|
||||||
// New mesh polyPatch information
|
|
||||||
bottomCoeffs
|
|
||||||
{
|
|
||||||
name "bottom";
|
|
||||||
type mappedWall;
|
|
||||||
sampleMode nearestPatchFace;
|
|
||||||
samplePatch ${masterPatchName};
|
|
||||||
offsetMode uniform;
|
|
||||||
offset (0 0 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
topCoeffs
|
|
||||||
{
|
|
||||||
name "top";
|
|
||||||
type mappedWall;
|
|
||||||
sampleMode nearestPatchFace;
|
|
||||||
samplePatch ${slavePatchName};
|
|
||||||
offsetMode uniform;
|
|
||||||
offset (0 0 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
sideCoeffs
|
|
||||||
{
|
|
||||||
name "side";
|
|
||||||
type patch;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -48,49 +48,18 @@ baffles
|
|||||||
surface triSurfaceMesh;
|
surface triSurfaceMesh;
|
||||||
name baffle3D.stl;
|
name baffle3D.stl;
|
||||||
|
|
||||||
patches
|
patchPairs
|
||||||
{
|
{
|
||||||
master
|
|
||||||
{
|
|
||||||
//- Master side patch
|
|
||||||
name ${masterPatchName};
|
|
||||||
|
|
||||||
type mappedWall;
|
type mappedWall;
|
||||||
inGroups (baffleWallGroup);
|
|
||||||
|
|
||||||
sampleMode nearestPatchFace;
|
sampleMode nearestPatchFace;
|
||||||
sampleRegion ${baffleRegionName};
|
//Group master and slave in different groups. (default off)
|
||||||
samplePatch bottom;
|
groupBase on;
|
||||||
offsetMode uniform;
|
|
||||||
offset (0 0 0);
|
|
||||||
|
|
||||||
patchFields
|
patchFields
|
||||||
{
|
{
|
||||||
#include "./0/include/wallBafflePatches"
|
#include "./0/include/wallBafflePatches"
|
||||||
#include "./0/include/3DBaffle/3DTemperatureMasterBafflePatches"
|
#include "./0/include/3DBaffle/3DTemperatureMasterBafflePatches"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
slave
|
|
||||||
{
|
|
||||||
//- Slave side patch
|
|
||||||
name ${slavePatchName};
|
|
||||||
|
|
||||||
type mappedWall;
|
|
||||||
inGroups (baffleWallGroup);
|
|
||||||
|
|
||||||
sampleMode nearestPatchFace;
|
|
||||||
sampleRegion ${baffleRegionName};
|
|
||||||
samplePatch top;
|
|
||||||
offsetMode uniform;
|
|
||||||
offset (0 0 0);
|
|
||||||
|
|
||||||
patchFields
|
|
||||||
{
|
|
||||||
#include "./0/include/wallBafflePatches"
|
|
||||||
#include "./0/include/3DBaffle/3DTemperatureSlaveBafflePatches"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user