Commit d6386b4a authored by mattijs's avatar mattijs
Browse files

extrudeMesh does extrusion from existing mesh

parents 65e925f1 91fca60f
......@@ -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;
value uniform 1.e-5;
}
air
{
type fixedValue;
value uniform 1.e-5;
}
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 k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 3.75e-5;
boundaryField
{
fuel
{
type fixedValue;
value uniform 3.75e-5;
}
air
{
type fixedValue;
value uniform 3.75e-5;
}
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 mut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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;
}
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/