Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
commit
5ef09ce543
@ -9,7 +9,7 @@
|
||||
- p*fvc::div(phi/fvc::interpolate(rho))
|
||||
);
|
||||
|
||||
pZones.addEnthalpySource(thermo, hEqn);
|
||||
pZones.addEnthalpySource(thermo, rho, hEqn);
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
regionProperties/regionProperties.C
|
||||
|
||||
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
|
||||
derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C
|
||||
|
||||
fluid/compressibleCourantNo.C
|
||||
|
||||
|
@ -5,7 +5,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lbasicThermophysicalModels \
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
for (label i=0; i<Ua.boundaryField().size(); i++)
|
||||
{
|
||||
if (isType<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
|
||||
if (isA<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
|
||||
{
|
||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
for (label i=0; i<Ub.boundaryField().size(); i++)
|
||||
{
|
||||
if (isType<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
|
||||
if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
|
||||
{
|
||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ Description
|
||||
{
|
||||
const fvPatch& p = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(p))
|
||||
if (isA<wallFvPatch>(p))
|
||||
{
|
||||
epsEqn.setValues
|
||||
(
|
||||
|
@ -12,7 +12,7 @@
|
||||
{
|
||||
const fvPatch& currPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(currPatch))
|
||||
if (isA<wallFvPatch>(currPatch))
|
||||
{
|
||||
forAll(currPatch, facei)
|
||||
{
|
||||
@ -30,7 +30,7 @@
|
||||
{
|
||||
const fvPatch& currPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(currPatch))
|
||||
if (isA<wallFvPatch>(currPatch))
|
||||
{
|
||||
const scalarField& nuw = nutb.boundaryField()[patchi];
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(curPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
forAll(curPatch, facei)
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
{
|
||||
const fvPatch& currPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(currPatch))
|
||||
if (isA<wallFvPatch>(currPatch))
|
||||
{
|
||||
scalarField& nutw = nutb.boundaryField()[patchi];
|
||||
|
||||
|
@ -352,7 +352,7 @@ void Foam::multiphaseMixture::correctContactAngle
|
||||
|
||||
forAll(boundary, patchi)
|
||||
{
|
||||
if (typeid(gbf[patchi]) == typeid(alphaContactAngleFvPatchScalarField))
|
||||
if (isA<alphaContactAngleFvPatchScalarField>(gbf[patchi]))
|
||||
{
|
||||
const alphaContactAngleFvPatchScalarField& acap =
|
||||
refCast<const alphaContactAngleFvPatchScalarField>(gbf[patchi]);
|
||||
|
@ -37,7 +37,7 @@ Description
|
||||
{
|
||||
const fvPatch& p = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(p))
|
||||
if (isA<wallFvPatch>(p))
|
||||
{
|
||||
epsEqn.setValues
|
||||
(
|
||||
|
@ -12,7 +12,7 @@
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(curPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
forAll(curPatch, facei)
|
||||
{
|
||||
@ -30,7 +30,7 @@
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(curPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
const scalarField& rhow = rho.boundaryField()[patchi];
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(curPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
forAll(curPatch, facei)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (isType<wallFvPatch>(curPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
const scalarField& rhow = rho.boundaryField()[patchi];
|
||||
|
||||
|
@ -109,7 +109,7 @@ Foam::phaseModel::phaseModel
|
||||
|
||||
for (label i=0; i<U_.boundaryField().size(); i++)
|
||||
{
|
||||
if (isType<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
|
||||
if (isA<fixedValueFvPatchVectorField>(U_.boundaryField()[i]))
|
||||
{
|
||||
phiTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const fvPatch& patch = mesh.boundary()[patchI];
|
||||
|
||||
if (typeid(patch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(patch))
|
||||
{
|
||||
nWalls += patch.size();
|
||||
}
|
||||
@ -91,7 +91,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const fvPatch& patch = mesh.boundary()[patchI];
|
||||
|
||||
if (typeid(patch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(patch))
|
||||
{
|
||||
forAll (patch.Cf(), patchFaceI)
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const fvPatch& patch = mesh.boundary()[patchI];
|
||||
|
||||
if (typeid(patch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(patch))
|
||||
{
|
||||
fvPatchVectorField& wallData = n.boundaryField()[patchI];
|
||||
|
||||
|
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const fvPatch& patch = mesh.boundary()[patchI];
|
||||
|
||||
if (typeid(patch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(patch))
|
||||
{
|
||||
fvPatchScalarField& wallData = yStar.boundaryField()[patchI];
|
||||
|
||||
|
@ -55,7 +55,7 @@ labelList procNeighbours(const polyMesh& mesh)
|
||||
|
||||
forAll (mesh.boundaryMesh(), patchI)
|
||||
{
|
||||
if (typeid(mesh.boundaryMesh()[patchI]) == typeid(processorPolyPatch))
|
||||
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
||||
{
|
||||
nNeighbours++;
|
||||
}
|
||||
@ -67,7 +67,7 @@ labelList procNeighbours(const polyMesh& mesh)
|
||||
|
||||
forAll (mesh.boundaryMesh(), patchI)
|
||||
{
|
||||
if (typeid(mesh.boundaryMesh()[patchI]) == typeid(processorPolyPatch))
|
||||
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchI];
|
||||
|
||||
|
@ -174,17 +174,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
nWrittenFaces += patchFaces.size();
|
||||
|
||||
// Write patch type
|
||||
if
|
||||
(
|
||||
typeid(boundary()[patchI]) == typeid(wallFvPatch)
|
||||
)
|
||||
if (isA<wallFvPatch>(boundary()[patchI]))
|
||||
{
|
||||
fluentMeshFile << 3;
|
||||
}
|
||||
else if
|
||||
(
|
||||
typeid(boundary()[patchI]) == typeid(symmetryFvPatch)
|
||||
)
|
||||
else if (isA<symmetryFvPatch>(boundary()[patchI]))
|
||||
{
|
||||
fluentMeshFile << 7;
|
||||
}
|
||||
@ -282,17 +276,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
<< "(39 (" << patchI + 10 << " ";
|
||||
|
||||
// Write patch type
|
||||
if
|
||||
(
|
||||
typeid(boundary()[patchI]) == typeid(wallFvPatch)
|
||||
)
|
||||
if (isA<wallFvPatch>(boundary()[patchI]))
|
||||
{
|
||||
fluentMeshFile << "wall ";
|
||||
}
|
||||
else if
|
||||
(
|
||||
typeid(boundary()[patchI]) == typeid(symmetryFvPatch)
|
||||
)
|
||||
else if (isA<symmetryFvPatch>(boundary()[patchI]))
|
||||
{
|
||||
fluentMeshFile << "symmetry ";
|
||||
}
|
||||
|
@ -0,0 +1,79 @@
|
||||
// Parametres geometriques
|
||||
r1 = 200*Cos(Pi/4)/1000;
|
||||
r2 = 200*Cos(Pi/4)/1000;
|
||||
|
||||
h1 = 250/1000;
|
||||
h2 = 360/1000;
|
||||
h3 = 900/1000;
|
||||
h4 = 1900/1000;
|
||||
|
||||
// Parametres de maillage
|
||||
// selon le rayon
|
||||
rCells = 10/2; rRatio = 0.85;
|
||||
// selon S1
|
||||
S1Cells = 30/2; S1ratio = 1;
|
||||
// selon S2
|
||||
S2Cells = 35/2; S2ratio = 0.95;
|
||||
// selon S3
|
||||
S3Cells = 20/2; S3ratio = 1;
|
||||
|
||||
Point(1) = {r1, r1, h4};
|
||||
Point(2) = {r1, r1, h3};
|
||||
Point(3) = {r2, r2, h2};
|
||||
Point(4) = {r2, r2, h1};
|
||||
Point(5) = {0, 0, h1};
|
||||
Point(6) = {0, 0, h2};
|
||||
Point(7) = {0, 0, h3};
|
||||
Point(8) = {0, 0, h4};
|
||||
|
||||
Line(1) = {8, 1};
|
||||
Line(2) = {1, 2};
|
||||
Line(3) = {7, 2};
|
||||
Line(4) = {8, 7};
|
||||
Line(5) = {2, 3};
|
||||
Line(6) = {6, 3};
|
||||
Line(7) = {7, 6};
|
||||
Line(8) = {3, 4};
|
||||
Line(9) = {5, 4};
|
||||
Line(10) = {6, 5};
|
||||
|
||||
Line Loop(11) = {1, 2, -3, -4};
|
||||
Ruled Surface(12) = {11};
|
||||
Line Loop(13) = {5, -6, -7, 3};
|
||||
Ruled Surface(14) = {13};
|
||||
Line Loop(15) = {8, -9, -10, 6};
|
||||
Ruled Surface(16) = {15};
|
||||
Transfinite Line {1, 3, 6, 9} = rCells Using Progression rRatio;
|
||||
Transfinite Line {4, 2} = S1Cells Using Progression S1ratio;
|
||||
Transfinite Line {7, 5} = S2Cells Using Progression S2ratio;
|
||||
Transfinite Line {10, 8} = S3Cells Using Progression S3ratio;
|
||||
Transfinite Surface {12} = {8, 1, 2, 7};
|
||||
Transfinite Surface {14} = {7, 2, 3, 6};
|
||||
Transfinite Surface {16} = {6, 3, 4, 5};
|
||||
Recombine Surface {12, 14, 16};
|
||||
Extrude {{0, 0, 1}, {0, 0, 0}, Pi/2} {
|
||||
Surface{12, 14, 16};
|
||||
Layers{25};
|
||||
Recombine;
|
||||
}
|
||||
Extrude {{0, 0, 1}, {0, 0, 0}, Pi/2} {
|
||||
Surface{33, 50, 67};
|
||||
Layers{25};
|
||||
Recombine;
|
||||
}
|
||||
Extrude {{0, 0, 1}, {0, 0, 0}, Pi/2} {
|
||||
Surface{84, 101, 118};
|
||||
Layers{25};
|
||||
Recombine;
|
||||
}
|
||||
Extrude {{0, 0, 1}, {0, 0, 0}, Pi/2} {
|
||||
Surface{135, 152, 169};
|
||||
Layers{25};
|
||||
Recombine;
|
||||
}
|
||||
Physical Surface("entree") = {126, 75, 24, 177};
|
||||
Physical Surface("S1") = {28, 181, 130, 79};
|
||||
Physical Surface("S2") = {93, 42, 193, 144};
|
||||
Physical Surface("S3") = {110, 59, 205, 161};
|
||||
Physical Surface("fond") = {113, 62, 208, 164};
|
||||
Physical Volume("fluide") = {4, 7, 10, 1, 5, 8, 11, 2, 9, 12, 3, 6};
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -312,11 +312,36 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
|
||||
string line;
|
||||
inFile.getLine(line);
|
||||
IStringStream lineStr(line);
|
||||
label nSpaces = lineStr.str().count(' ');
|
||||
|
||||
lineStr >> regionI >> regionName;
|
||||
if(nSpaces == 1)
|
||||
{
|
||||
lineStr >> regionI >> regionName;
|
||||
|
||||
Info<< " " << regionI << '\t' << string::validate<word>(regionName)
|
||||
<< endl;
|
||||
Info<< " " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
}
|
||||
else if(nSpaces == 2)
|
||||
{
|
||||
// >= Gmsh2.4 physical types has tag in front.
|
||||
label physType;
|
||||
lineStr >> physType >> regionI >> regionName;
|
||||
if (physType == 1)
|
||||
{
|
||||
Info<< " " << "Line " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
}
|
||||
else if (physType == 2)
|
||||
{
|
||||
Info<< " " << "Surface " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
}
|
||||
else if (physType == 3)
|
||||
{
|
||||
Info<< " " << "Volume " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
physicalNames.insert(regionI, string::validate<word>(regionName));
|
||||
}
|
||||
|
Binary file not shown.
@ -138,12 +138,29 @@ label findPatchID(const polyBoundaryMesh& patches, const word& name)
|
||||
}
|
||||
|
||||
|
||||
labelList patchFaces(const polyBoundaryMesh& patches, const word& name)
|
||||
labelList patchFaces(const polyBoundaryMesh& patches, const wordList& names)
|
||||
{
|
||||
label patchID = findPatchID(patches, name);
|
||||
const polyPatch& pp = patches[patchID];
|
||||
label n = 0;
|
||||
|
||||
return identity(pp.size()) + pp.start();
|
||||
forAll(names, i)
|
||||
{
|
||||
const polyPatch& pp = patches[findPatchID(patches, names[i])];
|
||||
|
||||
n += pp.size();
|
||||
}
|
||||
labelList faceLabels(n);
|
||||
n = 0;
|
||||
forAll(names, i)
|
||||
{
|
||||
const polyPatch& pp = patches[findPatchID(patches, names[i])];
|
||||
|
||||
forAll(pp, j)
|
||||
{
|
||||
faceLabels[n++] = pp.start()+j;
|
||||
}
|
||||
}
|
||||
|
||||
return faceLabels;
|
||||
}
|
||||
|
||||
|
||||
@ -231,13 +248,26 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (mode == PATCH || mode == MESH)
|
||||
{
|
||||
if (flipNormals)
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Flipping normals not supported for extrusions from patch."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
fileName sourceCasePath(dict.lookup("sourceCase"));
|
||||
sourceCasePath.expand();
|
||||
fileName sourceRootDir = sourceCasePath.path();
|
||||
fileName sourceCaseDir = sourceCasePath.name();
|
||||
dict.lookup("sourcePatch") >> frontPatchName;
|
||||
wordList sourcePatches;
|
||||
dict.lookup("sourcePatches") >> sourcePatches;
|
||||
|
||||
Info<< "Extruding patch " << frontPatchName
|
||||
if (sourcePatches.size() == 1)
|
||||
{
|
||||
frontPatchName = sourcePatches[0];
|
||||
}
|
||||
|
||||
Info<< "Extruding patches " << sourcePatches
|
||||
<< " on mesh " << sourceCasePath << nl
|
||||
<< endl;
|
||||
|
||||
@ -272,7 +302,7 @@ int main(int argc, char *argv[])
|
||||
IndirectList<face>
|
||||
(
|
||||
mesh.faces(),
|
||||
patchFaces(patches, frontPatchName)
|
||||
patchFaces(patches, sourcePatches)
|
||||
),
|
||||
mesh.points()
|
||||
);
|
||||
@ -471,13 +501,13 @@ int main(int argc, char *argv[])
|
||||
frontPatchFaces = patchFaces
|
||||
(
|
||||
meshFromSurface().boundaryMesh(),
|
||||
frontPatchName
|
||||
wordList(1, frontPatchName)
|
||||
);
|
||||
backPatchName = "otherSide";
|
||||
backPatchFaces = patchFaces
|
||||
(
|
||||
meshFromSurface().boundaryMesh(),
|
||||
backPatchName
|
||||
wordList(1, backPatchName)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
extrudeModel/extrudeModel.C
|
||||
extrudeModel/newExtrudeModel.C
|
||||
linearNormal/linearNormal.C
|
||||
linearDirection/linearDirection.C
|
||||
linearRadial/linearRadial.C
|
||||
sigmaRadial/sigmaRadial.C
|
||||
wedge/wedge.C
|
||||
|
@ -0,0 +1,90 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "linearDirection.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace extrudeModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(linearDirection, 0);
|
||||
|
||||
addToRunTimeSelectionTable(extrudeModel, linearDirection, dictionary);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
linearDirection::linearDirection(const dictionary& dict)
|
||||
:
|
||||
extrudeModel(typeName, dict),
|
||||
direction_(coeffDict_.lookup("direction")),
|
||||
thickness_(readScalar(coeffDict_.lookup("thickness")))
|
||||
{
|
||||
direction_ /= mag(direction_);
|
||||
|
||||
if (thickness_ <= 0)
|
||||
{
|
||||
FatalErrorIn("linearDirection(const dictionary&)")
|
||||
<< "thickness should be positive : " << thickness_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
linearDirection::~linearDirection()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
|
||||
|
||||
point linearDirection::operator()
|
||||
(
|
||||
const point& surfacePoint,
|
||||
const vector& surfaceNormal,
|
||||
const label layer
|
||||
) const
|
||||
{
|
||||
//scalar d = thickness_*layer/nLayers_;
|
||||
scalar d = thickness_*sumThickness(layer);
|
||||
return surfacePoint + d*direction_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace extrudeModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -0,0 +1,99 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::extrudeModels::linearDirection
|
||||
|
||||
Description
|
||||
Extrudes by transforming points in a specified direction by a given distance
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef linearDirection_H
|
||||
#define linearDirection_H
|
||||
|
||||
#include "point.H"
|
||||
#include "extrudeModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace extrudeModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class linearDirection Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class linearDirection
|
||||
:
|
||||
public extrudeModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Extrude direction
|
||||
vector direction_;
|
||||
|
||||
//- layer thickness
|
||||
scalar thickness_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("linearDirection");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
linearDirection(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
~linearDirection();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
point operator()
|
||||
(
|
||||
const point& surfacePoint,
|
||||
const vector& surfaceNormal,
|
||||
const label layer
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace extrudeModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -25,7 +25,7 @@ constructFrom patch;
|
||||
|
||||
// If construct from patch/mesh:
|
||||
sourceCase "../cavity";
|
||||
sourcePatch movingWall;
|
||||
sourcePatches (movingWall);
|
||||
// If construct from patch: patch to use for back (can be same as sourcePatch)
|
||||
exposedPatchName movingWall;
|
||||
// If construct from surface:
|
||||
@ -41,6 +41,9 @@ flipNormals false;
|
||||
//- Linear extrusion in point-normal direction
|
||||
//extrudeModel linearNormal;
|
||||
|
||||
//- Linear extrusion in specified direction
|
||||
//extrudeModel linearDirection;
|
||||
|
||||
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
|
||||
extrudeModel wedge;
|
||||
|
||||
@ -66,6 +69,11 @@ linearNormalCoeffs
|
||||
thickness 0.05;
|
||||
}
|
||||
|
||||
linearDirectionCoeffs
|
||||
{
|
||||
direction (0 0 1);
|
||||
}
|
||||
|
||||
linearRadialCoeffs
|
||||
{
|
||||
R 0.1;
|
||||
|
@ -363,6 +363,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (wantRefine)
|
||||
{
|
||||
cpuTime timer;
|
||||
|
||||
autoRefineDriver refineDriver
|
||||
(
|
||||
meshRefiner,
|
||||
@ -387,10 +389,15 @@ int main(int argc, char *argv[])
|
||||
meshRefiner,
|
||||
debug
|
||||
);
|
||||
|
||||
Info<< "Mesh refined in = "
|
||||
<< timer.cpuTimeIncrement() << " s." << endl;
|
||||
}
|
||||
|
||||
if (wantSnap)
|
||||
{
|
||||
cpuTime timer;
|
||||
|
||||
autoSnapDriver snapDriver
|
||||
(
|
||||
meshRefiner,
|
||||
@ -413,10 +420,15 @@ int main(int argc, char *argv[])
|
||||
meshRefiner,
|
||||
debug
|
||||
);
|
||||
|
||||
Info<< "Mesh snapped in = "
|
||||
<< timer.cpuTimeIncrement() << " s." << endl;
|
||||
}
|
||||
|
||||
if (wantLayers)
|
||||
{
|
||||
cpuTime timer;
|
||||
|
||||
autoLayerDriver layerDriver(meshRefiner);
|
||||
|
||||
// Layer addition parameters
|
||||
@ -442,6 +454,9 @@ int main(int argc, char *argv[])
|
||||
meshRefiner,
|
||||
debug
|
||||
);
|
||||
|
||||
Info<< "Layers added in = "
|
||||
<< timer.cpuTimeIncrement() << " s." << endl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -167,6 +167,16 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
forAll (oldPatches, patchI)
|
||||
{
|
||||
const polyPatch& curPatch = oldPatches[patchI];
|
||||
|
||||
if (curPatch.coupled())
|
||||
{
|
||||
WarningIn("mirrorFvMesh::mirrorFvMesh(const IOobject&)")
|
||||
<< "Found coupled patch " << curPatch.name() << endl
|
||||
<< " Mirroring faces on coupled patches destroys"
|
||||
<< " the ordering. This might be fixed by running a dummy"
|
||||
<< " createPatch afterwards." << endl;
|
||||
}
|
||||
|
||||
boolList& curInsBouFace = insertedBouFace[patchI];
|
||||
|
||||
curInsBouFace.setSize(curPatch.size());
|
||||
|
@ -268,10 +268,7 @@ label twoDNess(const polyMesh& mesh)
|
||||
{
|
||||
const polyPatch& patch = patches[patchI];
|
||||
|
||||
if
|
||||
(
|
||||
typeid(patch) != typeid(wedgePolyPatch)
|
||||
)
|
||||
if (!isA<wedgePolyPatch>(patch))
|
||||
{
|
||||
const vectorField& n = patch.faceAreas();
|
||||
|
||||
|
@ -121,7 +121,7 @@ void writeVTK
|
||||
const fileName& vtkName
|
||||
)
|
||||
{
|
||||
if (typeid(currentSet) == typeid(faceSet))
|
||||
if (isA<faceSet>(currentSet))
|
||||
{
|
||||
// Faces of set with OpenFOAM faceID as value
|
||||
|
||||
@ -148,7 +148,7 @@ void writeVTK
|
||||
mesh.time().path()/vtkName
|
||||
);
|
||||
}
|
||||
else if (typeid(currentSet) == typeid(cellSet))
|
||||
else if (isA<cellSet>(currentSet))
|
||||
{
|
||||
// External faces of cellset with OpenFOAM cellID as value
|
||||
|
||||
@ -208,7 +208,7 @@ void writeVTK
|
||||
mesh.time().path()/vtkName
|
||||
);
|
||||
}
|
||||
else if (typeid(currentSet) == typeid(pointSet))
|
||||
else if (isA<pointSet>(currentSet))
|
||||
{
|
||||
writePointSet
|
||||
(
|
||||
|
@ -160,12 +160,8 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew)
|
||||
|
||||
|
||||
// Adds patch if not yet there. Returns patchID.
|
||||
label addPatch
|
||||
(
|
||||
fvMesh& mesh,
|
||||
const word& patchName,
|
||||
const word& patchType
|
||||
)
|
||||
template<class PatchType>
|
||||
label addPatch(fvMesh& mesh, const word& patchName)
|
||||
{
|
||||
polyBoundaryMesh& polyPatches =
|
||||
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
|
||||
@ -173,11 +169,18 @@ label addPatch
|
||||
label patchI = polyPatches.findPatchID(patchName);
|
||||
if (patchI != -1)
|
||||
{
|
||||
if (polyPatches[patchI].type() == patchType)
|
||||
if (isA<PatchType>(polyPatches[patchI]))
|
||||
{
|
||||
// Already there
|
||||
return patchI;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("addPatch<PatchType>(fvMesh&, const word&)")
|
||||
<< "Already have patch " << patchName
|
||||
<< " but of type " << PatchType::typeName
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +217,7 @@ label addPatch
|
||||
sz,
|
||||
polyPatch::New
|
||||
(
|
||||
patchType,
|
||||
PatchType::typeName,
|
||||
patchName,
|
||||
0, // size
|
||||
startFaceI,
|
||||
@ -1021,17 +1024,15 @@ EdgeMap<label> addRegionPatches
|
||||
|
||||
if (interfaceSizes[e] > 0)
|
||||
{
|
||||
label patchI = addPatch
|
||||
label patchI = addPatch<directMappedWallPolyPatch>
|
||||
(
|
||||
mesh,
|
||||
regionNames[e[0]] + "_to_" + regionNames[e[1]],
|
||||
directMappedWallPolyPatch::typeName
|
||||
regionNames[e[0]] + "_to_" + regionNames[e[1]]
|
||||
);
|
||||
addPatch
|
||||
addPatch<directMappedWallPolyPatch>
|
||||
(
|
||||
mesh,
|
||||
regionNames[e[1]] + "_to_" + regionNames[e[0]],
|
||||
directMappedWallPolyPatch::typeName
|
||||
regionNames[e[1]] + "_to_" + regionNames[e[0]]
|
||||
);
|
||||
|
||||
Info<< "For interface between region " << e[0]
|
||||
@ -1405,7 +1406,7 @@ int main(int argc, char *argv[])
|
||||
IOobject
|
||||
(
|
||||
"cellToRegion",
|
||||
mesh.facesInstance(),
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
|
@ -243,7 +243,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
|
||||
const label patchStart = patches[patchi].start();
|
||||
|
||||
if (typeid(patches[patchi]) != typeid(cyclicPolyPatch))
|
||||
if (!isA<cyclicPolyPatch>(patches[patchi]))
|
||||
{
|
||||
// Normal patch. Add faces to processor where the cell
|
||||
// next to the face lives
|
||||
|
@ -237,23 +237,28 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (writeCellDist)
|
||||
{
|
||||
const labelList& procIds = mesh.cellToProc();
|
||||
|
||||
// Write the decomposition as labelList for use with 'manual'
|
||||
// decomposition method.
|
||||
|
||||
// FIXME: may attempt to write to a non-existent "region0/"
|
||||
OFstream os
|
||||
labelIOList cellDecomposition
|
||||
(
|
||||
runTime.path()
|
||||
/ mesh.facesInstance()
|
||||
/ regionName
|
||||
/ "cellDecomposition"
|
||||
IOobject
|
||||
(
|
||||
"cellDecomposition",
|
||||
mesh.facesInstance(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
procIds
|
||||
);
|
||||
|
||||
os << mesh.cellToProc();
|
||||
cellDecomposition.write();
|
||||
|
||||
Info<< nl << "Wrote decomposition to "
|
||||
<< os.name() << " for use in manual decomposition."
|
||||
<< endl;
|
||||
<< cellDecomposition.objectPath()
|
||||
<< " for use in manual decomposition." << endl;
|
||||
|
||||
// Write as volScalarField for postprocessing.
|
||||
volScalarField cellDist
|
||||
@ -271,7 +276,6 @@ int main(int argc, char *argv[])
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
const labelList& procIds = mesh.cellToProc();
|
||||
forAll(procIds, celli)
|
||||
{
|
||||
cellDist[celli] = procIds[celli];
|
||||
|
@ -191,7 +191,7 @@ Foam::fvFieldReconstructor::reconstructFvVolumeField
|
||||
// add empty patches
|
||||
if
|
||||
(
|
||||
typeid(mesh_.boundary()[patchI]) == typeid(emptyFvPatch)
|
||||
isType<emptyFvPatch>(mesh_.boundary()[patchI])
|
||||
&& !patchFields(patchI)
|
||||
)
|
||||
{
|
||||
@ -411,7 +411,7 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
|
||||
// add empty patches
|
||||
if
|
||||
(
|
||||
typeid(mesh_.boundary()[patchI]) == typeid(emptyFvPatch)
|
||||
isType<emptyFvPatch>(mesh_.boundary()[patchI])
|
||||
&& !patchFields(patchI)
|
||||
)
|
||||
{
|
||||
|
@ -127,8 +127,8 @@ Foam::fieldviewTopology::fieldviewTopology
|
||||
const polyPatch& currPatch = mesh.boundaryMesh()[patchI];
|
||||
if
|
||||
(
|
||||
isType<wallPolyPatch>(currPatch)
|
||||
|| isType<symmetryPolyPatch>(currPatch)
|
||||
isA<wallPolyPatch>(currPatch)
|
||||
|| isA<symmetryPolyPatch>(currPatch)
|
||||
)
|
||||
{
|
||||
forAll(currPatch, patchFaceI)
|
||||
|
@ -205,8 +205,8 @@ labelList getSelectedPatches
|
||||
|
||||
if
|
||||
(
|
||||
isType<emptyPolyPatch>(pp)
|
||||
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
|
||||
isA<emptyPolyPatch>(pp)
|
||||
|| (Pstream::parRun() && isA<processorPolyPatch>(pp))
|
||||
)
|
||||
{
|
||||
Info<< " discarding empty/processor patch " << patchI
|
||||
@ -805,7 +805,7 @@ int main(int argc, char *argv[])
|
||||
labelList(1, patchI)
|
||||
);
|
||||
|
||||
if (!isType<emptyPolyPatch>(pp))
|
||||
if (!isA<emptyPolyPatch>(pp))
|
||||
{
|
||||
// VolFields + patchID
|
||||
writeFuns::writeCellDataHeader
|
||||
|
@ -152,7 +152,7 @@ void Foam::patchWriter::writePatchIDs()
|
||||
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
||||
|
||||
if (!isType<emptyPolyPatch>(pp))
|
||||
if (!isA<emptyPolyPatch>(pp))
|
||||
{
|
||||
writeFuns::insert(scalarField(pp.size(), patchI), fField);
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ void user_query_file_function
|
||||
|
||||
strcpy(face_type_names[patchI], patch.name().c_str());
|
||||
|
||||
if (isType<wallPolyPatch>(patch))
|
||||
if (isA<wallPolyPatch>(patch))
|
||||
{
|
||||
wall_flags[patchI] = 1;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Give patch area
|
||||
if (isType<cyclicPolyPatch>(mesh.boundaryMesh()[patchi]))
|
||||
if (isA<cyclicPolyPatch>(mesh.boundaryMesh()[patchi]))
|
||||
{
|
||||
Info<< " Cyclic patch vector area: " << nl;
|
||||
label nFaces = mesh.boundaryMesh()[patchi].size();
|
||||
|
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "\nWall heat fluxes [W]" << endl;
|
||||
forAll(patchHeatFlux, patchi)
|
||||
{
|
||||
if (typeid(mesh.boundary()[patchi]) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(mesh.boundary()[patchi]))
|
||||
{
|
||||
Info<< mesh.boundary()[patchi].name()
|
||||
<< " "
|
||||
|
@ -109,7 +109,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const fvPatch& currPatch = patches[patchi];
|
||||
|
||||
if (typeid(currPatch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(currPatch))
|
||||
{
|
||||
yPlus.boundaryField()[patchi] =
|
||||
d[patchi]
|
||||
|
@ -202,7 +202,7 @@ void replaceBoundaryType
|
||||
dictionary& boundaryDict = dict.subDict("boundaryField");
|
||||
forAll(bMesh, patchI)
|
||||
{
|
||||
if (isType<wallPolyPatch>(bMesh[patchI]))
|
||||
if (isA<wallPolyPatch>(bMesh[patchI]))
|
||||
{
|
||||
word patchName = bMesh[patchI].name();
|
||||
dictionary& oldPatch = boundaryDict.subDict(patchName);
|
||||
|
@ -164,7 +164,7 @@ void mapConsistentSubMesh
|
||||
|
||||
forAll(meshTarget.boundary(), patchi)
|
||||
{
|
||||
if (typeid(meshTarget.boundary()[patchi]) != typeid(processorFvPatch))
|
||||
if (!isA<processorFvPatch>(meshTarget.boundary()[patchi]))
|
||||
{
|
||||
patchMap.insert
|
||||
(
|
||||
@ -201,7 +201,7 @@ wordList addProcessorPatches
|
||||
|
||||
forAll (meshTarget.boundary(), patchi)
|
||||
{
|
||||
if (typeid(meshTarget.boundary()[patchi]) == typeid(processorFvPatch))
|
||||
if (isA<processorFvPatch>(meshTarget.boundary()[patchi]))
|
||||
{
|
||||
if
|
||||
(
|
||||
|
@ -108,11 +108,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const polyPatch& patch = bMesh[patchI];
|
||||
|
||||
if
|
||||
(
|
||||
includeProcPatches
|
||||
|| (patch.type() != processorPolyPatch::typeName)
|
||||
)
|
||||
if (includeProcPatches || !isA<processorPolyPatch>(patch))
|
||||
{
|
||||
includePatches.insert(patchI);
|
||||
}
|
||||
|
@ -282,13 +282,13 @@ void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
|
||||
}
|
||||
|
||||
|
||||
// Check if patches of given type name are present
|
||||
// Check if has cyclic patches
|
||||
template <class Type>
|
||||
bool Foam::FaceCellWave<Type>::hasPatchType(const word& nameOfType)
|
||||
bool Foam::FaceCellWave<Type>::hasCyclicPatch() const
|
||||
{
|
||||
forAll(mesh_.boundaryMesh(), patchI)
|
||||
{
|
||||
if (mesh_.boundaryMesh()[patchI].type() == nameOfType)
|
||||
if (isA<cyclicPolyPatch>(mesh_.boundaryMesh()[patchI]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -811,7 +811,7 @@ Foam::FaceCellWave<Type>::FaceCellWave
|
||||
changedCell_(mesh_.nCells(), false),
|
||||
changedCells_(mesh_.nCells()),
|
||||
nChangedCells_(0),
|
||||
hasCyclicPatches_(hasPatchType(cyclicPolyPatch::typeName)),
|
||||
hasCyclicPatches_(hasCyclicPatch()),
|
||||
nEvals_(0),
|
||||
nUnvisitedCells_(mesh_.nCells()),
|
||||
nUnvisitedFaces_(mesh_.nFaces()),
|
||||
@ -841,7 +841,7 @@ Foam::FaceCellWave<Type>::FaceCellWave
|
||||
changedCell_(mesh_.nCells(), false),
|
||||
changedCells_(mesh_.nCells()),
|
||||
nChangedCells_(0),
|
||||
hasCyclicPatches_(hasPatchType(cyclicPolyPatch::typeName)),
|
||||
hasCyclicPatches_(hasCyclicPatch()),
|
||||
nEvals_(0),
|
||||
nUnvisitedCells_(mesh_.nCells()),
|
||||
nUnvisitedFaces_(mesh_.nFaces()),
|
||||
|
@ -184,8 +184,8 @@ class FaceCellWave
|
||||
//- Debugging: check info on both sides of cyclic
|
||||
void checkCyclic(const polyPatch& pPatch) const;
|
||||
|
||||
//- Has patches of certain type?
|
||||
bool hasPatchType(const word& nameOfType);
|
||||
//- Has cyclic patch?
|
||||
bool hasCyclicPatch() const;
|
||||
|
||||
//- Merge received patch data into global data
|
||||
void mergeFaceInfo
|
||||
|
@ -47,7 +47,7 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
|
||||
{
|
||||
const Patch& patch = patches[patchi];
|
||||
|
||||
if (isType<ProcPatch>(patch))
|
||||
if (isA<ProcPatch>(patch))
|
||||
{
|
||||
const ProcPatch& procPatch =
|
||||
refCast<const ProcPatch>(patch);
|
||||
@ -69,7 +69,7 @@ Foam::labelList Foam::ProcessorTopology<Patch, ProcPatch>::procNeighbours
|
||||
{
|
||||
const Patch& patch = patches[patchi];
|
||||
|
||||
if (isType<ProcPatch>(patch))
|
||||
if (isA<ProcPatch>(patch))
|
||||
{
|
||||
const ProcPatch& procPatch =
|
||||
refCast<const ProcPatch>(patch);
|
||||
@ -116,7 +116,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if (!isType<ProcPatch>(patches[patchi]))
|
||||
if (!isA<ProcPatch>(patches[patchi]))
|
||||
{
|
||||
patchSchedule_[patchEvali].patch = patchi;
|
||||
patchSchedule_[patchEvali++].init = true;
|
||||
@ -204,7 +204,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if (!isType<ProcPatch>(patches[patchi]))
|
||||
if (!isA<ProcPatch>(patches[patchi]))
|
||||
{
|
||||
patchSchedule_[patchEvali].patch = patchi;
|
||||
patchSchedule_[patchEvali++].init = true;
|
||||
@ -219,7 +219,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
||||
// 2a. initEvaluate
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if (isType<ProcPatch>(patches[patchi]))
|
||||
if (isA<ProcPatch>(patches[patchi]))
|
||||
{
|
||||
patchSchedule_[patchEvali].patch = patchi;
|
||||
patchSchedule_[patchEvali++].init = true;
|
||||
@ -229,7 +229,7 @@ Foam::ProcessorTopology<Patch, ProcPatch>::ProcessorTopology
|
||||
// 2b. evaluate
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if (isType<ProcPatch>(patches[patchi]))
|
||||
if (isA<ProcPatch>(patches[patchi]))
|
||||
{
|
||||
patchSchedule_[patchEvali].patch = patchi;
|
||||
patchSchedule_[patchEvali++].init = false;
|
||||
|
@ -158,11 +158,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
|
||||
forAll(pMesh.boundaryMesh(), patchI)
|
||||
{
|
||||
const polyPatch& pPatch = pMesh.boundaryMesh()[patchI];
|
||||
if
|
||||
(
|
||||
pPatch.size()
|
||||
&& typeid(pPatch) != typeid(processorPolyPatch)
|
||||
)
|
||||
if (pPatch.size() && !isA<processorPolyPatch>(pPatch))
|
||||
{
|
||||
partsList_.set
|
||||
(
|
||||
|
@ -31,6 +31,7 @@ License
|
||||
#include "fvMeshAdder.H"
|
||||
#include "faceCoupleInfo.H"
|
||||
#include "processorFvPatchField.H"
|
||||
#include "processorFvsPatchField.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "removeCells.H"
|
||||
#include "polyModifyFace.H"
|
||||
@ -2124,54 +2125,56 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
|
||||
|
||||
// Bit of hack: processorFvPatchField does not get reset since created
|
||||
// from nothing so explicitly reset.
|
||||
initPatchFields<volScalarField>
|
||||
initPatchFields<volScalarField, processorFvPatchField<scalar> >
|
||||
(
|
||||
processorFvPatchField<scalar>::typeName,
|
||||
pTraits<scalar>::zero
|
||||
);
|
||||
initPatchFields<volVectorField>
|
||||
initPatchFields<volVectorField, processorFvPatchField<vector> >
|
||||
(
|
||||
processorFvPatchField<vector>::typeName,
|
||||
pTraits<vector>::zero
|
||||
);
|
||||
initPatchFields<volSphericalTensorField>
|
||||
initPatchFields
|
||||
<
|
||||
volSphericalTensorField,
|
||||
processorFvPatchField<sphericalTensor>
|
||||
>
|
||||
(
|
||||
processorFvPatchField<sphericalTensor>::typeName,
|
||||
pTraits<sphericalTensor>::zero
|
||||
);
|
||||
initPatchFields<volSymmTensorField>
|
||||
initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor> >
|
||||
(
|
||||
processorFvPatchField<symmTensor>::typeName,
|
||||
pTraits<symmTensor>::zero
|
||||
);
|
||||
initPatchFields<volTensorField>
|
||||
initPatchFields<volTensorField, processorFvPatchField<tensor> >
|
||||
(
|
||||
processorFvPatchField<tensor>::typeName,
|
||||
pTraits<tensor>::zero
|
||||
);
|
||||
initPatchFields<surfaceScalarField>
|
||||
initPatchFields<surfaceScalarField, processorFvsPatchField<scalar> >
|
||||
(
|
||||
processorFvPatchField<scalar>::typeName,
|
||||
pTraits<scalar>::zero
|
||||
);
|
||||
initPatchFields<surfaceVectorField>
|
||||
initPatchFields<surfaceVectorField, processorFvsPatchField<vector> >
|
||||
(
|
||||
processorFvPatchField<vector>::typeName,
|
||||
pTraits<vector>::zero
|
||||
);
|
||||
initPatchFields<surfaceSphericalTensorField>
|
||||
initPatchFields
|
||||
<
|
||||
surfaceSphericalTensorField,
|
||||
processorFvsPatchField<sphericalTensor>
|
||||
>
|
||||
(
|
||||
processorFvPatchField<sphericalTensor>::typeName,
|
||||
pTraits<sphericalTensor>::zero
|
||||
);
|
||||
initPatchFields<surfaceSymmTensorField>
|
||||
initPatchFields
|
||||
<
|
||||
surfaceSymmTensorField,
|
||||
processorFvsPatchField<symmTensor>
|
||||
>
|
||||
(
|
||||
processorFvPatchField<symmTensor>::typeName,
|
||||
pTraits<symmTensor>::zero
|
||||
);
|
||||
initPatchFields<surfaceTensorField>
|
||||
initPatchFields<surfaceTensorField, processorFvsPatchField<tensor> >
|
||||
(
|
||||
processorFvPatchField<tensor>::typeName,
|
||||
pTraits<tensor>::zero
|
||||
);
|
||||
|
||||
|
@ -164,10 +164,9 @@ class fvMeshDistribute
|
||||
);
|
||||
|
||||
//- Init patch fields of certain type
|
||||
template<class GeoField>
|
||||
template<class GeoField, class PatchFieldType>
|
||||
void initPatchFields
|
||||
(
|
||||
const word& patchFieldType,
|
||||
const typename GeoField::value_type& initVal
|
||||
);
|
||||
|
||||
|
@ -235,10 +235,9 @@ void Foam::fvMeshDistribute::mapBoundaryFields
|
||||
|
||||
|
||||
// Init patch fields of certain type
|
||||
template<class GeoField>
|
||||
template<class GeoField, class PatchFieldType>
|
||||
void Foam::fvMeshDistribute::initPatchFields
|
||||
(
|
||||
const word& patchFieldType,
|
||||
const typename GeoField::value_type& initVal
|
||||
)
|
||||
{
|
||||
@ -264,7 +263,7 @@ void Foam::fvMeshDistribute::initPatchFields
|
||||
|
||||
forAll(bfld, patchI)
|
||||
{
|
||||
if (bfld[patchI].type() == patchFieldType)
|
||||
if (isA<PatchFieldType>(bfld[patchI]))
|
||||
{
|
||||
bfld[patchI] == initVal;
|
||||
}
|
||||
|
@ -774,7 +774,7 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
", polyTopoChange&)"
|
||||
) << "boundary-edge-to-be-extruded:"
|
||||
<< pp.points()[meshPoints[e[0]]]
|
||||
<< pp.points()[meshPoints[e[0]]]
|
||||
<< pp.points()[meshPoints[e[1]]]
|
||||
<< " has more than two faces using it:" << eFaces
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -816,7 +816,7 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
", polyTopoChange&)"
|
||||
) << "boundary-edge-to-be-extruded:"
|
||||
<< pp.points()[meshPoints[e[0]]]
|
||||
<< pp.points()[meshPoints[e[0]]]
|
||||
<< pp.points()[meshPoints[e[1]]]
|
||||
<< " has more than two boundary faces"
|
||||
<< " using it:"
|
||||
<< bFaceI << " fc:"
|
||||
|
@ -52,7 +52,7 @@ bool Foam::adjustPhi
|
||||
const fvPatchVectorField& Up = U.boundaryField()[patchi];
|
||||
const fvsPatchScalarField& phip = phi.boundaryField()[patchi];
|
||||
|
||||
if (!isType<processorFvsPatchScalarField>(phip))
|
||||
if (!isA<processorFvsPatchScalarField>(phip))
|
||||
{
|
||||
if
|
||||
(
|
||||
@ -128,7 +128,7 @@ bool Foam::adjustPhi
|
||||
const fvPatchVectorField& Up = U.boundaryField()[patchi];
|
||||
fvsPatchScalarField& phip = phi.boundaryField()[patchi];
|
||||
|
||||
if (!isType<processorFvsPatchScalarField>(phip))
|
||||
if (!isA<processorFvsPatchScalarField>(phip))
|
||||
{
|
||||
if
|
||||
(
|
||||
|
@ -1,4 +1,4 @@
|
||||
if (!isType<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
|
||||
if (!isA<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
|
||||
{
|
||||
FatalErrorIn("wall-function evaluation")
|
||||
<< k_.boundaryField()[patchi].type()
|
||||
@ -8,7 +8,7 @@ if (!isType<zeroGradientFvPatchScalarField>(k_.boundaryField()[patchi]))
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (!isType<zeroGradientFvPatchScalarField>(epsilon_.boundaryField()[patchi]))
|
||||
if (!isA<zeroGradientFvPatchScalarField>(epsilon_.boundaryField()[patchi]))
|
||||
{
|
||||
FatalErrorIn("wall-function evaluation")
|
||||
<< epsilon_.boundaryField()[patchi].type()
|
||||
|
@ -111,7 +111,7 @@ void Foam::fvMeshSubset::doCoupledPatches
|
||||
{
|
||||
const polyPatch& pp = oldPatches[oldPatchI];
|
||||
|
||||
if (typeid(pp) == typeid(processorPolyPatch))
|
||||
if (isA<processorPolyPatch>(pp))
|
||||
{
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(pp);
|
||||
@ -133,7 +133,7 @@ void Foam::fvMeshSubset::doCoupledPatches
|
||||
{
|
||||
const polyPatch& pp = oldPatches[oldPatchI];
|
||||
|
||||
if (typeid(pp) == typeid(processorPolyPatch))
|
||||
if (isA<processorPolyPatch>(pp))
|
||||
{
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(pp);
|
||||
@ -171,7 +171,7 @@ void Foam::fvMeshSubset::doCoupledPatches
|
||||
{
|
||||
const polyPatch& pp = oldPatches[oldPatchI];
|
||||
|
||||
if (typeid(pp) == typeid(cyclicPolyPatch))
|
||||
if (isA<cyclicPolyPatch>(pp))
|
||||
{
|
||||
const cyclicPolyPatch& cycPatch =
|
||||
refCast<const cyclicPolyPatch>(pp);
|
||||
|
@ -36,7 +36,7 @@ SourceFiles
|
||||
#ifndef directMappedWallFvPatch_H
|
||||
#define directMappedWallFvPatch_H
|
||||
|
||||
#include "fvPatch.H"
|
||||
#include "wallFvPatch.H"
|
||||
#include "directMappedWallPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -45,12 +45,12 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class directMappedWallFvPatch Declaration
|
||||
Class directMappedWallFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class directMappedWallFvPatch
|
||||
:
|
||||
public fvPatch
|
||||
public wallFvPatch
|
||||
{
|
||||
|
||||
public:
|
||||
@ -68,7 +68,7 @@ public:
|
||||
const fvBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
fvPatch(patch, bm)
|
||||
wallFvPatch(patch, bm)
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -37,13 +37,7 @@ void Foam::nearWallDist::doAll()
|
||||
cellDistFuncs wallUtils(mesh_);
|
||||
|
||||
// Get patch ids of walls
|
||||
labelHashSet wallPatchIDs
|
||||
(
|
||||
wallUtils.getPatchIDs
|
||||
(
|
||||
wallPolyPatch::typeName
|
||||
)
|
||||
);
|
||||
labelHashSet wallPatchIDs(wallUtils.getPatchIDs<wallPolyPatch>());
|
||||
|
||||
// Size neighbours array for maximum possible
|
||||
|
||||
@ -60,7 +54,7 @@ void Foam::nearWallDist::doAll()
|
||||
|
||||
const fvPatch& patch = mesh_.boundary()[patchI];
|
||||
|
||||
if (patch.type() == wallFvPatch::typeName)
|
||||
if (isA<wallFvPatch>(patch))
|
||||
{
|
||||
const polyPatch& pPatch = patch.patch();
|
||||
|
||||
|
@ -41,7 +41,7 @@ void Foam::nearWallDistNoSearch::doAll()
|
||||
{
|
||||
fvPatchScalarField& ypatch = operator[](patchI);
|
||||
|
||||
if (patches[patchI].type() == wallFvPatch::typeName)
|
||||
if (isA<wallFvPatch>(patches[patchI]))
|
||||
{
|
||||
const unallocLabelList& faceCells = patches[patchI].faceCells();
|
||||
|
||||
|
@ -60,7 +60,7 @@ void Foam::reflectionVectors::correct()
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
// find the nearest face for every cell
|
||||
if (patches[patchi].type() == wallFvPatch::typeName)
|
||||
if (isA<wallFvPatch>(patches[patchi]))
|
||||
{
|
||||
n_.boundaryField()[patchi] =
|
||||
mesh.Sf().boundaryField()[patchi]
|
||||
|
@ -68,7 +68,7 @@ Foam::wallDist::~wallDist()
|
||||
void Foam::wallDist::correct()
|
||||
{
|
||||
// Get patchids of walls
|
||||
labelHashSet wallPatchIDs(getPatchIDs(wallPolyPatch::typeName));
|
||||
labelHashSet wallPatchIDs(getPatchIDs<wallPolyPatch>());
|
||||
|
||||
// Calculate distance starting from wallPatch faces.
|
||||
patchWave wave(cellDistFuncs::mesh(), wallPatchIDs, correctWalls_);
|
||||
@ -79,7 +79,7 @@ void Foam::wallDist::correct()
|
||||
// Transfer values on patches into boundaryField of *this
|
||||
forAll(boundaryField(), patchI)
|
||||
{
|
||||
if (boundaryField()[patchI].type() != emptyFvPatchScalarField::typeName)
|
||||
if (!isA<emptyFvPatchScalarField>(boundaryField()[patchI]))
|
||||
{
|
||||
scalarField& waveFld = wave.patchDistance()[patchI];
|
||||
|
||||
|
@ -80,7 +80,7 @@ void Foam::wallDistData<TransferType>::correct()
|
||||
//
|
||||
|
||||
// Get patchids of walls
|
||||
labelHashSet wallPatchIDs(getPatchIDs(wallPolyPatch::typeName));
|
||||
labelHashSet wallPatchIDs(getPatchIDs<wallPolyPatch>());
|
||||
|
||||
// Collect pointers to data on patches
|
||||
UPtrList<Field<Type> > patchData(mesh.boundaryMesh().size());
|
||||
@ -109,7 +109,7 @@ void Foam::wallDistData<TransferType>::correct()
|
||||
{
|
||||
scalarField& waveFld = wave.patchDistance()[patchI];
|
||||
|
||||
if (boundaryField()[patchI].type() != emptyFvPatchScalarField::typeName)
|
||||
if (!isA<emptyFvPatchScalarField>(boundaryField()[patchI]))
|
||||
{
|
||||
boundaryField()[patchI].transfer(waveFld);
|
||||
|
||||
|
@ -367,7 +367,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField
|
||||
new scalarField
|
||||
(
|
||||
this->size(),
|
||||
fieldToken.scalarToken()
|
||||
fieldToken.number()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
if (isType<wallPolyPatch>(pbMesh[patch(face())]))
|
||||
if (isA<wallPolyPatch>(pbMesh[patch(face())]))
|
||||
{
|
||||
keepParcel = sDB.wall().wallTreatment(*this, face());
|
||||
|
||||
@ -12,7 +12,7 @@ if (isType<wallPolyPatch>(pbMesh[patch(face())]))
|
||||
U() = (magUs/magV1)*v1*n() + vs*sDB.axisOfSymmetry();
|
||||
}
|
||||
}
|
||||
else if (isType<wedgePolyPatch>(pbMesh[patch(face())]))
|
||||
else if (isA<wedgePolyPatch>(pbMesh[patch(face())]))
|
||||
{
|
||||
// check if parcel is trying to move out of the domain
|
||||
label patchi = patch(face());
|
||||
@ -27,7 +27,7 @@ else if (isType<wedgePolyPatch>(pbMesh[patch(face())]))
|
||||
U() -= 2.0*Un2*n();
|
||||
}
|
||||
}
|
||||
else if (isType<symmetryPolyPatch>(pbMesh[patch(face())]))
|
||||
else if (isA<symmetryPolyPatch>(pbMesh[patch(face())]))
|
||||
{
|
||||
// check if parcel is trying to move out of the domain
|
||||
label patchi = patch(face());
|
||||
|
@ -314,7 +314,7 @@ bool Foam::parcel::move(spray& sDB)
|
||||
{
|
||||
if (face() > -1)
|
||||
{
|
||||
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
|
||||
if (isA<processorPolyPatch>(pbMesh[patch(face())]))
|
||||
{
|
||||
switchProcessor = true;
|
||||
}
|
||||
|
@ -242,11 +242,11 @@ Foam::spray::spray
|
||||
// check for the type of boundary condition
|
||||
forAll(bMesh, patchi)
|
||||
{
|
||||
if (isType<symmetryPolyPatch>(bMesh[patchi]))
|
||||
if (isA<symmetryPolyPatch>(bMesh[patchi]))
|
||||
{
|
||||
symPlaneExist = true;
|
||||
}
|
||||
else if (isType<wedgePolyPatch>(bMesh[patchi]))
|
||||
else if (isA<wedgePolyPatch>(bMesh[patchi]))
|
||||
{
|
||||
wedgeExist = true;
|
||||
patches[n++] = patchi;
|
||||
|
@ -82,7 +82,7 @@ bool reflectParcel::wallTreatment
|
||||
|
||||
const polyMesh& mesh = spray_.mesh();
|
||||
|
||||
if (isType<wallPolyPatch>(mesh_.boundaryMesh()[patchi]))
|
||||
if (isA<wallPolyPatch>(mesh_.boundaryMesh()[patchi]))
|
||||
{
|
||||
// wallNormal defined to point outwards of domain
|
||||
vector Sf = mesh_.Sf().boundaryField()[patchi][facei];
|
||||
|
@ -60,7 +60,7 @@ bool Foam::DsmcParcel<ParcelType>::move
|
||||
|
||||
if (p.onBoundary() && td.keepParticle)
|
||||
{
|
||||
if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())]))
|
||||
if (isA<processorPolyPatch>(pbMesh[p.patch(p.face())]))
|
||||
{
|
||||
td.switchProcessor = true;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ Foam::FreeStream<CloudType>::FreeStream
|
||||
{
|
||||
const polyPatch& patch = cloud.mesh().boundaryMesh()[p];
|
||||
|
||||
if (patch.type() == polyPatch::typeName)
|
||||
if (isType<polyPatch>(patch))
|
||||
{
|
||||
patches.append(p);
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
|
||||
|
||||
if (p.onBoundary() && td.keepParticle)
|
||||
{
|
||||
if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())]))
|
||||
if (isA<processorPolyPatch>(pbMesh[p.patch(p.face())]))
|
||||
{
|
||||
td.switchProcessor = true;
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ void Foam::referredCellList::buildReferredCellList
|
||||
// boundaries. Separate treatment allows the serial version to run
|
||||
// transparently.
|
||||
|
||||
if (mesh.boundaryMesh()[patchI].type() == "cyclic")
|
||||
if (isA<cyclicPolyPatch>(mesh.boundaryMesh()[patchI]))
|
||||
{
|
||||
const cyclicPolyPatch& patch = refCast<const cyclicPolyPatch>
|
||||
(
|
||||
|
@ -84,7 +84,7 @@ bool Foam::solidParticle::move(solidParticle::trackData& td)
|
||||
|
||||
if (onBoundary() && td.keepParticle)
|
||||
{
|
||||
if (isType<processorPolyPatch>(pbMesh[patch(face())]))
|
||||
if (isA<processorPolyPatch>(pbMesh[patch(face())]))
|
||||
{
|
||||
td.switchProcessor = true;
|
||||
}
|
||||
|
@ -104,27 +104,6 @@ Foam::labelHashSet Foam::cellDistFuncs::getPatchIDs
|
||||
}
|
||||
|
||||
|
||||
// Get patch ids of patches of certain type (e.g. 'polyProcessorPatch')
|
||||
Foam::labelHashSet Foam::cellDistFuncs::getPatchIDs(const word& wantedType)
|
||||
const
|
||||
{
|
||||
const polyBoundaryMesh& bMesh = mesh().boundaryMesh();
|
||||
|
||||
labelHashSet patchIDs(bMesh.size());
|
||||
|
||||
forAll(bMesh, patchI)
|
||||
{
|
||||
const polyPatch& patch = bMesh[patchI];
|
||||
|
||||
if (patch.type() == wantedType)
|
||||
{
|
||||
patchIDs.insert(patchI);
|
||||
}
|
||||
}
|
||||
return patchIDs;
|
||||
}
|
||||
|
||||
|
||||
// Return smallest true distance from p to any of wallFaces.
|
||||
// Note that even if normal hits face we still check other faces.
|
||||
// Note that wallFaces is untruncated and we explicitly pass in size.
|
||||
|
@ -30,6 +30,7 @@ Description
|
||||
|
||||
SourceFiles
|
||||
cellDistFuncs.C
|
||||
cellDistFuncsTemplates.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -101,8 +102,10 @@ public:
|
||||
//- Get patchIDs of named patches
|
||||
labelHashSet getPatchIDs(const wordList&) const;
|
||||
|
||||
//- Get patchIDs of certain type (e.g. 'processorPolyPatch')
|
||||
labelHashSet getPatchIDs(const word&) const;
|
||||
//- Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
|
||||
// Uses isA, not isType
|
||||
template<class Type>
|
||||
labelHashSet getPatchIDs() const;
|
||||
|
||||
//- Calculate smallest true distance (and face index)
|
||||
// from pt to faces wallFaces.
|
||||
@ -159,6 +162,12 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "cellDistFuncsTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
52
src/meshTools/cellDist/cellDistFuncsTemplates.C
Normal file
52
src/meshTools/cellDist/cellDistFuncsTemplates.C
Normal file
@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "cellDistFuncs.H"
|
||||
#include "polyMesh.H"
|
||||
#include "polyBoundaryMesh.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::labelHashSet Foam::cellDistFuncs::getPatchIDs() const
|
||||
{
|
||||
const polyBoundaryMesh& bMesh = mesh().boundaryMesh();
|
||||
|
||||
labelHashSet patchIDs(bMesh.size());
|
||||
|
||||
forAll(bMesh, patchI)
|
||||
{
|
||||
if (isA<Type>(bMesh[patchI]))
|
||||
{
|
||||
patchIDs.insert(patchI);
|
||||
}
|
||||
}
|
||||
return patchIDs;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
@ -36,7 +36,7 @@ SourceFiles
|
||||
#ifndef directMappedWallPointPatch_H
|
||||
#define directMappedWallPointPatch_H
|
||||
|
||||
#include "facePointPatch.H"
|
||||
#include "wallPointPatch.H"
|
||||
#include "directMappedWallPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -50,7 +50,7 @@ namespace Foam
|
||||
|
||||
class directMappedWallPointPatch
|
||||
:
|
||||
public facePointPatch
|
||||
public wallPointPatch
|
||||
{
|
||||
|
||||
public:
|
||||
@ -68,7 +68,7 @@ public:
|
||||
const pointBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
facePointPatch(patch, bm)
|
||||
wallPointPatch(patch, bm)
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -366,14 +366,24 @@ void Foam::directMappedPatchBase::calcMapping() const
|
||||
if
|
||||
(
|
||||
offset_ == vector::zero
|
||||
&& mode_ == NEARESTPATCHFACE
|
||||
&& sampleRegion_ == patch_.boundaryMesh().mesh().name()
|
||||
&& samplePatch_ == patch_.name()
|
||||
)
|
||||
{
|
||||
FatalErrorIn("directMappedPatchBase::calcMapping() const")
|
||||
WarningIn("directMappedPatchBase::calcMapping() const")
|
||||
<< "Invalid offset " << offset_ << endl
|
||||
<< "Offset is the vector added to the patch face centres to"
|
||||
<< " find the cell supplying the data."
|
||||
<< exit(FatalError);
|
||||
<< " find the patch face supplying the data." << endl
|
||||
<< "Setting it to " << offset_
|
||||
<< " on the same patch, on the same region"
|
||||
<< " will find the faces themselves which does not make sense"
|
||||
<< " for anything but testing." << endl
|
||||
<< "patch_:" << patch_.name() << endl
|
||||
<< "sampleRegion_:" << sampleRegion_ << endl
|
||||
<< "mode_:" << sampleModeNames_[mode_] << endl
|
||||
<< "samplePatch_:" << samplePatch_ << endl
|
||||
<< "offset_:" << offset_ << endl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -113,7 +113,7 @@ void faceSet::sync(const polyMesh& mesh)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
|
||||
if (isType<processorPolyPatch>(pp))
|
||||
if (isA<processorPolyPatch>(pp))
|
||||
{
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(pp);
|
||||
@ -145,7 +145,7 @@ void faceSet::sync(const polyMesh& mesh)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
|
||||
if (isType<processorPolyPatch>(pp))
|
||||
if (isA<processorPolyPatch>(pp))
|
||||
{
|
||||
const processorPolyPatch& procPatch =
|
||||
refCast<const processorPolyPatch>(pp);
|
||||
@ -174,7 +174,7 @@ void faceSet::sync(const polyMesh& mesh)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
|
||||
if (typeid(pp) == typeid(cyclicPolyPatch))
|
||||
if (isA<cyclicPolyPatch>(pp))
|
||||
{
|
||||
const cyclicPolyPatch& cycPatch =
|
||||
refCast<const cyclicPolyPatch>(pp);
|
||||
|
@ -100,7 +100,7 @@ meshToMesh::meshToMesh
|
||||
forAll (toMesh_.boundaryMesh(), patchi)
|
||||
{
|
||||
// Add the processor patches in the toMesh to the cuttingPatches list
|
||||
if (toMesh_.boundaryMesh()[patchi].type() == processorFvPatch::typeName)
|
||||
if (isA<processorPolyPatch>(toMesh_.boundaryMesh()[patchi]))
|
||||
{
|
||||
cuttingPatches_.insert
|
||||
(
|
||||
|
@ -179,8 +179,8 @@ void Foam::thresholdCellFaces::calculate
|
||||
|
||||
if
|
||||
(
|
||||
isType<emptyPolyPatch>(p)
|
||||
|| (Pstream::parRun() && isType<processorPolyPatch>(p))
|
||||
isA<emptyPolyPatch>(p)
|
||||
|| (Pstream::parRun() && isA<processorPolyPatch>(p))
|
||||
)
|
||||
{
|
||||
continue;
|
||||
|
@ -73,6 +73,7 @@ Foam::thermalPorousZone::thermalPorousZone
|
||||
void Foam::thermalPorousZone::addEnthalpySource
|
||||
(
|
||||
const basicThermo& thermo,
|
||||
const volScalarField& rho,
|
||||
fvScalarMatrix& hEqn
|
||||
) const
|
||||
{
|
||||
@ -85,7 +86,6 @@ void Foam::thermalPorousZone::addEnthalpySource
|
||||
const scalarField& V = mesh().V();
|
||||
scalarField& hDiag = hEqn.diag();
|
||||
scalarField& hSource = hEqn.source();
|
||||
const scalarField& rho = thermo.rho();
|
||||
|
||||
scalarField hZone = thermo.h(scalarField(cells.size(), T_.value()), cells);
|
||||
scalar rate = 1e6;
|
||||
|
@ -138,6 +138,7 @@ public:
|
||||
void addEnthalpySource
|
||||
(
|
||||
const basicThermo& thermo,
|
||||
const volScalarField& rho,
|
||||
fvScalarMatrix& hEqn
|
||||
) const;
|
||||
};
|
||||
|
@ -50,12 +50,13 @@ Foam::thermalPorousZones::thermalPorousZones
|
||||
void Foam::thermalPorousZones::addEnthalpySource
|
||||
(
|
||||
const basicThermo& thermo,
|
||||
const volScalarField& rho,
|
||||
fvScalarMatrix& hEqn
|
||||
) const
|
||||
{
|
||||
forAll(*this, i)
|
||||
{
|
||||
operator[](i).addEnthalpySource(thermo, hEqn);
|
||||
operator[](i).addEnthalpySource(thermo, rho, hEqn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,6 +92,7 @@ public:
|
||||
void addEnthalpySource
|
||||
(
|
||||
const basicThermo& thermo,
|
||||
const volScalarField& rho,
|
||||
fvScalarMatrix& hEqn
|
||||
) const;
|
||||
};
|
||||
|
@ -175,7 +175,7 @@ void Foam::linearValveFvMesh::makeSlidersDead()
|
||||
// Enable layering
|
||||
forAll (topoChanges, modI)
|
||||
{
|
||||
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
|
||||
if (isA<slidingInterface>(topoChanges[modI]))
|
||||
{
|
||||
topoChanges[modI].disable();
|
||||
}
|
||||
@ -197,7 +197,7 @@ void Foam::linearValveFvMesh::makeSlidersLive()
|
||||
// Enable sliding interface
|
||||
forAll (topoChanges, modI)
|
||||
{
|
||||
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
|
||||
if (isA<slidingInterface>(topoChanges[modI]))
|
||||
{
|
||||
topoChanges[modI].enable();
|
||||
}
|
||||
@ -220,7 +220,7 @@ bool Foam::linearValveFvMesh::attached() const
|
||||
|
||||
forAll (topoChanges, modI)
|
||||
{
|
||||
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
|
||||
if (isA<slidingInterface>(topoChanges[modI]))
|
||||
{
|
||||
result =
|
||||
result
|
||||
@ -231,7 +231,7 @@ bool Foam::linearValveFvMesh::attached() const
|
||||
// Check thal all sliders are in sync (debug only)
|
||||
forAll (topoChanges, modI)
|
||||
{
|
||||
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
|
||||
if (isA<slidingInterface>(topoChanges[modI]))
|
||||
{
|
||||
if
|
||||
(
|
||||
|
@ -219,11 +219,11 @@ void Foam::linearValveLayersFvMesh::makeLayersLive()
|
||||
// Enable layering
|
||||
forAll (topoChanges, modI)
|
||||
{
|
||||
if (typeid(topoChanges[modI]) == typeid(layerAdditionRemoval))
|
||||
if (isA<layerAdditionRemoval>(topoChanges[modI]))
|
||||
{
|
||||
topoChanges[modI].enable();
|
||||
}
|
||||
else if (typeid(topoChanges[modI]) == typeid(slidingInterface))
|
||||
else if (isA<slidingInterface>(topoChanges[modI]))
|
||||
{
|
||||
topoChanges[modI].disable();
|
||||
}
|
||||
@ -245,11 +245,11 @@ void Foam::linearValveLayersFvMesh::makeSlidersLive()
|
||||
// Enable sliding interface
|
||||
forAll (topoChanges, modI)
|
||||
{
|
||||
if (typeid(topoChanges[modI]) == typeid(layerAdditionRemoval))
|
||||
if (isA<layerAdditionRemoval>(topoChanges[modI]))
|
||||
{
|
||||
topoChanges[modI].disable();
|
||||
}
|
||||
else if (typeid(topoChanges[modI]) == typeid(slidingInterface))
|
||||
else if (isA<slidingInterface>(topoChanges[modI]))
|
||||
{
|
||||
topoChanges[modI].enable();
|
||||
}
|
||||
@ -272,7 +272,7 @@ bool Foam::linearValveLayersFvMesh::attached() const
|
||||
|
||||
forAll (topoChanges, modI)
|
||||
{
|
||||
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
|
||||
if (isA<slidingInterface>(topoChanges[modI]))
|
||||
{
|
||||
result =
|
||||
result
|
||||
@ -283,7 +283,7 @@ bool Foam::linearValveLayersFvMesh::attached() const
|
||||
// Check thal all sliders are in sync (debug only)
|
||||
forAll (topoChanges, modI)
|
||||
{
|
||||
if (typeid(topoChanges[modI]) == typeid(slidingInterface))
|
||||
if (isA<slidingInterface>(topoChanges[modI]))
|
||||
{
|
||||
if
|
||||
(
|
||||
|
@ -71,7 +71,7 @@ void vanDriestDelta::calcDelta()
|
||||
const fvPatchList& patches = mesh_.boundary();
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if (isType<wallFvPatch>(patches[patchi]))
|
||||
if (isA<wallFvPatch>(patches[patchi]))
|
||||
{
|
||||
const fvPatchVectorField& Uw = U.boundaryField()[patchi];
|
||||
const scalarField& rhow = rho.boundaryField()[patchi];
|
||||
|
@ -370,7 +370,7 @@ void LRR::correct()
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (typeid(curPatch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
forAll(curPatch, facei)
|
||||
{
|
||||
@ -432,7 +432,7 @@ void LRR::correct()
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (typeid(curPatch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
symmTensorField& Rw = R_.boundaryField()[patchi];
|
||||
|
||||
|
@ -408,7 +408,7 @@ void LaunderGibsonRSTM::correct()
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (typeid(curPatch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
forAll(curPatch, facei)
|
||||
{
|
||||
@ -478,7 +478,7 @@ void LaunderGibsonRSTM::correct()
|
||||
{
|
||||
const fvPatch& curPatch = patches[patchi];
|
||||
|
||||
if (typeid(curPatch) == typeid(wallFvPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
symmTensorField& Rw = R_.boundaryField()[patchi];
|
||||
|
||||
|
@ -37,6 +37,8 @@ $(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
|
||||
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
|
||||
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
|
||||
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
|
||||
derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C
|
||||
derivedFvPatchFields/turbulentTemperatureCoupledBaffle/regionProperties.C
|
||||
|
||||
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
|
||||
|
||||
|
@ -7,4 +7,6 @@ EXE_INC = \
|
||||
LIB_LIBS = \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lfiniteVolume \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lmeshTools
|
||||
|
@ -174,7 +174,7 @@ tmp<scalarField> RASModel::yPlus(const label patchNo, const scalar Cmu) const
|
||||
tmp<scalarField> tYp(new scalarField(curPatch.size()));
|
||||
scalarField& Yp = tYp();
|
||||
|
||||
if (isType<wallFvPatch>(curPatch))
|
||||
if (isA<wallFvPatch>(curPatch))
|
||||
{
|
||||
Yp = pow025(Cmu)
|
||||
*y_[patchNo]
|
||||
|
@ -73,7 +73,7 @@ tmp<volScalarField> autoCreateAlphat
|
||||
|
||||
forAll(bm, patchI)
|
||||
{
|
||||
if (isType<wallFvPatch>(bm[patchI]))
|
||||
if (isA<wallFvPatch>(bm[patchI]))
|
||||
{
|
||||
alphatBoundaryTypes[patchI] =
|
||||
RASModels::alphatWallFunctionFvPatchScalarField::typeName;
|
||||
@ -143,7 +143,7 @@ tmp<volScalarField> autoCreateMut
|
||||
|
||||
forAll(bm, patchI)
|
||||
{
|
||||
if (isType<wallFvPatch>(bm[patchI]))
|
||||
if (isA<wallFvPatch>(bm[patchI]))
|
||||
{
|
||||
mutBoundaryTypes[patchI] =
|
||||
RASModels::mutkWallFunctionFvPatchScalarField::typeName;
|
||||
|
@ -28,7 +28,7 @@ License
|
||||
#include "Time.H"
|
||||
#include "OSspecific.H"
|
||||
|
||||
#include "wallPolyPatch.H"
|
||||
#include "wallFvPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -111,7 +111,7 @@ autoCreateWallFunctionField
|
||||
|
||||
forAll(newPatchFields, patchI)
|
||||
{
|
||||
if (isType<wallPolyPatch>(mesh.boundaryMesh()[patchI]))
|
||||
if (isA<wallFvPatch>(mesh.boundary()[patchI]))
|
||||
{
|
||||
newPatchFields.set
|
||||
(
|
||||
|
@ -24,70 +24,87 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "solidWallMixedTemperatureCoupledFvPatchScalarField.H"
|
||||
#include "turbulentTemperatureCoupledBaffleFvPatchScalarField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
#include "directMappedPatchBase.H"
|
||||
#include "regionProperties.H"
|
||||
#include "basicThermo.H"
|
||||
#include "RASModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::interfaceOwner
|
||||
bool Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::interfaceOwner
|
||||
(
|
||||
const polyMesh& nbrRegion
|
||||
const polyMesh& nbrRegion,
|
||||
const polyPatch& nbrPatch
|
||||
) const
|
||||
{
|
||||
const fvMesh& myRegion = patch().boundaryMesh().mesh();
|
||||
|
||||
const regionProperties& props =
|
||||
myRegion.objectRegistry::parent().lookupObject<regionProperties>
|
||||
(
|
||||
"regionProperties"
|
||||
);
|
||||
|
||||
label myIndex = findIndex(props.fluidRegionNames(), myRegion.name());
|
||||
if (myIndex == -1)
|
||||
if (nbrRegion.name() == myRegion.name())
|
||||
{
|
||||
label i = findIndex(props.solidRegionNames(), myRegion.name());
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
return patch().index() < nbrPatch.index();
|
||||
}
|
||||
else
|
||||
{
|
||||
const regionProperties& props =
|
||||
myRegion.objectRegistry::parent().lookupObject<regionProperties>
|
||||
(
|
||||
"solidWallMixedTemperatureCoupledFvPatchScalarField"
|
||||
"::interfaceOwner(const polyMesh&) const"
|
||||
) << "Cannot find region " << myRegion.name()
|
||||
<< " neither in fluids " << props.fluidRegionNames()
|
||||
<< " nor in solids " << props.solidRegionNames()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
myIndex = props.fluidRegionNames().size() + i;
|
||||
}
|
||||
label nbrIndex = findIndex(props.fluidRegionNames(), nbrRegion.name());
|
||||
if (nbrIndex == -1)
|
||||
{
|
||||
label i = findIndex(props.solidRegionNames(), nbrRegion.name());
|
||||
"regionProperties"
|
||||
);
|
||||
|
||||
if (i == -1)
|
||||
label myIndex = findIndex(props.fluidRegionNames(), myRegion.name());
|
||||
if (myIndex == -1)
|
||||
{
|
||||
FatalErrorIn("coupleManager::interfaceOwner(const polyMesh&) const")
|
||||
<< "Cannot find region " << nbrRegion.name()
|
||||
<< " neither in fluids " << props.fluidRegionNames()
|
||||
<< " nor in solids " << props.solidRegionNames()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
nbrIndex = props.fluidRegionNames().size() + i;
|
||||
}
|
||||
label i = findIndex(props.solidRegionNames(), myRegion.name());
|
||||
|
||||
return myIndex < nbrIndex;
|
||||
if (i == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"turbulentTemperatureCoupledBaffleFvPatchScalarField"
|
||||
"::interfaceOwner(const polyMesh&"
|
||||
", const polyPatch&)const"
|
||||
) << "Cannot find region " << myRegion.name()
|
||||
<< " neither in fluids " << props.fluidRegionNames()
|
||||
<< " nor in solids " << props.solidRegionNames()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
myIndex = props.fluidRegionNames().size() + i;
|
||||
}
|
||||
label nbrIndex = findIndex
|
||||
(
|
||||
props.fluidRegionNames(),
|
||||
nbrRegion.name()
|
||||
);
|
||||
if (nbrIndex == -1)
|
||||
{
|
||||
label i = findIndex(props.solidRegionNames(), nbrRegion.name());
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"coupleManager::interfaceOwner"
|
||||
"(const polyMesh&, const polyPatch&) const"
|
||||
) << "Cannot find region " << nbrRegion.name()
|
||||
<< " neither in fluids " << props.fluidRegionNames()
|
||||
<< " nor in solids " << props.solidRegionNames()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
nbrIndex = props.fluidRegionNames().size() + i;
|
||||
}
|
||||
return myIndex < nbrIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
@ -104,10 +121,10 @@ solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
}
|
||||
|
||||
|
||||
Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
const solidWallMixedTemperatureCoupledFvPatchScalarField& ptf,
|
||||
const turbulentTemperatureCoupledBaffleFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
@ -120,8 +137,8 @@ solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
{}
|
||||
|
||||
|
||||
Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
@ -136,8 +153,8 @@ solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"solidWallMixedTemperatureCoupledFvPatchScalarField::"
|
||||
"solidWallMixedTemperatureCoupledFvPatchScalarField\n"
|
||||
"turbulentTemperatureCoupledBaffleFvPatchScalarField::"
|
||||
"turbulentTemperatureCoupledBaffleFvPatchScalarField\n"
|
||||
"(\n"
|
||||
" const fvPatch& p,\n"
|
||||
" const DimensionedField<scalar, volMesh>& iF,\n"
|
||||
@ -172,10 +189,10 @@ solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
}
|
||||
|
||||
|
||||
Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
const solidWallMixedTemperatureCoupledFvPatchScalarField& wtcsf,
|
||||
const turbulentTemperatureCoupledBaffleFvPatchScalarField& wtcsf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
@ -188,14 +205,32 @@ solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::fvPatchScalarField&
|
||||
Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::K() const
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::K() const
|
||||
{
|
||||
return this->patch().lookupPatchField<volScalarField, scalar>(KName_);
|
||||
if (KName_ == "none")
|
||||
{
|
||||
const compressible::RASModel& model =
|
||||
db().lookupObject<compressible::RASModel>("RASProperties");
|
||||
|
||||
tmp<volScalarField> talpha = model.alphaEff();
|
||||
|
||||
const basicThermo& thermo =
|
||||
db().lookupObject<basicThermo>("thermophysicalProperties");
|
||||
|
||||
return
|
||||
talpha().boundaryField()[patch().index()]
|
||||
*thermo.rho()().boundaryField()[patch().index()]
|
||||
*thermo.Cp()().boundaryField()[patch().index()];
|
||||
}
|
||||
else
|
||||
{
|
||||
return patch().lookupPatchField<volScalarField, scalar>(KName_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
||||
void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
@ -208,29 +243,29 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
||||
patch().patch()
|
||||
);
|
||||
const polyMesh& nbrMesh = mpp.sampleMesh();
|
||||
const fvPatch& nbrPatch = refCast<const fvMesh>
|
||||
(
|
||||
nbrMesh
|
||||
).boundary()[mpp.samplePolyPatch().index()];
|
||||
|
||||
// Force recalculation of mapping and schedule
|
||||
const mapDistribute& distMap = mpp.map();
|
||||
(void)distMap.schedule();
|
||||
|
||||
tmp<scalarField> intFld = patchInternalField();
|
||||
|
||||
if (interfaceOwner(nbrMesh))
|
||||
if (interfaceOwner(nbrMesh, nbrPatch.patch()))
|
||||
{
|
||||
// Note: other side information could be cached - it only needs
|
||||
// to be updated the first time round the iteration (i.e. when
|
||||
// switching regions) but unfortunately we don't have this information.
|
||||
|
||||
const fvPatch& nbrPatch = refCast<const fvMesh>
|
||||
(
|
||||
nbrMesh
|
||||
).boundary()[mpp.samplePolyPatch().index()];
|
||||
|
||||
|
||||
// Calculate the temperature by harmonic averaging
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
const solidWallMixedTemperatureCoupledFvPatchScalarField& nbrField =
|
||||
refCast<const solidWallMixedTemperatureCoupledFvPatchScalarField>
|
||||
const turbulentTemperatureCoupledBaffleFvPatchScalarField& nbrField =
|
||||
refCast<const turbulentTemperatureCoupledBaffleFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
@ -262,7 +297,6 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
||||
nbrKDelta
|
||||
);
|
||||
|
||||
|
||||
tmp<scalarField> myKDelta = K()*patch().deltaCoeffs();
|
||||
|
||||
// Calculate common wall temperature. Reuse *this to store common value.
|
||||
@ -283,7 +317,7 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
||||
distMap.subMap(),
|
||||
Twall
|
||||
);
|
||||
const_cast<solidWallMixedTemperatureCoupledFvPatchScalarField&>
|
||||
const_cast<turbulentTemperatureCoupledBaffleFvPatchScalarField&>
|
||||
(
|
||||
nbrField
|
||||
).fvPatchScalarField::operator=(Twall);
|
||||
@ -302,7 +336,7 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
scalar Q = gSum(K()*patch().magSf()*normalGradient());
|
||||
|
||||
Info<< "solidWallMixedTemperatureCoupledFvPatchScalarField::"
|
||||
Info<< "turbulentTemperatureCoupledBaffleFvPatchScalarField::"
|
||||
<< "updateCoeffs() :"
|
||||
<< " patch:" << patch().name()
|
||||
<< " heatFlux:" << Q
|
||||
@ -339,7 +373,7 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
label nTotSize = returnReduce(this->size(), sumOp<label>());
|
||||
|
||||
Info<< "solidWallMixedTemperatureCoupledFvPatchScalarField::"
|
||||
Info<< "turbulentTemperatureCoupledBaffleFvPatchScalarField::"
|
||||
<< "updateCoeffs() :"
|
||||
<< " patch:" << patch().name()
|
||||
<< " out of:" << nTotSize
|
||||
@ -351,7 +385,7 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
|
||||
void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::write
|
||||
void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
@ -372,7 +406,7 @@ namespace Foam
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
);
|
||||
|
||||
} // End namespace Foam
|
@ -23,11 +23,12 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
|
||||
Description
|
||||
Mixed boundary condition for temperature, to be used by the
|
||||
conjugate heat transfer solver.
|
||||
Mixed boundary condition for temperature, to be used for heat-transfer
|
||||
on back-to-back baffles.
|
||||
|
||||
If my temperature is T1, neighbour is T2:
|
||||
|
||||
T1 > T2: my side becomes fixedValue T2 bc, other side becomes fixedGradient.
|
||||
@ -36,14 +37,17 @@ Description
|
||||
Example usage:
|
||||
myInterfacePatchName
|
||||
{
|
||||
type solidWallMixedTemperatureCoupled;
|
||||
type turbulentTemperatureCoupledBaffle;
|
||||
neighbourFieldName T;
|
||||
K K;
|
||||
K K; // or none
|
||||
value uniform 300;
|
||||
}
|
||||
|
||||
Needs to be on underlying directMapped(Wall)FvPatch.
|
||||
|
||||
Note: if K is "none" looks up RASModel and basicThermo, otherwise expects
|
||||
the solver to calculate a 'K' field.
|
||||
|
||||
Note: runs in parallel with arbitrary decomposition. Uses directMapped
|
||||
functionality to calculate exchange.
|
||||
|
||||
@ -54,12 +58,12 @@ Description
|
||||
this for last outer iteration but don't have access to this.
|
||||
|
||||
SourceFiles
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField.C
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solidWallMixedTemperatureCoupledFvPatchScalarField_H
|
||||
#define solidWallMixedTemperatureCoupledFvPatchScalarField_H
|
||||
#ifndef turbulentTemperatureCoupledBaffleFvPatchScalarField_H
|
||||
#define turbulentTemperatureCoupledBaffleFvPatchScalarField_H
|
||||
|
||||
#include "fvPatchFields.H"
|
||||
#include "mixedFvPatchFields.H"
|
||||
@ -71,10 +75,10 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class solidWallMixedTemperatureCoupledFvPatchScalarField Declaration
|
||||
Class turbulentTemperatureCoupledBaffleFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
class turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
:
|
||||
public mixedFvPatchScalarField
|
||||
{
|
||||
@ -92,26 +96,26 @@ class solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
// Private Member Functions
|
||||
|
||||
//- Am I or neighbour owner of interface
|
||||
bool interfaceOwner(const polyMesh& nbrRegion) const;
|
||||
bool interfaceOwner(const polyMesh&, const polyPatch&) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("solidWallMixedTemperatureCoupled");
|
||||
TypeName("turbulentTemperatureCoupledBaffle");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
@ -119,10 +123,10 @@ public:
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// solidWallMixedTemperatureCoupledFvPatchScalarField onto a new patch
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
// turbulentTemperatureCoupledBaffleFvPatchScalarField onto a new patch
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
const solidWallMixedTemperatureCoupledFvPatchScalarField&,
|
||||
const turbulentTemperatureCoupledBaffleFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
@ -133,14 +137,14 @@ public:
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new solidWallMixedTemperatureCoupledFvPatchScalarField(*this)
|
||||
new turbulentTemperatureCoupledBaffleFvPatchScalarField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
const solidWallMixedTemperatureCoupledFvPatchScalarField&,
|
||||
const turbulentTemperatureCoupledBaffleFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
@ -152,7 +156,7 @@ public:
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new solidWallMixedTemperatureCoupledFvPatchScalarField
|
||||
new turbulentTemperatureCoupledBaffleFvPatchScalarField
|
||||
(
|
||||
*this,
|
||||
iF
|
||||
@ -164,7 +168,7 @@ public:
|
||||
// Member functions
|
||||
|
||||
//- Get corresponding K field
|
||||
const fvPatchScalarField& K() const;
|
||||
tmp<scalarField> K() const;
|
||||
|
||||
//- Return true if this patch field fixes a value.
|
||||
// Needed to check if a level has to be specified while solving
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user