Commit 2625d891 authored by mattijs's avatar mattijs
Browse files

extrudeMesh does extrusion from existing mesh

parents 65e925f1 91fca60f
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::faceMesh
Description
Storage for surface mesh i.e. points and faces.
SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef faceMesh_H
#define faceMesh_H
#include "PrimitivePatch.H"
#include "faceList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class faceMesh Declaration
\*---------------------------------------------------------------------------*/
class faceMesh
:
public PrimitivePatch<face, List, pointField>
{
// Private member functions
PrimitivePatch<face, List, pointField> read(Istream& is)
{
pointField points(is);
faceList faces(is);
return PrimitivePatch<face, Foam::List, pointField>(faces, points);
}
public:
// Constructors
//- Construct from components
faceMesh(const faceList& faces, const pointField& points)
:
PrimitivePatch<face, Foam::List, pointField>(faces, points)
{}
//- Construct from Istream
faceMesh(Istream& is)
:
PrimitivePatch<face, Foam::List, pointField>(read(is))
{}
// Member Functions
void flip()
{
forAll(*this, i)
{
face& f = operator[](i);
f = f.reverseFace();
}
clearOut();
}
// IOstream Operators
friend Ostream& operator<<(Ostream& os, const faceMesh& fm)
{
return os
<< fm.points()
<< token::NL
<< static_cast<PrimitivePatch<face, Foam::List, pointField> >
(fm);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
......@@ -2987,6 +2987,7 @@ void Foam::autoLayerDriver::addLayers
(
invExpansionRatio,
pp,
labelList(0), // exposed patchIDs, not used for adding layers
nPatchFaceLayers, // layers per face
nPatchPointLayers, // layers per point
firstDisp, // thickness of layer nearest internal mesh
......
......@@ -55,8 +55,8 @@ Foam::faceZonesIntegration::faceZonesIntegration
obr_(obr),
active_(true),
log_(false),
faceZonesSet_(),
fItems_(),
zoneNames_(),
fieldNames_(),
filePtr_(NULL)
{
// Check if the available mesh is an fvMesh otherise deactivate
......@@ -94,9 +94,9 @@ void Foam::faceZonesIntegration::read(const dictionary& dict)
{
log_ = dict.lookupOrDefault<Switch>("log", false);
dict.lookup("fields") >> fItems_;
dict.lookup("fields") >> fieldNames_;
dict.lookup("faceZones") >> faceZonesSet_;
dict.lookup("faceZones") >> zoneNames_;
}
}
......@@ -132,11 +132,11 @@ void Foam::faceZonesIntegration::makeFile()
mkDir(faceZonesIntegrationDir);
// Open new file at start up
filePtr_.resize(fItems_.size());
filePtr_.resize(fieldNames_.size());
forAll(fItems_, Ifields)
forAll(fieldNames_, fieldI)
{
const word& fieldName = fItems_[Ifields];
const word& fieldName = fieldNames_[fieldI];
OFstream* sPtr = new OFstream
(
......@@ -163,10 +163,9 @@ void Foam::faceZonesIntegration::writeFileHeader()
os << "#Time " << setw(w);
forAll (faceZonesSet_, zoneI)
forAll (zoneNames_, zoneI)
{
const word name = faceZonesSet_[zoneI];
os << name << setw(w);
os << zoneNames_[zoneI] << setw(w);
}
os << nl << endl;
......@@ -192,9 +191,9 @@ void Foam::faceZonesIntegration::write()
{
makeFile();
forAll(fItems_, fieldI)
forAll(fieldNames_, fieldI)
{
const word& fieldName = fItems_[fieldI];
const word& fieldName = fieldNames_[fieldI];
const surfaceScalarField& sField =
obr_.lookupObject<surfaceScalarField>(fieldName);
......@@ -203,17 +202,17 @@ void Foam::faceZonesIntegration::write()
// 1. integrate over all face zones
scalarField integralVals(faceZonesSet_.size());
scalarField integralVals(zoneNames_.size());
forAll(faceZonesSet_, setI)
forAll(integralVals, zoneI)
{
const word name = faceZonesSet_[setI];
const word& name = zoneNames_[zoneI];
label zoneID = mesh.faceZones().findZoneID(name);
const faceZone& fZone = mesh.faceZones()[zoneID];
integralVals[setI] = returnReduce
integralVals[zoneI] = returnReduce
(
calcIntegral(sField, fZone),
sumOp<scalar>()
......@@ -231,15 +230,15 @@ void Foam::faceZonesIntegration::write()
os << obr_.time().value();
forAll(integralVals, setI)
forAll(integralVals, zoneI)
{
os << ' ' << setw(w) << integralVals[setI];
os << ' ' << setw(w) << integralVals[zoneI];
if (log_)
{
Info<< "faceZonesIntegration output:" << nl
<< " Integration[" << setI << "] "
<< integralVals[setI] << endl;
<< " Integration[" << zoneI << "] "
<< integralVals[zoneI] << endl;
}
}
......
......@@ -82,11 +82,11 @@ protected:
//- Switch to send output to Info as well as to file
Switch log_;
//- faceZones to integrate over
wordList faceZonesSet_;
//- List of face zone names to integrate over
wordList zoneNames_;
//- Names of the surface fields
wordList fItems_;
wordList fieldNames_;
//- Current open files
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object CH4;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
fuel
{
type fixedValue;
value uniform 1.0;
}
air
{
type fixedValue;
value uniform 0.0;
}
outlet
{
type inletOutlet;
inletValue uniform 0.0;
value uniform 0.0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object O2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0.77;
boundaryField
{
fuel
{
type fixedValue;
value uniform 0.0;
}
air
{
type fixedValue;
value uniform 0.77;
}
outlet
{
type inletOutlet;
inletValue uniform 0.77;
value uniform 0.77;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object O2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0.23;
boundaryField
{
fuel
{
type fixedValue;
value uniform 0.0;
}
air
{
type fixedValue;
value uniform 0.23;
}
outlet
{
type inletOutlet;
inletValue uniform 0.23;
value uniform 0.23;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 293;
boundaryField
{
fuel
{
type fixedValue;
value uniform 800;
}
air
{
type fixedValue;
value uniform 800;
}
outlet
{
type inletOutlet;
inletValue uniform 293;
value uniform 293;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
fuel
{
type fixedValue;
value uniform (0.1 0 0);
}
air
{
type fixedValue;
value uniform (-0.1 0 0);
}
outlet
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object Ydefault;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
fuel
{
type fixedValue;
value uniform 0.0;
}
air
{
type fixedValue;
value uniform 0.0;
}
outlet
{
type inletOutlet;
inletValue uniform 0.0;
value uniform 0.0;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0.0;
boundaryField
{
fuel
{
type fixedValue;
value uniform 0.0;
}
air
{
type fixedValue;
value uniform 0.0;
}
outlet
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 50;
boundaryField
{
fuel
{
type fixedValue;