Merge branch 'master' into cvm

This commit is contained in:
graham
2009-07-10 11:39:45 +01:00
297 changed files with 1097 additions and 566 deletions

View File

@ -2,11 +2,10 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-IBCs/lnInclude \
-IBCs/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lspecie \
-L$(FOAM_USER_LIBBIN) \
-lspecie \
-lrhoCentralFoam

View File

@ -348,7 +348,8 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
Info<< nl << "end" << endl;
Info<< nl << "End" << endl;
return 0;
}

View File

@ -23,8 +23,9 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Extrude mesh from existing patch (flipped so has inwards pointing
normals) or from patch read from file.
Extrude mesh from existing patch (by default outwards facing normals;
optional flips faces)
or from patch read from file.
Note: Merges close points so be careful.
Type of extrusion prescribed by run-time selectable model.
@ -108,14 +109,11 @@ int main(int argc, char *argv[])
const polyPatch& pp = mesh.boundaryMesh()[patchID];
fMesh.reset(new faceMesh(pp.localFaces(), pp.localPoints()));
fMesh().flip();
{
fileName surfName(patchName + ".sMesh");
Info<< "Writing (flipped) patch as surfaceMesh to "
fileName surfName(runTime.path()/patchName + ".sMesh");
Info<< "Writing patch as surfaceMesh to "
<< surfName << nl << endl;
OFstream os(surfName);
os << fMesh() << nl;
}
@ -142,6 +140,20 @@ int main(int argc, char *argv[])
<< "patch or surface." << exit(FatalError);
}
Switch flipNormals(dict.lookup("flipNormals"));
if (flipNormals)
{
Info<< "Flipping faces." << nl << endl;
faceList faces(fMesh().size());
forAll(faces, i)
{
faces[i] = fMesh()[i].reverseFace();
}
fMesh.reset(new faceMesh(faces, fMesh().localPoints()));
}
Info<< "Extruding patch with :" << nl
<< " points : " << fMesh().points().size() << nl

View File

@ -47,7 +47,14 @@ linearNormal::linearNormal(const dictionary& dict)
:
extrudeModel(typeName, dict),
thickness_(readScalar(coeffDict_.lookup("thickness")))
{}
{
if (thickness_ <= 0)
{
FatalErrorIn("linearNormal(const dictionary&)")
<< "thickness should be positive : " << thickness_
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

View File

@ -19,31 +19,40 @@ FoamFile
constructFrom patch; //surface;
// If construct from (flipped) patch
sourceCase "../cavity";
sourceCase "$FOAM_RUN/icoFoam/cavity";
sourcePatch movingWall;
// Flip surface normals before usage.
flipNormals false;
// If construct from surface
surface "movingWall.sMesh";
// Do front and back need to be merged?
mergeFaces false;
// Do front and back need to be merged? Usually only makes sense for 360
// degree wedges.
mergeFaces true;
//- Linear extrusion in point-normal direction
//extrudeModel linearNormal;
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
extrudeModel wedge;
//- Extrudes into sphere around (0 0 0)
//extrudeModel linearRadial;
//- Extrudes into sphere with grading according to pressure (atmospherics)
//extrudeModel sigmaRadial;
nLayers 6;
nLayers 20;
wedgeCoeffs
{
axisPt (0 0.1 0);
axis (1 0 0);
angle 90.0; // For nLayers=1 assume symmetry so angle/2 on each side
axis (-1 0 0);
angle 360; // For nLayers=1 assume symmetry so angle/2 on each side
}
linearNormalCoeffs

View File

@ -109,15 +109,33 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
label currentLayerOffset = layer*surfacePoints.size();
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Side faces from layer to layer+1
for (label i=0; i<nInternalEdges; i++)
// Vertical faces from layer to layer+1
for (label edgeI=0; edgeI<nInternalEdges; edgeI++)
{
quad[0] = surfaceEdges[i][1] + currentLayerOffset;
quad[1] = surfaceEdges[i][0] + currentLayerOffset;
quad[2] = surfaceEdges[i][0] + nextLayerOffset;
quad[3] = surfaceEdges[i][1] + nextLayerOffset;
const edge& e = surfaceEdges[edgeI];
const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
eFaces[facei++] = face(quad).reverseFace();
face& f = eFaces[facei++];
f.setSize(4);
if
(
(edgeFaces[0] < edgeFaces[1])
== sameOrder(surfaceFaces[edgeFaces[0]], e)
)
{
f[0] = e[0] + currentLayerOffset;
f[1] = e[1] + currentLayerOffset;
f[2] = e[1] + nextLayerOffset;
f[3] = e[0] + nextLayerOffset;
}
else
{
f[0] = e[1] + currentLayerOffset;
f[1] = e[0] + currentLayerOffset;
f[2] = e[0] + nextLayerOffset;
f[3] = e[1] + nextLayerOffset;
}
}
// Faces between layer and layer+1
@ -128,9 +146,9 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
eFaces[facei++] =
face
(
surfaceFaces[i].reverseFace()
surfaceFaces[i] //.reverseFace()
+ nextLayerOffset
).reverseFace();
);
}
}
}
@ -142,40 +160,46 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
// Side faces across layer
for (label i=nInternalEdges; i<surfaceEdges.size(); i++)
for (label edgeI=nInternalEdges; edgeI<surfaceEdges.size(); edgeI++)
{
const edge& e = surfaceEdges[i];
quad[0] = e[1] + currentLayerOffset;
quad[1] = e[0] + currentLayerOffset;
quad[2] = e[0] + nextLayerOffset;
quad[3] = e[1] + nextLayerOffset;
const edge& e = surfaceEdges[edgeI];
const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
label ownerFace = extrudePatch.edgeFaces()[i][0];
face& f = eFaces[facei++];
f.setSize(4);
if (sameOrder(surfaceFaces[ownerFace], e))
if (sameOrder(surfaceFaces[edgeFaces[0]], e))
{
reverse(quad);
f[0] = e[0] + currentLayerOffset;
f[1] = e[1] + currentLayerOffset;
f[2] = e[1] + nextLayerOffset;
f[3] = e[0] + nextLayerOffset;
}
else
{
f[0] = e[1] + currentLayerOffset;
f[1] = e[0] + currentLayerOffset;
f[2] = e[0] + nextLayerOffset;
f[3] = e[1] + nextLayerOffset;
}
eFaces[facei++] = face(quad);
}
}
// Top faces
forAll(surfaceFaces, i)
{
eFaces[facei++] = face(surfaceFaces[i]).reverseFace();
}
// Bottom faces
forAll(surfaceFaces, i)
{
eFaces[facei++] = face(surfaceFaces[i]).reverseFace();
}
// Top faces
forAll(surfaceFaces, i)
{
eFaces[facei++] =
face
(
surfaceFaces[i].reverseFace()
surfaceFaces[i]
+ nLayers*surfacePoints.size()
).reverseFace();
);
}
// return points for transferring

View File

@ -67,8 +67,13 @@ Foam::label Foam::checkTopology
{
forAll(mesh.faceZones(), zoneI)
{
if (mesh.faceZones()[zoneI].checkParallelSync(true))
if (mesh.faceZones()[zoneI].checkParallelSync(false))
{
Info<< " ***FaceZone " << mesh.faceZones()[zoneI].name()
<< " is not correctly synchronised"
<< " acrosss coupled boundaries."
<< " (coupled faces both"
<< " present in set but with opposite flipmap)" << endl;
noFailedChecks++;
}
}

View File

@ -492,6 +492,8 @@ int main(int argc, char *argv[])
delete ensightCaseFilePtr;
}
Info<< "End\n" << endl;
return 0;
}

View File

@ -88,7 +88,7 @@ int main(int argc, char *argv[])
}
}
Info << nl << "Translation Complete." << nl;
Info<< "\nEnd\n" << endl;
return 0;
}

View File

@ -84,6 +84,8 @@ int main(int argc, char *argv[])
utility().tryPostCalc(args, runTime, mesh);
Info<< "End\n" << endl;
return 0;
}

View File

@ -179,6 +179,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No phi" << endl;
}
Info<< "\nEnd\n" << endl;
}
// ************************************************************************* //

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
@ -78,6 +78,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No U" << endl;
}
Info<< "\nEnd\n" << endl;
}

View File

@ -134,6 +134,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " Missing U or T" << endl;
}
Info<< "\nEnd\n" << endl;
}

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
@ -361,6 +361,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No phi" << endl;
}
Info<< "\nEnd\n" << endl;
}
// ************************************************************************* //

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
@ -105,6 +105,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No U" << endl;
}
Info<< "\nEnd\n" << endl;
}
// ************************************************************************* //

View File

@ -80,6 +80,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No U" << endl;
}
Info<< "\nEnd\n" << endl;
}

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
@ -87,6 +87,8 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No U" << endl;
}
Info<< "\nEnd\n" << endl;
}

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
@ -460,7 +460,7 @@ int main(int argc, char *argv[])
}
}
Info<< "End\n" << endl;
Info<< "\nEnd\n" << endl;
return 0;
}

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
@ -80,6 +80,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No k" << endl;
}
Info<< "\nEnd\n" << endl;
}
// ************************************************************************* //

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
@ -93,6 +93,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " No U" << endl;
}
Info<< "\nEnd\n" << endl;
}
// ************************************************************************* //