ENH: atmosphericModels: Added Lopes da Costa porosity and turbulence models

Specialized variants of the power law porosity and k epsilon turbulence models
developed to simulate atmospheric flow over forested and non-forested complex
terrain.

Class
    Foam::powerLawLopesdaCosta

Description
    Variant of the power law porosity model with spatially varying
    drag coefficient

    given by:

        \f[
            S = -\rho C_d \Sigma |U|^{(C_1 - 1)} U
        \f]

    where
    \vartable
        \Sigma | Porosity surface area per unit volume
        C_d    | Model linear coefficient
        C_1    | Model exponent coefficient
    \endvartable

    Reference:
    \verbatim
        Costa, J. C. P. L. D. (2007).
        Atmospheric flow over forested and non-forested complex terrain.
    \endverbatim

Class
    Foam::RASModels::kEpsilonLopesdaCosta

Description
    Variant of the standard k-epsilon turbulence model with additional source
    terms to handle the changes in turbulence in porous regions represented by
    the powerLawLopesdaCosta porosity model.

    Reference:
    \verbatim
        Costa, J. C. P. L. D. (2007).
        Atmospheric flow over forested and non-forested complex terrain.
    \endverbatim

    The default model coefficients are
    \verbatim
        kEpsilonLopesdaCostaCoeffs
        {
            Cmu         0.09;
            C1          1.44;
            C2          1.92;
            sigmak      1.0;
            sigmaEps    1.3;
        }
    \endverbatim

Tutorial case to follow.
This commit is contained in:
Henry Weller
2018-03-20 22:26:07 +00:00
committed by Andrew Heather
parent 54ddd14168
commit c812b4c6f7
15 changed files with 1617 additions and 15 deletions

View File

@ -2276,7 +2276,6 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
}
// triangulation of boundaryMesh
Foam::triSurface Foam::triSurfaceTools::triangulate
(
const polyBoundaryMesh& bMesh,
@ -2357,6 +2356,96 @@ Foam::triSurface Foam::triSurfaceTools::triangulate
}
Foam::triSurface Foam::triSurfaceTools::triangulate
(
const polyBoundaryMesh& bMesh,
const labelHashSet& includePatches,
const boundBox& bBox,
const bool verbose
)
{
const polyMesh& mesh = bMesh.mesh();
// Storage for surfaceMesh. Size estimate.
DynamicList<labelledTri> triangles
(
mesh.nFaces() - mesh.nInternalFaces()
);
label newPatchi = 0;
forAllConstIter(labelHashSet, includePatches, iter)
{
const label patchi = iter.key();
const polyPatch& patch = bMesh[patchi];
const pointField& points = patch.points();
label nTriTotal = 0;
forAll(patch, patchFacei)
{
const face& f = patch[patchFacei];
if (bBox.containsAny(points, f))
{
faceList triFaces(f.nTriangles(points));
label nTri = 0;
f.triangles(points, nTri, triFaces);
forAll(triFaces, triFacei)
{
const face& f = triFaces[triFacei];
triangles.append(labelledTri(f[0], f[1], f[2], newPatchi));
nTriTotal++;
}
}
}
if (verbose)
{
Pout<< patch.name() << " : generated " << nTriTotal
<< " triangles from " << patch.size() << " faces with"
<< " new patchid " << newPatchi << endl;
}
newPatchi++;
}
triangles.shrink();
// Create globally numbered tri surface
triSurface rawSurface(triangles, mesh.points());
// Create locally numbered tri surface
triSurface surface
(
rawSurface.localFaces(),
rawSurface.localPoints()
);
// Add patch names to surface
surface.patches().setSize(newPatchi);
newPatchi = 0;
forAllConstIter(labelHashSet, includePatches, iter)
{
const label patchi = iter.key();
const polyPatch& patch = bMesh[patchi];
surface.patches()[newPatchi].name() = patch.name();
surface.patches()[newPatchi].geometricType() = patch.type();
newPatchi++;
}
return surface;
}
// triangulation of boundaryMesh
Foam::triSurface Foam::triSurfaceTools::triangulateFaceCentre
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -67,6 +67,7 @@ namespace Foam
{
// Forward declaration of classes
class boundBox;
class edge;
class labelledTri;
class polyBoundaryMesh;
@ -76,7 +77,6 @@ class face;
class Time;
template<class Face> class MeshedSurface;
/*---------------------------------------------------------------------------*\
Class triSurfaceTools Declaration
\*---------------------------------------------------------------------------*/
@ -484,6 +484,16 @@ public:
const bool verbose = false
);
static triSurface triangulate
(
const polyBoundaryMesh& bMesh,
const labelHashSet& includePatches,
const boundBox& bBox,
const bool verbose = false
);
//- Face-centre triangulation of (selected patches of) boundaryMesh.
// Needs
// polyMesh (or polyBoundaryMesh) since only at this level are the